@skip-go/client 1.0.1 → 1.0.2
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/getAssets.js +2 -15
- package/dist/api/getAssetsBetweenChains.js +2 -11
- package/dist/api/getBridges.js +2 -11
- package/dist/api/getChains.js +2 -11
- package/dist/api/getVenues.js +2 -11
- package/dist/api/postAssetsFromSource.js +3 -12
- package/dist/api/postBalances.js +2 -11
- package/dist/api/postIbcOriginAssets.js +2 -11
- package/dist/api/postMessages.js +2 -11
- package/dist/api/postMessagesDirect.js +2 -11
- package/dist/api/postRecommendAssets.js +2 -11
- package/dist/api/postRoute.js +2 -11
- package/dist/api/postSubmitTransaction.js +2 -11
- package/dist/api/postTrackTransaction.js +2 -11
- package/dist/api/postTransactionStatus.js +2 -11
- package/dist/chunk-33K6EESX.js +10 -0
- package/dist/{chunk-X2YPYBVN.js → chunk-3N7XVGLX.js} +59 -68
- package/dist/{chunk-RT5TZAMU.js → chunk-3OZQ35X3.js} +212 -312
- package/dist/{chunk-Z4ZKOUGH.js → chunk-4JJWOILI.js} +3 -5
- package/dist/chunk-735L35R6.js +1790 -0
- package/dist/chunk-BQTQJQ5E.js +10 -0
- package/dist/chunk-BRJDNGYH.js +22 -0
- package/dist/chunk-BRMONS6A.js +130 -0
- package/dist/{chunk-ZG23Z3WY.js → chunk-C2EDPY6J.js} +3 -5
- package/dist/chunk-DW4U6YI6.js +10 -0
- package/dist/chunk-GARVPN2H.js +16 -0
- package/dist/{chunk-CG5CQQBW.js → chunk-JTIHU43D.js} +33 -42
- package/dist/{chunk-5ZJBR5AQ.js → chunk-KNV72XRZ.js} +3 -5
- package/dist/chunk-MGVXJ2U4.js +11 -0
- package/dist/chunk-MTMPHY3Y.js +9 -0
- package/dist/{chunk-RE2QZJWE.js → chunk-PRQ2NHRZ.js} +3 -5
- package/dist/chunk-RDRDFJQE.js +10 -0
- package/dist/chunk-RMP3HM5N.js +14 -0
- package/dist/{chunk-GFRPLEJR.js → chunk-SQGWZAUC.js} +279 -311
- package/dist/chunk-SWYON2RG.js +1 -4
- package/dist/{chunk-PKPZTO4H.js → chunk-TW77BXMT.js} +10 -13
- package/dist/{chunk-4XWIXR2P.js → chunk-VMPFHQ7U.js} +19 -27
- package/dist/chunk-VQ5SIQWU.js +1 -3
- package/dist/chunk-W6TBGBV3.js +675 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +24 -209
- package/dist/public-functions/executeRoute.js +12 -21
- package/dist/public-functions/getFeeInfoForChain.js +5 -14
- package/dist/public-functions/getRecommendedGasPrice.d.ts +1 -1
- package/dist/public-functions/getRecommendedGasPrice.js +7 -16
- package/dist/public-functions/getSigningStargateClient.d.ts +1 -1
- package/dist/public-functions/getSigningStargateClient.js +4 -13
- package/dist/public-functions/setApiOptions.js +2 -11
- package/dist/public-functions/setClientOptions.js +4 -13
- package/package.json +12 -3
- package/dist/chunk-2WHYWV4Y.js +0 -12
- package/dist/chunk-5KVRQLI5.js +0 -17
- package/dist/chunk-6BTWKTNM.js +0 -16
- package/dist/chunk-6GJEXV5J.js +0 -130
- package/dist/chunk-ASPVKNJ7.js +0 -242
- package/dist/chunk-EQLA2SEZ.js +0 -2361
- package/dist/chunk-FVSSCQ6C.js +0 -12
- package/dist/chunk-KYFTM3PI.js +0 -12
- package/dist/chunk-L2Q5RP6O.js +0 -25
- package/dist/chunk-LRIPQQ4M.js +0 -11
- package/dist/chunk-X2E2TKVR.js +0 -12
- package/dist/chunk-YYNIFO2A.js +0 -13
package/dist/api/getAssets.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunk6GJEXV5J_js = require('../chunk-6GJEXV5J.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "assets", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk6GJEXV5J_js.assets; }
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "transformAssetsMap", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return chunk6GJEXV5J_js.transformAssetsMap; }
|
|
15
|
-
});
|
|
1
|
+
export { assets, transformAssetsMap } from '../chunk-BRMONS6A.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkLRIPQQ4M_js = require('../chunk-LRIPQQ4M.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "assetsBetweenChains", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkLRIPQQ4M_js.assetsBetweenChains; }
|
|
11
|
-
});
|
|
1
|
+
export { assetsBetweenChains } from '../chunk-MTMPHY3Y.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
package/dist/api/getBridges.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunk5ZJBR5AQ_js = require('../chunk-5ZJBR5AQ.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "bridges", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk5ZJBR5AQ_js.bridges; }
|
|
11
|
-
});
|
|
1
|
+
export { bridges } from '../chunk-KNV72XRZ.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
package/dist/api/getChains.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunk6GJEXV5J_js = require('../chunk-6GJEXV5J.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "chains", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk6GJEXV5J_js.chains; }
|
|
11
|
-
});
|
|
1
|
+
export { chains } from '../chunk-BRMONS6A.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
package/dist/api/getVenues.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkZG23Z3WY_js = require('../chunk-ZG23Z3WY.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "venues", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkZG23Z3WY_js.venues; }
|
|
11
|
-
});
|
|
1
|
+
export { venues } from '../chunk-C2EDPY6J.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require('../chunk-6GJEXV5J.js');
|
|
5
|
-
require('../chunk-ASPVKNJ7.js');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "assetsFromSource", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return chunk6BTWKTNM_js.assetsFromSource; }
|
|
12
|
-
});
|
|
1
|
+
export { assetsFromSource } from '../chunk-RMP3HM5N.js';
|
|
2
|
+
import '../chunk-BRMONS6A.js';
|
|
3
|
+
import '../chunk-W6TBGBV3.js';
|
package/dist/api/postBalances.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunk6GJEXV5J_js = require('../chunk-6GJEXV5J.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "balances", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk6GJEXV5J_js.balances; }
|
|
11
|
-
});
|
|
1
|
+
export { balances } from '../chunk-BRMONS6A.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkRE2QZJWE_js = require('../chunk-RE2QZJWE.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "ibcOriginAssets", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkRE2QZJWE_js.ibcOriginAssets; }
|
|
11
|
-
});
|
|
1
|
+
export { ibcOriginAssets } from '../chunk-PRQ2NHRZ.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
package/dist/api/postMessages.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkFVSSCQ6C_js = require('../chunk-FVSSCQ6C.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "messages", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkFVSSCQ6C_js.messages; }
|
|
11
|
-
});
|
|
1
|
+
export { messages } from '../chunk-DW4U6YI6.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkX2E2TKVR_js = require('../chunk-X2E2TKVR.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "messagesDirect", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkX2E2TKVR_js.messagesDirect; }
|
|
11
|
-
});
|
|
1
|
+
export { messagesDirect } from '../chunk-BQTQJQ5E.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkZ4ZKOUGH_js = require('../chunk-Z4ZKOUGH.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "recommendAssets", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkZ4ZKOUGH_js.recommendAssets; }
|
|
11
|
-
});
|
|
1
|
+
export { recommendAssets } from '../chunk-4JJWOILI.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
package/dist/api/postRoute.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunk5KVRQLI5_js = require('../chunk-5KVRQLI5.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "route", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk5KVRQLI5_js.route; }
|
|
11
|
-
});
|
|
1
|
+
export { route } from '../chunk-GARVPN2H.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkKYFTM3PI_js = require('../chunk-KYFTM3PI.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "submitTransaction", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkKYFTM3PI_js.submitTransaction; }
|
|
11
|
-
});
|
|
1
|
+
export { submitTransaction } from '../chunk-RDRDFJQE.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunkYYNIFO2A_js = require('../chunk-YYNIFO2A.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "trackTransaction", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkYYNIFO2A_js.trackTransaction; }
|
|
11
|
-
});
|
|
1
|
+
export { trackTransaction } from '../chunk-MGVXJ2U4.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var chunk2WHYWV4Y_js = require('../chunk-2WHYWV4Y.js');
|
|
4
|
-
require('../chunk-ASPVKNJ7.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "transactionStatus", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunk2WHYWV4Y_js.transactionStatus; }
|
|
11
|
-
});
|
|
1
|
+
export { transactionStatus } from '../chunk-33K6EESX.js';
|
|
2
|
+
import '../chunk-W6TBGBV3.js';
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var protoSigning = require('@cosmjs/proto-signing');
|
|
13
|
-
var sdkTs = require('@injectivelabs/sdk-ts');
|
|
14
|
-
var keys = require('cosmjs-types/cosmos/crypto/secp256k1/keys');
|
|
15
|
-
var amino = require('@cosmjs/amino');
|
|
1
|
+
import { chains, findFirstWorkingEndpoint } from './chunk-JTIHU43D.js';
|
|
2
|
+
import { ClientState } from './chunk-BRMONS6A.js';
|
|
3
|
+
import { accountFromAny, SigningStargateClient } from '@cosmjs/stargate';
|
|
4
|
+
import { assertDefinedAndNotNull } from '@cosmjs/utils';
|
|
5
|
+
import { BinaryWriter, BinaryReader } from 'cosmjs-types/binary';
|
|
6
|
+
import { BaseAccount } from 'cosmjs-types/cosmos/auth/v1beta1/auth';
|
|
7
|
+
import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin';
|
|
8
|
+
import { decodePubkey } from '@cosmjs/proto-signing';
|
|
9
|
+
import { accountEthParser } from '@injectivelabs/sdk-ts';
|
|
10
|
+
import { PubKey } from 'cosmjs-types/cosmos/crypto/secp256k1/keys';
|
|
11
|
+
import { encodeSecp256k1Pubkey } from '@cosmjs/amino';
|
|
16
12
|
|
|
17
13
|
var createBaseVestingAccount = () => {
|
|
18
14
|
return {
|
|
@@ -25,21 +21,21 @@ var createBaseVestingAccount = () => {
|
|
|
25
21
|
};
|
|
26
22
|
};
|
|
27
23
|
var BaseVestingAccount = {
|
|
28
|
-
encode(message, writer =
|
|
24
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
29
25
|
if (message.baseAccount !== void 0) {
|
|
30
|
-
|
|
26
|
+
BaseAccount.encode(
|
|
31
27
|
message.baseAccount,
|
|
32
28
|
writer.uint32(10).fork()
|
|
33
29
|
).ldelim();
|
|
34
30
|
}
|
|
35
31
|
for (const v of message.originalVesting) {
|
|
36
|
-
|
|
32
|
+
Coin.encode(v, writer.uint32(18).fork()).ldelim();
|
|
37
33
|
}
|
|
38
34
|
for (const v of message.delegatedFree) {
|
|
39
|
-
|
|
35
|
+
Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
40
36
|
}
|
|
41
37
|
for (const v of message.delegatedVesting) {
|
|
42
|
-
|
|
38
|
+
Coin.encode(v, writer.uint32(34).fork()).ldelim();
|
|
43
39
|
}
|
|
44
40
|
if (message.endTime !== BigInt(0)) {
|
|
45
41
|
writer.uint32(40).int64(message.endTime);
|
|
@@ -47,23 +43,23 @@ var BaseVestingAccount = {
|
|
|
47
43
|
return writer;
|
|
48
44
|
},
|
|
49
45
|
decode(input, length) {
|
|
50
|
-
const reader = input instanceof
|
|
46
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
51
47
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
52
48
|
const message = createBaseVestingAccount();
|
|
53
49
|
while (reader.pos < end) {
|
|
54
50
|
const tag = reader.uint32();
|
|
55
51
|
switch (tag >>> 3) {
|
|
56
52
|
case 1:
|
|
57
|
-
message.baseAccount =
|
|
53
|
+
message.baseAccount = BaseAccount.decode(reader, reader.uint32());
|
|
58
54
|
break;
|
|
59
55
|
case 2:
|
|
60
|
-
message.originalVesting.push(
|
|
56
|
+
message.originalVesting.push(Coin.decode(reader, reader.uint32()));
|
|
61
57
|
break;
|
|
62
58
|
case 3:
|
|
63
|
-
message.delegatedFree.push(
|
|
59
|
+
message.delegatedFree.push(Coin.decode(reader, reader.uint32()));
|
|
64
60
|
break;
|
|
65
61
|
case 4:
|
|
66
|
-
message.delegatedVesting.push(
|
|
62
|
+
message.delegatedVesting.push(Coin.decode(reader, reader.uint32()));
|
|
67
63
|
break;
|
|
68
64
|
case 5:
|
|
69
65
|
message.endTime = reader.int64();
|
|
@@ -85,7 +81,7 @@ function createBasePeriod() {
|
|
|
85
81
|
};
|
|
86
82
|
}
|
|
87
83
|
var Period = {
|
|
88
|
-
encode(message, writer =
|
|
84
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
89
85
|
if (message.startTime !== BigInt(0)) {
|
|
90
86
|
writer.uint32(8).int64(message.startTime);
|
|
91
87
|
}
|
|
@@ -93,7 +89,7 @@ var Period = {
|
|
|
93
89
|
writer.uint32(16).int64(message.length);
|
|
94
90
|
}
|
|
95
91
|
for (const v of message.amount) {
|
|
96
|
-
|
|
92
|
+
Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
97
93
|
}
|
|
98
94
|
if (message.actionType !== 0) {
|
|
99
95
|
writer.uint32(32).int32(message.actionType);
|
|
@@ -101,7 +97,7 @@ var Period = {
|
|
|
101
97
|
return writer;
|
|
102
98
|
},
|
|
103
99
|
decode(input, length) {
|
|
104
|
-
const reader = input instanceof
|
|
100
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
105
101
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
106
102
|
const message = createBasePeriod();
|
|
107
103
|
while (reader.pos < end) {
|
|
@@ -114,7 +110,7 @@ var Period = {
|
|
|
114
110
|
message.length = reader.int64();
|
|
115
111
|
break;
|
|
116
112
|
case 3:
|
|
117
|
-
message.amount.push(
|
|
113
|
+
message.amount.push(Coin.decode(reader, reader.uint32()));
|
|
118
114
|
break;
|
|
119
115
|
case 4:
|
|
120
116
|
message.actionType = reader.int32();
|
|
@@ -136,7 +132,7 @@ function createBaseStridePeriodicVestingAccount() {
|
|
|
136
132
|
};
|
|
137
133
|
}
|
|
138
134
|
var StridePeriodicVestingAccount = {
|
|
139
|
-
encode(message, writer =
|
|
135
|
+
encode(message, writer = BinaryWriter.create()) {
|
|
140
136
|
if (message.baseVestingAccount !== void 0) {
|
|
141
137
|
BaseVestingAccount.encode(
|
|
142
138
|
message.baseVestingAccount,
|
|
@@ -149,7 +145,7 @@ var StridePeriodicVestingAccount = {
|
|
|
149
145
|
return writer;
|
|
150
146
|
},
|
|
151
147
|
decode(input, length) {
|
|
152
|
-
const reader = input instanceof
|
|
148
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
153
149
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
154
150
|
const message = createBaseStridePeriodicVestingAccount();
|
|
155
151
|
while (reader.pos < end) {
|
|
@@ -173,33 +169,32 @@ var StridePeriodicVestingAccount = {
|
|
|
173
169
|
}
|
|
174
170
|
};
|
|
175
171
|
var accountParser = (acc) => {
|
|
176
|
-
var _a;
|
|
177
172
|
switch (acc.typeUrl) {
|
|
178
173
|
case "/stride.vesting.StridePeriodicVestingAccount": {
|
|
179
|
-
const baseAccount =
|
|
180
|
-
|
|
174
|
+
const baseAccount = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount?.baseAccount;
|
|
175
|
+
assertDefinedAndNotNull(baseAccount);
|
|
181
176
|
return {
|
|
182
177
|
address: baseAccount.address,
|
|
183
|
-
pubkey: baseAccount.pubKey ?
|
|
178
|
+
pubkey: baseAccount.pubKey ? decodePubkey(baseAccount.pubKey) : null,
|
|
184
179
|
accountNumber: Number(baseAccount.accountNumber),
|
|
185
180
|
sequence: Number(baseAccount.sequence)
|
|
186
181
|
};
|
|
187
182
|
}
|
|
188
183
|
case "/injective.types.v1beta1.EthAccount":
|
|
189
|
-
return
|
|
184
|
+
return accountEthParser(
|
|
190
185
|
acc,
|
|
191
186
|
"/injective.crypto.v1beta1.ethsecp256k1.PubKey"
|
|
192
187
|
);
|
|
193
188
|
case "/ethermint.types.v1.EthAccount":
|
|
194
|
-
return
|
|
189
|
+
return accountEthParser(acc, "/ethermint.crypto.v1.ethsecp256k1.PubKey");
|
|
195
190
|
default: {
|
|
196
191
|
if (acc.typeUrl === "/cosmos.auth.v1beta1.BaseAccount") {
|
|
197
|
-
const { address, pubKey, accountNumber, sequence } =
|
|
192
|
+
const { address, pubKey, accountNumber, sequence } = BaseAccount.decode(
|
|
198
193
|
acc.value
|
|
199
194
|
);
|
|
200
|
-
if (
|
|
201
|
-
const { key } =
|
|
202
|
-
const pk =
|
|
195
|
+
if (pubKey?.typeUrl === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
|
|
196
|
+
const { key } = PubKey.decode(pubKey.value);
|
|
197
|
+
const pk = encodeSecp256k1Pubkey(key);
|
|
203
198
|
return {
|
|
204
199
|
address,
|
|
205
200
|
pubkey: pk,
|
|
@@ -208,71 +203,67 @@ var accountParser = (acc) => {
|
|
|
208
203
|
};
|
|
209
204
|
}
|
|
210
205
|
}
|
|
211
|
-
return
|
|
206
|
+
return accountFromAny(acc);
|
|
212
207
|
}
|
|
213
208
|
}
|
|
214
209
|
};
|
|
215
210
|
|
|
216
211
|
// src/private-functions/getRpcEndpointForChain.ts
|
|
217
|
-
var getRpcEndpointForChain = (chainId) =>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return chunk6GJEXV5J_js.ClientState.endpointOptions.getRpcEndpointForChain(chainId);
|
|
212
|
+
var getRpcEndpointForChain = async (chainId) => {
|
|
213
|
+
if (ClientState.endpointOptions.getRpcEndpointForChain) {
|
|
214
|
+
return ClientState.endpointOptions.getRpcEndpointForChain(chainId);
|
|
221
215
|
}
|
|
222
|
-
if (
|
|
223
|
-
const endpointOptions =
|
|
224
|
-
if (endpointOptions
|
|
216
|
+
if (ClientState.endpointOptions.endpoints && ClientState.endpointOptions.endpoints[chainId]) {
|
|
217
|
+
const endpointOptions = ClientState.endpointOptions.endpoints[chainId];
|
|
218
|
+
if (endpointOptions?.rpc) {
|
|
225
219
|
return endpointOptions.rpc;
|
|
226
220
|
}
|
|
227
221
|
}
|
|
228
222
|
console.warn(
|
|
229
223
|
"Warning: You are using unreliable public endpoints. We strongly recommend overriding them via endpointOptions for use beyond development settings."
|
|
230
224
|
);
|
|
231
|
-
const chain =
|
|
225
|
+
const chain = chains().find((chain2) => chain2.chain_id === chainId);
|
|
232
226
|
if (!chain) {
|
|
233
227
|
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
234
228
|
}
|
|
235
|
-
if (
|
|
229
|
+
if (chain.apis?.rpc?.length === 0 || !chain.apis?.rpc) {
|
|
236
230
|
throw new Error(
|
|
237
231
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
238
232
|
);
|
|
239
233
|
}
|
|
240
|
-
const endpoints =
|
|
241
|
-
const endpoint =
|
|
234
|
+
const endpoints = chain.apis?.rpc?.map((api) => api.address);
|
|
235
|
+
const endpoint = await findFirstWorkingEndpoint(endpoints, "rpc");
|
|
242
236
|
if (!endpoint) {
|
|
243
237
|
throw new Error(
|
|
244
238
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
245
239
|
);
|
|
246
240
|
}
|
|
247
241
|
return endpoint;
|
|
248
|
-
}
|
|
242
|
+
};
|
|
249
243
|
|
|
250
244
|
// src/public-functions/getSigningStargateClient.ts
|
|
251
|
-
var getSigningStargateClient =
|
|
245
|
+
var getSigningStargateClient = async ({
|
|
252
246
|
chainId,
|
|
253
247
|
getOfflineSigner
|
|
254
|
-
}) {
|
|
255
|
-
var _a;
|
|
248
|
+
}) => {
|
|
256
249
|
if (!getOfflineSigner) {
|
|
257
250
|
throw new Error("'getCosmosSigner' is not provided or configured in skip router");
|
|
258
251
|
}
|
|
259
|
-
if (!
|
|
260
|
-
const [signer, endpoint] =
|
|
252
|
+
if (!ClientState.signingStargateClientByChainId?.[chainId]) {
|
|
253
|
+
const [signer, endpoint] = await Promise.all([
|
|
261
254
|
getOfflineSigner(chainId),
|
|
262
255
|
getRpcEndpointForChain(chainId)
|
|
263
256
|
]);
|
|
264
|
-
|
|
265
|
-
aminoTypes:
|
|
266
|
-
registry:
|
|
257
|
+
ClientState.signingStargateClientByChainId[chainId] = await SigningStargateClient.connectWithSigner(endpoint, signer, {
|
|
258
|
+
aminoTypes: ClientState.aminoTypes,
|
|
259
|
+
registry: ClientState.registry,
|
|
267
260
|
accountParser
|
|
268
261
|
});
|
|
269
262
|
}
|
|
270
263
|
return {
|
|
271
|
-
stargateClient:
|
|
272
|
-
signer:
|
|
264
|
+
stargateClient: ClientState.signingStargateClientByChainId[chainId],
|
|
265
|
+
signer: await getOfflineSigner(chainId)
|
|
273
266
|
};
|
|
274
|
-
}
|
|
267
|
+
};
|
|
275
268
|
|
|
276
|
-
|
|
277
|
-
exports.getRpcEndpointForChain = getRpcEndpointForChain;
|
|
278
|
-
exports.getSigningStargateClient = getSigningStargateClient;
|
|
269
|
+
export { accountParser, getRpcEndpointForChain, getSigningStargateClient };
|