@skip-go/client 1.0.0 → 1.0.1-alpha-0
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.cjs +15 -0
- package/dist/api/{getAssets.d.mts → getAssets.d.cts} +2 -2
- package/dist/api/getAssets.d.ts +19 -0
- package/dist/api/getAssets.js +2 -0
- package/dist/api/getAssetsBetweenChains.cjs +11 -0
- package/dist/api/{getAssetsBetweenChains.d.mts → getAssetsBetweenChains.d.cts} +2 -2
- package/dist/api/getAssetsBetweenChains.d.ts +56 -0
- package/dist/api/getAssetsBetweenChains.js +2 -0
- package/dist/api/getBridges.cjs +11 -0
- package/dist/api/{getBridges.d.mts → getBridges.d.cts} +2 -2
- package/dist/api/getBridges.d.ts +54 -0
- package/dist/api/getBridges.js +2 -0
- package/dist/api/getChains.cjs +11 -0
- package/dist/api/{getChains.d.mts → getChains.d.cts} +2 -2
- package/dist/api/getChains.d.ts +41 -0
- package/dist/api/getChains.js +2 -0
- package/dist/api/getVenues.cjs +11 -0
- package/dist/api/{getVenues.d.mts → getVenues.d.cts} +1 -1
- package/dist/api/getVenues.d.ts +13 -0
- package/dist/api/getVenues.js +2 -0
- package/dist/api/postAssetsFromSource.cjs +12 -0
- package/dist/api/{postAssetsFromSource.d.mts → postAssetsFromSource.d.cts} +2 -2
- package/dist/api/postAssetsFromSource.d.ts +13 -0
- package/dist/api/postAssetsFromSource.js +3 -0
- package/dist/api/postBalances.cjs +11 -0
- package/dist/api/{postBalances.d.mts → postBalances.d.cts} +3 -3
- package/dist/api/postBalances.d.ts +35 -0
- package/dist/api/postBalances.js +2 -0
- package/dist/api/postIbcOriginAssets.cjs +11 -0
- package/dist/api/{postIbcOriginAssets.d.mts → postIbcOriginAssets.d.cts} +1 -1
- package/dist/api/postIbcOriginAssets.d.ts +32 -0
- package/dist/api/postIbcOriginAssets.js +2 -0
- package/dist/api/postMessages.cjs +11 -0
- package/dist/api/{postMessages.d.mts → postMessages.d.cts} +3 -3
- package/dist/api/postMessages.d.ts +528 -0
- package/dist/api/postMessages.js +2 -0
- package/dist/api/postMessagesDirect.cjs +11 -0
- package/dist/api/{postMessagesDirect.d.mts → postMessagesDirect.d.cts} +2 -2
- package/dist/api/postMessagesDirect.d.ts +568 -0
- package/dist/api/postMessagesDirect.js +2 -0
- package/dist/api/postRecommendAssets.cjs +11 -0
- package/dist/api/{postRecommendAssets.d.mts → postRecommendAssets.d.cts} +2 -2
- package/dist/api/postRecommendAssets.d.ts +40 -0
- package/dist/api/postRecommendAssets.js +2 -0
- package/dist/api/postRoute.cjs +11 -0
- package/dist/api/{postRoute.d.mts → postRoute.d.cts} +3 -3
- package/dist/api/postRoute.d.ts +460 -0
- package/dist/api/postRoute.js +2 -0
- package/dist/api/postSubmitTransaction.cjs +11 -0
- package/dist/api/{postSubmitTransaction.d.mts → postSubmitTransaction.d.cts} +1 -1
- package/dist/api/postSubmitTransaction.d.ts +13 -0
- package/dist/api/postSubmitTransaction.js +2 -0
- package/dist/api/postTrackTransaction.cjs +11 -0
- package/dist/api/{postTrackTransaction.d.mts → postTrackTransaction.d.cts} +1 -1
- package/dist/api/postTrackTransaction.d.ts +13 -0
- package/dist/api/postTrackTransaction.js +2 -0
- package/dist/api/postTransactionStatus.cjs +11 -0
- package/dist/api/{postTransactionStatus.d.mts → postTransactionStatus.d.cts} +3 -3
- package/dist/api/postTransactionStatus.d.ts +559 -0
- package/dist/api/postTransactionStatus.js +2 -0
- package/dist/apiState-CdzxTxYd.d.ts +6 -0
- package/dist/chunk-32MRDO7V.cjs +12 -0
- package/dist/{chunk-C5CGY2X7.mjs → chunk-33K6EESX.js} +1 -1
- package/dist/{chunk-ZMEQSFOL.mjs → chunk-3N7XVGLX.js} +18 -23
- package/dist/{chunk-OTLFF5OB.mjs → chunk-3OZQ35X3.js} +101 -138
- package/dist/chunk-44PBLFB5.cjs +24 -0
- package/dist/{chunk-7TBBV2YY.mjs → chunk-4JJWOILI.js} +1 -1
- package/dist/chunk-4R6OCWRR.cjs +1346 -0
- package/dist/chunk-5IAEEEOQ.cjs +2251 -0
- package/dist/chunk-77ITCT75.cjs +15 -0
- package/dist/chunk-7OIZPQJB.cjs +3660 -0
- package/dist/chunk-7SK3IFXJ.cjs +188 -0
- package/dist/{chunk-QZ3X6MP3.mjs → chunk-BQTQJQ5E.js} +1 -1
- package/dist/{chunk-IHIJJNTV.mjs → chunk-BRJDNGYH.js} +6 -7
- package/dist/chunk-BRMONS6A.js +130 -0
- package/dist/{chunk-NNZFCKHP.mjs → chunk-C2EDPY6J.js} +1 -1
- package/dist/chunk-DAMZSSOH.cjs +12 -0
- package/dist/{chunk-KPK3Z6QZ.mjs → chunk-DW4U6YI6.js} +1 -1
- package/dist/chunk-ED2OY55G.cjs +136 -0
- package/dist/chunk-GARVPN2H.js +16 -0
- package/dist/chunk-HAR3IXDE.cjs +705 -0
- package/dist/chunk-ISHM4QWP.cjs +16 -0
- package/dist/chunk-J4LI33TK.cjs +95 -0
- package/dist/{chunk-NU7MCJOK.mjs → chunk-JTIHU43D.js} +32 -36
- package/dist/chunk-KDN7RCGP.cjs +13 -0
- package/dist/{chunk-J7GGREYX.mjs → chunk-KNV72XRZ.js} +1 -1
- package/dist/chunk-KZOSEIWH.cjs +10 -0
- package/dist/chunk-L5V5PASH.cjs +12 -0
- package/dist/chunk-LXYLWTNZ.cjs +12 -0
- package/dist/{chunk-CAAR7GDJ.mjs → chunk-MGVXJ2U4.js} +1 -1
- package/dist/{chunk-IGD32L7C.mjs → chunk-MTMPHY3Y.js} +1 -1
- package/dist/chunk-PNWIJSMA.cjs +12 -0
- package/dist/{chunk-CZ27FEZ7.mjs → chunk-PRQ2NHRZ.js} +1 -1
- package/dist/chunk-RDOSNDAQ.cjs +13 -0
- package/dist/{chunk-LJVI5DLG.mjs → chunk-RDRDFJQE.js} +1 -1
- package/dist/{chunk-YWYU6P7W.mjs → chunk-RMP3HM5N.js} +2 -2
- package/dist/chunk-SFMBRLUS.cjs +18 -0
- package/dist/{chunk-DZQJN6OX.mjs → chunk-SQGWZAUC.js} +76 -86
- package/dist/chunk-SW3SEQMJ.cjs +273 -0
- package/dist/{chunk-2ETF4N4H.mjs → chunk-TW77BXMT.js} +4 -5
- package/dist/chunk-URLFWBSC.cjs +11 -0
- package/dist/chunk-VI7UMBQ7.cjs +12 -0
- package/dist/{chunk-2F4MBSMT.mjs → chunk-VMPFHQ7U.js} +14 -20
- package/dist/chunk-W2U2UOFA.js +1790 -0
- package/dist/chunk-W6TBGBV3.js +675 -0
- package/dist/chunk-WWNTHZ6I.cjs +1812 -0
- package/dist/chunk-ZNXE6PUV.cjs +46 -0
- package/dist/{client-types-CVch1pZ-.d.mts → client-types-CxjtffyG.d.ts} +1 -1
- package/dist/client-types-qvyKvyFh.d.cts +60 -0
- package/dist/{executeRoute-CRdeEz1o.d.mts → executeRoute-BKRpODCc.d.cts} +3 -3
- package/dist/executeRoute-BKvMVd1I.d.ts +69 -0
- package/dist/{generateApi-3mHZ6Zbr.d.mts → generateApi-C0amiydg.d.cts} +1 -1
- package/dist/generateApi-DqCp36fX.d.ts +22 -0
- package/dist/index.cjs +209 -0
- package/dist/{index.d.mts → index.d.cts} +25 -27
- package/dist/index.d.ts +35 -0
- package/dist/index.js +24 -0
- package/dist/public-functions/executeRoute.cjs +21 -0
- package/dist/public-functions/{executeRoute.d.mts → executeRoute.d.cts} +4 -4
- package/dist/public-functions/executeRoute.d.ts +9 -0
- package/dist/public-functions/executeRoute.js +12 -0
- package/dist/public-functions/getFeeInfoForChain.cjs +14 -0
- package/dist/public-functions/{getFeeInfoForChain.d.mts → getFeeInfoForChain.d.cts} +2 -2
- package/dist/public-functions/getFeeInfoForChain.d.ts +9 -0
- package/dist/public-functions/getFeeInfoForChain.js +5 -0
- package/dist/public-functions/getRecommendedGasPrice.cjs +16 -0
- package/dist/public-functions/{getRecommendedGasPrice.d.mts → getRecommendedGasPrice.d.cts} +2 -2
- package/dist/public-functions/getRecommendedGasPrice.d.ts +9 -0
- package/dist/public-functions/getRecommendedGasPrice.js +7 -0
- package/dist/public-functions/getSigningStargateClient.cjs +13 -0
- package/dist/public-functions/{getSigningStargateClient.d.mts → getSigningStargateClient.d.cts} +1 -1
- package/dist/public-functions/getSigningStargateClient.d.ts +13 -0
- package/dist/public-functions/getSigningStargateClient.js +4 -0
- package/dist/public-functions/setApiOptions.cjs +11 -0
- package/dist/public-functions/{setApiOptions.d.mts → setApiOptions.d.cts} +2 -2
- package/dist/public-functions/setApiOptions.d.ts +9 -0
- package/dist/public-functions/setApiOptions.js +2 -0
- package/dist/public-functions/setClientOptions.cjs +13 -0
- package/dist/public-functions/setClientOptions.d.cts +9 -0
- package/dist/public-functions/setClientOptions.d.ts +9 -0
- package/dist/public-functions/setClientOptions.js +4 -0
- package/dist/{setClientOptions-CVB_OUIn.d.mts → setClientOptions-CT6CHI9I.d.cts} +2 -2
- package/dist/setClientOptions-DbanEIwL.d.ts +19 -0
- package/dist/swaggerTypes-O9-gvCT1.d.ts +1890 -0
- package/package.json +12 -3
- package/dist/api/getAssets.mjs +0 -2
- package/dist/api/getAssetsBetweenChains.mjs +0 -2
- package/dist/api/getBridges.mjs +0 -2
- package/dist/api/getChains.mjs +0 -2
- package/dist/api/getVenues.mjs +0 -2
- package/dist/api/postAssetsFromSource.mjs +0 -3
- package/dist/api/postBalances.mjs +0 -2
- package/dist/api/postIbcOriginAssets.mjs +0 -2
- package/dist/api/postMessages.mjs +0 -2
- package/dist/api/postMessagesDirect.mjs +0 -2
- package/dist/api/postRecommendAssets.mjs +0 -2
- package/dist/api/postRoute.mjs +0 -2
- package/dist/api/postSubmitTransaction.mjs +0 -2
- package/dist/api/postTrackTransaction.mjs +0 -2
- package/dist/api/postTransactionStatus.mjs +0 -2
- package/dist/chunk-2FYLP573.mjs +0 -15
- package/dist/chunk-DKIWPD5I.mjs +0 -124
- package/dist/chunk-I2MX24LT.mjs +0 -2316
- package/dist/chunk-RXWDHQLG.mjs +0 -231
- package/dist/index.mjs +0 -24
- package/dist/public-functions/executeRoute.mjs +0 -12
- package/dist/public-functions/getFeeInfoForChain.mjs +0 -5
- package/dist/public-functions/getRecommendedGasPrice.mjs +0 -7
- package/dist/public-functions/getSigningStargateClient.mjs +0 -4
- package/dist/public-functions/setApiOptions.mjs +0 -2
- package/dist/public-functions/setClientOptions.d.mts +0 -9
- package/dist/public-functions/setClientOptions.mjs +0 -4
- /package/dist/{apiState-CdzxTxYd.d.mts → apiState-CdzxTxYd.d.cts} +0 -0
- /package/dist/{chunk-ZAF3Z56R.mjs → chunk-SWYON2RG.js} +0 -0
- /package/dist/{chunk-TUBI6VE6.mjs → chunk-VQ5SIQWU.js} +0 -0
- /package/dist/{swaggerTypes-O9-gvCT1.d.mts → swaggerTypes-O9-gvCT1.d.cts} +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk7SK3IFXJ_cjs = require('./chunk-7SK3IFXJ.cjs');
|
|
4
|
+
var chunkED2OY55G_cjs = require('./chunk-ED2OY55G.cjs');
|
|
5
|
+
var stargate = require('@cosmjs/stargate');
|
|
6
|
+
var utils = require('@cosmjs/utils');
|
|
7
|
+
var binary = require('cosmjs-types/binary');
|
|
8
|
+
var auth = require('cosmjs-types/cosmos/auth/v1beta1/auth');
|
|
9
|
+
var coin = require('cosmjs-types/cosmos/base/v1beta1/coin');
|
|
10
|
+
var protoSigning = require('@cosmjs/proto-signing');
|
|
11
|
+
var sdkTs = require('@injectivelabs/sdk-ts');
|
|
12
|
+
var keys = require('cosmjs-types/cosmos/crypto/secp256k1/keys');
|
|
13
|
+
var amino = require('@cosmjs/amino');
|
|
14
|
+
|
|
15
|
+
var createBaseVestingAccount = () => {
|
|
16
|
+
return {
|
|
17
|
+
// @ts-expect-error
|
|
18
|
+
baseAccount: void 0,
|
|
19
|
+
originalVesting: [],
|
|
20
|
+
delegatedFree: [],
|
|
21
|
+
delegatedVesting: [],
|
|
22
|
+
endTime: BigInt(0)
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
var BaseVestingAccount = {
|
|
26
|
+
encode(message, writer = binary.BinaryWriter.create()) {
|
|
27
|
+
if (message.baseAccount !== void 0) {
|
|
28
|
+
auth.BaseAccount.encode(
|
|
29
|
+
message.baseAccount,
|
|
30
|
+
writer.uint32(10).fork()
|
|
31
|
+
).ldelim();
|
|
32
|
+
}
|
|
33
|
+
for (const v of message.originalVesting) {
|
|
34
|
+
coin.Coin.encode(v, writer.uint32(18).fork()).ldelim();
|
|
35
|
+
}
|
|
36
|
+
for (const v of message.delegatedFree) {
|
|
37
|
+
coin.Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
38
|
+
}
|
|
39
|
+
for (const v of message.delegatedVesting) {
|
|
40
|
+
coin.Coin.encode(v, writer.uint32(34).fork()).ldelim();
|
|
41
|
+
}
|
|
42
|
+
if (message.endTime !== BigInt(0)) {
|
|
43
|
+
writer.uint32(40).int64(message.endTime);
|
|
44
|
+
}
|
|
45
|
+
return writer;
|
|
46
|
+
},
|
|
47
|
+
decode(input, length) {
|
|
48
|
+
const reader = input instanceof binary.BinaryReader ? input : new binary.BinaryReader(input);
|
|
49
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
50
|
+
const message = createBaseVestingAccount();
|
|
51
|
+
while (reader.pos < end) {
|
|
52
|
+
const tag = reader.uint32();
|
|
53
|
+
switch (tag >>> 3) {
|
|
54
|
+
case 1:
|
|
55
|
+
message.baseAccount = auth.BaseAccount.decode(reader, reader.uint32());
|
|
56
|
+
break;
|
|
57
|
+
case 2:
|
|
58
|
+
message.originalVesting.push(coin.Coin.decode(reader, reader.uint32()));
|
|
59
|
+
break;
|
|
60
|
+
case 3:
|
|
61
|
+
message.delegatedFree.push(coin.Coin.decode(reader, reader.uint32()));
|
|
62
|
+
break;
|
|
63
|
+
case 4:
|
|
64
|
+
message.delegatedVesting.push(coin.Coin.decode(reader, reader.uint32()));
|
|
65
|
+
break;
|
|
66
|
+
case 5:
|
|
67
|
+
message.endTime = reader.int64();
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
reader.skipType(tag & 7);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return message;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function createBasePeriod() {
|
|
78
|
+
return {
|
|
79
|
+
startTime: BigInt(0),
|
|
80
|
+
length: BigInt(0),
|
|
81
|
+
amount: [],
|
|
82
|
+
actionType: 0
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
var Period = {
|
|
86
|
+
encode(message, writer = binary.BinaryWriter.create()) {
|
|
87
|
+
if (message.startTime !== BigInt(0)) {
|
|
88
|
+
writer.uint32(8).int64(message.startTime);
|
|
89
|
+
}
|
|
90
|
+
if (message.length !== BigInt(0)) {
|
|
91
|
+
writer.uint32(16).int64(message.length);
|
|
92
|
+
}
|
|
93
|
+
for (const v of message.amount) {
|
|
94
|
+
coin.Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
95
|
+
}
|
|
96
|
+
if (message.actionType !== 0) {
|
|
97
|
+
writer.uint32(32).int32(message.actionType);
|
|
98
|
+
}
|
|
99
|
+
return writer;
|
|
100
|
+
},
|
|
101
|
+
decode(input, length) {
|
|
102
|
+
const reader = input instanceof binary.BinaryReader ? input : new binary.BinaryReader(input);
|
|
103
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
104
|
+
const message = createBasePeriod();
|
|
105
|
+
while (reader.pos < end) {
|
|
106
|
+
const tag = reader.uint32();
|
|
107
|
+
switch (tag >>> 3) {
|
|
108
|
+
case 1:
|
|
109
|
+
message.startTime = reader.int64();
|
|
110
|
+
break;
|
|
111
|
+
case 2:
|
|
112
|
+
message.length = reader.int64();
|
|
113
|
+
break;
|
|
114
|
+
case 3:
|
|
115
|
+
message.amount.push(coin.Coin.decode(reader, reader.uint32()));
|
|
116
|
+
break;
|
|
117
|
+
case 4:
|
|
118
|
+
message.actionType = reader.int32();
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
reader.skipType(tag & 7);
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return message;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
function createBaseStridePeriodicVestingAccount() {
|
|
129
|
+
return {
|
|
130
|
+
//eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
131
|
+
//@ts-ignore
|
|
132
|
+
baseVestingAccount: void 0,
|
|
133
|
+
vestingPeriods: []
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
var StridePeriodicVestingAccount = {
|
|
137
|
+
encode(message, writer = binary.BinaryWriter.create()) {
|
|
138
|
+
if (message.baseVestingAccount !== void 0) {
|
|
139
|
+
BaseVestingAccount.encode(
|
|
140
|
+
message.baseVestingAccount,
|
|
141
|
+
writer.uint32(10).fork()
|
|
142
|
+
).ldelim();
|
|
143
|
+
}
|
|
144
|
+
for (const v of message.vestingPeriods) {
|
|
145
|
+
Period.encode(v, writer.uint32(26).fork()).ldelim();
|
|
146
|
+
}
|
|
147
|
+
return writer;
|
|
148
|
+
},
|
|
149
|
+
decode(input, length) {
|
|
150
|
+
const reader = input instanceof binary.BinaryReader ? input : new binary.BinaryReader(input);
|
|
151
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
152
|
+
const message = createBaseStridePeriodicVestingAccount();
|
|
153
|
+
while (reader.pos < end) {
|
|
154
|
+
const tag = reader.uint32();
|
|
155
|
+
switch (tag >>> 3) {
|
|
156
|
+
case 1:
|
|
157
|
+
message.baseVestingAccount = BaseVestingAccount.decode(
|
|
158
|
+
reader,
|
|
159
|
+
reader.uint32()
|
|
160
|
+
);
|
|
161
|
+
break;
|
|
162
|
+
case 3:
|
|
163
|
+
message.vestingPeriods.push(Period.decode(reader, reader.uint32()));
|
|
164
|
+
break;
|
|
165
|
+
default:
|
|
166
|
+
reader.skipType(tag & 7);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return message;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
var accountParser = (acc) => {
|
|
174
|
+
switch (acc.typeUrl) {
|
|
175
|
+
case "/stride.vesting.StridePeriodicVestingAccount": {
|
|
176
|
+
const baseAccount = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount?.baseAccount;
|
|
177
|
+
utils.assertDefinedAndNotNull(baseAccount);
|
|
178
|
+
return {
|
|
179
|
+
address: baseAccount.address,
|
|
180
|
+
pubkey: baseAccount.pubKey ? protoSigning.decodePubkey(baseAccount.pubKey) : null,
|
|
181
|
+
accountNumber: Number(baseAccount.accountNumber),
|
|
182
|
+
sequence: Number(baseAccount.sequence)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
case "/injective.types.v1beta1.EthAccount":
|
|
186
|
+
return sdkTs.accountEthParser(
|
|
187
|
+
acc,
|
|
188
|
+
"/injective.crypto.v1beta1.ethsecp256k1.PubKey"
|
|
189
|
+
);
|
|
190
|
+
case "/ethermint.types.v1.EthAccount":
|
|
191
|
+
return sdkTs.accountEthParser(acc, "/ethermint.crypto.v1.ethsecp256k1.PubKey");
|
|
192
|
+
default: {
|
|
193
|
+
if (acc.typeUrl === "/cosmos.auth.v1beta1.BaseAccount") {
|
|
194
|
+
const { address, pubKey, accountNumber, sequence } = auth.BaseAccount.decode(
|
|
195
|
+
acc.value
|
|
196
|
+
);
|
|
197
|
+
if (pubKey?.typeUrl === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
|
|
198
|
+
const { key } = keys.PubKey.decode(pubKey.value);
|
|
199
|
+
const pk = amino.encodeSecp256k1Pubkey(key);
|
|
200
|
+
return {
|
|
201
|
+
address,
|
|
202
|
+
pubkey: pk,
|
|
203
|
+
accountNumber: Number(accountNumber),
|
|
204
|
+
sequence: Number(sequence)
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return stargate.accountFromAny(acc);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/private-functions/getRpcEndpointForChain.ts
|
|
214
|
+
var getRpcEndpointForChain = async (chainId) => {
|
|
215
|
+
if (chunkED2OY55G_cjs.ClientState.endpointOptions.getRpcEndpointForChain) {
|
|
216
|
+
return chunkED2OY55G_cjs.ClientState.endpointOptions.getRpcEndpointForChain(chainId);
|
|
217
|
+
}
|
|
218
|
+
if (chunkED2OY55G_cjs.ClientState.endpointOptions.endpoints && chunkED2OY55G_cjs.ClientState.endpointOptions.endpoints[chainId]) {
|
|
219
|
+
const endpointOptions = chunkED2OY55G_cjs.ClientState.endpointOptions.endpoints[chainId];
|
|
220
|
+
if (endpointOptions?.rpc) {
|
|
221
|
+
return endpointOptions.rpc;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
console.warn(
|
|
225
|
+
"Warning: You are using unreliable public endpoints. We strongly recommend overriding them via endpointOptions for use beyond development settings."
|
|
226
|
+
);
|
|
227
|
+
const chain = chunk7SK3IFXJ_cjs.chains().find((chain2) => chain2.chain_id === chainId);
|
|
228
|
+
if (!chain) {
|
|
229
|
+
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
230
|
+
}
|
|
231
|
+
if (chain.apis?.rpc?.length === 0 || !chain.apis?.rpc) {
|
|
232
|
+
throw new Error(
|
|
233
|
+
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
const endpoints = chain.apis?.rpc?.map((api) => api.address);
|
|
237
|
+
const endpoint = await chunk7SK3IFXJ_cjs.findFirstWorkingEndpoint(endpoints, "rpc");
|
|
238
|
+
if (!endpoint) {
|
|
239
|
+
throw new Error(
|
|
240
|
+
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
return endpoint;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// src/public-functions/getSigningStargateClient.ts
|
|
247
|
+
var getSigningStargateClient = async ({
|
|
248
|
+
chainId,
|
|
249
|
+
getOfflineSigner
|
|
250
|
+
}) => {
|
|
251
|
+
if (!getOfflineSigner) {
|
|
252
|
+
throw new Error("'getCosmosSigner' is not provided or configured in skip router");
|
|
253
|
+
}
|
|
254
|
+
if (!chunkED2OY55G_cjs.ClientState.signingStargateClientByChainId?.[chainId]) {
|
|
255
|
+
const [signer, endpoint] = await Promise.all([
|
|
256
|
+
getOfflineSigner(chainId),
|
|
257
|
+
getRpcEndpointForChain(chainId)
|
|
258
|
+
]);
|
|
259
|
+
chunkED2OY55G_cjs.ClientState.signingStargateClientByChainId[chainId] = await stargate.SigningStargateClient.connectWithSigner(endpoint, signer, {
|
|
260
|
+
aminoTypes: chunkED2OY55G_cjs.ClientState.aminoTypes,
|
|
261
|
+
registry: chunkED2OY55G_cjs.ClientState.registry,
|
|
262
|
+
accountParser
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
stargateClient: chunkED2OY55G_cjs.ClientState.signingStargateClientByChainId[chainId],
|
|
267
|
+
signer: await getOfflineSigner(chainId)
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
exports.accountParser = accountParser;
|
|
272
|
+
exports.getRpcEndpointForChain = getRpcEndpointForChain;
|
|
273
|
+
exports.getSigningStargateClient = getSigningStargateClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiState, createRequestClient } from './chunk-
|
|
1
|
+
import { ApiState, createRequestClient } from './chunk-W6TBGBV3.js';
|
|
2
2
|
|
|
3
3
|
// src/public-functions/setApiOptions.ts
|
|
4
4
|
var setApiOptions = (options = {}) => {
|
|
@@ -14,9 +14,8 @@ var setApiOptions = (options = {}) => {
|
|
|
14
14
|
return ApiState.clientInitialized;
|
|
15
15
|
};
|
|
16
16
|
function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
17
|
-
var _a;
|
|
18
17
|
const affiliatesArray = Object.values(chainIdsToAffiliates).map((chain) => chain.affiliates).filter((a) => a !== void 0);
|
|
19
|
-
const firstAffiliateBasisPointsFee =
|
|
18
|
+
const firstAffiliateBasisPointsFee = affiliatesArray[0]?.reduce((acc, affiliate) => {
|
|
20
19
|
if (!affiliate.basisPointsFee) {
|
|
21
20
|
throw new Error("basisPointFee must exist in each affiliate");
|
|
22
21
|
}
|
|
@@ -30,7 +29,7 @@ function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
|
30
29
|
if (!affiliate2.address) {
|
|
31
30
|
throw new Error("address to receive fee must exist in each affiliate");
|
|
32
31
|
}
|
|
33
|
-
return acc + parseInt(affiliate2
|
|
32
|
+
return acc + parseInt(affiliate2?.basisPointsFee, 10);
|
|
34
33
|
}, 0);
|
|
35
34
|
return totalBasisPointsFee === firstAffiliateBasisPointsFee;
|
|
36
35
|
});
|
|
@@ -39,7 +38,7 @@ function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
|
39
38
|
"basisPointFee does not add up to the same number for each chain in chainIdsToAffiliates"
|
|
40
39
|
);
|
|
41
40
|
}
|
|
42
|
-
return firstAffiliateBasisPointsFee
|
|
41
|
+
return firstAffiliateBasisPointsFee?.toFixed(0);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
export { setApiOptions };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHAR3IXDE_cjs = require('./chunk-HAR3IXDE.cjs');
|
|
4
|
+
|
|
5
|
+
// src/api/getAssetsBetweenChains.ts
|
|
6
|
+
var assetsBetweenChains = chunkHAR3IXDE_cjs.api({
|
|
7
|
+
methodName: "fungibleAssetsBetweenChainsCreate",
|
|
8
|
+
path: "/v2/fungible/assets_between_chains"
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
exports.assetsBetweenChains = assetsBetweenChains;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHAR3IXDE_cjs = require('./chunk-HAR3IXDE.cjs');
|
|
4
|
+
|
|
5
|
+
// src/api/getBridges.ts
|
|
6
|
+
var bridges = chunkHAR3IXDE_cjs.api({
|
|
7
|
+
methodName: "getBridges",
|
|
8
|
+
path: "/v2/info/bridges",
|
|
9
|
+
transformResponse: (response) => response.bridges
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
exports.bridges = bridges;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { DEFAULT_GAS_DENOM_OVERRIDES } from './chunk-
|
|
2
|
-
import { chains } from './chunk-
|
|
3
|
-
import { ClientState } from './chunk-
|
|
4
|
-
import { __async } from './chunk-RXWDHQLG.mjs';
|
|
1
|
+
import { DEFAULT_GAS_DENOM_OVERRIDES } from './chunk-SWYON2RG.js';
|
|
2
|
+
import { chains } from './chunk-JTIHU43D.js';
|
|
3
|
+
import { ClientState } from './chunk-BRMONS6A.js';
|
|
5
4
|
|
|
6
5
|
// src/private-functions/getDefaultGasTokenForChain.ts
|
|
7
|
-
var getDefaultGasTokenForChain = (chainId) =>
|
|
8
|
-
var _a;
|
|
6
|
+
var getDefaultGasTokenForChain = async (chainId) => {
|
|
9
7
|
const gasDenom = DEFAULT_GAS_DENOM_OVERRIDES[chainId];
|
|
10
8
|
if (gasDenom) {
|
|
11
9
|
return gasDenom;
|
|
@@ -20,10 +18,7 @@ var getDefaultGasTokenForChain = (chainId) => __async(void 0, null, function* ()
|
|
|
20
18
|
const stakingTokens = getStakingTokensForChain(chainId);
|
|
21
19
|
if (stakingTokens && stakingTokens.length > 0) {
|
|
22
20
|
const feeAsset = chain.fees.fee_tokens.find(
|
|
23
|
-
(feeToken) =>
|
|
24
|
-
var _a2;
|
|
25
|
-
return feeToken.denom === ((_a2 = stakingTokens[0]) == null ? void 0 : _a2.denom);
|
|
26
|
-
}
|
|
21
|
+
(feeToken) => feeToken.denom === stakingTokens[0]?.denom
|
|
27
22
|
);
|
|
28
23
|
if (feeAsset) {
|
|
29
24
|
return feeAsset.denom;
|
|
@@ -39,8 +34,8 @@ var getDefaultGasTokenForChain = (chainId) => __async(void 0, null, function* ()
|
|
|
39
34
|
if (nonL2Asset) {
|
|
40
35
|
return nonL2Asset.denom;
|
|
41
36
|
}
|
|
42
|
-
return
|
|
43
|
-
}
|
|
37
|
+
return chain.fees.fee_tokens[0]?.denom;
|
|
38
|
+
};
|
|
44
39
|
var getStakingTokensForChain = (chainId) => {
|
|
45
40
|
const chain = chains().find((chain2) => chain2.chain_id === chainId);
|
|
46
41
|
if (!chain) {
|
|
@@ -55,20 +50,19 @@ var getStakingTokensForChain = (chainId) => {
|
|
|
55
50
|
};
|
|
56
51
|
|
|
57
52
|
// src/public-functions/getFeeInfoForChain.ts
|
|
58
|
-
var getFeeInfoForChain =
|
|
59
|
-
|
|
60
|
-
const skipChains = yield ClientState.getSkipChains({ apiUrl, apiKey });
|
|
53
|
+
var getFeeInfoForChain = async ({ chainId, apiUrl, apiKey }) => {
|
|
54
|
+
const skipChains = await ClientState.getSkipChains({ apiUrl, apiKey });
|
|
61
55
|
const skipChain = skipChains.find((chain2) => chain2.chainId === chainId);
|
|
62
56
|
if (!skipChain) {
|
|
63
57
|
return void 0;
|
|
64
58
|
}
|
|
65
|
-
const defaultGasToken =
|
|
59
|
+
const defaultGasToken = await getDefaultGasTokenForChain(chainId);
|
|
66
60
|
if (!defaultGasToken && !skipChain.feeAssets) {
|
|
67
61
|
return void 0;
|
|
68
62
|
}
|
|
69
|
-
const skipFeeInfo = defaultGasToken ?
|
|
70
|
-
if (!skipFeeInfo &&
|
|
71
|
-
return
|
|
63
|
+
const skipFeeInfo = defaultGasToken ? skipChain.feeAssets?.find((skipFee) => skipFee.denom === defaultGasToken) : skipChain.feeAssets?.[0];
|
|
64
|
+
if (!skipFeeInfo && skipChain.feeAssets?.[0]?.gasPrice !== null) {
|
|
65
|
+
return skipChain.feeAssets?.[0];
|
|
72
66
|
}
|
|
73
67
|
if (skipFeeInfo && skipFeeInfo.gasPrice !== null) {
|
|
74
68
|
return skipFeeInfo;
|
|
@@ -94,6 +88,6 @@ var getFeeInfoForChain = (_0) => __async(void 0, [_0], function* ({ chainId, api
|
|
|
94
88
|
high: registryFeeInfo.high_gas_price ? `${registryFeeInfo.high_gas_price}` : ""
|
|
95
89
|
}
|
|
96
90
|
};
|
|
97
|
-
}
|
|
91
|
+
};
|
|
98
92
|
|
|
99
93
|
export { getFeeInfoForChain };
|