diff --git a/jest.config.js b/jest.config.js index 012dabb6e3..741bd6ef7d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -10,6 +10,7 @@ module.exports = { '^@moralisweb3/api-utils': path.join(__dirname, 'packages/apiUtils/src'), '^@moralisweb3/test-utils': path.join(__dirname, 'packages/testUtils/src'), '^@moralisweb3/common-streams-utils': path.join(__dirname, 'packages/common/streamsUtils/src'), + '^@moralisweb3/common-auth-utils': path.join(__dirname, 'packages/common/authUtils/src'), '^@moralisweb3/common-core': path.join(__dirname, 'packages/common/core/src'), '^@moralisweb3/(.*)$': path.join(__dirname, 'packages/$1/src'), }, diff --git a/packages/auth/package.json b/packages/auth/package.json index aef6abc7b0..10500282c8 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -16,7 +16,6 @@ "test:watch": "yarn run test --watch", "lint": "eslint . --ext .js,.ts,.tsx,jsx", "clean": "rm -rf lib && rm -rf tsconfig.tsbuildinfo && rm -rf tsconfig.build.tsbuildinfo && rm -rf ./node_modules/.cache/nx", - "gen:api-types": "openapi-typescript https://authapi.moralis.io/api-docs-json --output src/generated/types.ts", "build": "tsc -p tsconfig.build.json", "dev": "tsc --watch" }, @@ -31,6 +30,7 @@ "@moralisweb3/api-utils": "^2.7.4", "@moralisweb3/common-core": "^2.7.4", "@moralisweb3/common-evm-utils": "^2.7.4", + "@moralisweb3/common-auth-utils": "^2.7.4", "@moralisweb3/common-sol-utils": "^2.7.4" } } diff --git a/packages/auth/src/Auth.ts b/packages/auth/src/Auth.ts index 96545f7f1c..be3408a8b8 100644 --- a/packages/auth/src/Auth.ts +++ b/packages/auth/src/Auth.ts @@ -1,8 +1,10 @@ import { ApiModule, Core, CoreProvider } from '@moralisweb3/common-core'; import { makeRequestMessage, RequestMessageOptions } from './methods/requestMessage'; import { makeVerify, VerifyEvmOptions, VerifyOptions, VerifySolOptions } from './methods/verify'; -import { VerifyChallengeEvmResponseAdapter } from './operations/evm'; -import { VerifyChallengeSolanaResponseAdapter } from './operations/solana'; +import { + VerifyChallengeSolanaResponseAdapter, + VerifyChallengeEvmResponseAdapter, +} from '@moralisweb3/common-auth-utils'; export const BASE_URL = 'https://authapi.moralis.io'; diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts index 842544e35b..97bcfd986d 100644 --- a/packages/auth/src/index.ts +++ b/packages/auth/src/index.ts @@ -1,10 +1,8 @@ import { Auth } from './Auth'; export * from './Auth'; -export * from './operations'; // Export SDK types export * from './methods/types'; -export * from './operations'; export default Auth; diff --git a/packages/auth/src/methods/requestMessage.ts b/packages/auth/src/methods/requestMessage.ts index 58fa3c0bba..37b6180a1b 100644 --- a/packages/auth/src/methods/requestMessage.ts +++ b/packages/auth/src/methods/requestMessage.ts @@ -4,7 +4,7 @@ import Core, { AuthErrorCode, MoralisAuthError } from '@moralisweb3/common-core' import { EvmAddress, EvmAddressish, EvmChain, EvmChainish } from '@moralisweb3/common-evm-utils'; import { BASE_URL } from '../Auth'; import { AuthNetworkType } from '../utils/AuthNetworkType'; -import { requestChallengeSolanaOperation, requestChallengeEvmOperation } from '../operations'; +import { requestChallengeSolanaOperation, requestChallengeEvmOperation } from '@moralisweb3/common-auth-utils'; // Imported from Swagger and adjusted for better types for Evm // TODO: generalize and extend generated types diff --git a/packages/auth/src/methods/verify.ts b/packages/auth/src/methods/verify.ts index 38c0dc8d91..67d7542645 100644 --- a/packages/auth/src/methods/verify.ts +++ b/packages/auth/src/methods/verify.ts @@ -1,7 +1,7 @@ import { OperationResolver } from '@moralisweb3/api-utils'; import Core, { AuthErrorCode, MoralisAuthError } from '@moralisweb3/common-core'; import { BASE_URL } from '../Auth'; -import { verifyChallengeSolanaOperation, verifyChallengeEvmOperation } from '../operations'; +import { verifyChallengeSolanaOperation, verifyChallengeEvmOperation } from '@moralisweb3/common-auth-utils'; import { AuthNetworkType } from '../utils/AuthNetworkType'; export interface VerifyEvmOptions { diff --git a/packages/common/authUtils/.eslintrc.js b/packages/common/authUtils/.eslintrc.js new file mode 100644 index 0000000000..92cea72b04 --- /dev/null +++ b/packages/common/authUtils/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + extends: ['@moralisweb3'], + plugins: ['jest'], + ignorePatterns: ['**/lib/**/*', '**/*.test.ts', '**/dist/**/*', '**/build/**/*', '**/generated/**/*'], +}; diff --git a/packages/common/authUtils/README.md b/packages/common/authUtils/README.md new file mode 100644 index 0000000000..7ba99945d6 --- /dev/null +++ b/packages/common/authUtils/README.md @@ -0,0 +1 @@ +# @moralisweb3/common-auth-utils diff --git a/packages/common/authUtils/jest.config.js b/packages/common/authUtils/jest.config.js new file mode 100644 index 0000000000..dd8e195ea5 --- /dev/null +++ b/packages/common/authUtils/jest.config.js @@ -0,0 +1,4 @@ +/* eslint-disable global-require */ +module.exports = { + ...require('../../../jest.config'), +}; diff --git a/packages/common/authUtils/package.json b/packages/common/authUtils/package.json new file mode 100644 index 0000000000..55b25a29ce --- /dev/null +++ b/packages/common/authUtils/package.json @@ -0,0 +1,36 @@ +{ + "name": "@moralisweb3/common-auth-utils", + "author": "Moralis", + "version": "2.7.4", + "license": "MIT", + "private": false, + "main": "./lib/index.js", + "types": "./lib/index.d.ts", + "sideEffects": false, + "files": [ + "lib/*" + ], + "scripts": { + "test": "yarn jest --runInBand --detectOpenHandles --forceExit --ci", + "test:coverage": "yarn run test --coverage", + "test:watch": "yarn run test --watch", + "gen:api-types": "openapi-typescript https://authapi.moralis.io/api-docs-json --output src/operations/openapi.ts", + "lint": "eslint . --ext .js,.ts,.tsx,jsx", + "clean": "rm -rf lib && rm -rf tsconfig.tsbuildinfo && rm -rf tsconfig.build.tsbuildinfo && rm -rf ./node_modules/.cache/nx", + "build": "tsc -p tsconfig.build.json", + "dev": "tsc --watch" + }, + "devDependencies": { + "eslint-plugin-jest": "^26.8.3", + "jest": "^28.0.3", + "prettier": "^2.5.1", + "typescript": "^4.5.5" + }, + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@moralisweb3/common-core": "^2.7.4", + "@moralisweb3/common-evm-utils": "^2.7.4", + "@moralisweb3/common-sol-utils": "^2.7.4", + "@moralisweb3/streams-typings": "^1.0.5" + } +} diff --git a/packages/common/authUtils/src/index.ts b/packages/common/authUtils/src/index.ts new file mode 100644 index 0000000000..b6af58befd --- /dev/null +++ b/packages/common/authUtils/src/index.ts @@ -0,0 +1 @@ +export * from './operations'; diff --git a/packages/auth/src/operations/evm/index.ts b/packages/common/authUtils/src/operations/evm/index.ts similarity index 100% rename from packages/auth/src/operations/evm/index.ts rename to packages/common/authUtils/src/operations/evm/index.ts diff --git a/packages/auth/src/operations/evm/requestChallengeEvmOperation.test.ts b/packages/common/authUtils/src/operations/evm/requestChallengeEvmOperation.test.ts similarity index 100% rename from packages/auth/src/operations/evm/requestChallengeEvmOperation.test.ts rename to packages/common/authUtils/src/operations/evm/requestChallengeEvmOperation.test.ts diff --git a/packages/auth/src/operations/evm/requestChallengeEvmOperation.ts b/packages/common/authUtils/src/operations/evm/requestChallengeEvmOperation.ts similarity index 98% rename from packages/auth/src/operations/evm/requestChallengeEvmOperation.ts rename to packages/common/authUtils/src/operations/evm/requestChallengeEvmOperation.ts index c9e60d297f..130782fc4a 100644 --- a/packages/auth/src/operations/evm/requestChallengeEvmOperation.ts +++ b/packages/common/authUtils/src/operations/evm/requestChallengeEvmOperation.ts @@ -1,6 +1,6 @@ import { Core, Camelize, Operation, DateInput, ResponseAdapter } from '@moralisweb3/common-core'; import { EvmAddress, EvmAddressish, EvmChainish, EvmChainResolver } from '@moralisweb3/common-evm-utils'; -import { operations } from '../../generated/types'; +import { operations } from '../openapi'; type OperationId = 'requestChallengeEvm'; diff --git a/packages/auth/src/operations/evm/verifyChallengeEvmOperation.test.ts b/packages/common/authUtils/src/operations/evm/verifyChallengeEvmOperation.test.ts similarity index 100% rename from packages/auth/src/operations/evm/verifyChallengeEvmOperation.test.ts rename to packages/common/authUtils/src/operations/evm/verifyChallengeEvmOperation.test.ts diff --git a/packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts b/packages/common/authUtils/src/operations/evm/verifyChallengeEvmOperation.ts similarity index 97% rename from packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts rename to packages/common/authUtils/src/operations/evm/verifyChallengeEvmOperation.ts index e6e38f8a41..a5c39023af 100644 --- a/packages/auth/src/operations/evm/verifyChallengeEvmOperation.ts +++ b/packages/common/authUtils/src/operations/evm/verifyChallengeEvmOperation.ts @@ -1,6 +1,6 @@ import { Camelize, maybe, Operation, ResponseAdapter } from '@moralisweb3/common-core'; import { EvmAddress, EvmChain } from '@moralisweb3/common-evm-utils'; -import { operations } from '../../generated/types'; +import { operations } from '../openapi'; type OperationId = 'verifyChallengeEvm'; diff --git a/packages/auth/src/operations/index.ts b/packages/common/authUtils/src/operations/index.ts similarity index 100% rename from packages/auth/src/operations/index.ts rename to packages/common/authUtils/src/operations/index.ts diff --git a/packages/auth/src/generated/types.ts b/packages/common/authUtils/src/operations/openapi.ts similarity index 100% rename from packages/auth/src/generated/types.ts rename to packages/common/authUtils/src/operations/openapi.ts diff --git a/packages/auth/src/operations/operations.test.ts b/packages/common/authUtils/src/operations/operations.test.ts similarity index 96% rename from packages/auth/src/operations/operations.test.ts rename to packages/common/authUtils/src/operations/operations.test.ts index dde395b3df..f29cdba37d 100644 --- a/packages/auth/src/operations/operations.test.ts +++ b/packages/common/authUtils/src/operations/operations.test.ts @@ -6,7 +6,7 @@ describe('operations', () => { let reader: OpenApiInterfaceReader; beforeAll(() => { - reader = new OpenApiInterfaceReader('src/generated/types.ts')!; + reader = new OpenApiInterfaceReader('src/operations/openapi.ts')!; }); for (const operation of operations) { diff --git a/packages/auth/src/operations/operations.ts b/packages/common/authUtils/src/operations/operations.ts similarity index 100% rename from packages/auth/src/operations/operations.ts rename to packages/common/authUtils/src/operations/operations.ts diff --git a/packages/auth/src/operations/solana/index.ts b/packages/common/authUtils/src/operations/solana/index.ts similarity index 100% rename from packages/auth/src/operations/solana/index.ts rename to packages/common/authUtils/src/operations/solana/index.ts diff --git a/packages/auth/src/operations/solana/requestChallengeSolanaOperation.test.ts b/packages/common/authUtils/src/operations/solana/requestChallengeSolanaOperation.test.ts similarity index 100% rename from packages/auth/src/operations/solana/requestChallengeSolanaOperation.test.ts rename to packages/common/authUtils/src/operations/solana/requestChallengeSolanaOperation.test.ts diff --git a/packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts b/packages/common/authUtils/src/operations/solana/requestChallengeSolanaOperation.ts similarity index 98% rename from packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts rename to packages/common/authUtils/src/operations/solana/requestChallengeSolanaOperation.ts index 9f7968b9a6..fe6c808a97 100644 --- a/packages/auth/src/operations/solana/requestChallengeSolanaOperation.ts +++ b/packages/common/authUtils/src/operations/solana/requestChallengeSolanaOperation.ts @@ -1,6 +1,6 @@ import { Camelize, Operation, DateInput, ResponseAdapter } from '@moralisweb3/common-core'; import { SolAddress, SolAddressish, SolNetwork, SolNetworkish } from '@moralisweb3/common-sol-utils'; -import { operations } from '../../generated/types'; +import { operations } from '../openapi'; type OperationId = 'requestChallengeSolana'; diff --git a/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.test.ts b/packages/common/authUtils/src/operations/solana/verifyChallengeSolanaOperation.test.ts similarity index 100% rename from packages/auth/src/operations/solana/verifyChallengeSolanaOperation.test.ts rename to packages/common/authUtils/src/operations/solana/verifyChallengeSolanaOperation.test.ts diff --git a/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts b/packages/common/authUtils/src/operations/solana/verifyChallengeSolanaOperation.ts similarity index 97% rename from packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts rename to packages/common/authUtils/src/operations/solana/verifyChallengeSolanaOperation.ts index 90e2521380..e6b36fa9c6 100644 --- a/packages/auth/src/operations/solana/verifyChallengeSolanaOperation.ts +++ b/packages/common/authUtils/src/operations/solana/verifyChallengeSolanaOperation.ts @@ -1,6 +1,6 @@ import { Camelize, maybe, Operation, ResponseAdapter } from '@moralisweb3/common-core'; import { SolAddress, SolNetwork } from '@moralisweb3/common-sol-utils'; -import { operations } from '../../generated/types'; +import { operations } from '../openapi'; type OperationId = 'verifyChallengeSolana'; diff --git a/packages/common/authUtils/tsconfig.build.json b/packages/common/authUtils/tsconfig.build.json new file mode 100644 index 0000000000..b4c56f4a53 --- /dev/null +++ b/packages/common/authUtils/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./lib/", + "declarationDir": "./lib/", + "rootDir": "./src" + }, + "exclude": ["test/**/*", "**/__mocks__/*", "**/test/*", "**/*.test.ts", "integration/**/*"] +} diff --git a/packages/common/authUtils/tsconfig.json b/packages/common/authUtils/tsconfig.json new file mode 100644 index 0000000000..ad5abb3998 --- /dev/null +++ b/packages/common/authUtils/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../tsconfig.package.json", + "compilerOptions": {}, + "include": ["src/**/*", "types/**/*", "integration/**/*"] +} diff --git a/packages/common/streamsUtils/package.json b/packages/common/streamsUtils/package.json index 58e0234bbb..212b3540d6 100644 --- a/packages/common/streamsUtils/package.json +++ b/packages/common/streamsUtils/package.json @@ -14,6 +14,8 @@ "test": "yarn jest --runInBand --detectOpenHandles --forceExit --ci", "test:coverage": "yarn run test --coverage", "test:watch": "yarn run test --watch", + "gen:api-types": "openapi-typescript https://api.moralis-streams.com/api-docs/swagger.json --output src/operations/openapi.ts", + "gen:api-types-beta": "openapi-typescript https://streams-api-stage.aws-prod-streams-master-1.moralis.io/api-docs/swagger.json --output src/operations/openapi.ts", "lint": "eslint . --ext .js,.ts,.tsx,jsx", "clean": "rm -rf lib && rm -rf tsconfig.tsbuildinfo && rm -rf tsconfig.build.tsbuildinfo && rm -rf ./node_modules/.cache/nx", "build": "tsc -p tsconfig.build.json", diff --git a/packages/common/streamsUtils/src/index.ts b/packages/common/streamsUtils/src/index.ts index aeaf085d5e..3a55d644c5 100644 --- a/packages/common/streamsUtils/src/index.ts +++ b/packages/common/streamsUtils/src/index.ts @@ -1,2 +1,3 @@ // Export data types export * from './dataTypes'; +export * from './operations'; diff --git a/packages/streams/src/operations/evmStreams/addAddressEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/addAddressEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/addAddressEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/addAddressEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/addAddressEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/addAddressEvmOperation.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/addAddressEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/addAddressEvmOperation.ts diff --git a/packages/streams/src/operations/evmStreams/createStreamEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/createStreamEvmOperation.test.ts similarity index 99% rename from packages/streams/src/operations/evmStreams/createStreamEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/createStreamEvmOperation.test.ts index 625a1aa53f..dea4cbfc3b 100644 --- a/packages/streams/src/operations/evmStreams/createStreamEvmOperation.test.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/createStreamEvmOperation.test.ts @@ -22,6 +22,7 @@ describe('createStreamEvmOperation', () => { chains: ['0x1'], abi: null, advancedOptions: null, + demo: true, }; const serializedRequest = createStreamEvmOperation.serializeRequest(request, core); diff --git a/packages/streams/src/operations/evmStreams/createStreamEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/createStreamEvmOperation.ts similarity index 98% rename from packages/streams/src/operations/evmStreams/createStreamEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/createStreamEvmOperation.ts index 8c2ba41f0d..28cfebb859 100644 --- a/packages/streams/src/operations/evmStreams/createStreamEvmOperation.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/createStreamEvmOperation.ts @@ -1,6 +1,6 @@ import { Camelize, Core, Operation } from '@moralisweb3/common-core'; import { EvmChain, EvmChainish } from '@moralisweb3/common-evm-utils'; -import { EvmStream } from '@moralisweb3/common-streams-utils'; +import { EvmStream } from '../../dataTypes'; import { operations } from '../openapi'; type OperationId = 'CreateStream'; diff --git a/packages/streams/src/operations/evmStreams/deleteAddressEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/deleteAddressEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/deleteAddressEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/deleteAddressEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/deleteAddressEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/deleteAddressEvmOperation.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/deleteAddressEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/deleteAddressEvmOperation.ts diff --git a/packages/streams/src/operations/evmStreams/deleteStreamEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/deleteStreamEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/deleteStreamEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/deleteStreamEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/deleteStreamEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/deleteStreamEvmOperation.ts similarity index 96% rename from packages/streams/src/operations/evmStreams/deleteStreamEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/deleteStreamEvmOperation.ts index 13fd5b822e..b45d8b4591 100644 --- a/packages/streams/src/operations/evmStreams/deleteStreamEvmOperation.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/deleteStreamEvmOperation.ts @@ -1,5 +1,5 @@ import { Camelize, Core, Operation } from '@moralisweb3/common-core'; -import { EvmStream } from '@moralisweb3/common-streams-utils'; +import { EvmStream } from '../../dataTypes'; import { operations } from '../openapi'; type OperationId = 'DeleteStream'; diff --git a/packages/streams/src/operations/evmStreams/getAddressesEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/getAddressesEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/getAddressesEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/getAddressesEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/getAddressesEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/getAddressesEvmOperation.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/getAddressesEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/getAddressesEvmOperation.ts diff --git a/packages/streams/src/operations/evmStreams/getStreamEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/getStreamEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/getStreamEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/getStreamEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/getStreamEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/getStreamEvmOperation.ts similarity index 96% rename from packages/streams/src/operations/evmStreams/getStreamEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/getStreamEvmOperation.ts index 4a4637ac2a..215730b35c 100644 --- a/packages/streams/src/operations/evmStreams/getStreamEvmOperation.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/getStreamEvmOperation.ts @@ -1,5 +1,5 @@ import { Core, Camelize, Operation } from '@moralisweb3/common-core'; -import { EvmStream } from '@moralisweb3/common-streams-utils'; +import { EvmStream } from '../../dataTypes'; import { operations } from '../openapi'; type OperationId = 'GetStream'; diff --git a/packages/streams/src/operations/evmStreams/getStreamsEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/getStreamsEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/getStreamsEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/getStreamsEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/getStreamsEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/getStreamsEvmOperation.ts similarity index 96% rename from packages/streams/src/operations/evmStreams/getStreamsEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/getStreamsEvmOperation.ts index 2afefb52cf..94317b01a5 100644 --- a/packages/streams/src/operations/evmStreams/getStreamsEvmOperation.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/getStreamsEvmOperation.ts @@ -1,5 +1,5 @@ import { Core, Camelize, maybe, PaginatedOperation } from '@moralisweb3/common-core'; -import { EvmStream } from '@moralisweb3/common-streams-utils'; +import { EvmStream } from '../../dataTypes'; import { operations } from '../openapi'; type OperationId = 'GetStreams'; diff --git a/packages/streams/src/operations/evmStreams/index.ts b/packages/common/streamsUtils/src/operations/evmStreams/index.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/index.ts rename to packages/common/streamsUtils/src/operations/evmStreams/index.ts diff --git a/packages/streams/src/operations/evmStreams/updateStreamEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/updateStreamEvmOperation.test.ts similarity index 99% rename from packages/streams/src/operations/evmStreams/updateStreamEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/updateStreamEvmOperation.test.ts index 62efc1651f..fbc9cc68bc 100644 --- a/packages/streams/src/operations/evmStreams/updateStreamEvmOperation.test.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/updateStreamEvmOperation.test.ts @@ -23,6 +23,7 @@ describe('createStreamEvmOperation', () => { chains: ['0x1'], abi: null, advancedOptions: null, + demo: true, }; const serializedRequest = updateStreamEvmOperation.serializeRequest(request, core); diff --git a/packages/streams/src/operations/evmStreams/updateStreamEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/updateStreamEvmOperation.ts similarity index 98% rename from packages/streams/src/operations/evmStreams/updateStreamEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/updateStreamEvmOperation.ts index 2f237ceb93..75d9852f4c 100644 --- a/packages/streams/src/operations/evmStreams/updateStreamEvmOperation.ts +++ b/packages/common/streamsUtils/src/operations/evmStreams/updateStreamEvmOperation.ts @@ -1,6 +1,6 @@ import { Camelize, Core, Operation } from '@moralisweb3/common-core'; import { EvmChain, EvmChainish } from '@moralisweb3/common-evm-utils'; -import { EvmStream } from '@moralisweb3/common-streams-utils'; +import { EvmStream } from '../../dataTypes'; import { operations } from '../openapi'; type OperationId = 'UpdateStream'; diff --git a/packages/streams/src/operations/evmStreams/updateStreamStatusEvmOperation.test.ts b/packages/common/streamsUtils/src/operations/evmStreams/updateStreamStatusEvmOperation.test.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/updateStreamStatusEvmOperation.test.ts rename to packages/common/streamsUtils/src/operations/evmStreams/updateStreamStatusEvmOperation.test.ts diff --git a/packages/streams/src/operations/evmStreams/updateStreamStatusEvmOperation.ts b/packages/common/streamsUtils/src/operations/evmStreams/updateStreamStatusEvmOperation.ts similarity index 100% rename from packages/streams/src/operations/evmStreams/updateStreamStatusEvmOperation.ts rename to packages/common/streamsUtils/src/operations/evmStreams/updateStreamStatusEvmOperation.ts diff --git a/packages/streams/src/operations/history/getHistoryOperation.test.ts b/packages/common/streamsUtils/src/operations/history/getHistoryOperation.test.ts similarity index 100% rename from packages/streams/src/operations/history/getHistoryOperation.test.ts rename to packages/common/streamsUtils/src/operations/history/getHistoryOperation.test.ts diff --git a/packages/streams/src/operations/history/getHistoryOperation.ts b/packages/common/streamsUtils/src/operations/history/getHistoryOperation.ts similarity index 100% rename from packages/streams/src/operations/history/getHistoryOperation.ts rename to packages/common/streamsUtils/src/operations/history/getHistoryOperation.ts diff --git a/packages/streams/src/operations/history/index.ts b/packages/common/streamsUtils/src/operations/history/index.ts similarity index 100% rename from packages/streams/src/operations/history/index.ts rename to packages/common/streamsUtils/src/operations/history/index.ts diff --git a/packages/streams/src/operations/history/replayHistoryOperation.test.ts b/packages/common/streamsUtils/src/operations/history/replayHistoryOperation.test.ts similarity index 100% rename from packages/streams/src/operations/history/replayHistoryOperation.test.ts rename to packages/common/streamsUtils/src/operations/history/replayHistoryOperation.test.ts diff --git a/packages/streams/src/operations/history/replayHistoryOperation.ts b/packages/common/streamsUtils/src/operations/history/replayHistoryOperation.ts similarity index 100% rename from packages/streams/src/operations/history/replayHistoryOperation.ts rename to packages/common/streamsUtils/src/operations/history/replayHistoryOperation.ts diff --git a/packages/streams/src/operations/index.ts b/packages/common/streamsUtils/src/operations/index.ts similarity index 100% rename from packages/streams/src/operations/index.ts rename to packages/common/streamsUtils/src/operations/index.ts diff --git a/packages/streams/src/operations/openapi.ts b/packages/common/streamsUtils/src/operations/openapi.ts similarity index 96% rename from packages/streams/src/operations/openapi.ts rename to packages/common/streamsUtils/src/operations/openapi.ts index 42539109a9..2f2dceeaee 100644 --- a/packages/streams/src/operations/openapi.ts +++ b/packages/common/streamsUtils/src/operations/openapi.ts @@ -288,8 +288,8 @@ export interface components { */ StreamsStatus: "active" | "paused" | "error" | "terminated"; /** - * @description The filter object, optional and only used if the type : log - * https://v1docs.moralis.io/moralis-dapp/automatic-transaction-sync/smart-contract-events#event-filters + * @description The filter object for the topic0 + * https://docs.moralis.io/docs/filter-streams * @example {} */ StreamsFilter: { [key: string]: unknown }; @@ -306,7 +306,7 @@ export interface components { description: string; /** @description A user-provided tag that will be send along the webhook, the user can use this tag to identify the specific stream if multiple streams are present */ tag: string; - /** @description An Array of topic0's in hex, required if the type : log */ + /** @description An Array of topic0's in string-signature format ex: ['FunctionName(address,uint256)'] */ topic0?: string[] | null; /** @description Include events for all addresses (only applied when abi and topic0 is provided) */ allAddresses?: boolean; @@ -320,6 +320,8 @@ export interface components { advancedOptions?: components["schemas"]["advancedOptions"][] | null; /** @description The ids of the chains for this stream in hex Ex: ["0x1","0x38"] */ chainIds: string[]; + /** @description Indicator if it is a demo stream */ + demo?: boolean; /** @description The unique uuid of the stream */ id: components["schemas"]["UUID"]; /** @description The status of the stream. */ @@ -345,7 +347,7 @@ export interface components { description: string; /** @description A user-provided tag that will be send along the webhook, the user can use this tag to identify the specific stream if multiple streams are present */ tag: string; - /** @description An Array of topic0's in hex, required if the type : log */ + /** @description An Array of topic0's in string-signature format ex: ['FunctionName(address,uint256)'] */ topic0?: string[] | null; /** @description Include events for all addresses (only applied when abi and topic0 is provided) */ allAddresses?: boolean; @@ -359,6 +361,8 @@ export interface components { advancedOptions?: components["schemas"]["advancedOptions"][] | null; /** @description The ids of the chains for this stream in hex Ex: ["0x1","0x38"] */ chainIds: string[]; + /** @description Indicator if it is a demo stream */ + demo?: boolean; /** @description The unique uuid of the stream */ id: components["schemas"]["UUID"]; /** @description The status of the stream. */ @@ -373,7 +377,7 @@ export interface components { description: string; /** @description A user-provided tag that will be send along the webhook, the user can use this tag to identify the specific stream if multiple streams are present */ tag: string; - /** @description An Array of topic0's in hex, required if the type : log */ + /** @description An Array of topic0's in string-signature format ex: ['FunctionName(address,uint256)'] */ topic0?: string[] | null; /** @description Include events for all addresses (only applied when abi and topic0 is provided) */ allAddresses?: boolean; @@ -387,6 +391,8 @@ export interface components { advancedOptions?: components["schemas"]["advancedOptions"][] | null; /** @description The ids of the chains for this stream in hex Ex: ["0x1","0x38"] */ chainIds: string[]; + /** @description Indicator if it is a demo stream */ + demo?: boolean; }; /** @description Make all properties in T optional */ "Partial_streamsTypes.StreamsModelCreate_": { @@ -396,7 +402,7 @@ export interface components { description?: string; /** @description A user-provided tag that will be send along the webhook, the user can use this tag to identify the specific stream if multiple streams are present */ tag?: string; - /** @description An Array of topic0's in hex, required if the type : log */ + /** @description An Array of topic0's in string-signature format ex: ['FunctionName(address,uint256)'] */ topic0?: string[] | null; /** @description Include events for all addresses (only applied when abi and topic0 is provided) */ allAddresses?: boolean; @@ -410,6 +416,8 @@ export interface components { advancedOptions?: components["schemas"]["advancedOptions"][] | null; /** @description The ids of the chains for this stream in hex Ex: ["0x1","0x38"] */ chainIds?: string[]; + /** @description Indicator if it is a demo stream */ + demo?: boolean; }; "streamsTypes.StreamsStatusUpdate": { /** @description The status of the stream. */ diff --git a/packages/streams/src/operations/operations.test.ts b/packages/common/streamsUtils/src/operations/operations.test.ts similarity index 100% rename from packages/streams/src/operations/operations.test.ts rename to packages/common/streamsUtils/src/operations/operations.test.ts diff --git a/packages/streams/src/operations/operations.ts b/packages/common/streamsUtils/src/operations/operations.ts similarity index 100% rename from packages/streams/src/operations/operations.ts rename to packages/common/streamsUtils/src/operations/operations.ts diff --git a/packages/streams/src/operations/project/getSettingsOperation.ts b/packages/common/streamsUtils/src/operations/project/getSettingsOperation.ts similarity index 100% rename from packages/streams/src/operations/project/getSettingsOperation.ts rename to packages/common/streamsUtils/src/operations/project/getSettingsOperation.ts diff --git a/packages/streams/src/operations/project/index.ts b/packages/common/streamsUtils/src/operations/project/index.ts similarity index 100% rename from packages/streams/src/operations/project/index.ts rename to packages/common/streamsUtils/src/operations/project/index.ts diff --git a/packages/streams/src/operations/project/setSettingsOperation.test.ts b/packages/common/streamsUtils/src/operations/project/setSettingsOperation.test.ts similarity index 100% rename from packages/streams/src/operations/project/setSettingsOperation.test.ts rename to packages/common/streamsUtils/src/operations/project/setSettingsOperation.test.ts diff --git a/packages/streams/src/operations/project/setSettingsOperation.ts b/packages/common/streamsUtils/src/operations/project/setSettingsOperation.ts similarity index 100% rename from packages/streams/src/operations/project/setSettingsOperation.ts rename to packages/common/streamsUtils/src/operations/project/setSettingsOperation.ts diff --git a/packages/streams/src/operations/stats/getStatsByIdOperation.test.ts b/packages/common/streamsUtils/src/operations/stats/getStatsByIdOperation.test.ts similarity index 100% rename from packages/streams/src/operations/stats/getStatsByIdOperation.test.ts rename to packages/common/streamsUtils/src/operations/stats/getStatsByIdOperation.test.ts diff --git a/packages/streams/src/operations/stats/getStatsByIdOperation.ts b/packages/common/streamsUtils/src/operations/stats/getStatsByIdOperation.ts similarity index 100% rename from packages/streams/src/operations/stats/getStatsByIdOperation.ts rename to packages/common/streamsUtils/src/operations/stats/getStatsByIdOperation.ts diff --git a/packages/streams/src/operations/stats/getStatsOperation.ts b/packages/common/streamsUtils/src/operations/stats/getStatsOperation.ts similarity index 100% rename from packages/streams/src/operations/stats/getStatsOperation.ts rename to packages/common/streamsUtils/src/operations/stats/getStatsOperation.ts diff --git a/packages/streams/src/operations/stats/index.ts b/packages/common/streamsUtils/src/operations/stats/index.ts similarity index 100% rename from packages/streams/src/operations/stats/index.ts rename to packages/common/streamsUtils/src/operations/stats/index.ts diff --git a/packages/moralis/package.json b/packages/moralis/package.json index 18f8cf8343..f441330221 100644 --- a/packages/moralis/package.json +++ b/packages/moralis/package.json @@ -40,6 +40,8 @@ "./streams-typings": "./lib/streamsTypings/index.js", "./common-evm-utils": "./lib/commonEvmUtils/index.js", "./common-sol-utils": "./lib/commonSolUtils/index.js", + "./common-auth-utils": "./lib/commonAuthUtils/index.js", + "./common-streams-utils": "./lib/commonStreamsUtils/index.js", "./auth": "./lib/auth/index.js", "./streams": "./lib/streams/index.js" }, @@ -57,6 +59,12 @@ "common-sol-utils": [ "lib/commonSolUtils/index.d.ts" ], + "common-auth-utils": [ + "lib/commonAuthUtils/index.d.ts" + ], + "common-streams-utils": [ + "lib/commonStreamsUtils/index.d.ts" + ], "streams": [ "lib/streams/index.d.ts" ], @@ -67,6 +75,8 @@ }, "dependencies": { "@moralisweb3/auth": "^2.7.4", + "@moralisweb3/common-auth-utils": "^2.7.4", + "@moralisweb3/common-streams-utils": "^2.7.4", "@moralisweb3/common-core": "^2.7.4", "@moralisweb3/streams": "^2.7.4", "@moralisweb3/api-utils": "^2.7.4", diff --git a/packages/moralis/src/commonAuthUtils/index.ts b/packages/moralis/src/commonAuthUtils/index.ts new file mode 100644 index 0000000000..c86e060e82 --- /dev/null +++ b/packages/moralis/src/commonAuthUtils/index.ts @@ -0,0 +1 @@ +export * from '@moralisweb3/common-auth-utils'; diff --git a/packages/moralis/src/commonStreamsUtils/index.ts b/packages/moralis/src/commonStreamsUtils/index.ts new file mode 100644 index 0000000000..5b0c71cb84 --- /dev/null +++ b/packages/moralis/src/commonStreamsUtils/index.ts @@ -0,0 +1 @@ +export * from '@moralisweb3/common-streams-utils'; diff --git a/packages/next/package.json b/packages/next/package.json index aa0123779f..cd94c4ed2b 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -27,6 +27,7 @@ "dependencies": { "@moralisweb3/api-utils": "^2.7.4", "@moralisweb3/evm-api": "^2.7.4", + "@moralisweb3/common-auth-utils": "^2.7.4", "@moralisweb3/auth": "^2.7.4", "@moralisweb3/sol-api": "^2.7.4", "axios": "^0.27.2", diff --git a/packages/next/src/MoralisNextApi/RequestHandlerResolver.ts b/packages/next/src/MoralisNextApi/RequestHandlerResolver.ts index 66fc290959..958f6e65a0 100644 --- a/packages/next/src/MoralisNextApi/RequestHandlerResolver.ts +++ b/packages/next/src/MoralisNextApi/RequestHandlerResolver.ts @@ -3,7 +3,8 @@ import { operations as evmOperations } from 'moralis/common-evm-utils'; import { operations as solOperations } from 'moralis/common-sol-utils'; import { Operation } from 'moralis/common-core'; import { OperationResolver } from '@moralisweb3/api-utils'; -import { operations as authOperations, Auth } from '@moralisweb3/auth'; +import { operations as authOperations } from '@moralisweb3/common-auth-utils'; +import { Auth } from '@moralisweb3/auth'; import { SolApi } from '@moralisweb3/sol-api'; import Moralis from 'moralis'; diff --git a/packages/next/src/MoralisNextApi/types.ts b/packages/next/src/MoralisNextApi/types.ts index c7e46e163e..315415f901 100644 --- a/packages/next/src/MoralisNextApi/types.ts +++ b/packages/next/src/MoralisNextApi/types.ts @@ -1,5 +1,5 @@ import { ApiUtilsConfigValues } from '@moralisweb3/api-utils'; -import { RequestChallengeEvmRequest, RequestChallengeSolanaRequest } from '@moralisweb3/auth'; +import { RequestChallengeEvmRequest, RequestChallengeSolanaRequest } from '@moralisweb3/common-auth-utils'; import { MoralisCoreConfigValues } from 'moralis/common-core'; import type { NextApiRequest, NextApiResponse } from 'next'; diff --git a/packages/next/src/auth/MoralisNextAuthProvider.ts b/packages/next/src/auth/MoralisNextAuthProvider.ts index 436a1e5637..91d0f9fb02 100644 --- a/packages/next/src/auth/MoralisNextAuthProvider.ts +++ b/packages/next/src/auth/MoralisNextAuthProvider.ts @@ -1,4 +1,4 @@ -import { VerifyChallengeSolanaJSONResponse, VerifyChallengeEvmJSONResponse } from '@moralisweb3/auth'; +import { VerifyChallengeSolanaJSONResponse, VerifyChallengeEvmJSONResponse } from '@moralisweb3/common-auth-utils'; import axios from 'axios'; import CredentialsProvider from 'next-auth/providers/credentials'; import { Network } from 'moralis/common-core'; diff --git a/packages/next/src/hooks/auth/useAuthRequestChallengeEvm.ts b/packages/next/src/hooks/auth/useAuthRequestChallengeEvm.ts index 3e5a3eafaa..6eb33fa7d1 100644 --- a/packages/next/src/hooks/auth/useAuthRequestChallengeEvm.ts +++ b/packages/next/src/hooks/auth/useAuthRequestChallengeEvm.ts @@ -2,7 +2,7 @@ import { requestChallengeEvmOperation as operation, RequestChallengeEvmRequest, RequestChallengeEvmResponse, -} from '@moralisweb3/auth'; +} from '@moralisweb3/common-auth-utils'; import { fetcher } from '../../utils/fetcher'; import { FetchParams } from '../types'; import { useCallback } from 'react'; diff --git a/packages/next/src/hooks/auth/useAuthRequestChallengeSolana.ts b/packages/next/src/hooks/auth/useAuthRequestChallengeSolana.ts index afdd894c67..7f6ee28c6d 100644 --- a/packages/next/src/hooks/auth/useAuthRequestChallengeSolana.ts +++ b/packages/next/src/hooks/auth/useAuthRequestChallengeSolana.ts @@ -2,7 +2,7 @@ import { requestChallengeSolanaOperation as operation, RequestChallengeSolanaRequest, RequestChallengeSolanaResponse, -} from '@moralisweb3/auth'; +} from '@moralisweb3/common-auth-utils'; import { fetcher } from '../../utils/fetcher'; import { FetchParams } from '../types'; import { useCallback } from 'react'; diff --git a/packages/streams/package.json b/packages/streams/package.json index 8c300167c0..cf708a63bf 100644 --- a/packages/streams/package.json +++ b/packages/streams/package.json @@ -16,8 +16,6 @@ "test:watch": "yarn run test --watch", "lint": "eslint . --ext .js,.ts,.tsx,jsx", "clean": "rm -rf lib && rm -rf tsconfig.tsbuildinfo && rm -rf tsconfig.build.tsbuildinfo && rm -rf ./node_modules/.cache/nx", - "gen:api-types": "openapi-typescript https://api.moralis-streams.com/api-docs/swagger.json --output src/operations/openapi.ts", - "gen:api-types-beta": "openapi-typescript https://streams-api-stage.aws-prod-streams-master-1.moralis.io/api-docs/swagger.json --output src/operations/openapi.ts", "build": "tsc -p tsconfig.build.json", "dev": "tsc --watch" }, diff --git a/packages/streams/src/Streams.ts b/packages/streams/src/Streams.ts index ab7cca6f12..442ac773e4 100644 --- a/packages/streams/src/Streams.ts +++ b/packages/streams/src/Streams.ts @@ -26,7 +26,7 @@ import { getStatsOperation, setSettingsOperation, replayHistoryOperation, -} from './operations/index'; +} from '@moralisweb3/common-streams-utils'; const BASE_URL = 'https://api.moralis-streams.com'; diff --git a/packages/streams/src/index.ts b/packages/streams/src/index.ts index b538de970e..95c2c841f6 100644 --- a/packages/streams/src/index.ts +++ b/packages/streams/src/index.ts @@ -9,6 +9,5 @@ export * from './Streams'; // Export SDK types export * from './methods/types'; export * from './mapping'; -export * from './operations'; export default Streams; diff --git a/packages/streams/src/methods/addAddress.ts b/packages/streams/src/methods/addAddress.ts index 2c213c4327..5a39452eb7 100644 --- a/packages/streams/src/methods/addAddress.ts +++ b/packages/streams/src/methods/addAddress.ts @@ -2,7 +2,7 @@ import Core from '@moralisweb3/common-core'; import { OperationResolver } from '@moralisweb3/api-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; -import { addAddressEvmOperation, AddAddressEvmRequest } from '../operations'; +import { addAddressEvmOperation, AddAddressEvmRequest } from '@moralisweb3/common-streams-utils'; export interface AddAddressEvmOptions extends AddAddressEvmRequest { networkType?: 'evm'; diff --git a/packages/streams/src/methods/create.ts b/packages/streams/src/methods/create.ts index 6773e29a55..ea9d950780 100644 --- a/packages/streams/src/methods/create.ts +++ b/packages/streams/src/methods/create.ts @@ -1,6 +1,6 @@ import { OperationResolver } from '@moralisweb3/api-utils'; import Core from '@moralisweb3/common-core'; -import { createStreamEvmOperation, CreateStreamEvmRequest } from '../operations'; +import { createStreamEvmOperation, CreateStreamEvmRequest } from '@moralisweb3/common-streams-utils'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; import { StreamNetwork } from '../utils/StreamNetwork'; diff --git a/packages/streams/src/methods/delete.ts b/packages/streams/src/methods/delete.ts index 907c8dcf7d..6e35523938 100644 --- a/packages/streams/src/methods/delete.ts +++ b/packages/streams/src/methods/delete.ts @@ -2,7 +2,7 @@ import { OperationResolver } from '@moralisweb3/api-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; import Core from '@moralisweb3/common-core'; -import { deleteStreamEvmOperation, DeleteStreamEvmRequest } from '../operations'; +import { deleteStreamEvmOperation, DeleteStreamEvmRequest } from '@moralisweb3/common-streams-utils'; export interface DeleteStreamEvmOptions extends DeleteStreamEvmRequest { networkType?: 'evm'; diff --git a/packages/streams/src/methods/deleteAddress.ts b/packages/streams/src/methods/deleteAddress.ts index edce7c015b..ee27d54994 100644 --- a/packages/streams/src/methods/deleteAddress.ts +++ b/packages/streams/src/methods/deleteAddress.ts @@ -2,7 +2,7 @@ import { OperationResolver } from '@moralisweb3/api-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; import Core from '@moralisweb3/common-core'; -import { deleteAddressEvmOperation, DeleteAddressEvmRequest } from '../operations'; +import { deleteAddressEvmOperation, DeleteAddressEvmRequest } from '@moralisweb3/common-streams-utils'; export interface DeleteAddressEvmOptions extends DeleteAddressEvmRequest { networkType?: 'evm'; diff --git a/packages/streams/src/methods/getAddresses.ts b/packages/streams/src/methods/getAddresses.ts index d01c517581..c04c03fc2e 100644 --- a/packages/streams/src/methods/getAddresses.ts +++ b/packages/streams/src/methods/getAddresses.ts @@ -1,7 +1,7 @@ import { PaginatedOperationResolver } from '@moralisweb3/api-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; -import { getAddressesEvmOperation, GetAddressesEvmRequest } from '../operations'; +import { getAddressesEvmOperation, GetAddressesEvmRequest } from '@moralisweb3/common-streams-utils'; import Core from '@moralisweb3/common-core'; export interface GetAddressesEvmOptions extends GetAddressesEvmRequest { diff --git a/packages/streams/src/methods/getAll.ts b/packages/streams/src/methods/getAll.ts index 9518e85539..6c3ce8d2a2 100644 --- a/packages/streams/src/methods/getAll.ts +++ b/packages/streams/src/methods/getAll.ts @@ -1,6 +1,6 @@ import Core from '@moralisweb3/common-core'; import { PaginatedOperationResolver } from '@moralisweb3/api-utils'; -import { getStreamsEvmOperation, GetStreamsEvmRequest } from '../operations'; +import { getStreamsEvmOperation, GetStreamsEvmRequest } from '@moralisweb3/common-streams-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; diff --git a/packages/streams/src/methods/getById.ts b/packages/streams/src/methods/getById.ts index f30395fed1..6b052107d0 100644 --- a/packages/streams/src/methods/getById.ts +++ b/packages/streams/src/methods/getById.ts @@ -2,7 +2,7 @@ import Core from '@moralisweb3/common-core'; import { OperationResolver } from '@moralisweb3/api-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; -import { getStreamEvmOperation, GetStreamEvmRequest } from '../operations'; +import { getStreamEvmOperation, GetStreamEvmRequest } from '@moralisweb3/common-streams-utils'; export interface GetStreamEvmOptions extends GetStreamEvmRequest { network: 'evm'; diff --git a/packages/streams/src/methods/update.ts b/packages/streams/src/methods/update.ts index 5fb9fbe699..46c8960ee7 100644 --- a/packages/streams/src/methods/update.ts +++ b/packages/streams/src/methods/update.ts @@ -1,7 +1,7 @@ import { OperationResolver } from '@moralisweb3/api-utils'; import { StreamNetwork } from '../utils/StreamNetwork'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; -import { updateStreamEvmOperation, UpdateStreamEvmRequest } from '../operations'; +import { updateStreamEvmOperation, UpdateStreamEvmRequest } from '@moralisweb3/common-streams-utils'; import Core from '@moralisweb3/common-core'; export interface UpdateStreamEvmOptions extends UpdateStreamEvmRequest { diff --git a/packages/streams/src/methods/updateStatus.ts b/packages/streams/src/methods/updateStatus.ts index 36a9822768..5017971aff 100644 --- a/packages/streams/src/methods/updateStatus.ts +++ b/packages/streams/src/methods/updateStatus.ts @@ -1,6 +1,6 @@ import { OperationResolver } from '@moralisweb3/api-utils'; import Core from '@moralisweb3/common-core'; -import { updateStreamStatusEvmOperation, UpdateStreamStatusEvmRequest } from '../operations'; +import { updateStreamStatusEvmOperation, UpdateStreamStatusEvmRequest } from '@moralisweb3/common-streams-utils'; import { IncorrectNetworkError } from '../utils/IncorrectNetworkError'; import { StreamNetwork } from '../utils/StreamNetwork';