Skip to content

Commit c040b1a

Browse files
committed
feat: streamManagerV2 - canary
1 parent 3fbe62f commit c040b1a

File tree

60 files changed

+3152
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3152
-106
lines changed

.github/workflows/dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
182182
- name: Push tags to git
183183
run: |
184-
git push --follow-tags
184+
git push origin HEAD --follow-tags
185185
186186
- name: Broadcast published versions on Slack
187187
run: node etc/slack.cjs --api=$SLACK_API --actor=$GIT_ACTOR --commit-message=$GIT_LATEST_COMMIT_MESSAGE

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
"cache:clear": "nx reset",
3131
"bootstrap": "pnpm clean-up && pnpm install",
3232
"test:watch": "vitest",
33-
"test": "npm run test:standard; npm run test:broadcast",
34-
"test:standard": "vitest run",
35-
"test:broadcast": "vitest run --config=vitest.broadcast.config.ts",
33+
"test": "vitest run",
34+
"test:all": "vitest run; vitest run --config=vitest.broadcast.config.ts",
3635
"lint": "cross-env NODE_OPTIONS='--max-old-space-size=4096' lerna run lint",
3736
"lint:fix": "cross-env NODE_OPTIONS='--max-old-space-size=4096' lerna run lint -- --fix",
3837
"husky-skip": "cross-env HUSKY_SKIP_HOOKS=1",

packages/exceptions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@injectivelabs/exceptions",
3-
"version": "1.17.2-alpha.8",
3+
"version": "1.17.2-alpha.9",
44
"description": "List of exceptions that can be reused throughout Injective's projects.",
55
"license": "Apache-2.0",
66
"author": {

packages/networks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@injectivelabs/networks",
3-
"version": "1.17.2-alpha.8",
3+
"version": "1.17.2-alpha.9",
44
"description": "Endpoints, networks, etc. Can be reused throughout Injective's projects.",
55
"license": "Apache-2.0",
66
"author": {

packages/sdk-ts/package.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@injectivelabs/sdk-ts",
3-
"version": "1.17.2-alpha.8",
3+
"version": "1.17.2-alpha.9",
44
"description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
55
"license": "Apache-2.0",
66
"author": {
@@ -319,35 +319,36 @@
319319
"lint": "eslint . --ext .ts,.js"
320320
},
321321
"dependencies": {
322+
"viem": "catalog:",
323+
"axios": "catalog:",
324+
"ethers": "catalog:",
325+
"@scure/base": "catalog:",
326+
"@scure/bip39": "catalog:",
327+
"@noble/curves": "catalog:",
328+
"@noble/hashes": "catalog:",
329+
"eventemitter3": "catalog:",
322330
"@cosmjs/amino": "catalog:",
323-
"@cosmjs/proto-signing": "catalog:",
324331
"@cosmjs/stargate": "catalog:",
325-
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
326-
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
332+
"http-status-codes": "catalog:",
333+
"@cosmjs/proto-signing": "catalog:",
334+
"@injectivelabs/utils": "workspace:*",
335+
"@injectivelabs/networks": "workspace:*",
336+
"@injectivelabs/ts-types": "workspace:*",
327337
"@injectivelabs/exceptions": "workspace:*",
328338
"@injectivelabs/grpc-web": "^0.0.1",
329339
"@injectivelabs/olp-proto-ts-v2": "1.17.3",
330340
"@injectivelabs/core-proto-ts-v2": "1.17.3",
331341
"@injectivelabs/mito-proto-ts-v2": "1.17.3",
332342
"@injectivelabs/abacus-proto-ts-v2": "1.17.4",
333343
"@injectivelabs/indexer-proto-ts-v2": "1.17.5",
334-
"@injectivelabs/networks": "workspace:*",
335-
"@injectivelabs/ts-types": "workspace:*",
336-
"@injectivelabs/utils": "workspace:*",
337-
"@noble/curves": "catalog:",
338-
"@noble/hashes": "catalog:",
339-
"@protobuf-ts/grpcweb-transport": "^2.11.1",
340-
"@protobuf-ts/runtime": "^2.11.1",
341-
"@protobuf-ts/runtime-rpc": "^2.11.1",
342-
"@scure/base": "catalog:",
343-
"@scure/bip39": "catalog:",
344-
"axios": "catalog:",
344+
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
345+
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
346+
"rxjs": "7.8.2:",
345347
"cosmjs-types": "0.9.0",
346-
"ethers": "catalog:",
347-
"http-status-codes": "catalog:",
348-
"rxjs": "catalog:",
349348
"snakecase-keys": "^5.4.1",
350-
"viem": "catalog:"
349+
"@protobuf-ts/runtime": "^2.11.1",
350+
"@protobuf-ts/runtime-rpc": "^2.11.1",
351+
"@protobuf-ts/grpcweb-transport": "^2.11.1"
351352
},
352353
"publishConfig": {
353354
"access": "public"

packages/sdk-ts/src/client/indexer/IndexerGrpcStreamClient.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { IndexerGrpcSpotStream } from './grpc_stream/IndexerGrpcSpotStream.js'
2-
import { IndexerGrpcOracleStream } from './grpc_stream/IndexerGrpcOracleStream.js'
3-
import { IndexerGrpcAccountStream } from './grpc_stream/IndexerGrpcAccountStream.js'
4-
import { IndexerGrpcAuctionStream } from './grpc_stream/IndexerGrpcAuctionStream.js'
5-
import { IndexerGrpcExplorerStream } from './grpc_stream/IndexerGrpcExplorerStream.js'
6-
import { IndexerGrpcDerivativesStream } from './grpc_stream/IndexerGrpcDerivativesStream.js'
7-
import { IndexerGrpcAccountPortfolioStream } from './grpc_stream/IndexerGrpcAccountPortfolioStream.js'
1+
import { IndexerGrpcSpotStream } from './grpc_stream/stream/IndexerGrpcSpotStream.js'
2+
import { IndexerGrpcOracleStream } from './grpc_stream/stream/IndexerGrpcOracleStream.js'
3+
import { IndexerGrpcAccountStream } from './grpc_stream/stream/IndexerGrpcAccountStream.js'
4+
import { IndexerGrpcAuctionStream } from './grpc_stream/stream/IndexerGrpcAuctionStream.js'
5+
import { IndexerGrpcExplorerStream } from './grpc_stream/stream/IndexerGrpcExplorerStream.js'
6+
import { IndexerGrpcDerivativesStream } from './grpc_stream/stream/IndexerGrpcDerivativesStream.js'
7+
import { IndexerGrpcAccountPortfolioStream } from './grpc_stream/stream/IndexerGrpcAccountPortfolioStream.js'
88

99
/**
1010
* @category Indexer Grpc API
Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
export * from './IndexerGrpcSpotStream.js'
2-
export * from './IndexerGrpcMitoStream.js'
3-
export * from './IndexerGrpcOracleStream.js'
4-
export * from './IndexerGrpcAccountStream.js'
5-
export * from './IndexerGrpcAuctionStream.js'
6-
export * from './IndexerGrpcTradingStream.js'
7-
export * from './IndexerGrpcArchiverStream.js'
8-
export * from './IndexerGrpcExplorerStream.js'
9-
export * from './IndexerGrpcDerivativesStream.js'
10-
export * from './IndexerGrpcAccountPortfolioStream.js'
1+
/* eslint-disable */
2+
3+
// V1 Streams (RxJS-based, backwards compatibility)
4+
export * from './stream/IndexerGrpcSpotStream.js'
5+
export * from './stream/IndexerGrpcMitoStream.js'
6+
export * from './stream/IndexerGrpcOracleStream.js'
7+
export * from './stream/IndexerGrpcAccountStream.js'
8+
export * from './stream/IndexerGrpcAuctionStream.js'
9+
export * from './stream/IndexerGrpcTradingStream.js'
10+
export * from './stream/IndexerGrpcArchiverStream.js'
11+
export * from './stream/IndexerGrpcExplorerStream.js'
12+
export * from './stream/IndexerGrpcDerivativesStream.js'
13+
export * from './stream/IndexerGrpcAccountPortfolioStream.js'
14+
15+
export * from './stream/streamHelpers.js'
16+
export { default as StreamManager } from './stream/StreamManager.js'
17+
18+
// V2 Streams (Event-based, for StreamManagerV2)
19+
export * from './streamV2/IndexerGrpcSpotStreamV2.js'
20+
export * from './streamV2/IndexerGrpcMitoStreamV2.js'
21+
export * from './streamV2/IndexerGrpcOracleStreamV2.js'
22+
export * from './streamV2/IndexerGrpcAccountStreamV2.js'
23+
export * from './streamV2/IndexerGrpcAuctionStreamV2.js'
24+
export * from './streamV2/IndexerGrpcTradingStreamV2.js'
25+
export * from './streamV2/IndexerGrpcArchiverStreamV2.js'
26+
export * from './streamV2/IndexerGrpcExplorerStreamV2.js'
27+
export * from './streamV2/IndexerGrpcDerivativesStreamV2.js'
28+
export * from './streamV2/IndexerGrpcAccountPortfolioStreamV2.js'
29+
30+
export * from './streamV2/StreamManager.js'
31+
export * from './streamV2/streamHelpersV2.js'

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcAccountPortfolioStream.ts renamed to packages/sdk-ts/src/client/indexer/grpc_stream/stream/IndexerGrpcAccountPortfolioStream.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as InjectivePortfolioRpcPb from '@injectivelabs/indexer-proto-ts-v2/generated/injective_portfolio_rpc_pb'
22
import { InjectivePortfolioRPCClient } from '@injectivelabs/indexer-proto-ts-v2/generated/injective_portfolio_rpc_pb.client'
33
import { createStreamSubscription } from './streamHelpers.js'
4-
import { GrpcWebRpcTransport } from '../../base/GrpcWebRpcTransport.js'
5-
import { IndexerAccountPortfolioStreamTransformer } from '../transformers/index.js'
4+
import { GrpcWebRpcTransport } from '../../../base/GrpcWebRpcTransport.js'
5+
import { IndexerAccountPortfolioStreamTransformer } from '../../transformers/index.js'
66
import type { Subscription } from 'rxjs'
7-
import type { StreamStatusResponse } from '../types/index.js'
7+
import type { StreamStatusResponse } from '../../types/index.js'
88

99
export type AccountPortfolioStreamCallback = (
1010
response: ReturnType<

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcAccountStream.spec.ts renamed to packages/sdk-ts/src/client/indexer/grpc_stream/stream/IndexerGrpcAccountStream.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mockFactory } from '@injectivelabs/utils/test-utils'
22
import { Network, getNetworkEndpoints } from '@injectivelabs/networks'
3-
import { getDefaultSubaccountId } from '../../../utils/address.js'
3+
import { getDefaultSubaccountId } from '../../../../utils/address.js'
44
import { IndexerGrpcAccountStream } from './IndexerGrpcAccountStream.js'
55

66
const injectiveAddress = mockFactory.injectiveAddress

packages/sdk-ts/src/client/indexer/grpc_stream/IndexerGrpcAccountStream.ts renamed to packages/sdk-ts/src/client/indexer/grpc_stream/stream/IndexerGrpcAccountStream.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as InjectiveAccountsRpcPb from '@injectivelabs/indexer-proto-ts-v2/generated/injective_accounts_rpc_pb'
22
import { InjectiveAccountsRPCClient } from '@injectivelabs/indexer-proto-ts-v2/generated/injective_accounts_rpc_pb.client'
33
import { createStreamSubscription } from './streamHelpers.js'
4-
import { GrpcWebRpcTransport } from '../../base/GrpcWebRpcTransport.js'
5-
import { IndexerAccountStreamTransformer } from '../transformers/index.js'
4+
import { GrpcWebRpcTransport } from '../../../base/GrpcWebRpcTransport.js'
5+
import { IndexerAccountStreamTransformer } from '../../transformers/index.js'
66
import type { Subscription } from 'rxjs'
7-
import type { StreamStatusResponse } from '../types/index.js'
7+
import type { StreamStatusResponse } from '../../types/index.js'
88

99
export type BalanceStreamCallback = (
1010
response: ReturnType<

0 commit comments

Comments
 (0)