@injectivelabs/sdk-ts 1.15.30 → 1.15.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,6 @@ import { GrpcWebImpl } from './IndexerGrpcWebImpl.js';
4
4
  */
5
5
  export default class BaseIndexerGrpcWebConsumer extends GrpcWebImpl {
6
6
  protected module: string;
7
- constructor(endpoint: string);
7
+ constructor(endpoint: string, metadata?: Record<string, string>);
8
8
  }
9
- export declare const getGrpcIndexerWebImpl: (endpoint: string) => BaseIndexerGrpcWebConsumer;
9
+ export declare const getGrpcIndexerWebImpl: (endpoint: string, metadata?: Record<string, string>) => BaseIndexerGrpcWebConsumer;
@@ -8,10 +8,12 @@ const IndexerGrpcWebImpl_js_1 = require("./IndexerGrpcWebImpl.js");
8
8
  */
9
9
  class BaseIndexerGrpcWebConsumer extends IndexerGrpcWebImpl_js_1.GrpcWebImpl {
10
10
  module = '';
11
- constructor(endpoint) {
12
- super(endpoint, { transport: (0, grpc_js_1.getGrpcTransport)() });
11
+ constructor(endpoint, metadata = {}) {
12
+ const grpcMetadata = new grpc_js_1.grpc.Metadata();
13
+ Object.keys(metadata).forEach((key) => grpcMetadata.set(key, metadata[key]));
14
+ super(endpoint, { transport: (0, grpc_js_1.getGrpcTransport)(), metadata: grpcMetadata });
13
15
  }
14
16
  }
15
17
  exports.default = BaseIndexerGrpcWebConsumer;
16
- const getGrpcIndexerWebImpl = (endpoint) => new BaseIndexerGrpcWebConsumer(endpoint);
18
+ const getGrpcIndexerWebImpl = (endpoint, metadata) => new BaseIndexerGrpcWebConsumer(endpoint, metadata);
17
19
  exports.getGrpcIndexerWebImpl = getGrpcIndexerWebImpl;
@@ -6,7 +6,7 @@ import { StreamStatusResponse } from '../types/index.js';
6
6
  */
7
7
  export declare class IndexerGrpcTradingStream {
8
8
  protected client: InjectiveTradingRpc.InjectiveTradingRPCClientImpl;
9
- constructor(endpoint: string);
9
+ constructor(endpoint: string, metadata?: Record<string, string>);
10
10
  streamGridStrategies({ marketId, callback, onEndCallback, accountAddresses, onStatusCallback, }: {
11
11
  marketId?: string;
12
12
  accountAddresses?: string[];
@@ -8,8 +8,8 @@ const BaseIndexerGrpcWebConsumer_js_1 = require("../../base/BaseIndexerGrpcWebCo
8
8
  */
9
9
  class IndexerGrpcTradingStream {
10
10
  client;
11
- constructor(endpoint) {
12
- this.client = new indexer_proto_ts_1.InjectiveTradingRpc.InjectiveTradingRPCClientImpl((0, BaseIndexerGrpcWebConsumer_js_1.getGrpcIndexerWebImpl)(endpoint));
11
+ constructor(endpoint, metadata) {
12
+ this.client = new indexer_proto_ts_1.InjectiveTradingRpc.InjectiveTradingRPCClientImpl((0, BaseIndexerGrpcWebConsumer_js_1.getGrpcIndexerWebImpl)(endpoint, metadata));
13
13
  }
14
14
  streamGridStrategies({ marketId, callback, onEndCallback, accountAddresses, onStatusCallback, }) {
15
15
  const request = indexer_proto_ts_1.InjectiveTradingRpc.StreamStrategyRequest.create();
@@ -4,6 +4,6 @@ import { GrpcWebImpl } from './IndexerGrpcWebImpl.js';
4
4
  */
5
5
  export default class BaseIndexerGrpcWebConsumer extends GrpcWebImpl {
6
6
  protected module: string;
7
- constructor(endpoint: string);
7
+ constructor(endpoint: string, metadata?: Record<string, string>);
8
8
  }
9
- export declare const getGrpcIndexerWebImpl: (endpoint: string) => BaseIndexerGrpcWebConsumer;
9
+ export declare const getGrpcIndexerWebImpl: (endpoint: string, metadata?: Record<string, string>) => BaseIndexerGrpcWebConsumer;
@@ -1,12 +1,14 @@
1
- import { getGrpcTransport } from '../../utils/grpc.js';
1
+ import { grpc, getGrpcTransport } from '../../utils/grpc.js';
2
2
  import { GrpcWebImpl } from './IndexerGrpcWebImpl.js';
3
3
  /**
4
4
  * @hidden
5
5
  */
6
6
  export default class BaseIndexerGrpcWebConsumer extends GrpcWebImpl {
7
7
  module = '';
8
- constructor(endpoint) {
9
- super(endpoint, { transport: getGrpcTransport() });
8
+ constructor(endpoint, metadata = {}) {
9
+ const grpcMetadata = new grpc.Metadata();
10
+ Object.keys(metadata).forEach((key) => grpcMetadata.set(key, metadata[key]));
11
+ super(endpoint, { transport: getGrpcTransport(), metadata: grpcMetadata });
10
12
  }
11
13
  }
12
- export const getGrpcIndexerWebImpl = (endpoint) => new BaseIndexerGrpcWebConsumer(endpoint);
14
+ export const getGrpcIndexerWebImpl = (endpoint, metadata) => new BaseIndexerGrpcWebConsumer(endpoint, metadata);
@@ -6,7 +6,7 @@ import { StreamStatusResponse } from '../types/index.js';
6
6
  */
7
7
  export declare class IndexerGrpcTradingStream {
8
8
  protected client: InjectiveTradingRpc.InjectiveTradingRPCClientImpl;
9
- constructor(endpoint: string);
9
+ constructor(endpoint: string, metadata?: Record<string, string>);
10
10
  streamGridStrategies({ marketId, callback, onEndCallback, accountAddresses, onStatusCallback, }: {
11
11
  marketId?: string;
12
12
  accountAddresses?: string[];
@@ -5,8 +5,8 @@ import { getGrpcIndexerWebImpl } from '../../base/BaseIndexerGrpcWebConsumer.js'
5
5
  */
6
6
  export class IndexerGrpcTradingStream {
7
7
  client;
8
- constructor(endpoint) {
9
- this.client = new InjectiveTradingRpc.InjectiveTradingRPCClientImpl(getGrpcIndexerWebImpl(endpoint));
8
+ constructor(endpoint, metadata) {
9
+ this.client = new InjectiveTradingRpc.InjectiveTradingRPCClientImpl(getGrpcIndexerWebImpl(endpoint, metadata));
10
10
  }
11
11
  streamGridStrategies({ marketId, callback, onEndCallback, accountAddresses, onStatusCallback, }) {
12
12
  const request = InjectiveTradingRpc.StreamStrategyRequest.create();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/sdk-ts",
3
3
  "description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
4
- "version": "1.15.30",
4
+ "version": "1.15.31",
5
5
  "sideEffects": false,
6
6
  "license": "Apache-2.0",
7
7
  "author": {
@@ -123,16 +123,16 @@
123
123
  "@cosmjs/stargate": "^0.33.0",
124
124
  "@injectivelabs/abacus-proto-ts": "1.14.0",
125
125
  "@injectivelabs/core-proto-ts": "1.14.3",
126
- "@injectivelabs/exceptions": "^1.15.27",
126
+ "@injectivelabs/exceptions": "^1.15.28",
127
127
  "@injectivelabs/grpc-web": "^0.0.1",
128
128
  "@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
129
129
  "@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
130
130
  "@injectivelabs/indexer-proto-ts": "1.13.13",
131
131
  "@injectivelabs/mito-proto-ts": "1.13.2",
132
- "@injectivelabs/networks": "^1.15.28",
132
+ "@injectivelabs/networks": "^1.15.29",
133
133
  "@injectivelabs/olp-proto-ts": "1.13.4",
134
- "@injectivelabs/ts-types": "^1.15.28",
135
- "@injectivelabs/utils": "^1.15.28",
134
+ "@injectivelabs/ts-types": "^1.15.29",
135
+ "@injectivelabs/utils": "^1.15.29",
136
136
  "@metamask/eth-sig-util": "^8.2.0",
137
137
  "@noble/curves": "^1.8.1",
138
138
  "@noble/hashes": "^1.7.1",
@@ -151,7 +151,7 @@
151
151
  "shx": "^0.3.4",
152
152
  "snakecase-keys": "^5.4.1"
153
153
  },
154
- "gitHead": "2c2a365b27e08ad2e0eb06efe3c490c88888fee4",
154
+ "gitHead": "5b5ea65de8584a70d9bc9f75a17d1d43e2b3bbad",
155
155
  "typedoc": {
156
156
  "entryPoint": "./src/index.ts",
157
157
  "readmeFile": "./README.md",