@skip-go/client 1.0.3 → 1.0.4
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/api/postMessages.d.cts +183 -183
- package/dist/api/postMessagesDirect.d.cts +183 -183
- package/dist/api/postRoute.d.cts +160 -160
- package/dist/{chunk-44PBLFB5.cjs → chunk-4RVEOKQU.cjs} +2 -2
- package/dist/{chunk-SW3SEQMJ.cjs → chunk-D2MDLQQZ.cjs} +22 -22
- package/dist/{chunk-G7BBDZ7C.cjs → chunk-GQYZQCOJ.cjs} +77 -97
- package/dist/{chunk-5IAEEEOQ.cjs → chunk-UO54MR5Z.cjs} +192 -209
- package/dist/{chunk-7OIZPQJB.cjs → chunk-WMXUOVHN.cjs} +71 -89
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +0 -1
- package/dist/public-functions/executeRoute.cjs +4 -4
- package/dist/public-functions/getRecommendedGasPrice.cjs +2 -2
- package/dist/public-functions/getSigningStargateClient.cjs +2 -2
- package/dist/public-functions/getSigningStargateClient.d.cts +1 -1
- package/dist/public-functions/setClientOptions.cjs +3 -3
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk4R6OCWRR_cjs = require('./chunk-4R6OCWRR.cjs');
|
|
4
4
|
var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkD2MDLQQZ_cjs = require('./chunk-D2MDLQQZ.cjs');
|
|
6
6
|
var chunk7SK3IFXJ_cjs = require('./chunk-7SK3IFXJ.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkWMXUOVHN_cjs = require('./chunk-WMXUOVHN.cjs');
|
|
8
8
|
var chunk32MRDO7V_cjs = require('./chunk-32MRDO7V.cjs');
|
|
9
9
|
var chunkL5V5PASH_cjs = require('./chunk-L5V5PASH.cjs');
|
|
10
10
|
var chunkKDN7RCGP_cjs = require('./chunk-KDN7RCGP.cjs');
|
|
@@ -15,44 +15,24 @@ var web3_js = require('@solana/web3.js');
|
|
|
15
15
|
var bech32 = require('bech32');
|
|
16
16
|
var stargate = require('@cosmjs/stargate');
|
|
17
17
|
var tx_js = require('cosmjs-types/cosmos/tx/v1beta1/tx.js');
|
|
18
|
-
var
|
|
19
|
-
var base64 = require('@cosmjs/encoding/build/base64');
|
|
18
|
+
var protoSigning = require('@cosmjs/proto-signing');
|
|
20
19
|
var encoding = require('@cosmjs/encoding');
|
|
21
20
|
var sdkTs = require('@injectivelabs/sdk-ts');
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var _m0 = require('protobufjs/minimal');
|
|
21
|
+
var tx_js$3 = require('cosmjs-types/cosmos/bank/v1beta1/tx.js');
|
|
22
|
+
var tx_js$2 = require('cosmjs-types/cosmwasm/wasm/v1/tx.js');
|
|
23
|
+
var tx_js$1 = require('cosmjs-types/ibc/applications/transfer/v1/tx.js');
|
|
24
|
+
var _m0 = require('protobufjs/minimal.js');
|
|
26
25
|
var utils = require('@injectivelabs/utils');
|
|
27
|
-
var signing = require('@cosmjs/proto-signing/build/signing');
|
|
28
26
|
var amino = require('@cosmjs/amino');
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var signing$1 = require('cosmjs-types/cosmos/tx/signing/v1beta1/signing');
|
|
27
|
+
var keys_js = require('cosmjs-types/cosmos/crypto/secp256k1/keys.js');
|
|
28
|
+
var any_js = require('cosmjs-types/google/protobuf/any.js');
|
|
29
|
+
var math = require('@cosmjs/math');
|
|
30
|
+
var signing_js = require('cosmjs-types/cosmos/tx/signing/v1beta1/signing.js');
|
|
34
31
|
var viem = require('viem');
|
|
35
|
-
var decimal = require('@cosmjs/math/build/decimal');
|
|
36
32
|
|
|
37
|
-
function
|
|
38
|
-
if (e && e.__esModule) return e;
|
|
39
|
-
var n = Object.create(null);
|
|
40
|
-
if (e) {
|
|
41
|
-
Object.keys(e).forEach(function (k) {
|
|
42
|
-
if (k !== 'default') {
|
|
43
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
44
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () { return e[k]; }
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
n.default = e;
|
|
52
|
-
return Object.freeze(n);
|
|
53
|
-
}
|
|
33
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
54
34
|
|
|
55
|
-
var
|
|
35
|
+
var _m0__default = /*#__PURE__*/_interopDefault(_m0);
|
|
56
36
|
|
|
57
37
|
// src/private-functions/getRestEndpointForChain.ts
|
|
58
38
|
var getRestEndpointForChain = async (chainId) => {
|
|
@@ -91,9 +71,9 @@ var getAccountNumberAndSequence = async (address, chainId) => {
|
|
|
91
71
|
if (chainId.includes("dymension")) {
|
|
92
72
|
return getAccountNumberAndSequenceFromDymension(address, chainId);
|
|
93
73
|
}
|
|
94
|
-
const endpoint = await
|
|
74
|
+
const endpoint = await chunkD2MDLQQZ_cjs.getRpcEndpointForChain(chainId);
|
|
95
75
|
const client = chunkED2OY55G_cjs.ClientState.signingStargateClientByChainId[chainId] ?? await stargate.StargateClient.connect(endpoint, {
|
|
96
|
-
accountParser:
|
|
76
|
+
accountParser: chunkD2MDLQQZ_cjs.accountParser
|
|
97
77
|
});
|
|
98
78
|
const account = await client.getAccount(address);
|
|
99
79
|
if (!account) {
|
|
@@ -136,45 +116,45 @@ function createBaseClawbackVestingAccount() {
|
|
|
136
116
|
}
|
|
137
117
|
var ClawbackVestingAccount = {
|
|
138
118
|
typeUrl: "/evmos.vesting.v2.ClawbackVestingAccount",
|
|
139
|
-
encode(message, writer =
|
|
119
|
+
encode(message, writer = _m0__default.default.Writer.create()) {
|
|
140
120
|
if (message.baseVestingAccount !== void 0) {
|
|
141
|
-
|
|
121
|
+
chunkWMXUOVHN_cjs.BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim();
|
|
142
122
|
}
|
|
143
123
|
if (message.funderAddress !== "") {
|
|
144
124
|
writer.uint32(18).string(message.funderAddress);
|
|
145
125
|
}
|
|
146
126
|
if (message.startTime !== void 0) {
|
|
147
|
-
|
|
127
|
+
chunkWMXUOVHN_cjs.Timestamp.encode(chunkWMXUOVHN_cjs.toTimestamp(message.startTime), writer.uint32(26).fork()).ldelim();
|
|
148
128
|
}
|
|
149
129
|
for (const v of message.lockupPeriods) {
|
|
150
|
-
|
|
130
|
+
chunkWMXUOVHN_cjs.Period.encode(v, writer.uint32(34).fork()).ldelim();
|
|
151
131
|
}
|
|
152
132
|
for (const v of message.vestingPeriods) {
|
|
153
|
-
|
|
133
|
+
chunkWMXUOVHN_cjs.Period.encode(v, writer.uint32(42).fork()).ldelim();
|
|
154
134
|
}
|
|
155
135
|
return writer;
|
|
156
136
|
},
|
|
157
137
|
decode(input, length) {
|
|
158
|
-
const reader = input instanceof
|
|
138
|
+
const reader = input instanceof _m0__default.default.Reader ? input : new _m0__default.default.Reader(input);
|
|
159
139
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
160
140
|
const message = createBaseClawbackVestingAccount();
|
|
161
141
|
while (reader.pos < end) {
|
|
162
142
|
const tag = reader.uint32();
|
|
163
143
|
switch (tag >>> 3) {
|
|
164
144
|
case 1:
|
|
165
|
-
message.baseVestingAccount =
|
|
145
|
+
message.baseVestingAccount = chunkWMXUOVHN_cjs.BaseVestingAccount.decode(reader, reader.uint32());
|
|
166
146
|
break;
|
|
167
147
|
case 2:
|
|
168
148
|
message.funderAddress = reader.string();
|
|
169
149
|
break;
|
|
170
150
|
case 3:
|
|
171
|
-
message.startTime =
|
|
151
|
+
message.startTime = chunkWMXUOVHN_cjs.fromTimestamp(chunkWMXUOVHN_cjs.Timestamp.decode(reader, reader.uint32()));
|
|
172
152
|
break;
|
|
173
153
|
case 4:
|
|
174
|
-
message.lockupPeriods.push(
|
|
154
|
+
message.lockupPeriods.push(chunkWMXUOVHN_cjs.Period.decode(reader, reader.uint32()));
|
|
175
155
|
break;
|
|
176
156
|
case 5:
|
|
177
|
-
message.vestingPeriods.push(
|
|
157
|
+
message.vestingPeriods.push(chunkWMXUOVHN_cjs.Period.decode(reader, reader.uint32()));
|
|
178
158
|
break;
|
|
179
159
|
default:
|
|
180
160
|
reader.skipType(tag & 7);
|
|
@@ -185,25 +165,25 @@ var ClawbackVestingAccount = {
|
|
|
185
165
|
},
|
|
186
166
|
fromJSON(object) {
|
|
187
167
|
return {
|
|
188
|
-
baseVestingAccount:
|
|
189
|
-
funderAddress:
|
|
190
|
-
startTime:
|
|
191
|
-
lockupPeriods: Array.isArray(object?.lockupPeriods) ? object.lockupPeriods.map((e) =>
|
|
192
|
-
vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e) =>
|
|
168
|
+
baseVestingAccount: chunkWMXUOVHN_cjs.isSet(object.baseVestingAccount) ? chunkWMXUOVHN_cjs.BaseVestingAccount.fromJSON(object.baseVestingAccount) : void 0,
|
|
169
|
+
funderAddress: chunkWMXUOVHN_cjs.isSet(object.funderAddress) ? String(object.funderAddress) : "",
|
|
170
|
+
startTime: chunkWMXUOVHN_cjs.isSet(object.startTime) ? chunkWMXUOVHN_cjs.fromJsonTimestamp(object.startTime) : void 0,
|
|
171
|
+
lockupPeriods: Array.isArray(object?.lockupPeriods) ? object.lockupPeriods.map((e) => chunkWMXUOVHN_cjs.Period.fromJSON(e)) : [],
|
|
172
|
+
vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e) => chunkWMXUOVHN_cjs.Period.fromJSON(e)) : []
|
|
193
173
|
};
|
|
194
174
|
},
|
|
195
175
|
toJSON(message) {
|
|
196
176
|
const obj = {};
|
|
197
|
-
message.baseVestingAccount !== void 0 && (obj.baseVestingAccount = message.baseVestingAccount ?
|
|
177
|
+
message.baseVestingAccount !== void 0 && (obj.baseVestingAccount = message.baseVestingAccount ? chunkWMXUOVHN_cjs.BaseVestingAccount.toJSON(message.baseVestingAccount) : void 0);
|
|
198
178
|
message.funderAddress !== void 0 && (obj.funderAddress = message.funderAddress);
|
|
199
179
|
message.startTime !== void 0 && (obj.startTime = message.startTime.toISOString());
|
|
200
180
|
if (message.lockupPeriods) {
|
|
201
|
-
obj.lockupPeriods = message.lockupPeriods.map((e) => e ?
|
|
181
|
+
obj.lockupPeriods = message.lockupPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toJSON(e) : void 0);
|
|
202
182
|
} else {
|
|
203
183
|
obj.lockupPeriods = [];
|
|
204
184
|
}
|
|
205
185
|
if (message.vestingPeriods) {
|
|
206
|
-
obj.vestingPeriods = message.vestingPeriods.map((e) => e ?
|
|
186
|
+
obj.vestingPeriods = message.vestingPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toJSON(e) : void 0);
|
|
207
187
|
} else {
|
|
208
188
|
obj.vestingPeriods = [];
|
|
209
189
|
}
|
|
@@ -211,40 +191,40 @@ var ClawbackVestingAccount = {
|
|
|
211
191
|
},
|
|
212
192
|
fromPartial(object) {
|
|
213
193
|
const message = createBaseClawbackVestingAccount();
|
|
214
|
-
message.baseVestingAccount = object.baseVestingAccount !== void 0 && object.baseVestingAccount !== null ?
|
|
194
|
+
message.baseVestingAccount = object.baseVestingAccount !== void 0 && object.baseVestingAccount !== null ? chunkWMXUOVHN_cjs.BaseVestingAccount.fromPartial(object.baseVestingAccount) : void 0;
|
|
215
195
|
message.funderAddress = object.funderAddress ?? "";
|
|
216
196
|
message.startTime = object.startTime ?? void 0;
|
|
217
|
-
message.lockupPeriods = object.lockupPeriods?.map((e) =>
|
|
218
|
-
message.vestingPeriods = object.vestingPeriods?.map((e) =>
|
|
197
|
+
message.lockupPeriods = object.lockupPeriods?.map((e) => chunkWMXUOVHN_cjs.Period.fromPartial(e)) || [];
|
|
198
|
+
message.vestingPeriods = object.vestingPeriods?.map((e) => chunkWMXUOVHN_cjs.Period.fromPartial(e)) || [];
|
|
219
199
|
return message;
|
|
220
200
|
},
|
|
221
201
|
fromAmino(object) {
|
|
222
202
|
const message = createBaseClawbackVestingAccount();
|
|
223
203
|
if (object.base_vesting_account !== void 0 && object.base_vesting_account !== null) {
|
|
224
|
-
message.baseVestingAccount =
|
|
204
|
+
message.baseVestingAccount = chunkWMXUOVHN_cjs.BaseVestingAccount.fromAmino(object.base_vesting_account);
|
|
225
205
|
}
|
|
226
206
|
if (object.funder_address !== void 0 && object.funder_address !== null) {
|
|
227
207
|
message.funderAddress = object.funder_address;
|
|
228
208
|
}
|
|
229
209
|
if (object.start_time !== void 0 && object.start_time !== null) {
|
|
230
|
-
message.startTime =
|
|
210
|
+
message.startTime = chunkWMXUOVHN_cjs.fromTimestamp(chunkWMXUOVHN_cjs.Timestamp.fromAmino(object.start_time));
|
|
231
211
|
}
|
|
232
|
-
message.lockupPeriods = object.lockup_periods?.map((e) =>
|
|
233
|
-
message.vestingPeriods = object.vesting_periods?.map((e) =>
|
|
212
|
+
message.lockupPeriods = object.lockup_periods?.map((e) => chunkWMXUOVHN_cjs.Period.fromAmino(e)) || [];
|
|
213
|
+
message.vestingPeriods = object.vesting_periods?.map((e) => chunkWMXUOVHN_cjs.Period.fromAmino(e)) || [];
|
|
234
214
|
return message;
|
|
235
215
|
},
|
|
236
216
|
toAmino(message) {
|
|
237
217
|
const obj = {};
|
|
238
|
-
obj.base_vesting_account = message.baseVestingAccount ?
|
|
218
|
+
obj.base_vesting_account = message.baseVestingAccount ? chunkWMXUOVHN_cjs.BaseVestingAccount.toAmino(message.baseVestingAccount) : void 0;
|
|
239
219
|
obj.funder_address = message.funderAddress === "" ? void 0 : message.funderAddress;
|
|
240
|
-
obj.start_time = message.startTime ?
|
|
220
|
+
obj.start_time = message.startTime ? chunkWMXUOVHN_cjs.Timestamp.toAmino(chunkWMXUOVHN_cjs.toTimestamp(message.startTime)) : void 0;
|
|
241
221
|
if (message.lockupPeriods) {
|
|
242
|
-
obj.lockup_periods = message.lockupPeriods.map((e) => e ?
|
|
222
|
+
obj.lockup_periods = message.lockupPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toAmino(e) : void 0);
|
|
243
223
|
} else {
|
|
244
224
|
obj.lockup_periods = message.lockupPeriods;
|
|
245
225
|
}
|
|
246
226
|
if (message.vestingPeriods) {
|
|
247
|
-
obj.vesting_periods = message.vestingPeriods.map((e) => e ?
|
|
227
|
+
obj.vesting_periods = message.vestingPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toAmino(e) : void 0);
|
|
248
228
|
} else {
|
|
249
229
|
obj.vesting_periods = message.vestingPeriods;
|
|
250
230
|
}
|
|
@@ -279,7 +259,7 @@ function getEncodeObjectFromCosmosMessage(message) {
|
|
|
279
259
|
if (message.msgTypeUrl === "/ibc.applications.transfer.v1.MsgTransfer") {
|
|
280
260
|
return {
|
|
281
261
|
typeUrl: "/ibc.applications.transfer.v1.MsgTransfer",
|
|
282
|
-
value:
|
|
262
|
+
value: tx_js$1.MsgTransfer.fromJSON({
|
|
283
263
|
sourcePort: msgJson.source_port,
|
|
284
264
|
sourceChannel: msgJson.source_channel,
|
|
285
265
|
token: msgJson.token,
|
|
@@ -294,7 +274,7 @@ function getEncodeObjectFromCosmosMessage(message) {
|
|
|
294
274
|
if (message.msgTypeUrl === "/cosmwasm.wasm.v1.MsgExecuteContract") {
|
|
295
275
|
return {
|
|
296
276
|
typeUrl: message.msgTypeUrl,
|
|
297
|
-
value:
|
|
277
|
+
value: tx_js$2.MsgExecuteContract.fromPartial({
|
|
298
278
|
sender: msgJson.sender,
|
|
299
279
|
contract: msgJson.contract,
|
|
300
280
|
msg: encoding.toUtf8(JSON.stringify(msgJson.msg)),
|
|
@@ -305,7 +285,7 @@ function getEncodeObjectFromCosmosMessage(message) {
|
|
|
305
285
|
if (message.msgTypeUrl === "/cosmos.bank.v1beta1.MsgSend") {
|
|
306
286
|
return {
|
|
307
287
|
typeUrl: message.msgTypeUrl,
|
|
308
|
-
value:
|
|
288
|
+
value: tx_js$3.MsgSend.fromPartial({
|
|
309
289
|
fromAddress: msgJson.from_address,
|
|
310
290
|
toAddress: msgJson.to_address,
|
|
311
291
|
amount: msgJson.amount
|
|
@@ -315,19 +295,19 @@ function getEncodeObjectFromCosmosMessage(message) {
|
|
|
315
295
|
if (message.msgTypeUrl === "/circle.cctp.v1.MsgDepositForBurn") {
|
|
316
296
|
return {
|
|
317
297
|
typeUrl: message.msgTypeUrl,
|
|
318
|
-
value:
|
|
298
|
+
value: chunkWMXUOVHN_cjs.MsgDepositForBurn.fromAmino(msgJson)
|
|
319
299
|
};
|
|
320
300
|
}
|
|
321
301
|
if (message.msgTypeUrl === "/circle.cctp.v1.MsgDepositForBurnWithCaller") {
|
|
322
302
|
return {
|
|
323
303
|
typeUrl: message.msgTypeUrl,
|
|
324
|
-
value:
|
|
304
|
+
value: chunkWMXUOVHN_cjs.MsgDepositForBurnWithCaller.fromAmino(msgJson)
|
|
325
305
|
};
|
|
326
306
|
}
|
|
327
307
|
if (message.msgTypeUrl === "/initia.move.v1.MsgExecute") {
|
|
328
308
|
return {
|
|
329
309
|
typeUrl: message.msgTypeUrl,
|
|
330
|
-
value:
|
|
310
|
+
value: chunkWMXUOVHN_cjs.MsgExecute.fromPartial({
|
|
331
311
|
sender: msgJson.sender,
|
|
332
312
|
moduleAddress: msgJson.module_address,
|
|
333
313
|
moduleName: msgJson.module_name,
|
|
@@ -339,7 +319,7 @@ function getEncodeObjectFromCosmosMessage(message) {
|
|
|
339
319
|
if (message.msgTypeUrl === "/opinit.ophost.v1.MsgInitiateTokenDeposit") {
|
|
340
320
|
return {
|
|
341
321
|
typeUrl: message.msgTypeUrl,
|
|
342
|
-
value:
|
|
322
|
+
value: chunkWMXUOVHN_cjs.MsgInitiateTokenDeposit.fromPartial({
|
|
343
323
|
sender: msgJson.sender,
|
|
344
324
|
to: msgJson.to,
|
|
345
325
|
amount: msgJson.amount,
|
|
@@ -438,7 +418,7 @@ var signCosmosMessageDirectEvmos = async (signerAddress, signer, cosmosMsgs, fee
|
|
|
438
418
|
return tx_js.TxRaw.fromPartial({
|
|
439
419
|
bodyBytes: directSignResponse.signed.bodyBytes,
|
|
440
420
|
authInfoBytes: directSignResponse.signed.authInfoBytes,
|
|
441
|
-
signatures: [
|
|
421
|
+
signatures: [encoding.fromBase64(directSignResponse.signature.signature)]
|
|
442
422
|
});
|
|
443
423
|
};
|
|
444
424
|
var signCosmosMessageDirectInjective = async (signerAddress, signer, cosmosMsgs, fee, { accountNumber, sequence, chainId }) => {
|
|
@@ -473,7 +453,7 @@ var signCosmosMessageDirectInjective = async (signerAddress, signer, cosmosMsgs,
|
|
|
473
453
|
return tx_js.TxRaw.fromPartial({
|
|
474
454
|
bodyBytes: directSignResponse.signed.bodyBytes,
|
|
475
455
|
authInfoBytes: directSignResponse.signed.authInfoBytes,
|
|
476
|
-
signatures: [
|
|
456
|
+
signatures: [encoding.fromBase64(directSignResponse.signature.signature)]
|
|
477
457
|
});
|
|
478
458
|
};
|
|
479
459
|
var pubkeyType = {
|
|
@@ -503,7 +483,7 @@ function makePubkeyAnyFromAccount(account, chainId) {
|
|
|
503
483
|
}
|
|
504
484
|
function encodePubkeyToAny(pubkey, chainId, isEthermint) {
|
|
505
485
|
if (isEthermint) {
|
|
506
|
-
const pubkeyProto =
|
|
486
|
+
const pubkeyProto = keys_js.PubKey.fromPartial({
|
|
507
487
|
key: encoding.fromBase64(pubkey.value)
|
|
508
488
|
});
|
|
509
489
|
let typeUrl = "";
|
|
@@ -512,19 +492,19 @@ function encodePubkeyToAny(pubkey, chainId, isEthermint) {
|
|
|
512
492
|
} else {
|
|
513
493
|
typeUrl = "/ethermint.crypto.v1.ethsecp256k1.PubKey";
|
|
514
494
|
}
|
|
515
|
-
return
|
|
495
|
+
return any_js.Any.fromPartial({
|
|
516
496
|
typeUrl,
|
|
517
|
-
value: Uint8Array.from(
|
|
497
|
+
value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
|
|
518
498
|
});
|
|
519
499
|
} else {
|
|
520
500
|
const isInitia = chunk7SK3IFXJ_cjs.getIsInitia(chainId);
|
|
521
|
-
const pubkeyProto =
|
|
501
|
+
const pubkeyProto = keys_js.PubKey.fromPartial({
|
|
522
502
|
key: encoding.fromBase64(pubkey.value)
|
|
523
503
|
});
|
|
524
504
|
if (isInitia) {
|
|
525
|
-
return
|
|
505
|
+
return any_js.Any.fromPartial({
|
|
526
506
|
typeUrl: "/initia.crypto.v1beta1.ethsecp256k1.PubKey",
|
|
527
|
-
value: Uint8Array.from(
|
|
507
|
+
value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
|
|
528
508
|
});
|
|
529
509
|
}
|
|
530
510
|
return protoSigning.encodePubkey(pubkey);
|
|
@@ -566,21 +546,21 @@ var signCosmosMessageDirect = async (options) => {
|
|
|
566
546
|
}
|
|
567
547
|
};
|
|
568
548
|
const txBodyBytes = chunkED2OY55G_cjs.ClientState.registry.encode(txBodyEncodeObject);
|
|
569
|
-
const gasLimit =
|
|
549
|
+
const gasLimit = math.Int53.fromString(fee.gas).toNumber();
|
|
570
550
|
const pubkeyAny = makePubkeyAnyFromAccount(accountFromSigner, chainId);
|
|
571
|
-
const authInfoBytes =
|
|
551
|
+
const authInfoBytes = protoSigning.makeAuthInfoBytes(
|
|
572
552
|
[{ pubkey: pubkeyAny, sequence }],
|
|
573
553
|
fee.amount,
|
|
574
554
|
gasLimit,
|
|
575
555
|
fee.granter,
|
|
576
556
|
fee.payer
|
|
577
557
|
);
|
|
578
|
-
const signDoc =
|
|
558
|
+
const signDoc = protoSigning.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
|
579
559
|
const { signature, signed } = await signer.signDirect(signerAddress, signDoc);
|
|
580
560
|
return tx_js.TxRaw.fromPartial({
|
|
581
561
|
bodyBytes: signed.bodyBytes,
|
|
582
562
|
authInfoBytes: signed.authInfoBytes,
|
|
583
|
-
signatures: [
|
|
563
|
+
signatures: [encoding.fromBase64(signature.signature)]
|
|
584
564
|
});
|
|
585
565
|
};
|
|
586
566
|
var signCosmosMessageAmino = async (options) => {
|
|
@@ -598,7 +578,7 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
598
578
|
throw new Error("signCosmosMessageAmino: failed to retrieve account from signer");
|
|
599
579
|
}
|
|
600
580
|
const messages2 = cosmosMsgs.map((cosmosMsg) => getEncodeObjectFromCosmosMessage(cosmosMsg));
|
|
601
|
-
const signMode =
|
|
581
|
+
const signMode = signing_js.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
|
|
602
582
|
const msgs = messages2.map((msg) => chunkED2OY55G_cjs.ClientState.aminoTypes.toAmino(msg));
|
|
603
583
|
console.log("sign cosmos message amino", msgs, fee, signerChainId, "", accountNumber, sequence);
|
|
604
584
|
const signDoc = amino.makeSignDoc(msgs, fee, signerChainId, "", accountNumber, sequence);
|
|
@@ -613,10 +593,10 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
613
593
|
value: signedTxBody
|
|
614
594
|
};
|
|
615
595
|
const signedTxBodyBytes = chunkED2OY55G_cjs.ClientState.registry.encode(signedTxBodyEncodeObject);
|
|
616
|
-
const signedGasLimit =
|
|
617
|
-
const signedSequence =
|
|
596
|
+
const signedGasLimit = math.Int53.fromString(signed.fee.gas).toNumber();
|
|
597
|
+
const signedSequence = math.Int53.fromString(signed.sequence).toNumber();
|
|
618
598
|
const pubkeyAny = makePubkeyAnyFromAccount(accountFromSigner, chainId);
|
|
619
|
-
const signedAuthInfoBytes =
|
|
599
|
+
const signedAuthInfoBytes = protoSigning.makeAuthInfoBytes(
|
|
620
600
|
[{ pubkey: pubkeyAny, sequence: signedSequence }],
|
|
621
601
|
signed.fee.amount,
|
|
622
602
|
signedGasLimit,
|
|
@@ -627,7 +607,7 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
627
607
|
return tx_js.TxRaw.fromPartial({
|
|
628
608
|
bodyBytes: signedTxBodyBytes,
|
|
629
609
|
authInfoBytes: signedAuthInfoBytes,
|
|
630
|
-
signatures: [
|
|
610
|
+
signatures: [encoding.fromBase64(signature.signature)]
|
|
631
611
|
});
|
|
632
612
|
};
|
|
633
613
|
|
|
@@ -659,7 +639,7 @@ var executeCosmosTransaction = async ({
|
|
|
659
639
|
if (messages2 === void 0) {
|
|
660
640
|
throw new Error("no messages found for tx");
|
|
661
641
|
}
|
|
662
|
-
const { stargateClient, signer
|
|
642
|
+
const { stargateClient, signer } = await chunkD2MDLQQZ_cjs.getSigningStargateClient({
|
|
663
643
|
chainId,
|
|
664
644
|
getOfflineSigner: options?.getCosmosSigner
|
|
665
645
|
});
|
|
@@ -668,7 +648,7 @@ var executeCosmosTransaction = async ({
|
|
|
668
648
|
`executeCosmosTransaction error: invalid address for chain '${tx.cosmosTx?.chainId}'`
|
|
669
649
|
);
|
|
670
650
|
}
|
|
671
|
-
const accounts = await signer
|
|
651
|
+
const accounts = await signer.getAccounts();
|
|
672
652
|
const accountFromSigner = accounts.find((account) => account.address === currentUserAddress);
|
|
673
653
|
if (!accountFromSigner) {
|
|
674
654
|
throw new Error("executeCosmosTransaction error: failed to retrieve account from signer");
|
|
@@ -693,13 +673,13 @@ var executeCosmosTransaction = async ({
|
|
|
693
673
|
chainId
|
|
694
674
|
}
|
|
695
675
|
};
|
|
696
|
-
if (
|
|
676
|
+
if (protoSigning.isOfflineDirectSigner(signer)) {
|
|
697
677
|
rawTx = await signCosmosMessageDirect({
|
|
698
678
|
...commonRawTxBody,
|
|
699
|
-
signer
|
|
679
|
+
signer
|
|
700
680
|
});
|
|
701
681
|
} else {
|
|
702
|
-
rawTx = await signCosmosMessageAmino({ ...commonRawTxBody, signer
|
|
682
|
+
rawTx = await signCosmosMessageAmino({ ...commonRawTxBody, signer });
|
|
703
683
|
}
|
|
704
684
|
options?.onTransactionSigned?.({
|
|
705
685
|
chainId
|
|
@@ -1021,7 +1001,7 @@ var executeSvmTransaction = async (tx, options) => {
|
|
|
1021
1001
|
}
|
|
1022
1002
|
const txBuffer = Buffer.from(svmTx.tx ?? "", "base64");
|
|
1023
1003
|
const transaction = web3_js.Transaction.from(txBuffer);
|
|
1024
|
-
const endpoint = await
|
|
1004
|
+
const endpoint = await chunkD2MDLQQZ_cjs.getRpcEndpointForChain(svmTx.chainId);
|
|
1025
1005
|
const connection = new web3_js.Connection(endpoint);
|
|
1026
1006
|
let signature;
|
|
1027
1007
|
if ("signTransaction" in signer) {
|
|
@@ -1119,7 +1099,7 @@ var validateCosmosGasBalance = async ({
|
|
|
1119
1099
|
if (txIndex !== 0 && chainId === "noble-1") {
|
|
1120
1100
|
return "0";
|
|
1121
1101
|
}
|
|
1122
|
-
const { stargateClient } = await
|
|
1102
|
+
const { stargateClient } = await chunkD2MDLQQZ_cjs.getSigningStargateClient({
|
|
1123
1103
|
chainId,
|
|
1124
1104
|
getOfflineSigner
|
|
1125
1105
|
});
|
|
@@ -1157,7 +1137,7 @@ var validateCosmosGasBalance = async ({
|
|
|
1157
1137
|
}
|
|
1158
1138
|
if (!price) return;
|
|
1159
1139
|
return new stargate.GasPrice(
|
|
1160
|
-
|
|
1140
|
+
math.Decimal.fromUserInput(chunk4R6OCWRR_cjs.BigNumber(price).toFixed(), 18),
|
|
1161
1141
|
asset?.denom ?? ""
|
|
1162
1142
|
);
|
|
1163
1143
|
})();
|
|
@@ -1441,7 +1421,7 @@ var validateSvmGasBalance = async ({
|
|
|
1441
1421
|
tx
|
|
1442
1422
|
}) => {
|
|
1443
1423
|
if (!tx) throw new Error("Transaction is required");
|
|
1444
|
-
const endpoint = await
|
|
1424
|
+
const endpoint = await chunkD2MDLQQZ_cjs.getRpcEndpointForChain(tx.chainId ?? "");
|
|
1445
1425
|
const connection = new web3_js.Connection(endpoint);
|
|
1446
1426
|
if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
|
|
1447
1427
|
if (!tx.tx) {
|