@injectivelabs/sdk-ts 1.15.35 → 1.15.36
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.
- package/dist/cjs/client/chain/grpc/ChainGrpcPermissionsApi.js +21 -21
- package/dist/cjs/client/chain/grpc/ChainGrpcTxFeesApi.d.ts +12 -0
- package/dist/cjs/client/chain/grpc/ChainGrpcTxFeesApi.js +65 -0
- package/dist/cjs/client/chain/grpc/index.d.ts +1 -0
- package/dist/cjs/client/chain/grpc/index.js +3 -1
- package/dist/cjs/client/chain/transformers/ChainGrpcTxFeesTransformer.d.ts +9 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcTxFeesTransformer.js +35 -0
- package/dist/cjs/client/chain/transformers/index.d.ts +1 -0
- package/dist/cjs/client/chain/transformers/index.js +1 -0
- package/dist/cjs/client/chain/types/index.d.ts +2 -0
- package/dist/cjs/client/chain/types/index.js +1 -0
- package/dist/cjs/client/chain/types/txFees.d.ts +21 -0
- package/dist/cjs/client/chain/types/txFees.js +2 -0
- package/dist/cjs/client/indexer/rest/IndexerRestExplorerApi.d.ts +2 -0
- package/dist/cjs/client/indexer/rest/IndexerRestExplorerApi.js +4 -2
- package/dist/cjs/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js +9 -8
- package/dist/cjs/client/indexer/types/derivatives.d.ts +1 -0
- package/dist/esm/client/chain/grpc/ChainGrpcPermissionsApi.js +21 -21
- package/dist/esm/client/chain/grpc/ChainGrpcTxFeesApi.d.ts +12 -0
- package/dist/esm/client/chain/grpc/ChainGrpcTxFeesApi.js +58 -0
- package/dist/esm/client/chain/grpc/index.d.ts +1 -0
- package/dist/esm/client/chain/grpc/index.js +1 -0
- package/dist/esm/client/chain/transformers/ChainGrpcTxFeesTransformer.d.ts +9 -0
- package/dist/esm/client/chain/transformers/ChainGrpcTxFeesTransformer.js +31 -0
- package/dist/esm/client/chain/transformers/index.d.ts +1 -0
- package/dist/esm/client/chain/transformers/index.js +1 -0
- package/dist/esm/client/chain/types/index.d.ts +2 -0
- package/dist/esm/client/chain/types/index.js +1 -0
- package/dist/esm/client/chain/types/txFees.d.ts +21 -0
- package/dist/esm/client/chain/types/txFees.js +1 -0
- package/dist/esm/client/indexer/rest/IndexerRestExplorerApi.d.ts +2 -0
- package/dist/esm/client/indexer/rest/IndexerRestExplorerApi.js +4 -2
- package/dist/esm/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js +9 -8
- package/dist/esm/client/indexer/types/derivatives.d.ts +1 -0
- package/package.json +7 -7
|
@@ -30,13 +30,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
30
30
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
31
31
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
32
32
|
context: 'Params',
|
|
33
|
-
contextModule: this.module
|
|
33
|
+
contextModule: this.module,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
37
37
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
38
38
|
context: 'Params',
|
|
39
|
-
contextModule: this.module
|
|
39
|
+
contextModule: this.module,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -50,14 +50,14 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
50
50
|
if (e instanceof core_proto_ts_1.InjectivePermissionsV1Beta1Query.GrpcWebError) {
|
|
51
51
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
52
52
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
53
|
-
context: '
|
|
54
|
-
contextModule: this.module
|
|
53
|
+
context: 'NamespaceDenoms',
|
|
54
|
+
contextModule: this.module,
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
58
58
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
59
59
|
context: 'NamespaceDenoms',
|
|
60
|
-
contextModule: this.module
|
|
60
|
+
contextModule: this.module,
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -72,13 +72,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
72
72
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
73
73
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
74
74
|
context: 'Namespaces',
|
|
75
|
-
contextModule: this.module
|
|
75
|
+
contextModule: this.module,
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
79
79
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
80
80
|
context: 'Namespaces',
|
|
81
|
-
contextModule: this.module
|
|
81
|
+
contextModule: this.module,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -94,13 +94,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
94
94
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
95
95
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
96
96
|
context: 'Namespace',
|
|
97
|
-
contextModule: this.module
|
|
97
|
+
contextModule: this.module,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
101
101
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
102
102
|
context: 'Namespace',
|
|
103
|
-
contextModule: this.module
|
|
103
|
+
contextModule: this.module,
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -117,13 +117,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
117
117
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
118
118
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
119
119
|
context: 'ActorsByRole',
|
|
120
|
-
contextModule: this.module
|
|
120
|
+
contextModule: this.module,
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
124
124
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
125
125
|
context: 'ActorsByRole',
|
|
126
|
-
contextModule: this.module
|
|
126
|
+
contextModule: this.module,
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -140,13 +140,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
140
140
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
141
141
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
142
142
|
context: 'RolesByActor',
|
|
143
|
-
contextModule: this.module
|
|
143
|
+
contextModule: this.module,
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
147
147
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
148
148
|
context: 'RolesByActor',
|
|
149
|
-
contextModule: this.module
|
|
149
|
+
contextModule: this.module,
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|
|
@@ -163,13 +163,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
163
163
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
164
164
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
165
165
|
context: 'RoleManager',
|
|
166
|
-
contextModule: this.module
|
|
166
|
+
contextModule: this.module,
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
170
170
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
171
171
|
context: 'RoleManager',
|
|
172
|
-
contextModule: this.module
|
|
172
|
+
contextModule: this.module,
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
}
|
|
@@ -184,13 +184,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
184
184
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
185
185
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
186
186
|
context: 'RoleManagers',
|
|
187
|
-
contextModule: this.module
|
|
187
|
+
contextModule: this.module,
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
191
191
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
192
192
|
context: 'RoleManagers',
|
|
193
|
-
contextModule: this.module
|
|
193
|
+
contextModule: this.module,
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -205,7 +205,7 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
205
205
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
206
206
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
207
207
|
context: 'PolicyStatuses',
|
|
208
|
-
contextModule: this.module
|
|
208
|
+
contextModule: this.module,
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
@@ -226,13 +226,13 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
226
226
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
227
227
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
228
228
|
context: 'PolicyManagerCapabilities',
|
|
229
|
-
contextModule: this.module
|
|
229
|
+
contextModule: this.module,
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
233
233
|
code: exceptions_1.UnspecifiedErrorCode,
|
|
234
234
|
context: 'PolicyManagerCapabilities',
|
|
235
|
-
contextModule: this.module
|
|
235
|
+
contextModule: this.module,
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -249,7 +249,7 @@ class ChainGrpcPermissionsApi extends BaseGrpcConsumer_js_1.default {
|
|
|
249
249
|
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
250
250
|
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
251
251
|
context: 'Voucher',
|
|
252
|
-
contextModule: this.module
|
|
252
|
+
contextModule: this.module,
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
2
|
+
import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
|
|
3
|
+
/**
|
|
4
|
+
* @category Chain Grpc API
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChainGrpcTxFeesApi extends BaseGrpcConsumer {
|
|
7
|
+
protected module: string;
|
|
8
|
+
protected client: InjectiveTxFeesV1Beta1Query.QueryClientImpl;
|
|
9
|
+
constructor(endpoint: string);
|
|
10
|
+
fetchModuleParams(): Promise<import("../types/txFees.js").TxFeesModuleStateParams>;
|
|
11
|
+
fetchEipBaseFee(): Promise<import("../types/txFees.js").TxFeesEipBaseFee>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ChainGrpcTxFeesApi = void 0;
|
|
7
|
+
const exceptions_1 = require("@injectivelabs/exceptions");
|
|
8
|
+
const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
|
|
9
|
+
const BaseGrpcConsumer_js_1 = __importDefault(require("../../base/BaseGrpcConsumer.js"));
|
|
10
|
+
const index_js_1 = require("../transformers/index.js");
|
|
11
|
+
const index_js_2 = require("../types/index.js");
|
|
12
|
+
/**
|
|
13
|
+
* @category Chain Grpc API
|
|
14
|
+
*/
|
|
15
|
+
class ChainGrpcTxFeesApi extends BaseGrpcConsumer_js_1.default {
|
|
16
|
+
module = index_js_2.ChainModule.TxFees;
|
|
17
|
+
client;
|
|
18
|
+
constructor(endpoint) {
|
|
19
|
+
super(endpoint);
|
|
20
|
+
this.client = new core_proto_ts_1.InjectiveTxFeesV1Beta1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
|
|
21
|
+
}
|
|
22
|
+
async fetchModuleParams() {
|
|
23
|
+
const request = core_proto_ts_1.InjectiveTxFeesV1Beta1Query.QueryParamsRequest.create();
|
|
24
|
+
try {
|
|
25
|
+
const response = await this.retry(() => this.client.Params(request, this.metadata));
|
|
26
|
+
return index_js_1.ChainGrpcTxFeesTransformer.moduleParamsResponseToModuleParams(response);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
if (e instanceof core_proto_ts_1.InjectiveTxFeesV1Beta1Query.GrpcWebError) {
|
|
30
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
31
|
+
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
32
|
+
context: 'Params',
|
|
33
|
+
contextModule: this.module,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
37
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
38
|
+
context: 'Params',
|
|
39
|
+
contextModule: this.module,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async fetchEipBaseFee() {
|
|
44
|
+
const request = core_proto_ts_1.InjectiveTxFeesV1Beta1Query.QueryEipBaseFeeRequest.create();
|
|
45
|
+
try {
|
|
46
|
+
const response = await this.retry(() => this.client.GetEipBaseFee(request, this.metadata));
|
|
47
|
+
return index_js_1.ChainGrpcTxFeesTransformer.eipBaseFeeResponseToEipBaseFee(response);
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
if (e instanceof core_proto_ts_1.InjectiveTxFeesV1Beta1Query.GrpcWebError) {
|
|
51
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
52
|
+
code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
|
|
53
|
+
context: 'EipBaseFee',
|
|
54
|
+
contextModule: this.module,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
58
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
59
|
+
context: 'EipBaseFee',
|
|
60
|
+
contextModule: this.module,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.ChainGrpcTxFeesApi = ChainGrpcTxFeesApi;
|
|
@@ -16,3 +16,4 @@ export { ChainGrpcTokenFactoryApi } from './ChainGrpcTokenFactoryApi.js';
|
|
|
16
16
|
export { ChainGrpcWasmApi } from './ChainGrpcWasmApi.js';
|
|
17
17
|
export { ChainGrpcWasmXApi } from './ChainGrpcWasmXApi.js';
|
|
18
18
|
export { ChainGrpcTendermintApi } from './ChainGrpcTendermintApi.js';
|
|
19
|
+
export { ChainGrpcTxFeesApi } from './ChainGrpcTxFeesApi.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChainGrpcTendermintApi = exports.ChainGrpcWasmXApi = exports.ChainGrpcWasmApi = exports.ChainGrpcTokenFactoryApi = exports.ChainGrpcStakingApi = exports.ChainGrpcPermissionsApi = exports.ChainGrpcPeggyApi = exports.ChainGrpcOracleApi = exports.ChainGrpcMintApi = exports.ChainGrpcInsuranceFundApi = exports.ChainGrpcIbcApi = exports.ChainGrpcGovApi = exports.ChainGrpcExchangeApi = exports.ChainGrpcDistributionApi = exports.ChainGrpcBankApi = exports.ChainGrpcAuthZApi = exports.ChainGrpcAuthApi = exports.ChainGrpcAuctionApi = void 0;
|
|
3
|
+
exports.ChainGrpcTxFeesApi = exports.ChainGrpcTendermintApi = exports.ChainGrpcWasmXApi = exports.ChainGrpcWasmApi = exports.ChainGrpcTokenFactoryApi = exports.ChainGrpcStakingApi = exports.ChainGrpcPermissionsApi = exports.ChainGrpcPeggyApi = exports.ChainGrpcOracleApi = exports.ChainGrpcMintApi = exports.ChainGrpcInsuranceFundApi = exports.ChainGrpcIbcApi = exports.ChainGrpcGovApi = exports.ChainGrpcExchangeApi = exports.ChainGrpcDistributionApi = exports.ChainGrpcBankApi = exports.ChainGrpcAuthZApi = exports.ChainGrpcAuthApi = exports.ChainGrpcAuctionApi = void 0;
|
|
4
4
|
var ChainGrpcAuctionApi_js_1 = require("./ChainGrpcAuctionApi.js");
|
|
5
5
|
Object.defineProperty(exports, "ChainGrpcAuctionApi", { enumerable: true, get: function () { return ChainGrpcAuctionApi_js_1.ChainGrpcAuctionApi; } });
|
|
6
6
|
var ChainGrpcAuthApi_js_1 = require("./ChainGrpcAuthApi.js");
|
|
@@ -37,3 +37,5 @@ var ChainGrpcWasmXApi_js_1 = require("./ChainGrpcWasmXApi.js");
|
|
|
37
37
|
Object.defineProperty(exports, "ChainGrpcWasmXApi", { enumerable: true, get: function () { return ChainGrpcWasmXApi_js_1.ChainGrpcWasmXApi; } });
|
|
38
38
|
var ChainGrpcTendermintApi_js_1 = require("./ChainGrpcTendermintApi.js");
|
|
39
39
|
Object.defineProperty(exports, "ChainGrpcTendermintApi", { enumerable: true, get: function () { return ChainGrpcTendermintApi_js_1.ChainGrpcTendermintApi; } });
|
|
40
|
+
var ChainGrpcTxFeesApi_js_1 = require("./ChainGrpcTxFeesApi.js");
|
|
41
|
+
Object.defineProperty(exports, "ChainGrpcTxFeesApi", { enumerable: true, get: function () { return ChainGrpcTxFeesApi_js_1.ChainGrpcTxFeesApi; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TxFeesEipBaseFee, TxFeesModuleStateParams } from '../types/txFees.js';
|
|
2
|
+
import { InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
/**
|
|
4
|
+
* @category Chain Grpc Transformer
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChainGrpcTxFeesTransformer {
|
|
7
|
+
static moduleParamsResponseToModuleParams(response: InjectiveTxFeesV1Beta1Query.QueryParamsResponse): TxFeesModuleStateParams;
|
|
8
|
+
static eipBaseFeeResponseToEipBaseFee(response: InjectiveTxFeesV1Beta1Query.QueryEipBaseFeeResponse): TxFeesEipBaseFee;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChainGrpcTxFeesTransformer = void 0;
|
|
4
|
+
const numbers_js_1 = require("./../../../utils/numbers.js");
|
|
5
|
+
/**
|
|
6
|
+
* @category Chain Grpc Transformer
|
|
7
|
+
*/
|
|
8
|
+
class ChainGrpcTxFeesTransformer {
|
|
9
|
+
static moduleParamsResponseToModuleParams(response) {
|
|
10
|
+
const params = response.params;
|
|
11
|
+
return {
|
|
12
|
+
maxGasWantedPerTx: params.maxGasWantedPerTx,
|
|
13
|
+
highGasTxThreshold: params.highGasTxThreshold,
|
|
14
|
+
minGasPriceForHighGasTx: params.minGasPriceForHighGasTx,
|
|
15
|
+
mempool1559Enabled: params.mempool1559Enabled,
|
|
16
|
+
minGasPrice: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.minGasPrice).toFixed(),
|
|
17
|
+
defaultBaseFeeMultiplier: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.defaultBaseFeeMultiplier).toFixed(),
|
|
18
|
+
maxBaseFeeMultiplier: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.maxBaseFeeMultiplier).toFixed(),
|
|
19
|
+
resetInterval: params.resetInterval,
|
|
20
|
+
maxBlockChangeRate: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.maxBlockChangeRate).toFixed(),
|
|
21
|
+
targetBlockSpacePercentRate: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.targetBlockSpacePercentRate).toFixed(),
|
|
22
|
+
recheckFeeLowBaseFee: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.recheckFeeLowBaseFee).toFixed(),
|
|
23
|
+
recheckFeeHighBaseFee: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.recheckFeeHighBaseFee).toFixed(),
|
|
24
|
+
recheckFeeBaseFeeThresholdMultiplier: (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(params.recheckFeeBaseFeeThresholdMultiplier).toFixed(),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static eipBaseFeeResponseToEipBaseFee(response) {
|
|
28
|
+
return {
|
|
29
|
+
baseFee: response.baseFee
|
|
30
|
+
? (0, numbers_js_1.denomAmountFromGrpcChainDenomAmount)(response.baseFee.baseFee).toFixed()
|
|
31
|
+
: undefined,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.ChainGrpcTxFeesTransformer = ChainGrpcTxFeesTransformer;
|
|
@@ -29,3 +29,4 @@ __exportStar(require("./ChainGrpcPermissionsTransformer.js"), exports);
|
|
|
29
29
|
__exportStar(require("./ChainGrpcStakingTransformer.js"), exports);
|
|
30
30
|
__exportStar(require("./ChainGrpcTokenFactoryTransformer.js"), exports);
|
|
31
31
|
__exportStar(require("./ChainGrpcWasmTransformer.js"), exports);
|
|
32
|
+
__exportStar(require("./ChainGrpcTxFeesTransformer.js"), exports);
|
|
@@ -6,6 +6,7 @@ export * from './mint.js';
|
|
|
6
6
|
export * from './wasm.js';
|
|
7
7
|
export * from './authZ.js';
|
|
8
8
|
export * from './peggy.js';
|
|
9
|
+
export * from './txFees.js';
|
|
9
10
|
export * from './oracle.js';
|
|
10
11
|
export * from './auction.js';
|
|
11
12
|
export * from './staking.js';
|
|
@@ -38,4 +39,5 @@ export declare const ChainModule: {
|
|
|
38
39
|
WasmX: ChainErrorModule.WasmX;
|
|
39
40
|
Tendermint: ChainErrorModule.Tendermint;
|
|
40
41
|
Permissions: ChainErrorModule.Permissions;
|
|
42
|
+
TxFees: ChainErrorModule.TxFees;
|
|
41
43
|
};
|
|
@@ -23,6 +23,7 @@ __exportStar(require("./mint.js"), exports);
|
|
|
23
23
|
__exportStar(require("./wasm.js"), exports);
|
|
24
24
|
__exportStar(require("./authZ.js"), exports);
|
|
25
25
|
__exportStar(require("./peggy.js"), exports);
|
|
26
|
+
__exportStar(require("./txFees.js"), exports);
|
|
26
27
|
__exportStar(require("./oracle.js"), exports);
|
|
27
28
|
__exportStar(require("./auction.js"), exports);
|
|
28
29
|
__exportStar(require("./staking.js"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InjectiveTxFeesV1Beta1Txfees, InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
2
|
+
export interface TxFeesModuleStateParams {
|
|
3
|
+
maxGasWantedPerTx: string;
|
|
4
|
+
highGasTxThreshold: string;
|
|
5
|
+
minGasPriceForHighGasTx: string;
|
|
6
|
+
mempool1559Enabled: boolean;
|
|
7
|
+
minGasPrice: string;
|
|
8
|
+
defaultBaseFeeMultiplier: string;
|
|
9
|
+
maxBaseFeeMultiplier: string;
|
|
10
|
+
resetInterval: string;
|
|
11
|
+
maxBlockChangeRate: string;
|
|
12
|
+
targetBlockSpacePercentRate: string;
|
|
13
|
+
recheckFeeLowBaseFee: string;
|
|
14
|
+
recheckFeeHighBaseFee: string;
|
|
15
|
+
recheckFeeBaseFeeThresholdMultiplier: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TxFeesEipBaseFee {
|
|
18
|
+
baseFee?: string;
|
|
19
|
+
}
|
|
20
|
+
export type GrpcTxFeesParams = InjectiveTxFeesV1Beta1Txfees.Params;
|
|
21
|
+
export type GrpcTxFeesEipBaseFee = InjectiveTxFeesV1Beta1Query.EipBaseFee;
|
|
@@ -242,16 +242,18 @@ class IndexerRestExplorerApi extends BaseRestConsumer_js_1.default {
|
|
|
242
242
|
async fetchContracts(params) {
|
|
243
243
|
const endpoint = `/wasm/contracts`;
|
|
244
244
|
try {
|
|
245
|
-
const {
|
|
245
|
+
const { skip, limit, label, token, codeId, lookup, assetsOnly, fromNumber, } = params || {
|
|
246
246
|
limit: 12,
|
|
247
247
|
};
|
|
248
248
|
const response = await this.retry(() => this.get(endpoint, {
|
|
249
249
|
skip,
|
|
250
250
|
limit,
|
|
251
251
|
label,
|
|
252
|
-
|
|
252
|
+
token,
|
|
253
|
+
lookup,
|
|
253
254
|
assets_only: assetsOnly,
|
|
254
255
|
from_number: fromNumber,
|
|
256
|
+
code_id: codeId?.toString(),
|
|
255
257
|
}));
|
|
256
258
|
const { paging, data } = response.data;
|
|
257
259
|
return {
|
|
@@ -356,18 +356,19 @@ class IndexerGrpcDerivativeTransformer {
|
|
|
356
356
|
? IndexerGrpcDerivativeTransformer.grpcPositionDeltaToPositionDelta(positionDelta)
|
|
357
357
|
: zeroPositionDelta();
|
|
358
358
|
return {
|
|
359
|
-
orderHash: trade.orderHash,
|
|
360
|
-
tradeId: trade.tradeId,
|
|
361
359
|
cid: trade.cid,
|
|
362
|
-
subaccountId: trade.subaccountId,
|
|
363
|
-
marketId: trade.marketId,
|
|
364
|
-
executedAt: parseInt(trade.executedAt, 10),
|
|
365
|
-
tradeExecutionType: trade.tradeExecutionType,
|
|
366
|
-
executionSide: trade.executionSide,
|
|
367
360
|
fee: trade.fee,
|
|
361
|
+
pnl: trade.pnl,
|
|
362
|
+
payout: trade.payout,
|
|
363
|
+
tradeId: trade.tradeId,
|
|
364
|
+
marketId: trade.marketId,
|
|
365
|
+
orderHash: trade.orderHash,
|
|
366
|
+
subaccountId: trade.subaccountId,
|
|
368
367
|
feeRecipient: trade.feeRecipient,
|
|
369
368
|
isLiquidation: trade.isLiquidation,
|
|
370
|
-
|
|
369
|
+
executedAt: parseInt(trade.executedAt, 10),
|
|
370
|
+
executionSide: trade.executionSide,
|
|
371
|
+
tradeExecutionType: trade.tradeExecutionType,
|
|
371
372
|
...mappedPositionDelta,
|
|
372
373
|
};
|
|
373
374
|
}
|
|
@@ -24,13 +24,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
24
24
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
25
25
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
26
26
|
context: 'Params',
|
|
27
|
-
contextModule: this.module
|
|
27
|
+
contextModule: this.module,
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
throw new GrpcUnaryRequestException(e, {
|
|
31
31
|
code: UnspecifiedErrorCode,
|
|
32
32
|
context: 'Params',
|
|
33
|
-
contextModule: this.module
|
|
33
|
+
contextModule: this.module,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -44,14 +44,14 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
44
44
|
if (e instanceof InjectivePermissionsV1Beta1Query.GrpcWebError) {
|
|
45
45
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
46
46
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
47
|
-
context: '
|
|
48
|
-
contextModule: this.module
|
|
47
|
+
context: 'NamespaceDenoms',
|
|
48
|
+
contextModule: this.module,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
throw new GrpcUnaryRequestException(e, {
|
|
52
52
|
code: UnspecifiedErrorCode,
|
|
53
53
|
context: 'NamespaceDenoms',
|
|
54
|
-
contextModule: this.module
|
|
54
|
+
contextModule: this.module,
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -66,13 +66,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
66
66
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
67
67
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
68
68
|
context: 'Namespaces',
|
|
69
|
-
contextModule: this.module
|
|
69
|
+
contextModule: this.module,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
throw new GrpcUnaryRequestException(e, {
|
|
73
73
|
code: UnspecifiedErrorCode,
|
|
74
74
|
context: 'Namespaces',
|
|
75
|
-
contextModule: this.module
|
|
75
|
+
contextModule: this.module,
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -88,13 +88,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
88
88
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
89
89
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
90
90
|
context: 'Namespace',
|
|
91
|
-
contextModule: this.module
|
|
91
|
+
contextModule: this.module,
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
throw new GrpcUnaryRequestException(e, {
|
|
95
95
|
code: UnspecifiedErrorCode,
|
|
96
96
|
context: 'Namespace',
|
|
97
|
-
contextModule: this.module
|
|
97
|
+
contextModule: this.module,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -111,13 +111,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
111
111
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
112
112
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
113
113
|
context: 'ActorsByRole',
|
|
114
|
-
contextModule: this.module
|
|
114
|
+
contextModule: this.module,
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
throw new GrpcUnaryRequestException(e, {
|
|
118
118
|
code: UnspecifiedErrorCode,
|
|
119
119
|
context: 'ActorsByRole',
|
|
120
|
-
contextModule: this.module
|
|
120
|
+
contextModule: this.module,
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -134,13 +134,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
134
134
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
135
135
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
136
136
|
context: 'RolesByActor',
|
|
137
|
-
contextModule: this.module
|
|
137
|
+
contextModule: this.module,
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
throw new GrpcUnaryRequestException(e, {
|
|
141
141
|
code: UnspecifiedErrorCode,
|
|
142
142
|
context: 'RolesByActor',
|
|
143
|
-
contextModule: this.module
|
|
143
|
+
contextModule: this.module,
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -157,13 +157,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
157
157
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
158
158
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
159
159
|
context: 'RoleManager',
|
|
160
|
-
contextModule: this.module
|
|
160
|
+
contextModule: this.module,
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
throw new GrpcUnaryRequestException(e, {
|
|
164
164
|
code: UnspecifiedErrorCode,
|
|
165
165
|
context: 'RoleManager',
|
|
166
|
-
contextModule: this.module
|
|
166
|
+
contextModule: this.module,
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -178,13 +178,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
178
178
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
179
179
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
180
180
|
context: 'RoleManagers',
|
|
181
|
-
contextModule: this.module
|
|
181
|
+
contextModule: this.module,
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
throw new GrpcUnaryRequestException(e, {
|
|
185
185
|
code: UnspecifiedErrorCode,
|
|
186
186
|
context: 'RoleManagers',
|
|
187
|
-
contextModule: this.module
|
|
187
|
+
contextModule: this.module,
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -199,7 +199,7 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
199
199
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
200
200
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
201
201
|
context: 'PolicyStatuses',
|
|
202
|
-
contextModule: this.module
|
|
202
|
+
contextModule: this.module,
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
throw new GrpcUnaryRequestException(e, {
|
|
@@ -220,13 +220,13 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
220
220
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
221
221
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
222
222
|
context: 'PolicyManagerCapabilities',
|
|
223
|
-
contextModule: this.module
|
|
223
|
+
contextModule: this.module,
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
throw new GrpcUnaryRequestException(e, {
|
|
227
227
|
code: UnspecifiedErrorCode,
|
|
228
228
|
context: 'PolicyManagerCapabilities',
|
|
229
|
-
contextModule: this.module
|
|
229
|
+
contextModule: this.module,
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -243,7 +243,7 @@ export class ChainGrpcPermissionsApi extends BaseGrpcConsumer {
|
|
|
243
243
|
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
244
244
|
code: grpcErrorCodeToErrorCode(e.code),
|
|
245
245
|
context: 'Voucher',
|
|
246
|
-
contextModule: this.module
|
|
246
|
+
contextModule: this.module,
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
throw new GrpcUnaryRequestException(e, {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
2
|
+
import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
|
|
3
|
+
/**
|
|
4
|
+
* @category Chain Grpc API
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChainGrpcTxFeesApi extends BaseGrpcConsumer {
|
|
7
|
+
protected module: string;
|
|
8
|
+
protected client: InjectiveTxFeesV1Beta1Query.QueryClientImpl;
|
|
9
|
+
constructor(endpoint: string);
|
|
10
|
+
fetchModuleParams(): Promise<import("../types/txFees.js").TxFeesModuleStateParams>;
|
|
11
|
+
fetchEipBaseFee(): Promise<import("../types/txFees.js").TxFeesEipBaseFee>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { UnspecifiedErrorCode, grpcErrorCodeToErrorCode, GrpcUnaryRequestException, } from '@injectivelabs/exceptions';
|
|
2
|
+
import { InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
|
|
4
|
+
import { ChainGrpcTxFeesTransformer } from '../transformers/index.js';
|
|
5
|
+
import { ChainModule } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* @category Chain Grpc API
|
|
8
|
+
*/
|
|
9
|
+
export class ChainGrpcTxFeesApi extends BaseGrpcConsumer {
|
|
10
|
+
module = ChainModule.TxFees;
|
|
11
|
+
client;
|
|
12
|
+
constructor(endpoint) {
|
|
13
|
+
super(endpoint);
|
|
14
|
+
this.client = new InjectiveTxFeesV1Beta1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
|
|
15
|
+
}
|
|
16
|
+
async fetchModuleParams() {
|
|
17
|
+
const request = InjectiveTxFeesV1Beta1Query.QueryParamsRequest.create();
|
|
18
|
+
try {
|
|
19
|
+
const response = await this.retry(() => this.client.Params(request, this.metadata));
|
|
20
|
+
return ChainGrpcTxFeesTransformer.moduleParamsResponseToModuleParams(response);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
if (e instanceof InjectiveTxFeesV1Beta1Query.GrpcWebError) {
|
|
24
|
+
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
25
|
+
code: grpcErrorCodeToErrorCode(e.code),
|
|
26
|
+
context: 'Params',
|
|
27
|
+
contextModule: this.module,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
throw new GrpcUnaryRequestException(e, {
|
|
31
|
+
code: UnspecifiedErrorCode,
|
|
32
|
+
context: 'Params',
|
|
33
|
+
contextModule: this.module,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async fetchEipBaseFee() {
|
|
38
|
+
const request = InjectiveTxFeesV1Beta1Query.QueryEipBaseFeeRequest.create();
|
|
39
|
+
try {
|
|
40
|
+
const response = await this.retry(() => this.client.GetEipBaseFee(request, this.metadata));
|
|
41
|
+
return ChainGrpcTxFeesTransformer.eipBaseFeeResponseToEipBaseFee(response);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
if (e instanceof InjectiveTxFeesV1Beta1Query.GrpcWebError) {
|
|
45
|
+
throw new GrpcUnaryRequestException(new Error(e.toString()), {
|
|
46
|
+
code: grpcErrorCodeToErrorCode(e.code),
|
|
47
|
+
context: 'EipBaseFee',
|
|
48
|
+
contextModule: this.module,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
throw new GrpcUnaryRequestException(e, {
|
|
52
|
+
code: UnspecifiedErrorCode,
|
|
53
|
+
context: 'EipBaseFee',
|
|
54
|
+
contextModule: this.module,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -16,3 +16,4 @@ export { ChainGrpcTokenFactoryApi } from './ChainGrpcTokenFactoryApi.js';
|
|
|
16
16
|
export { ChainGrpcWasmApi } from './ChainGrpcWasmApi.js';
|
|
17
17
|
export { ChainGrpcWasmXApi } from './ChainGrpcWasmXApi.js';
|
|
18
18
|
export { ChainGrpcTendermintApi } from './ChainGrpcTendermintApi.js';
|
|
19
|
+
export { ChainGrpcTxFeesApi } from './ChainGrpcTxFeesApi.js';
|
|
@@ -16,3 +16,4 @@ export { ChainGrpcTokenFactoryApi } from './ChainGrpcTokenFactoryApi.js';
|
|
|
16
16
|
export { ChainGrpcWasmApi } from './ChainGrpcWasmApi.js';
|
|
17
17
|
export { ChainGrpcWasmXApi } from './ChainGrpcWasmXApi.js';
|
|
18
18
|
export { ChainGrpcTendermintApi } from './ChainGrpcTendermintApi.js';
|
|
19
|
+
export { ChainGrpcTxFeesApi } from './ChainGrpcTxFeesApi.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TxFeesEipBaseFee, TxFeesModuleStateParams } from '../types/txFees.js';
|
|
2
|
+
import { InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
/**
|
|
4
|
+
* @category Chain Grpc Transformer
|
|
5
|
+
*/
|
|
6
|
+
export declare class ChainGrpcTxFeesTransformer {
|
|
7
|
+
static moduleParamsResponseToModuleParams(response: InjectiveTxFeesV1Beta1Query.QueryParamsResponse): TxFeesModuleStateParams;
|
|
8
|
+
static eipBaseFeeResponseToEipBaseFee(response: InjectiveTxFeesV1Beta1Query.QueryEipBaseFeeResponse): TxFeesEipBaseFee;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { denomAmountFromGrpcChainDenomAmount } from './../../../utils/numbers.js';
|
|
2
|
+
/**
|
|
3
|
+
* @category Chain Grpc Transformer
|
|
4
|
+
*/
|
|
5
|
+
export class ChainGrpcTxFeesTransformer {
|
|
6
|
+
static moduleParamsResponseToModuleParams(response) {
|
|
7
|
+
const params = response.params;
|
|
8
|
+
return {
|
|
9
|
+
maxGasWantedPerTx: params.maxGasWantedPerTx,
|
|
10
|
+
highGasTxThreshold: params.highGasTxThreshold,
|
|
11
|
+
minGasPriceForHighGasTx: params.minGasPriceForHighGasTx,
|
|
12
|
+
mempool1559Enabled: params.mempool1559Enabled,
|
|
13
|
+
minGasPrice: denomAmountFromGrpcChainDenomAmount(params.minGasPrice).toFixed(),
|
|
14
|
+
defaultBaseFeeMultiplier: denomAmountFromGrpcChainDenomAmount(params.defaultBaseFeeMultiplier).toFixed(),
|
|
15
|
+
maxBaseFeeMultiplier: denomAmountFromGrpcChainDenomAmount(params.maxBaseFeeMultiplier).toFixed(),
|
|
16
|
+
resetInterval: params.resetInterval,
|
|
17
|
+
maxBlockChangeRate: denomAmountFromGrpcChainDenomAmount(params.maxBlockChangeRate).toFixed(),
|
|
18
|
+
targetBlockSpacePercentRate: denomAmountFromGrpcChainDenomAmount(params.targetBlockSpacePercentRate).toFixed(),
|
|
19
|
+
recheckFeeLowBaseFee: denomAmountFromGrpcChainDenomAmount(params.recheckFeeLowBaseFee).toFixed(),
|
|
20
|
+
recheckFeeHighBaseFee: denomAmountFromGrpcChainDenomAmount(params.recheckFeeHighBaseFee).toFixed(),
|
|
21
|
+
recheckFeeBaseFeeThresholdMultiplier: denomAmountFromGrpcChainDenomAmount(params.recheckFeeBaseFeeThresholdMultiplier).toFixed(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static eipBaseFeeResponseToEipBaseFee(response) {
|
|
25
|
+
return {
|
|
26
|
+
baseFee: response.baseFee
|
|
27
|
+
? denomAmountFromGrpcChainDenomAmount(response.baseFee.baseFee).toFixed()
|
|
28
|
+
: undefined,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -6,6 +6,7 @@ export * from './mint.js';
|
|
|
6
6
|
export * from './wasm.js';
|
|
7
7
|
export * from './authZ.js';
|
|
8
8
|
export * from './peggy.js';
|
|
9
|
+
export * from './txFees.js';
|
|
9
10
|
export * from './oracle.js';
|
|
10
11
|
export * from './auction.js';
|
|
11
12
|
export * from './staking.js';
|
|
@@ -38,4 +39,5 @@ export declare const ChainModule: {
|
|
|
38
39
|
WasmX: ChainErrorModule.WasmX;
|
|
39
40
|
Tendermint: ChainErrorModule.Tendermint;
|
|
40
41
|
Permissions: ChainErrorModule.Permissions;
|
|
42
|
+
TxFees: ChainErrorModule.TxFees;
|
|
41
43
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InjectiveTxFeesV1Beta1Txfees, InjectiveTxFeesV1Beta1Query } from '@injectivelabs/core-proto-ts';
|
|
2
|
+
export interface TxFeesModuleStateParams {
|
|
3
|
+
maxGasWantedPerTx: string;
|
|
4
|
+
highGasTxThreshold: string;
|
|
5
|
+
minGasPriceForHighGasTx: string;
|
|
6
|
+
mempool1559Enabled: boolean;
|
|
7
|
+
minGasPrice: string;
|
|
8
|
+
defaultBaseFeeMultiplier: string;
|
|
9
|
+
maxBaseFeeMultiplier: string;
|
|
10
|
+
resetInterval: string;
|
|
11
|
+
maxBlockChangeRate: string;
|
|
12
|
+
targetBlockSpacePercentRate: string;
|
|
13
|
+
recheckFeeLowBaseFee: string;
|
|
14
|
+
recheckFeeHighBaseFee: string;
|
|
15
|
+
recheckFeeBaseFeeThresholdMultiplier: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TxFeesEipBaseFee {
|
|
18
|
+
baseFee?: string;
|
|
19
|
+
}
|
|
20
|
+
export type GrpcTxFeesParams = InjectiveTxFeesV1Beta1Txfees.Params;
|
|
21
|
+
export type GrpcTxFeesEipBaseFee = InjectiveTxFeesV1Beta1Query.EipBaseFee;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -236,16 +236,18 @@ export class IndexerRestExplorerApi extends BaseRestConsumer {
|
|
|
236
236
|
async fetchContracts(params) {
|
|
237
237
|
const endpoint = `/wasm/contracts`;
|
|
238
238
|
try {
|
|
239
|
-
const {
|
|
239
|
+
const { skip, limit, label, token, codeId, lookup, assetsOnly, fromNumber, } = params || {
|
|
240
240
|
limit: 12,
|
|
241
241
|
};
|
|
242
242
|
const response = await this.retry(() => this.get(endpoint, {
|
|
243
243
|
skip,
|
|
244
244
|
limit,
|
|
245
245
|
label,
|
|
246
|
-
|
|
246
|
+
token,
|
|
247
|
+
lookup,
|
|
247
248
|
assets_only: assetsOnly,
|
|
248
249
|
from_number: fromNumber,
|
|
250
|
+
code_id: codeId?.toString(),
|
|
249
251
|
}));
|
|
250
252
|
const { paging, data } = response.data;
|
|
251
253
|
return {
|
|
@@ -353,18 +353,19 @@ export class IndexerGrpcDerivativeTransformer {
|
|
|
353
353
|
? IndexerGrpcDerivativeTransformer.grpcPositionDeltaToPositionDelta(positionDelta)
|
|
354
354
|
: zeroPositionDelta();
|
|
355
355
|
return {
|
|
356
|
-
orderHash: trade.orderHash,
|
|
357
|
-
tradeId: trade.tradeId,
|
|
358
356
|
cid: trade.cid,
|
|
359
|
-
subaccountId: trade.subaccountId,
|
|
360
|
-
marketId: trade.marketId,
|
|
361
|
-
executedAt: parseInt(trade.executedAt, 10),
|
|
362
|
-
tradeExecutionType: trade.tradeExecutionType,
|
|
363
|
-
executionSide: trade.executionSide,
|
|
364
357
|
fee: trade.fee,
|
|
358
|
+
pnl: trade.pnl,
|
|
359
|
+
payout: trade.payout,
|
|
360
|
+
tradeId: trade.tradeId,
|
|
361
|
+
marketId: trade.marketId,
|
|
362
|
+
orderHash: trade.orderHash,
|
|
363
|
+
subaccountId: trade.subaccountId,
|
|
365
364
|
feeRecipient: trade.feeRecipient,
|
|
366
365
|
isLiquidation: trade.isLiquidation,
|
|
367
|
-
|
|
366
|
+
executedAt: parseInt(trade.executedAt, 10),
|
|
367
|
+
executionSide: trade.executionSide,
|
|
368
|
+
tradeExecutionType: trade.tradeExecutionType,
|
|
368
369
|
...mappedPositionDelta,
|
|
369
370
|
};
|
|
370
371
|
}
|
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.
|
|
4
|
+
"version": "1.15.36",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": {
|
|
@@ -122,17 +122,17 @@
|
|
|
122
122
|
"@cosmjs/proto-signing": "^0.33.0",
|
|
123
123
|
"@cosmjs/stargate": "^0.33.0",
|
|
124
124
|
"@injectivelabs/abacus-proto-ts": "1.14.0",
|
|
125
|
-
"@injectivelabs/core-proto-ts": "1.
|
|
126
|
-
"@injectivelabs/exceptions": "^1.15.
|
|
125
|
+
"@injectivelabs/core-proto-ts": "1.15.0",
|
|
126
|
+
"@injectivelabs/exceptions": "^1.15.33",
|
|
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.14",
|
|
131
131
|
"@injectivelabs/mito-proto-ts": "1.13.2",
|
|
132
|
-
"@injectivelabs/networks": "^1.15.
|
|
132
|
+
"@injectivelabs/networks": "^1.15.34",
|
|
133
133
|
"@injectivelabs/olp-proto-ts": "1.13.4",
|
|
134
|
-
"@injectivelabs/ts-types": "^1.15.
|
|
135
|
-
"@injectivelabs/utils": "^1.15.
|
|
134
|
+
"@injectivelabs/ts-types": "^1.15.34",
|
|
135
|
+
"@injectivelabs/utils": "^1.15.34",
|
|
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": "
|
|
154
|
+
"gitHead": "ac2df064aa01bc617fb79c547a085dae55c53703",
|
|
155
155
|
"typedoc": {
|
|
156
156
|
"entryPoint": "./src/index.ts",
|
|
157
157
|
"readmeFile": "./README.md",
|