@skip-go/client 1.0.1-alpha-1 → 1.0.1
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.d.ts +19 -0
- package/dist/api/getAssets.js +15 -2
- package/dist/api/getAssetsBetweenChains.d.ts +56 -0
- package/dist/api/getAssetsBetweenChains.js +11 -2
- package/dist/api/getBridges.d.ts +54 -0
- package/dist/api/getBridges.js +11 -2
- package/dist/api/getChains.d.ts +41 -0
- package/dist/api/getChains.js +11 -2
- package/dist/api/getVenues.d.ts +13 -0
- package/dist/api/getVenues.js +11 -2
- package/dist/api/postAssetsFromSource.d.ts +13 -0
- package/dist/api/postAssetsFromSource.js +12 -3
- package/dist/api/postBalances.d.ts +35 -0
- package/dist/api/postBalances.js +11 -2
- package/dist/api/postIbcOriginAssets.d.ts +32 -0
- package/dist/api/postIbcOriginAssets.js +11 -2
- package/dist/api/postMessages.d.ts +528 -0
- package/dist/api/postMessages.js +11 -2
- package/dist/api/postMessagesDirect.d.ts +568 -0
- package/dist/api/postMessagesDirect.js +11 -2
- package/dist/api/postRecommendAssets.d.ts +40 -0
- package/dist/api/postRecommendAssets.js +11 -2
- package/dist/api/postRoute.d.ts +460 -0
- package/dist/api/postRoute.js +11 -2
- package/dist/api/postSubmitTransaction.d.ts +13 -0
- package/dist/api/postSubmitTransaction.js +11 -2
- package/dist/api/postTrackTransaction.d.ts +13 -0
- package/dist/api/postTrackTransaction.js +11 -2
- package/dist/api/postTransactionStatus.d.ts +559 -0
- package/dist/api/postTransactionStatus.js +11 -2
- package/dist/apiState-CdzxTxYd.d.ts +6 -0
- package/dist/chunk-2WHYWV4Y.js +12 -0
- package/dist/{chunk-VMPFHQ7U.js → chunk-4XWIXR2P.js} +27 -19
- package/dist/chunk-5KVRQLI5.js +17 -0
- package/dist/{chunk-KNV72XRZ.js → chunk-5ZJBR5AQ.js} +5 -3
- package/dist/chunk-6BTWKTNM.js +16 -0
- package/dist/chunk-6GJEXV5J.js +130 -0
- package/dist/chunk-ASPVKNJ7.js +242 -0
- package/dist/{chunk-JTIHU43D.js → chunk-CG5CQQBW.js} +42 -33
- package/dist/chunk-EQLA2SEZ.js +2361 -0
- package/dist/chunk-FVSSCQ6C.js +12 -0
- package/dist/{chunk-SQGWZAUC.js → chunk-GFRPLEJR.js} +311 -279
- package/dist/chunk-KYFTM3PI.js +12 -0
- package/dist/chunk-L2Q5RP6O.js +25 -0
- package/dist/chunk-LRIPQQ4M.js +11 -0
- package/dist/{chunk-TW77BXMT.js → chunk-PKPZTO4H.js} +13 -10
- package/dist/{chunk-PRQ2NHRZ.js → chunk-RE2QZJWE.js} +5 -3
- package/dist/{chunk-3OZQ35X3.js → chunk-RT5TZAMU.js} +312 -212
- package/dist/chunk-SWYON2RG.js +4 -1
- package/dist/chunk-VQ5SIQWU.js +3 -1
- package/dist/chunk-X2E2TKVR.js +12 -0
- package/dist/{chunk-3N7XVGLX.js → chunk-X2YPYBVN.js} +68 -59
- package/dist/chunk-YYNIFO2A.js +13 -0
- package/dist/{chunk-4JJWOILI.js → chunk-Z4ZKOUGH.js} +5 -3
- package/dist/{chunk-C2EDPY6J.js → chunk-ZG23Z3WY.js} +5 -3
- package/dist/client-types-CxjtffyG.d.ts +60 -0
- package/dist/executeRoute-BKvMVd1I.d.ts +69 -0
- package/dist/generateApi-DqCp36fX.d.ts +22 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +209 -24
- package/dist/public-functions/executeRoute.d.ts +9 -0
- package/dist/public-functions/executeRoute.js +21 -12
- package/dist/public-functions/getFeeInfoForChain.d.ts +9 -0
- package/dist/public-functions/getFeeInfoForChain.js +14 -5
- package/dist/public-functions/getRecommendedGasPrice.d.ts +9 -0
- package/dist/public-functions/getRecommendedGasPrice.js +16 -7
- package/dist/public-functions/getSigningStargateClient.d.ts +13 -0
- package/dist/public-functions/getSigningStargateClient.js +13 -4
- package/dist/public-functions/setApiOptions.d.ts +9 -0
- package/dist/public-functions/setApiOptions.js +11 -2
- package/dist/public-functions/setClientOptions.d.ts +9 -0
- package/dist/public-functions/setClientOptions.js +13 -4
- package/dist/setClientOptions-DbanEIwL.d.ts +19 -0
- package/dist/swaggerTypes-O9-gvCT1.d.ts +1890 -0
- package/package.json +1 -10
- package/dist/chunk-33K6EESX.js +0 -10
- package/dist/chunk-BQTQJQ5E.js +0 -10
- package/dist/chunk-BRJDNGYH.js +0 -22
- package/dist/chunk-BRMONS6A.js +0 -130
- package/dist/chunk-DW4U6YI6.js +0 -10
- package/dist/chunk-GARVPN2H.js +0 -16
- package/dist/chunk-MGVXJ2U4.js +0 -11
- package/dist/chunk-MTMPHY3Y.js +0 -9
- package/dist/chunk-RDRDFJQE.js +0 -10
- package/dist/chunk-RMP3HM5N.js +0 -14
- package/dist/chunk-W6TBGBV3.js +0 -675
- package/dist/chunk-Y5EY3Q6D.js +0 -1790
package/dist/chunk-SWYON2RG.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
// src/constants/constants.ts
|
|
2
4
|
var DEFAULT_GAS_DENOM_OVERRIDES = {
|
|
3
5
|
"noble-1": "uusdc"
|
|
4
6
|
};
|
|
5
7
|
var GAS_STATION_CHAIN_IDS = ["bbn-test-5", "bbn-1"];
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
exports.DEFAULT_GAS_DENOM_OVERRIDES = DEFAULT_GAS_DENOM_OVERRIDES;
|
|
10
|
+
exports.GAS_STATION_CHAIN_IDS = GAS_STATION_CHAIN_IDS;
|
package/dist/chunk-VQ5SIQWU.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
1
3
|
// ../../node_modules/bignumber.js/bignumber.mjs
|
|
2
4
|
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
3
5
|
var mathceil = Math.ceil;
|
|
@@ -1341,4 +1343,4 @@ function toFixedPoint(str, e, z) {
|
|
|
1341
1343
|
}
|
|
1342
1344
|
var BigNumber = clone();
|
|
1343
1345
|
|
|
1344
|
-
|
|
1346
|
+
exports.BigNumber = BigNumber;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
|
|
4
|
+
|
|
5
|
+
// src/api/postMessagesDirect.ts
|
|
6
|
+
var messagesDirect = chunkASPVKNJ7_js.api({
|
|
7
|
+
methodName: "getMsgsDirectV2",
|
|
8
|
+
method: "post",
|
|
9
|
+
path: "/v2/fungible/msgs_direct"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
exports.messagesDirect = messagesDirect;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCG5CQQBW_js = require('./chunk-CG5CQQBW.js');
|
|
4
|
+
var chunk6GJEXV5J_js = require('./chunk-6GJEXV5J.js');
|
|
5
|
+
var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
|
|
6
|
+
var signingstargateclient = require('@cosmjs/stargate/build/signingstargateclient');
|
|
7
|
+
var stargate = require('@cosmjs/stargate');
|
|
8
|
+
var utils = require('@cosmjs/utils');
|
|
9
|
+
var binary = require('cosmjs-types/binary');
|
|
10
|
+
var auth = require('cosmjs-types/cosmos/auth/v1beta1/auth');
|
|
11
|
+
var coin = require('cosmjs-types/cosmos/base/v1beta1/coin');
|
|
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');
|
|
12
16
|
|
|
13
17
|
var createBaseVestingAccount = () => {
|
|
14
18
|
return {
|
|
@@ -21,21 +25,21 @@ var createBaseVestingAccount = () => {
|
|
|
21
25
|
};
|
|
22
26
|
};
|
|
23
27
|
var BaseVestingAccount = {
|
|
24
|
-
encode(message, writer = BinaryWriter.create()) {
|
|
28
|
+
encode(message, writer = binary.BinaryWriter.create()) {
|
|
25
29
|
if (message.baseAccount !== void 0) {
|
|
26
|
-
BaseAccount.encode(
|
|
30
|
+
auth.BaseAccount.encode(
|
|
27
31
|
message.baseAccount,
|
|
28
32
|
writer.uint32(10).fork()
|
|
29
33
|
).ldelim();
|
|
30
34
|
}
|
|
31
35
|
for (const v of message.originalVesting) {
|
|
32
|
-
Coin.encode(v, writer.uint32(18).fork()).ldelim();
|
|
36
|
+
coin.Coin.encode(v, writer.uint32(18).fork()).ldelim();
|
|
33
37
|
}
|
|
34
38
|
for (const v of message.delegatedFree) {
|
|
35
|
-
Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
39
|
+
coin.Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
36
40
|
}
|
|
37
41
|
for (const v of message.delegatedVesting) {
|
|
38
|
-
Coin.encode(v, writer.uint32(34).fork()).ldelim();
|
|
42
|
+
coin.Coin.encode(v, writer.uint32(34).fork()).ldelim();
|
|
39
43
|
}
|
|
40
44
|
if (message.endTime !== BigInt(0)) {
|
|
41
45
|
writer.uint32(40).int64(message.endTime);
|
|
@@ -43,23 +47,23 @@ var BaseVestingAccount = {
|
|
|
43
47
|
return writer;
|
|
44
48
|
},
|
|
45
49
|
decode(input, length) {
|
|
46
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
50
|
+
const reader = input instanceof binary.BinaryReader ? input : new binary.BinaryReader(input);
|
|
47
51
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
48
52
|
const message = createBaseVestingAccount();
|
|
49
53
|
while (reader.pos < end) {
|
|
50
54
|
const tag = reader.uint32();
|
|
51
55
|
switch (tag >>> 3) {
|
|
52
56
|
case 1:
|
|
53
|
-
message.baseAccount = BaseAccount.decode(reader, reader.uint32());
|
|
57
|
+
message.baseAccount = auth.BaseAccount.decode(reader, reader.uint32());
|
|
54
58
|
break;
|
|
55
59
|
case 2:
|
|
56
|
-
message.originalVesting.push(Coin.decode(reader, reader.uint32()));
|
|
60
|
+
message.originalVesting.push(coin.Coin.decode(reader, reader.uint32()));
|
|
57
61
|
break;
|
|
58
62
|
case 3:
|
|
59
|
-
message.delegatedFree.push(Coin.decode(reader, reader.uint32()));
|
|
63
|
+
message.delegatedFree.push(coin.Coin.decode(reader, reader.uint32()));
|
|
60
64
|
break;
|
|
61
65
|
case 4:
|
|
62
|
-
message.delegatedVesting.push(Coin.decode(reader, reader.uint32()));
|
|
66
|
+
message.delegatedVesting.push(coin.Coin.decode(reader, reader.uint32()));
|
|
63
67
|
break;
|
|
64
68
|
case 5:
|
|
65
69
|
message.endTime = reader.int64();
|
|
@@ -81,7 +85,7 @@ function createBasePeriod() {
|
|
|
81
85
|
};
|
|
82
86
|
}
|
|
83
87
|
var Period = {
|
|
84
|
-
encode(message, writer = BinaryWriter.create()) {
|
|
88
|
+
encode(message, writer = binary.BinaryWriter.create()) {
|
|
85
89
|
if (message.startTime !== BigInt(0)) {
|
|
86
90
|
writer.uint32(8).int64(message.startTime);
|
|
87
91
|
}
|
|
@@ -89,7 +93,7 @@ var Period = {
|
|
|
89
93
|
writer.uint32(16).int64(message.length);
|
|
90
94
|
}
|
|
91
95
|
for (const v of message.amount) {
|
|
92
|
-
Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
96
|
+
coin.Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
93
97
|
}
|
|
94
98
|
if (message.actionType !== 0) {
|
|
95
99
|
writer.uint32(32).int32(message.actionType);
|
|
@@ -97,7 +101,7 @@ var Period = {
|
|
|
97
101
|
return writer;
|
|
98
102
|
},
|
|
99
103
|
decode(input, length) {
|
|
100
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
104
|
+
const reader = input instanceof binary.BinaryReader ? input : new binary.BinaryReader(input);
|
|
101
105
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
102
106
|
const message = createBasePeriod();
|
|
103
107
|
while (reader.pos < end) {
|
|
@@ -110,7 +114,7 @@ var Period = {
|
|
|
110
114
|
message.length = reader.int64();
|
|
111
115
|
break;
|
|
112
116
|
case 3:
|
|
113
|
-
message.amount.push(Coin.decode(reader, reader.uint32()));
|
|
117
|
+
message.amount.push(coin.Coin.decode(reader, reader.uint32()));
|
|
114
118
|
break;
|
|
115
119
|
case 4:
|
|
116
120
|
message.actionType = reader.int32();
|
|
@@ -132,7 +136,7 @@ function createBaseStridePeriodicVestingAccount() {
|
|
|
132
136
|
};
|
|
133
137
|
}
|
|
134
138
|
var StridePeriodicVestingAccount = {
|
|
135
|
-
encode(message, writer = BinaryWriter.create()) {
|
|
139
|
+
encode(message, writer = binary.BinaryWriter.create()) {
|
|
136
140
|
if (message.baseVestingAccount !== void 0) {
|
|
137
141
|
BaseVestingAccount.encode(
|
|
138
142
|
message.baseVestingAccount,
|
|
@@ -145,7 +149,7 @@ var StridePeriodicVestingAccount = {
|
|
|
145
149
|
return writer;
|
|
146
150
|
},
|
|
147
151
|
decode(input, length) {
|
|
148
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
152
|
+
const reader = input instanceof binary.BinaryReader ? input : new binary.BinaryReader(input);
|
|
149
153
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
150
154
|
const message = createBaseStridePeriodicVestingAccount();
|
|
151
155
|
while (reader.pos < end) {
|
|
@@ -169,32 +173,33 @@ var StridePeriodicVestingAccount = {
|
|
|
169
173
|
}
|
|
170
174
|
};
|
|
171
175
|
var accountParser = (acc) => {
|
|
176
|
+
var _a;
|
|
172
177
|
switch (acc.typeUrl) {
|
|
173
178
|
case "/stride.vesting.StridePeriodicVestingAccount": {
|
|
174
|
-
const baseAccount = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount
|
|
175
|
-
assertDefinedAndNotNull(baseAccount);
|
|
179
|
+
const baseAccount = (_a = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount) == null ? void 0 : _a.baseAccount;
|
|
180
|
+
utils.assertDefinedAndNotNull(baseAccount);
|
|
176
181
|
return {
|
|
177
182
|
address: baseAccount.address,
|
|
178
|
-
pubkey: baseAccount.pubKey ? decodePubkey(baseAccount.pubKey) : null,
|
|
183
|
+
pubkey: baseAccount.pubKey ? protoSigning.decodePubkey(baseAccount.pubKey) : null,
|
|
179
184
|
accountNumber: Number(baseAccount.accountNumber),
|
|
180
185
|
sequence: Number(baseAccount.sequence)
|
|
181
186
|
};
|
|
182
187
|
}
|
|
183
188
|
case "/injective.types.v1beta1.EthAccount":
|
|
184
|
-
return accountEthParser(
|
|
189
|
+
return sdkTs.accountEthParser(
|
|
185
190
|
acc,
|
|
186
191
|
"/injective.crypto.v1beta1.ethsecp256k1.PubKey"
|
|
187
192
|
);
|
|
188
193
|
case "/ethermint.types.v1.EthAccount":
|
|
189
|
-
return accountEthParser(acc, "/ethermint.crypto.v1.ethsecp256k1.PubKey");
|
|
194
|
+
return sdkTs.accountEthParser(acc, "/ethermint.crypto.v1.ethsecp256k1.PubKey");
|
|
190
195
|
default: {
|
|
191
196
|
if (acc.typeUrl === "/cosmos.auth.v1beta1.BaseAccount") {
|
|
192
|
-
const { address, pubKey, accountNumber, sequence } = BaseAccount.decode(
|
|
197
|
+
const { address, pubKey, accountNumber, sequence } = auth.BaseAccount.decode(
|
|
193
198
|
acc.value
|
|
194
199
|
);
|
|
195
|
-
if (pubKey
|
|
196
|
-
const { key } = PubKey.decode(pubKey.value);
|
|
197
|
-
const pk = encodeSecp256k1Pubkey(key);
|
|
200
|
+
if ((pubKey == null ? void 0 : pubKey.typeUrl) === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
|
|
201
|
+
const { key } = keys.PubKey.decode(pubKey.value);
|
|
202
|
+
const pk = amino.encodeSecp256k1Pubkey(key);
|
|
198
203
|
return {
|
|
199
204
|
address,
|
|
200
205
|
pubkey: pk,
|
|
@@ -203,67 +208,71 @@ var accountParser = (acc) => {
|
|
|
203
208
|
};
|
|
204
209
|
}
|
|
205
210
|
}
|
|
206
|
-
return accountFromAny(acc);
|
|
211
|
+
return stargate.accountFromAny(acc);
|
|
207
212
|
}
|
|
208
213
|
}
|
|
209
214
|
};
|
|
210
215
|
|
|
211
216
|
// src/private-functions/getRpcEndpointForChain.ts
|
|
212
|
-
var getRpcEndpointForChain =
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
var getRpcEndpointForChain = (chainId) => chunkASPVKNJ7_js.__async(void 0, null, function* () {
|
|
218
|
+
var _a, _b, _c, _d, _e;
|
|
219
|
+
if (chunk6GJEXV5J_js.ClientState.endpointOptions.getRpcEndpointForChain) {
|
|
220
|
+
return chunk6GJEXV5J_js.ClientState.endpointOptions.getRpcEndpointForChain(chainId);
|
|
215
221
|
}
|
|
216
|
-
if (ClientState.endpointOptions.endpoints && ClientState.endpointOptions.endpoints[chainId]) {
|
|
217
|
-
const endpointOptions = ClientState.endpointOptions.endpoints[chainId];
|
|
218
|
-
if (endpointOptions
|
|
222
|
+
if (chunk6GJEXV5J_js.ClientState.endpointOptions.endpoints && chunk6GJEXV5J_js.ClientState.endpointOptions.endpoints[chainId]) {
|
|
223
|
+
const endpointOptions = chunk6GJEXV5J_js.ClientState.endpointOptions.endpoints[chainId];
|
|
224
|
+
if (endpointOptions == null ? void 0 : endpointOptions.rpc) {
|
|
219
225
|
return endpointOptions.rpc;
|
|
220
226
|
}
|
|
221
227
|
}
|
|
222
228
|
console.warn(
|
|
223
229
|
"Warning: You are using unreliable public endpoints. We strongly recommend overriding them via endpointOptions for use beyond development settings."
|
|
224
230
|
);
|
|
225
|
-
const chain = chains().find((chain2) => chain2.chain_id === chainId);
|
|
231
|
+
const chain = chunkCG5CQQBW_js.chains().find((chain2) => chain2.chain_id === chainId);
|
|
226
232
|
if (!chain) {
|
|
227
233
|
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
228
234
|
}
|
|
229
|
-
if (chain.apis
|
|
235
|
+
if (((_b = (_a = chain.apis) == null ? void 0 : _a.rpc) == null ? void 0 : _b.length) === 0 || !((_c = chain.apis) == null ? void 0 : _c.rpc)) {
|
|
230
236
|
throw new Error(
|
|
231
237
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
232
238
|
);
|
|
233
239
|
}
|
|
234
|
-
const endpoints = chain.apis
|
|
235
|
-
const endpoint =
|
|
240
|
+
const endpoints = (_e = (_d = chain.apis) == null ? void 0 : _d.rpc) == null ? void 0 : _e.map((api) => api.address);
|
|
241
|
+
const endpoint = yield chunkCG5CQQBW_js.findFirstWorkingEndpoint(endpoints, "rpc");
|
|
236
242
|
if (!endpoint) {
|
|
237
243
|
throw new Error(
|
|
238
244
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
239
245
|
);
|
|
240
246
|
}
|
|
241
247
|
return endpoint;
|
|
242
|
-
};
|
|
248
|
+
});
|
|
243
249
|
|
|
244
250
|
// src/public-functions/getSigningStargateClient.ts
|
|
245
|
-
var getSigningStargateClient =
|
|
251
|
+
var getSigningStargateClient = (_0) => chunkASPVKNJ7_js.__async(void 0, [_0], function* ({
|
|
246
252
|
chainId,
|
|
247
253
|
getOfflineSigner
|
|
248
|
-
})
|
|
254
|
+
}) {
|
|
255
|
+
var _a;
|
|
249
256
|
if (!getOfflineSigner) {
|
|
250
257
|
throw new Error("'getCosmosSigner' is not provided or configured in skip router");
|
|
251
258
|
}
|
|
252
|
-
if (!ClientState.signingStargateClientByChainId
|
|
253
|
-
const [signer, endpoint] =
|
|
259
|
+
if (!((_a = chunk6GJEXV5J_js.ClientState.signingStargateClientByChainId) == null ? void 0 : _a[chainId])) {
|
|
260
|
+
const [signer, endpoint] = yield Promise.all([
|
|
254
261
|
getOfflineSigner(chainId),
|
|
255
262
|
getRpcEndpointForChain(chainId)
|
|
256
263
|
]);
|
|
257
|
-
ClientState.signingStargateClientByChainId[chainId] =
|
|
258
|
-
aminoTypes: ClientState.aminoTypes,
|
|
259
|
-
registry: ClientState.registry,
|
|
264
|
+
chunk6GJEXV5J_js.ClientState.signingStargateClientByChainId[chainId] = yield signingstargateclient.SigningStargateClient.connectWithSigner(endpoint, signer, {
|
|
265
|
+
aminoTypes: chunk6GJEXV5J_js.ClientState.aminoTypes,
|
|
266
|
+
registry: chunk6GJEXV5J_js.ClientState.registry,
|
|
260
267
|
accountParser
|
|
261
268
|
});
|
|
262
269
|
}
|
|
263
270
|
return {
|
|
264
|
-
stargateClient: ClientState.signingStargateClientByChainId[chainId],
|
|
265
|
-
signer:
|
|
271
|
+
stargateClient: chunk6GJEXV5J_js.ClientState.signingStargateClientByChainId[chainId],
|
|
272
|
+
signer: yield getOfflineSigner(chainId)
|
|
266
273
|
};
|
|
267
|
-
};
|
|
274
|
+
});
|
|
268
275
|
|
|
269
|
-
|
|
276
|
+
exports.accountParser = accountParser;
|
|
277
|
+
exports.getRpcEndpointForChain = getRpcEndpointForChain;
|
|
278
|
+
exports.getSigningStargateClient = getSigningStargateClient;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
|
|
4
|
+
|
|
5
|
+
// src/api/postTrackTransaction.ts
|
|
6
|
+
var trackTransaction = chunkASPVKNJ7_js.pollingApi({
|
|
7
|
+
methodName: "trackTransactionV2",
|
|
8
|
+
path: "/v2/tx/track",
|
|
9
|
+
method: "post",
|
|
10
|
+
backoffMultiplier: 2.5
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
exports.trackTransaction = trackTransaction;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
|
|
2
4
|
|
|
3
5
|
// src/api/postRecommendAssets.ts
|
|
4
|
-
var recommendAssets = api({
|
|
6
|
+
var recommendAssets = chunkASPVKNJ7_js.api({
|
|
5
7
|
methodName: "getAssetRecommendations",
|
|
6
8
|
method: "post",
|
|
7
9
|
path: "/v2/fungible/recommend_assets",
|
|
@@ -10,4 +12,4 @@ var recommendAssets = api({
|
|
|
10
12
|
}
|
|
11
13
|
});
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
exports.recommendAssets = recommendAssets;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
|
|
2
4
|
|
|
3
5
|
// src/api/getVenues.ts
|
|
4
|
-
var venues = api({
|
|
6
|
+
var venues = chunkASPVKNJ7_js.api({
|
|
5
7
|
methodName: "getVenues",
|
|
6
8
|
path: "/v2/fungible/venues",
|
|
7
9
|
transformResponse: (response) => response.venues
|
|
8
10
|
});
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
exports.venues = venues;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { OfflineAminoSigner } from '@cosmjs/amino';
|
|
2
|
+
import { OfflineDirectSigner } from '@cosmjs/proto-signing';
|
|
3
|
+
import { StdFee, GasPrice, SignerData } from '@cosmjs/stargate';
|
|
4
|
+
import { WalletClient } from 'viem';
|
|
5
|
+
import { Adapter } from '@solana/wallet-adapter-base';
|
|
6
|
+
import { a2 as FeeAsset, K as ChainType, V as CosmosMsg } from './swaggerTypes-O9-gvCT1.js';
|
|
7
|
+
|
|
8
|
+
/** Common Types */
|
|
9
|
+
type UserAddress = {
|
|
10
|
+
chainId: string;
|
|
11
|
+
address: string;
|
|
12
|
+
};
|
|
13
|
+
type EndpointOptions = {
|
|
14
|
+
rpc?: string;
|
|
15
|
+
rest?: string;
|
|
16
|
+
};
|
|
17
|
+
type ValidateGasResult = {
|
|
18
|
+
error: null | string;
|
|
19
|
+
asset: FeeAsset | null;
|
|
20
|
+
fee: StdFee | null;
|
|
21
|
+
};
|
|
22
|
+
/** Signer Getters */
|
|
23
|
+
type SignerGetters = {
|
|
24
|
+
getEvmSigner?: (chainId: string) => Promise<WalletClient>;
|
|
25
|
+
getCosmosSigner?: (chainId: string) => Promise<(OfflineAminoSigner & OfflineDirectSigner) | OfflineAminoSigner | OfflineDirectSigner>;
|
|
26
|
+
getSvmSigner?: () => Promise<Adapter>;
|
|
27
|
+
};
|
|
28
|
+
/** Gas Options */
|
|
29
|
+
type GetFallbackGasAmount = (chainId: string, chainType: ChainType) => Promise<number | undefined>;
|
|
30
|
+
type GetGasPrice = (chainId: string, chainType: ChainType) => Promise<GasPrice | undefined>;
|
|
31
|
+
type GasOptions = {
|
|
32
|
+
/**
|
|
33
|
+
* If `getGasPrice` is undefined, or returns undefined, the router will attempt to set the recommended gas price
|
|
34
|
+
**/
|
|
35
|
+
getGasPrice?: GetGasPrice;
|
|
36
|
+
/**
|
|
37
|
+
* If `getFallbackGasAmount` is set, when router fails to simulate the gas amount, it will use the fallback gas amount
|
|
38
|
+
*/
|
|
39
|
+
getFallbackGasAmount?: GetFallbackGasAmount;
|
|
40
|
+
gasAmountMultiplier?: number;
|
|
41
|
+
};
|
|
42
|
+
type SignCosmosMessageOptionsBase = {
|
|
43
|
+
signerAddress: string;
|
|
44
|
+
chainId: string;
|
|
45
|
+
cosmosMsgs: CosmosMsg[];
|
|
46
|
+
fee: StdFee;
|
|
47
|
+
signerData: SignerData;
|
|
48
|
+
};
|
|
49
|
+
type SignCosmosMessageDirectOptions = SignCosmosMessageOptionsBase & {
|
|
50
|
+
signer: OfflineDirectSigner;
|
|
51
|
+
};
|
|
52
|
+
type SignCosmosMessageAminoOptions = SignCosmosMessageOptionsBase & {
|
|
53
|
+
signer: OfflineAminoSigner;
|
|
54
|
+
};
|
|
55
|
+
type TxResult = {
|
|
56
|
+
txHash: string;
|
|
57
|
+
chainId: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type { EndpointOptions as E, GetFallbackGasAmount as G, SignerGetters as S, TxResult as T, UserAddress as U, ValidateGasResult as V, GetGasPrice as a, GasOptions as b, SignCosmosMessageOptionsBase as c, SignCosmosMessageDirectOptions as d, SignCosmosMessageAminoOptions as e };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { aT as TransferStatus, R as Erc20Approval, ap as RouteResponse, V as CosmosMsg } from './swaggerTypes-O9-gvCT1.js';
|
|
2
|
+
import { A as ApiRequest } from './generateApi-DqCp36fX.js';
|
|
3
|
+
import { S as SignerGetters, b as GasOptions, U as UserAddress } from './client-types-CxjtffyG.js';
|
|
4
|
+
|
|
5
|
+
type CallbackStatus = "success" | "error" | "pending" | "completed";
|
|
6
|
+
type TransactionCallbacks = {
|
|
7
|
+
onTransactionSigned?: (txInfo: {
|
|
8
|
+
chainId: string;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
onTransactionBroadcast?: (txInfo: {
|
|
11
|
+
txHash: string;
|
|
12
|
+
chainId: string;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
onTransactionTracked?: (txInfo: {
|
|
15
|
+
txHash: string;
|
|
16
|
+
chainId: string;
|
|
17
|
+
explorerLink: string;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
onTransactionCompleted?: (txInfo: {
|
|
20
|
+
chainId: string;
|
|
21
|
+
txHash: string;
|
|
22
|
+
status?: TransferStatus;
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
onValidateGasBalance?: (value: {
|
|
25
|
+
chainId?: string;
|
|
26
|
+
txIndex?: number;
|
|
27
|
+
status: CallbackStatus;
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
onApproveAllowance?: (value: {
|
|
30
|
+
allowance?: Erc20Approval;
|
|
31
|
+
status: CallbackStatus;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Execute Route Options */
|
|
36
|
+
type ExecuteRouteOptions = SignerGetters & GasOptions & TransactionCallbacks & Pick<ApiRequest<"getMsgsV2">, "timeoutSeconds"> & {
|
|
37
|
+
route: RouteResponse;
|
|
38
|
+
/**
|
|
39
|
+
* Addresses should be in the same order with the `chainIDs` in the `route`
|
|
40
|
+
*/
|
|
41
|
+
userAddresses: UserAddress[];
|
|
42
|
+
simulate?: boolean;
|
|
43
|
+
slippageTolerancePercent?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Arbitrary Tx to be executed before or after route msgs
|
|
46
|
+
*/
|
|
47
|
+
beforeMsg?: CosmosMsg;
|
|
48
|
+
afterMsg?: CosmosMsg;
|
|
49
|
+
/**
|
|
50
|
+
* Set allowance amount to max if EVM transaction requires allowance approval.
|
|
51
|
+
*/
|
|
52
|
+
useUnlimitedApproval?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
/**
|
|
55
|
+
* If `skipApproval` is set to `true`, the router will bypass checking whether
|
|
56
|
+
* the signer has granted approval for the specified token contract on an EVM chain.
|
|
57
|
+
* This can be useful if approval has already been handled externally or there are race conditions.
|
|
58
|
+
*/
|
|
59
|
+
bypassApprovalCheck?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* defaults to true
|
|
62
|
+
* If `batchSimulate` is set to `true`, it will simulate all messages in a batch before the first tx run.
|
|
63
|
+
* If `batchSimulate` is set to `false`, it will simulate each message one by one.
|
|
64
|
+
*/
|
|
65
|
+
batchSimulate?: boolean;
|
|
66
|
+
};
|
|
67
|
+
declare const executeRoute: (options: ExecuteRouteOptions) => Promise<void>;
|
|
68
|
+
|
|
69
|
+
export { type ExecuteRouteOptions as E, type TransactionCallbacks as T, executeRoute as e };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { bc as Api } from './swaggerTypes-O9-gvCT1.js';
|
|
2
|
+
|
|
3
|
+
type CamelKey<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<CamelKey<U>>}` : S;
|
|
4
|
+
type Camel<T> = T extends (infer U)[] ? Camel<U>[] : T extends object ? {
|
|
5
|
+
[K in keyof T as K extends string ? CamelKey<K> : never]: Camel<T[K]>;
|
|
6
|
+
} : T;
|
|
7
|
+
|
|
8
|
+
type ApiInstance = InstanceType<typeof Api>;
|
|
9
|
+
type FunctionKeys<T> = {
|
|
10
|
+
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
|
|
11
|
+
}[keyof T];
|
|
12
|
+
type ValidApiMethodKeys = {
|
|
13
|
+
[K in FunctionKeys<ApiInstance>]: Awaited<ReturnType<ApiInstance[K]>> extends {
|
|
14
|
+
data: unknown;
|
|
15
|
+
} ? K : never;
|
|
16
|
+
}[FunctionKeys<ApiInstance>];
|
|
17
|
+
type ApiRequest<K extends ValidApiMethodKeys> = NonNullable<Camel<Parameters<ApiInstance[K]>[0]>>;
|
|
18
|
+
type ApiResponse<K extends ValidApiMethodKeys> = Camel<Awaited<ReturnType<ApiInstance[K]>> extends {
|
|
19
|
+
data: infer D;
|
|
20
|
+
} ? D extends object ? D : never : never>;
|
|
21
|
+
|
|
22
|
+
export type { ApiRequest as A, ApiResponse as a };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { A as AcknowledgementErrorDetails, a as Affiliate, bc as Api, b8 as ApiConfig, b as ApiError, c as Asset, d as AssetBetweenChains, e as AssetRecommendation, f as AutopilotAction, g as AutopilotMsg, h as AutopilotMsgWrapper, i as AxelarTransfer, j as AxelarTransferInfo, k as AxelarTransferState, l as AxelarTransferType, m as AxelarTransferWrapper, B as BalanceRequestChainEntry, D as BalanceResponseChainEntry, z as BalanceResponseDenomEntry, E as BankSend, F as BankSendWrapper, H as Bridge, I as BridgeType, C as CCTPTransfer, n as CCTPTransferInfo, p as CCTPTransferState, o as CCTPTransferTxs, q as CCTPTransferWrapper, J as Chain, L as ChainAffiliates, al as ChainTransaction, K as ChainType, ba as ContentType, M as ContractCallWithTokenError, N as ContractCallWithTokenErrorType, O as ContractCallWithTokenTxs, P as CosmWasmContractMsg, Q as CosmWasmContractMsgWrapper, b0 as CosmosModuleSupport, V as CosmosMsg, W as CosmosTx, X as CosmosTxWrapper, R as Erc20Approval, U as Error, T as ErrorDetail, aV as EurekaTransfer, aW as EurekaTransferInfo, aX as EurekaTransferWrapper, Y as EvmSwap, Z as EvmSwapWrapper, _ as EvmTx, $ as EvmTxWrapper, b3 as Fee, a2 as FeeAsset, b2 as FeeType, b6 as FullRequestParams, a4 as GRPCStatusCode, a3 as GoFastFee, G as GoFastTransfer, y as GoFastTransferInfo, w as GoFastTransferState, x as GoFastTransferTxs, bb as HttpClient, b9 as HttpResponse, a5 as HyperlaneTransfer, a6 as HyperlaneTransferInfo, a7 as HyperlaneTransferState, a8 as HyperlaneTransferTransactions, a9 as HyperlaneTransferWrapper, aa as IBCTransferInfo, b1 as IbcCapabilities, aY as LayerZeroTransfer, aZ as LayerZeroTransferInfo, aO as LayerZeroTransferState, ah as LayerZeroTransferTransactions, a_ as LayerZeroTransferWrapper, ab as Msg, ad as MultiChainMsg, ae as MultiChainMsgWrapper, aJ as OPInitTransfer, aL as OPInitTransferInfo, aN as OPInitTransferState, aM as OPInitTransferTxs, aK as OPInitTransferWrapper, af as Operation, ag as OptionalAsset, ai as Packet, aj as PacketError, ak as PacketErrorType, am as PostHandler, b4 as QueryParamsType, an as Reason, a$ as RecommendationRequest, b7 as RequestParams, b5 as ResponseFormat, ao as RoutePriceWarningType, ap as RouteResponse, aq as SendTokenError, ar as SendTokenErrorType, as as SendTokenTxs, S as SmartRelayFeeQuote, aC as SmartSwapExactCoinIn, aE as SmartSwapInWrapper, aD as SmartSwapOptions, r as StargateTransfer, u as StargateTransferInfo, s as StargateTransferState, t as StargateTransferTxs, v as StargateTransferWrapper, at as StatusError, au as StatusErrorType, a0 as SvmTx, a1 as SvmTxWrapper, av as Swap, aw as SwapExactCoinIn, ax as SwapExactCoinOut, ay as SwapInWrapper, az as SwapOperation, aA as SwapOutWrapper, aB as SwapRoute, aF as SwapVenue, aG as SwapWrapper, aH as TransactionExecutionErrorDetails, aI as TransactionState, aP as Transfer, aS as TransferAssetRelease, aQ as TransferEvent, aR as TransferState, aT as TransferStatus, aU as TransferWrapper, ac as Tx } from './swaggerTypes-O9-gvCT1.js';
|
|
2
|
+
export { E as ExecuteRouteOptions, T as TransactionCallbacks, e as executeRoute } from './executeRoute-BKvMVd1I.js';
|
|
3
|
+
export { E as EndpointOptions, b as GasOptions, G as GetFallbackGasAmount, a as GetGasPrice, e as SignCosmosMessageAminoOptions, d as SignCosmosMessageDirectOptions, c as SignCosmosMessageOptionsBase, S as SignerGetters, T as TxResult, U as UserAddress, V as ValidateGasResult } from './client-types-CxjtffyG.js';
|
|
4
|
+
export { assets } from './api/getAssets.js';
|
|
5
|
+
export { assetsBetweenChains } from './api/getAssetsBetweenChains.js';
|
|
6
|
+
export { bridges } from './api/getBridges.js';
|
|
7
|
+
export { chains } from './api/getChains.js';
|
|
8
|
+
export { venues } from './api/getVenues.js';
|
|
9
|
+
export { ibcOriginAssets } from './api/postIbcOriginAssets.js';
|
|
10
|
+
export { MessagesRequest, MessagesResponse, messages } from './api/postMessages.js';
|
|
11
|
+
export { messagesDirect } from './api/postMessagesDirect.js';
|
|
12
|
+
export { recommendAssets } from './api/postRecommendAssets.js';
|
|
13
|
+
export { assetsFromSource } from './api/postAssetsFromSource.js';
|
|
14
|
+
export { BalanceRequest, BalanceResponse, balances } from './api/postBalances.js';
|
|
15
|
+
export { RouteRequest, route } from './api/postRoute.js';
|
|
16
|
+
export { submitTransaction } from './api/postSubmitTransaction.js';
|
|
17
|
+
export { trackTransaction } from './api/postTrackTransaction.js';
|
|
18
|
+
export { TxStatusResponse, transactionStatus } from './api/postTransactionStatus.js';
|
|
19
|
+
export { getSigningStargateClient, getSigningStargateClientProps } from './public-functions/getSigningStargateClient.js';
|
|
20
|
+
export { S as SkipClientOptions, s as setClientOptions } from './setClientOptions-DbanEIwL.js';
|
|
21
|
+
export { getRecommendedGasPrice } from './public-functions/getRecommendedGasPrice.js';
|
|
22
|
+
export { getFeeInfoForChain } from './public-functions/getFeeInfoForChain.js';
|
|
23
|
+
export { SetApiOptionsProps, setApiOptions } from './public-functions/setApiOptions.js';
|
|
24
|
+
import './generateApi-DqCp36fX.js';
|
|
25
|
+
import '@cosmjs/amino';
|
|
26
|
+
import '@cosmjs/proto-signing';
|
|
27
|
+
import '@cosmjs/stargate';
|
|
28
|
+
import 'viem';
|
|
29
|
+
import '@solana/wallet-adapter-base';
|
|
30
|
+
import './apiState-CdzxTxYd.js';
|
|
31
|
+
import '@cosmjs/proto-signing/build/signer';
|
|
32
|
+
import '@cosmjs/stargate/build/signingstargateclient';
|
|
33
|
+
import '@cosmjs/stargate/build/fee';
|
|
34
|
+
|
|
35
|
+
declare const GAS_STATION_CHAIN_IDS: string[];
|
|
36
|
+
|
|
37
|
+
export { GAS_STATION_CHAIN_IDS };
|