@injectivelabs/sdk-ts 1.0.131 → 1.0.133
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/README.md +1 -2
- package/dist/client/exchange/transformers/ExchangeGrpcDerivativeTransformer.d.ts.map +1 -1
- package/dist/client/exchange/transformers/ExchangeGrpcDerivativeTransformer.js +1 -1
- package/dist/client/exchange/transformers/ExchangeGrpcDerivativeTransformer.js.map +1 -1
- package/dist/client/exchange/transformers/ExchangeGrpcSpotTransformer.d.ts.map +1 -1
- package/dist/client/exchange/transformers/ExchangeGrpcSpotTransformer.js +1 -1
- package/dist/client/exchange/transformers/ExchangeGrpcSpotTransformer.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcAccountApi.d.ts +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcAccountApi.js +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcAccountApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcSpotApi.d.ts.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcSpotApi.js +12 -14
- package/dist/client/indexer/grpc/IndexerGrpcSpotApi.js.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.d.ts.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js +3 -3
- package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.d.ts.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.js +2 -2
- package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.js.map +1 -1
- package/dist/client/indexer/types/derivatives.d.ts +3 -2
- package/dist/client/indexer/types/derivatives.d.ts.map +1 -1
- package/dist/client/indexer/types/derivatives.js.map +1 -1
- package/dist/client/indexer/types/spot.d.ts +3 -2
- package/dist/client/indexer/types/spot.d.ts.map +1 -1
- package/dist/client/indexer/types/spot.js.map +1 -1
- package/dist/core/{Eip712/tx.d.ts → eip712/eip712.d.ts} +2 -2
- package/dist/core/eip712/eip712.d.ts.map +1 -0
- package/dist/core/{Eip712/tx.js → eip712/eip712.js} +4 -4
- package/dist/core/eip712/eip712.js.map +1 -0
- package/dist/core/{Eip712 → eip712}/index.d.ts +1 -1
- package/dist/core/{Eip712 → eip712}/index.d.ts.map +1 -1
- package/dist/core/{Eip712 → eip712}/index.js +1 -1
- package/dist/core/eip712/index.js.map +1 -0
- package/dist/core/{Eip712 → eip712}/maps.d.ts +0 -0
- package/dist/core/{Eip712 → eip712}/maps.d.ts.map +1 -1
- package/dist/core/{Eip712 → eip712}/maps.js +0 -0
- package/dist/core/{Eip712 → eip712}/maps.js.map +1 -1
- package/dist/core/{Eip712 → eip712}/types.d.ts +0 -0
- package/dist/core/{Eip712 → eip712}/types.d.ts.map +1 -1
- package/dist/core/{Eip712 → eip712}/types.js +0 -0
- package/dist/core/{Eip712 → eip712}/types.js.map +1 -1
- package/dist/core/{Eip712 → eip712}/utils.d.ts +0 -0
- package/dist/core/{Eip712 → eip712}/utils.d.ts.map +1 -1
- package/dist/core/{Eip712 → eip712}/utils.js +0 -0
- package/dist/core/{Eip712 → eip712}/utils.js.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/modules/MsgBase.d.ts +1 -1
- package/dist/core/modules/MsgBase.js +3 -3
- package/dist/core/transaction/client/TxClient.d.ts +19 -0
- package/dist/core/transaction/client/TxClient.d.ts.map +1 -0
- package/dist/core/transaction/client/TxClient.js +30 -0
- package/dist/core/transaction/client/TxClient.js.map +1 -0
- package/dist/core/transaction/client/TxGrpcClient.d.ts +32 -0
- package/dist/core/transaction/client/TxGrpcClient.d.ts.map +1 -0
- package/dist/core/transaction/client/TxGrpcClient.js +159 -0
- package/dist/core/transaction/client/TxGrpcClient.js.map +1 -0
- package/dist/core/transaction/client/TxRestClient.d.ts +46 -0
- package/dist/core/transaction/client/TxRestClient.d.ts.map +1 -0
- package/dist/core/transaction/client/TxRestClient.js +225 -0
- package/dist/core/transaction/client/TxRestClient.js.map +1 -0
- package/dist/core/transaction/client/index.d.ts +4 -0
- package/dist/core/transaction/client/index.d.ts.map +1 -0
- package/dist/core/transaction/client/index.js +20 -0
- package/dist/core/transaction/client/index.js.map +1 -0
- package/dist/core/transaction/index.d.ts +4 -0
- package/dist/core/transaction/index.d.ts.map +1 -0
- package/dist/core/transaction/index.js +20 -0
- package/dist/core/transaction/index.js.map +1 -0
- package/dist/core/transaction/tx.d.ts +100 -0
- package/dist/core/transaction/tx.d.ts.map +1 -0
- package/dist/core/transaction/tx.js +184 -0
- package/dist/core/transaction/tx.js.map +1 -0
- package/dist/core/transaction/types/block.d.ts +59 -0
- package/dist/core/transaction/types/block.d.ts.map +1 -0
- package/dist/core/transaction/types/block.js +3 -0
- package/dist/core/transaction/types/block.js.map +1 -0
- package/dist/core/transaction/types/rest-client.d.ts +20 -0
- package/dist/core/transaction/types/rest-client.d.ts.map +1 -0
- package/dist/core/transaction/types/rest-client.js +3 -0
- package/dist/core/transaction/types/rest-client.js.map +1 -0
- package/dist/core/transaction/types/tx-rest-client.d.ts +169 -0
- package/dist/core/transaction/types/tx-rest-client.d.ts.map +1 -0
- package/dist/core/transaction/types/tx-rest-client.js +10 -0
- package/dist/core/transaction/types/tx-rest-client.js.map +1 -0
- package/dist/core/transaction/utils/crypto.d.ts +4 -0
- package/dist/core/transaction/utils/crypto.d.ts.map +1 -0
- package/dist/core/transaction/utils/crypto.js +20 -0
- package/dist/core/transaction/utils/crypto.js.map +1 -0
- package/dist/core/transaction/utils/index.d.ts +9 -0
- package/dist/core/transaction/utils/index.d.ts.map +1 -0
- package/dist/core/transaction/utils/index.js +19 -0
- package/dist/core/transaction/utils/index.js.map +1 -0
- package/package.json +11 -8
- package/dist/core/Eip712/index.js.map +0 -1
- package/dist/core/Eip712/tx.d.ts.map +0 -1
- package/dist/core/Eip712/tx.js.map +0 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TxRestClient = exports.isTxError = void 0;
|
|
13
|
+
const utils_1 = require("@injectivelabs/utils");
|
|
14
|
+
const tx_rest_client_1 = require("../types/tx-rest-client");
|
|
15
|
+
const TxClient_1 = require("./TxClient");
|
|
16
|
+
const crypto_1 = require("../utils/crypto");
|
|
17
|
+
function isTxError(x) {
|
|
18
|
+
return (x.code !== undefined &&
|
|
19
|
+
x.code !== 0 &&
|
|
20
|
+
x.code !== '0');
|
|
21
|
+
}
|
|
22
|
+
exports.isTxError = isTxError;
|
|
23
|
+
class TxRestClient {
|
|
24
|
+
constructor(endpoint) {
|
|
25
|
+
this.httpClient = new utils_1.HttpClient(endpoint, {
|
|
26
|
+
headers: {
|
|
27
|
+
Accept: 'application/json',
|
|
28
|
+
},
|
|
29
|
+
timeout: 3000,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
txInfo(txHash, params = {}) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
try {
|
|
35
|
+
const response = yield this.getRaw(`/cosmos/tx/v1beta1/txs/${txHash}`, params);
|
|
36
|
+
return Object.assign(Object.assign({}, response), { txResponse: Object.assign(Object.assign({}, response.tx_response), { rawLog: response.tx_response.raw_log, gasWanted: response.tx_response.gas_wanted, gasUsed: response.tx_response.gas_used }) });
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
throw new Error(e);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
txInfosByHeight(height) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const endpoint = height !== undefined
|
|
46
|
+
? `/cosmos/base/tendermint/v1beta1/blocks/${height}`
|
|
47
|
+
: `/cosmos/base/tendermint/v1beta1/blocks/latest`;
|
|
48
|
+
const blockInfo = yield this.getRaw(endpoint);
|
|
49
|
+
const { txs } = blockInfo.block.data;
|
|
50
|
+
if (!txs) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
const txHashes = txs.map((txData) => (0, crypto_1.hashToHex)(txData));
|
|
54
|
+
const txInfos = [];
|
|
55
|
+
for (const txhash of txHashes) {
|
|
56
|
+
const txInfo = yield this.txInfo(txhash);
|
|
57
|
+
txInfos.push(txInfo.txResponse);
|
|
58
|
+
}
|
|
59
|
+
return txInfos;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
waitTxBroadcast(txHash, timeout = 30000) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const POLL_INTERVAL = 1000;
|
|
65
|
+
for (let i = 0; i <= timeout / POLL_INTERVAL; i += 1) {
|
|
66
|
+
try {
|
|
67
|
+
const txInfo = yield this.txInfo(txHash);
|
|
68
|
+
const { txResponse: txInfoSearchResponse } = txInfo;
|
|
69
|
+
if (txInfoSearchResponse) {
|
|
70
|
+
return {
|
|
71
|
+
txhash: txInfoSearchResponse.txhash,
|
|
72
|
+
rawLog: txInfoSearchResponse.rawLog,
|
|
73
|
+
gasWanted: parseInt(txInfoSearchResponse.gasWanted, 10),
|
|
74
|
+
gasUsed: parseInt(txInfoSearchResponse.gasUsed, 10),
|
|
75
|
+
height: parseInt(txInfoSearchResponse.height, 10),
|
|
76
|
+
logs: txInfoSearchResponse.logs,
|
|
77
|
+
code: txInfoSearchResponse.code,
|
|
78
|
+
codespace: txInfoSearchResponse.codespace,
|
|
79
|
+
timestamp: txInfoSearchResponse.timestamp,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (!error.toString().includes('404')) {
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
yield new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));
|
|
89
|
+
}
|
|
90
|
+
throw new Error(`Transaction was not included in a block before timeout of ${timeout}ms`);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
simulate(txRaw) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
try {
|
|
96
|
+
const response = yield this.postRaw('/cosmos/tx/v1beta1/simulate', {
|
|
97
|
+
tx_bytes: TxClient_1.TxClient.encode(txRaw),
|
|
98
|
+
});
|
|
99
|
+
return Object.assign(Object.assign({}, response), { gasInfo: {
|
|
100
|
+
gasUsed: response.gas_info.gas_used,
|
|
101
|
+
gasWanted: response.gas_info.gas_wanted,
|
|
102
|
+
} });
|
|
103
|
+
}
|
|
104
|
+
catch (e) {
|
|
105
|
+
throw new Error(e.response ? e.response.data.message : e);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
broadcastTx(txRaw, mode = tx_rest_client_1.BroadcastMode.Sync) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
try {
|
|
112
|
+
const response = yield this.postRaw('cosmos/tx/v1beta1/txs', {
|
|
113
|
+
tx_bytes: TxClient_1.TxClient.encode(txRaw),
|
|
114
|
+
mode,
|
|
115
|
+
});
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
throw new Error(e.response ? e.response.data.message : e);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
broadcast(tx, timeout = 30000) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const { tx_response: txResponse } = yield this.broadcastTx(tx, tx_rest_client_1.BroadcastMode.Sync);
|
|
126
|
+
if (txResponse.code !== 0) {
|
|
127
|
+
const result = {
|
|
128
|
+
height: txResponse.height,
|
|
129
|
+
txhash: txResponse.txhash,
|
|
130
|
+
rawLog: txResponse.rawLog,
|
|
131
|
+
code: txResponse.code,
|
|
132
|
+
codespace: txResponse.codespace,
|
|
133
|
+
gasUsed: 0,
|
|
134
|
+
gasWanted: 0,
|
|
135
|
+
timestamp: '',
|
|
136
|
+
logs: [],
|
|
137
|
+
};
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
return this.waitTxBroadcast(txResponse.txhash, timeout);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Broadcast the transaction using the "block" mode, waiting for its inclusion in the blockchain.
|
|
145
|
+
* @param tx transaction to broadcast
|
|
146
|
+
*/
|
|
147
|
+
broadcastBlock(tx) {
|
|
148
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
const response = yield this.broadcastTx(tx, tx_rest_client_1.BroadcastMode.Block);
|
|
150
|
+
const { tx_response: txResponse } = response;
|
|
151
|
+
return {
|
|
152
|
+
txhash: txResponse.txhash,
|
|
153
|
+
rawLog: txResponse.rawLog,
|
|
154
|
+
gasWanted: txResponse.gasWanted,
|
|
155
|
+
gasUsed: txResponse.gasUsed,
|
|
156
|
+
height: txResponse.height,
|
|
157
|
+
logs: txResponse.logs,
|
|
158
|
+
code: txResponse.code,
|
|
159
|
+
codespace: txResponse.codespace,
|
|
160
|
+
data: txResponse.data,
|
|
161
|
+
info: txResponse.info,
|
|
162
|
+
timestamp: txResponse.timestamp,
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* NOTE: This is not a synchronous function and is unconventionally named. This function
|
|
168
|
+
* can be await as it returns a `Promise`.
|
|
169
|
+
*
|
|
170
|
+
* Broadcast the transaction using the "sync" mode, returning after CheckTx() is performed.
|
|
171
|
+
* @param tx transaction to broadcast
|
|
172
|
+
*/
|
|
173
|
+
broadcastSync(tx) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const response = yield this.broadcastTx(tx, tx_rest_client_1.BroadcastMode.Sync);
|
|
176
|
+
const { tx_response: txResponse } = response;
|
|
177
|
+
const blockResult = {
|
|
178
|
+
height: txResponse.height,
|
|
179
|
+
txhash: txResponse.txhash,
|
|
180
|
+
rawLog: txResponse.rawLog,
|
|
181
|
+
};
|
|
182
|
+
if (txResponse.code) {
|
|
183
|
+
blockResult.code = txResponse.code;
|
|
184
|
+
}
|
|
185
|
+
if (txResponse.codespace) {
|
|
186
|
+
blockResult.codespace = txResponse.codespace;
|
|
187
|
+
}
|
|
188
|
+
return blockResult;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Search for transactions based on event attributes.
|
|
193
|
+
* @param options
|
|
194
|
+
*/
|
|
195
|
+
search(options) {
|
|
196
|
+
var _a;
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
const params = new URLSearchParams();
|
|
199
|
+
// build search params
|
|
200
|
+
(_a = options.events) === null || _a === void 0 ? void 0 : _a.forEach((v) => params.append('events', v.key === 'tx.height' ? `${v.key}=${v.value}` : `${v.key}='${v.value}'`));
|
|
201
|
+
delete options.events;
|
|
202
|
+
Object.entries(options).forEach((v) => {
|
|
203
|
+
params.append(v[0], v[1]);
|
|
204
|
+
});
|
|
205
|
+
const response = yield this.getRaw(`cosmos/tx/v1beta1/txs`, params);
|
|
206
|
+
return response;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
postRaw(endpoint, params = {}) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
return this.httpClient
|
|
212
|
+
.post(endpoint, params)
|
|
213
|
+
.then((d) => d.data);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
getRaw(endpoint, params = {}) {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
return this.httpClient
|
|
219
|
+
.get(endpoint, params)
|
|
220
|
+
.then((d) => d.data);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
exports.TxRestClient = TxRestClient;
|
|
225
|
+
//# sourceMappingURL=TxRestClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TxRestClient.js","sourceRoot":"","sources":["../../../../src/core/transaction/client/TxRestClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,gDAAiD;AACjD,4DAiBgC;AAGhC,yCAAqC;AACrC,4CAA2C;AAE3C,SAAgB,SAAS,CAIvB,CAAI;IACJ,OAAO,CACJ,CAAiB,CAAC,IAAI,KAAK,SAAS;QACpC,CAAiB,CAAC,IAAI,KAAK,CAAC;QAC5B,CAAiB,CAAC,IAAI,KAAK,GAAG,CAChC,CAAA;AACH,CAAC;AAVD,8BAUC;AAED,MAAa,YAAY;IAGvB,YAAY,QAAgB;QAC1B,IAAI,CAAC,UAAU,GAAG,IAAI,kBAAU,CAAC,QAAQ,EAAE;YACzC,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;YACD,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;IACJ,CAAC;IAEY,MAAM,CACjB,MAAc,EACd,SAAoB,EAAE;;YAEtB,IAAI;gBACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAChC,0BAA0B,MAAM,EAAE,EAClC,MAAM,CACP,CAAA;gBAED,uCACK,QAAQ,KACX,UAAU,kCACL,QAAQ,CAAC,WAAW,KACvB,MAAM,EAAE,QAAQ,CAAC,WAAW,CAA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AAE,MAAM,CAAC;iBAC/D,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;KAAA;CACF;AAzQD,oCAyQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/transaction/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TxGrpcClient"), exports);
|
|
18
|
+
__exportStar(require("./TxRestClient"), exports);
|
|
19
|
+
__exportStar(require("./TxClient"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/transaction/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,iDAA8B;AAC9B,6CAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/transaction/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAA;AACpB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./tx"), exports);
|
|
18
|
+
__exportStar(require("./utils"), exports);
|
|
19
|
+
__exportStar(require("./client"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/transaction/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAoB;AACpB,0CAAuB;AACvB,2CAAwB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { StdFee } from '@cosmjs/amino';
|
|
2
|
+
import { TxBody, SignDoc, SignerInfo, AuthInfo, Fee, TxRaw } from '@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb';
|
|
3
|
+
import { SignModeMap } from '@injectivelabs/chain-api/cosmos/tx/signing/v1beta1/signing_pb';
|
|
4
|
+
import { ExtensionOptionsWeb3Tx } from '@injectivelabs/chain-api/injective/types/v1beta1/tx_ext_pb';
|
|
5
|
+
import { DirectSignResponse } from '@cosmjs/proto-signing';
|
|
6
|
+
import { EthereumChainId } from '@injectivelabs/ts-types';
|
|
7
|
+
import { Msgs } from '../modules';
|
|
8
|
+
export declare type MsgArg = {
|
|
9
|
+
type: string;
|
|
10
|
+
message: any;
|
|
11
|
+
};
|
|
12
|
+
/** @type {CreateTransactionArgs} */
|
|
13
|
+
export interface CreateTransactionArgs {
|
|
14
|
+
message: MsgArg | MsgArg[];
|
|
15
|
+
memo: string;
|
|
16
|
+
fee?: StdFee;
|
|
17
|
+
pubKey: string;
|
|
18
|
+
sequence: number;
|
|
19
|
+
accountNumber: number;
|
|
20
|
+
chainId: string;
|
|
21
|
+
signMode?: SignModeMap[keyof SignModeMap];
|
|
22
|
+
timeoutHeight?: number;
|
|
23
|
+
}
|
|
24
|
+
/** @type {CreateTransactionResult} */
|
|
25
|
+
export interface CreateTransactionResult {
|
|
26
|
+
txRaw: TxRaw;
|
|
27
|
+
signDoc: SignDoc;
|
|
28
|
+
accountNumber: number;
|
|
29
|
+
bodyBytes: Uint8Array;
|
|
30
|
+
authInfoBytes: Uint8Array;
|
|
31
|
+
signBytes: Uint8Array;
|
|
32
|
+
signHashedBytes: Uint8Array;
|
|
33
|
+
}
|
|
34
|
+
export declare const SIGN_DIRECT: 1;
|
|
35
|
+
export declare const SIGN_AMINO: 127;
|
|
36
|
+
export declare const getPublicKey: ({ chainId, key, }: {
|
|
37
|
+
chainId: string;
|
|
38
|
+
key: string;
|
|
39
|
+
}) => import("google-protobuf/google/protobuf/any_pb").Any;
|
|
40
|
+
export declare const createBody: ({ message, memo, timeoutHeight, }: {
|
|
41
|
+
message: MsgArg | MsgArg[];
|
|
42
|
+
memo: string;
|
|
43
|
+
timeoutHeight?: number | undefined;
|
|
44
|
+
}) => TxBody;
|
|
45
|
+
export declare const createFee: ({ fee, gasLimit, }: {
|
|
46
|
+
fee: {
|
|
47
|
+
amount: string;
|
|
48
|
+
denom: string;
|
|
49
|
+
};
|
|
50
|
+
gasLimit: number;
|
|
51
|
+
}) => Fee;
|
|
52
|
+
export declare const createSignerInfo: ({ chainId, publicKey, sequence, mode, }: {
|
|
53
|
+
chainId: string;
|
|
54
|
+
publicKey: string;
|
|
55
|
+
sequence: number;
|
|
56
|
+
mode: SignModeMap[keyof SignModeMap];
|
|
57
|
+
}) => SignerInfo;
|
|
58
|
+
export declare const createAuthInfo: ({ signerInfo, fee, }: {
|
|
59
|
+
signerInfo: SignerInfo;
|
|
60
|
+
fee: Fee;
|
|
61
|
+
}) => AuthInfo;
|
|
62
|
+
export declare const createSigDoc: ({ bodyBytes, authInfoBytes, chainId, accountNumber, }: {
|
|
63
|
+
bodyBytes: Uint8Array;
|
|
64
|
+
authInfoBytes: Uint8Array;
|
|
65
|
+
chainId: string;
|
|
66
|
+
accountNumber: number;
|
|
67
|
+
}) => SignDoc;
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {Object} CreateTransactionArgs
|
|
70
|
+
* @param {CreateTransactionArgs} params
|
|
71
|
+
* @property {MsgArg | MsgArg[]} message - the Cosmos messages to wrap them in a transaction
|
|
72
|
+
* @property {string} memo - the memo to attach to the transaction
|
|
73
|
+
* @property {StdFee} fee - the fee to attach to the transaction
|
|
74
|
+
* @property {string} sequence - the account sequence to attach to the transaction
|
|
75
|
+
* @property {number} number - the account number to attach to the transaction
|
|
76
|
+
* @property {number} chainId - the chain-id to attach to the transaction
|
|
77
|
+
* @property {string} pubKey - the account pubKey to attach to the transaction (in base64)
|
|
78
|
+
*
|
|
79
|
+
* @typedef {Object} CreateTransactionResult
|
|
80
|
+
* @property {TxRaw} txRaw // the Tx raw that was created
|
|
81
|
+
* @property {SignDoc} signDoc // the SignDoc that was created - used for signing of the transaction
|
|
82
|
+
* @property {number} accountNumber // the account number of the signer of the transaction
|
|
83
|
+
* @property {Uint8Array} bodyBytes // the body bytes of the transaction
|
|
84
|
+
* @property {Uint8Array} authInfoBytes // the auth info bytes of the transaction
|
|
85
|
+
* @property {Uint8Array} signBytes // the sign bytes of the transaction (SignDoc serialized to binary)
|
|
86
|
+
* @property {Uint8Array} signHashedBytes // the sign bytes of the transaction (SignDoc serialized to binary) and hashed using keccak256
|
|
87
|
+
* @returns {CreateTransactionResult} result
|
|
88
|
+
*/
|
|
89
|
+
export declare const createTransaction: ({ memo, pubKey, chainId, message, sequence, fee, signMode, accountNumber, timeoutHeight, }: CreateTransactionArgs) => CreateTransactionResult;
|
|
90
|
+
export declare const createTransactionFromMsg: (params: Omit<CreateTransactionArgs, 'message'> & {
|
|
91
|
+
message: Msgs | Msgs[];
|
|
92
|
+
}) => CreateTransactionResult;
|
|
93
|
+
export declare const createTxRawFromSigResponse: (signatureResponse: DirectSignResponse) => TxRaw;
|
|
94
|
+
export declare const createTxRawEIP712: (txRaw: TxRaw, extension: ExtensionOptionsWeb3Tx) => TxRaw;
|
|
95
|
+
export declare const createWeb3Extension: ({ ethereumChainId, feePayer, feePayerSig, }: {
|
|
96
|
+
ethereumChainId: EthereumChainId;
|
|
97
|
+
feePayer?: string | undefined;
|
|
98
|
+
feePayerSig?: Uint8Array | undefined;
|
|
99
|
+
}) => ExtensionOptionsWeb3Tx;
|
|
100
|
+
//# sourceMappingURL=tx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../src/core/transaction/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EAER,GAAG,EACH,KAAK,EACN,MAAM,kDAAkD,CAAA;AACzD,OAAO,EAEL,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AE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;cAC5B,MAAM;SAWjB,CAAA;AAED,eAAO,MAAM,gBAAgB;aAMlB,MAAM;eACJ,MAAM;cACP,MAAM;UACV,WAAW,CAAC,MAAM,WAAW,CAAC;gBAgBrC,CAAA;AAED,eAAO,MAAM,cAAc;gBAIb,UAAU;SACjB,GAAG;cAOT,CAAA;AAED,eAAO,MAAM,YAAY;eAMZ,UAAU;mBACN,UAAU;aAChB,MAAM;mBACA,MAAM;aAStB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,+FAU3B,qBAAqB,KAAG,uBA0C1B,CAAA;AAED,eAAO,MAAM,wBAAwB,WAC3B,KAAK,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,EAAE,IAAI,GAAG,IAAI,EAAE,CAAA;CAAE,4BAU5E,CAAA;AAED,eAAO,MAAM,0BAA0B,sBAClB,kBAAkB,UAQtC,CAAA;AAED,eAAO,MAAM,iBAAiB,UACrB,KAAK,aACD,sBAAsB,UAYlC,CAAA;AAED,eAAO,MAAM,mBAAmB;qBAKb,eAAe;;;4BAgBjC,CAAA"}
|
|
@@ -0,0 +1,184 @@
|
|
|
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.createWeb3Extension = exports.createTxRawEIP712 = exports.createTxRawFromSigResponse = exports.createTransactionFromMsg = exports.createTransaction = exports.createSigDoc = exports.createAuthInfo = exports.createSignerInfo = exports.createFee = exports.createBody = exports.getPublicKey = exports.SIGN_AMINO = exports.SIGN_DIRECT = void 0;
|
|
7
|
+
const keccak256_1 = __importDefault(require("keccak256"));
|
|
8
|
+
const tx_pb_1 = require("@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb");
|
|
9
|
+
const signing_pb_1 = require("@injectivelabs/chain-api/cosmos/tx/signing/v1beta1/signing_pb");
|
|
10
|
+
const coin_pb_1 = require("@injectivelabs/chain-api/cosmos/base/v1beta1/coin_pb");
|
|
11
|
+
const keys_pb_1 = require("@injectivelabs/chain-api/cosmos/crypto/secp256k1/keys_pb");
|
|
12
|
+
const keys_pb_2 = require("@injectivelabs/chain-api/injective/crypto/v1beta1/ethsecp256k1/keys_pb");
|
|
13
|
+
const tx_ext_pb_1 = require("@injectivelabs/chain-api/injective/types/v1beta1/tx_ext_pb");
|
|
14
|
+
const utils_1 = require("@injectivelabs/utils");
|
|
15
|
+
const utils_2 = require("./utils");
|
|
16
|
+
exports.SIGN_DIRECT = signing_pb_1.SignMode.SIGN_MODE_DIRECT;
|
|
17
|
+
exports.SIGN_AMINO = signing_pb_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
|
|
18
|
+
const getPublicKey = ({ chainId, key, }) => {
|
|
19
|
+
let proto;
|
|
20
|
+
let path;
|
|
21
|
+
if (chainId.startsWith('injective')) {
|
|
22
|
+
proto = new keys_pb_2.PubKey();
|
|
23
|
+
path = '/injective.crypto.v1beta1.ethsecp256k1.PubKey';
|
|
24
|
+
}
|
|
25
|
+
else if (chainId.startsWith('evmos')) {
|
|
26
|
+
proto = new keys_pb_2.PubKey();
|
|
27
|
+
path = '/ethermint.crypto.v1.ethsecp256k1.PubKey';
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
proto = new keys_pb_1.PubKey();
|
|
31
|
+
path = '/cosmos.crypto.secp256k1.PubKey';
|
|
32
|
+
}
|
|
33
|
+
proto.setKey(Buffer.from(key, 'base64'));
|
|
34
|
+
return (0, utils_2.createAny)(proto.serializeBinary(), path);
|
|
35
|
+
};
|
|
36
|
+
exports.getPublicKey = getPublicKey;
|
|
37
|
+
const createBody = ({ message, memo, timeoutHeight, }) => {
|
|
38
|
+
const messages = Array.isArray(message) ? message : [message];
|
|
39
|
+
const txBody = new tx_pb_1.TxBody();
|
|
40
|
+
txBody.setMessagesList(messages.map((message) => (0, utils_2.createAnyMessage)({
|
|
41
|
+
value: message.message,
|
|
42
|
+
type: message.type,
|
|
43
|
+
})));
|
|
44
|
+
txBody.setMemo(memo);
|
|
45
|
+
if (timeoutHeight) {
|
|
46
|
+
txBody.setTimeoutHeight(timeoutHeight);
|
|
47
|
+
}
|
|
48
|
+
return txBody;
|
|
49
|
+
};
|
|
50
|
+
exports.createBody = createBody;
|
|
51
|
+
const createFee = ({ fee, gasLimit, }) => {
|
|
52
|
+
const feeAmount = new coin_pb_1.Coin();
|
|
53
|
+
feeAmount.setAmount(fee.amount);
|
|
54
|
+
feeAmount.setDenom(fee.denom);
|
|
55
|
+
const feeProto = new tx_pb_1.Fee();
|
|
56
|
+
feeProto.setGasLimit(gasLimit);
|
|
57
|
+
feeProto.setAmountList([feeAmount]);
|
|
58
|
+
return feeProto;
|
|
59
|
+
};
|
|
60
|
+
exports.createFee = createFee;
|
|
61
|
+
const createSignerInfo = ({ chainId, publicKey, sequence, mode, }) => {
|
|
62
|
+
const pubKey = (0, exports.getPublicKey)({ chainId, key: publicKey });
|
|
63
|
+
const single = new tx_pb_1.ModeInfo.Single();
|
|
64
|
+
single.setMode(mode);
|
|
65
|
+
const modeInfo = new tx_pb_1.ModeInfo();
|
|
66
|
+
modeInfo.setSingle(single);
|
|
67
|
+
const signerInfo = new tx_pb_1.SignerInfo();
|
|
68
|
+
signerInfo.setPublicKey(pubKey);
|
|
69
|
+
signerInfo.setSequence(sequence);
|
|
70
|
+
signerInfo.setModeInfo(modeInfo);
|
|
71
|
+
return signerInfo;
|
|
72
|
+
};
|
|
73
|
+
exports.createSignerInfo = createSignerInfo;
|
|
74
|
+
const createAuthInfo = ({ signerInfo, fee, }) => {
|
|
75
|
+
const authInfo = new tx_pb_1.AuthInfo();
|
|
76
|
+
authInfo.setSignerInfosList([signerInfo]);
|
|
77
|
+
authInfo.setFee(fee);
|
|
78
|
+
return authInfo;
|
|
79
|
+
};
|
|
80
|
+
exports.createAuthInfo = createAuthInfo;
|
|
81
|
+
const createSigDoc = ({ bodyBytes, authInfoBytes, chainId, accountNumber, }) => {
|
|
82
|
+
const signDoc = new tx_pb_1.SignDoc();
|
|
83
|
+
signDoc.setAccountNumber(accountNumber);
|
|
84
|
+
signDoc.setChainId(chainId);
|
|
85
|
+
signDoc.setBodyBytes(bodyBytes);
|
|
86
|
+
signDoc.setAuthInfoBytes(authInfoBytes);
|
|
87
|
+
return signDoc;
|
|
88
|
+
};
|
|
89
|
+
exports.createSigDoc = createSigDoc;
|
|
90
|
+
/**
|
|
91
|
+
* @typedef {Object} CreateTransactionArgs
|
|
92
|
+
* @param {CreateTransactionArgs} params
|
|
93
|
+
* @property {MsgArg | MsgArg[]} message - the Cosmos messages to wrap them in a transaction
|
|
94
|
+
* @property {string} memo - the memo to attach to the transaction
|
|
95
|
+
* @property {StdFee} fee - the fee to attach to the transaction
|
|
96
|
+
* @property {string} sequence - the account sequence to attach to the transaction
|
|
97
|
+
* @property {number} number - the account number to attach to the transaction
|
|
98
|
+
* @property {number} chainId - the chain-id to attach to the transaction
|
|
99
|
+
* @property {string} pubKey - the account pubKey to attach to the transaction (in base64)
|
|
100
|
+
*
|
|
101
|
+
* @typedef {Object} CreateTransactionResult
|
|
102
|
+
* @property {TxRaw} txRaw // the Tx raw that was created
|
|
103
|
+
* @property {SignDoc} signDoc // the SignDoc that was created - used for signing of the transaction
|
|
104
|
+
* @property {number} accountNumber // the account number of the signer of the transaction
|
|
105
|
+
* @property {Uint8Array} bodyBytes // the body bytes of the transaction
|
|
106
|
+
* @property {Uint8Array} authInfoBytes // the auth info bytes of the transaction
|
|
107
|
+
* @property {Uint8Array} signBytes // the sign bytes of the transaction (SignDoc serialized to binary)
|
|
108
|
+
* @property {Uint8Array} signHashedBytes // the sign bytes of the transaction (SignDoc serialized to binary) and hashed using keccak256
|
|
109
|
+
* @returns {CreateTransactionResult} result
|
|
110
|
+
*/
|
|
111
|
+
const createTransaction = ({ memo, pubKey, chainId, message, sequence, fee = utils_1.DEFAULT_STD_FEE, signMode = exports.SIGN_DIRECT, accountNumber, timeoutHeight, }) => {
|
|
112
|
+
const body = (0, exports.createBody)({ message, memo, timeoutHeight });
|
|
113
|
+
const feeMessage = (0, exports.createFee)({
|
|
114
|
+
fee: fee.amount[0],
|
|
115
|
+
gasLimit: parseInt(fee.gas, 10),
|
|
116
|
+
});
|
|
117
|
+
const signInfo = (0, exports.createSignerInfo)({
|
|
118
|
+
chainId,
|
|
119
|
+
sequence,
|
|
120
|
+
mode: signMode,
|
|
121
|
+
publicKey: pubKey,
|
|
122
|
+
});
|
|
123
|
+
const authInfo = (0, exports.createAuthInfo)({
|
|
124
|
+
signerInfo: signInfo,
|
|
125
|
+
fee: feeMessage,
|
|
126
|
+
});
|
|
127
|
+
const signDoc = (0, exports.createSigDoc)({
|
|
128
|
+
bodyBytes: body.serializeBinary(),
|
|
129
|
+
authInfoBytes: authInfo.serializeBinary(),
|
|
130
|
+
chainId,
|
|
131
|
+
accountNumber,
|
|
132
|
+
});
|
|
133
|
+
const toSignBytes = Buffer.from(signDoc.serializeBinary());
|
|
134
|
+
const toSignHash = (0, keccak256_1.default)(Buffer.from(signDoc.serializeBinary()));
|
|
135
|
+
const txRaw = new tx_pb_1.TxRaw();
|
|
136
|
+
txRaw.setAuthInfoBytes(authInfo.serializeBinary());
|
|
137
|
+
txRaw.setBodyBytes(body.serializeBinary());
|
|
138
|
+
return {
|
|
139
|
+
txRaw,
|
|
140
|
+
signDoc,
|
|
141
|
+
accountNumber,
|
|
142
|
+
bodyBytes: body.serializeBinary(),
|
|
143
|
+
authInfoBytes: authInfo.serializeBinary(),
|
|
144
|
+
signBytes: toSignBytes,
|
|
145
|
+
signHashedBytes: toSignHash,
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
exports.createTransaction = createTransaction;
|
|
149
|
+
const createTransactionFromMsg = (params) => {
|
|
150
|
+
const messages = Array.isArray(params.message)
|
|
151
|
+
? params.message
|
|
152
|
+
: [params.message];
|
|
153
|
+
return (0, exports.createTransaction)(Object.assign(Object.assign({}, params), { message: messages.map((m) => m.toDirectSign()) }));
|
|
154
|
+
};
|
|
155
|
+
exports.createTransactionFromMsg = createTransactionFromMsg;
|
|
156
|
+
const createTxRawFromSigResponse = (signatureResponse) => {
|
|
157
|
+
const txRaw = new tx_pb_1.TxRaw();
|
|
158
|
+
txRaw.setAuthInfoBytes(signatureResponse.signed.authInfoBytes);
|
|
159
|
+
txRaw.setBodyBytes(signatureResponse.signed.bodyBytes);
|
|
160
|
+
txRaw.setSignaturesList([signatureResponse.signature.signature]);
|
|
161
|
+
return txRaw;
|
|
162
|
+
};
|
|
163
|
+
exports.createTxRawFromSigResponse = createTxRawFromSigResponse;
|
|
164
|
+
const createTxRawEIP712 = (txRaw, extension) => {
|
|
165
|
+
const body = tx_pb_1.TxBody.deserializeBinary(txRaw.getBodyBytes_asU8());
|
|
166
|
+
const extensionAny = (0, utils_2.createAny)(extension.serializeBinary(), '/injective.types.v1beta1.ExtensionOptionsWeb3Tx');
|
|
167
|
+
body.addExtensionOptions(extensionAny);
|
|
168
|
+
txRaw.setBodyBytes(body.serializeBinary());
|
|
169
|
+
return txRaw;
|
|
170
|
+
};
|
|
171
|
+
exports.createTxRawEIP712 = createTxRawEIP712;
|
|
172
|
+
const createWeb3Extension = ({ ethereumChainId, feePayer, feePayerSig, }) => {
|
|
173
|
+
const web3Extension = new tx_ext_pb_1.ExtensionOptionsWeb3Tx();
|
|
174
|
+
web3Extension.setTypeddatachainid(ethereumChainId);
|
|
175
|
+
if (feePayer) {
|
|
176
|
+
web3Extension.setFeepayer(feePayer);
|
|
177
|
+
}
|
|
178
|
+
if (feePayerSig) {
|
|
179
|
+
web3Extension.setFeepayersig(feePayerSig);
|
|
180
|
+
}
|
|
181
|
+
return web3Extension;
|
|
182
|
+
};
|
|
183
|
+
exports.createWeb3Extension = createWeb3Extension;
|
|
184
|
+
//#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