@skip-go/client 1.0.1-alpha-0 → 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.js +15 -2
- package/dist/api/getAssetsBetweenChains.js +11 -2
- package/dist/api/getBridges.js +11 -2
- package/dist/api/getChains.js +11 -2
- package/dist/api/getVenues.js +11 -2
- package/dist/api/postAssetsFromSource.js +12 -3
- package/dist/api/postBalances.js +11 -2
- package/dist/api/postIbcOriginAssets.js +11 -2
- package/dist/api/postMessages.js +11 -2
- package/dist/api/postMessagesDirect.js +11 -2
- package/dist/api/postRecommendAssets.js +11 -2
- package/dist/api/postRoute.js +11 -2
- package/dist/api/postSubmitTransaction.js +11 -2
- package/dist/api/postTrackTransaction.js +11 -2
- package/dist/api/postTransactionStatus.js +11 -2
- package/dist/{chunk-DAMZSSOH.cjs → chunk-2WHYWV4Y.js} +2 -2
- package/dist/{chunk-J4LI33TK.cjs → chunk-4XWIXR2P.js} +24 -18
- package/dist/chunk-5KVRQLI5.js +17 -0
- package/dist/{chunk-VI7UMBQ7.cjs → chunk-5ZJBR5AQ.js} +2 -2
- package/dist/{chunk-ISHM4QWP.cjs → chunk-6BTWKTNM.js} +4 -4
- package/dist/chunk-6GJEXV5J.js +130 -0
- package/dist/chunk-ASPVKNJ7.js +242 -0
- package/dist/{chunk-7SK3IFXJ.cjs → chunk-CG5CQQBW.js} +36 -32
- package/dist/chunk-EQLA2SEZ.js +2361 -0
- package/dist/{chunk-32MRDO7V.cjs → chunk-FVSSCQ6C.js} +2 -2
- package/dist/{chunk-5IAEEEOQ.cjs → chunk-GFRPLEJR.js} +227 -217
- package/dist/{chunk-L5V5PASH.cjs → chunk-KYFTM3PI.js} +2 -2
- package/dist/chunk-L2Q5RP6O.js +25 -0
- package/dist/{chunk-URLFWBSC.cjs → chunk-LRIPQQ4M.js} +2 -2
- package/dist/{chunk-ZNXE6PUV.cjs → chunk-PKPZTO4H.js} +10 -9
- package/dist/{chunk-RDOSNDAQ.cjs → chunk-RE2QZJWE.js} +2 -2
- package/dist/{chunk-7OIZPQJB.cjs → chunk-RT5TZAMU.js} +138 -101
- package/dist/chunk-SWYON2RG.js +4 -1
- package/dist/chunk-VQ5SIQWU.js +3 -1
- package/dist/{chunk-LXYLWTNZ.cjs → chunk-X2E2TKVR.js} +2 -2
- package/dist/{chunk-SW3SEQMJ.cjs → chunk-X2YPYBVN.js} +30 -25
- package/dist/{chunk-KDN7RCGP.cjs → chunk-YYNIFO2A.js} +2 -2
- package/dist/{chunk-77ITCT75.cjs → chunk-Z4ZKOUGH.js} +2 -2
- package/dist/{chunk-PNWIJSMA.cjs → chunk-ZG23Z3WY.js} +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +209 -24
- package/dist/public-functions/executeRoute.js +21 -12
- package/dist/public-functions/getFeeInfoForChain.js +14 -5
- package/dist/public-functions/getRecommendedGasPrice.d.ts +1 -1
- package/dist/public-functions/getRecommendedGasPrice.js +16 -7
- package/dist/public-functions/getSigningStargateClient.d.ts +1 -1
- package/dist/public-functions/getSigningStargateClient.js +13 -4
- package/dist/public-functions/setApiOptions.js +11 -2
- package/dist/public-functions/setClientOptions.js +13 -4
- package/package.json +1 -10
- package/dist/api/getAssets.cjs +0 -15
- package/dist/api/getAssets.d.cts +0 -19
- package/dist/api/getAssetsBetweenChains.cjs +0 -11
- package/dist/api/getAssetsBetweenChains.d.cts +0 -56
- package/dist/api/getBridges.cjs +0 -11
- package/dist/api/getBridges.d.cts +0 -54
- package/dist/api/getChains.cjs +0 -11
- package/dist/api/getChains.d.cts +0 -41
- package/dist/api/getVenues.cjs +0 -11
- package/dist/api/getVenues.d.cts +0 -13
- package/dist/api/postAssetsFromSource.cjs +0 -12
- package/dist/api/postAssetsFromSource.d.cts +0 -13
- package/dist/api/postBalances.cjs +0 -11
- package/dist/api/postBalances.d.cts +0 -35
- package/dist/api/postIbcOriginAssets.cjs +0 -11
- package/dist/api/postIbcOriginAssets.d.cts +0 -32
- package/dist/api/postMessages.cjs +0 -11
- package/dist/api/postMessages.d.cts +0 -528
- package/dist/api/postMessagesDirect.cjs +0 -11
- package/dist/api/postMessagesDirect.d.cts +0 -568
- package/dist/api/postRecommendAssets.cjs +0 -11
- package/dist/api/postRecommendAssets.d.cts +0 -40
- package/dist/api/postRoute.cjs +0 -11
- package/dist/api/postRoute.d.cts +0 -460
- package/dist/api/postSubmitTransaction.cjs +0 -11
- package/dist/api/postSubmitTransaction.d.cts +0 -13
- package/dist/api/postTrackTransaction.cjs +0 -11
- package/dist/api/postTrackTransaction.d.cts +0 -13
- package/dist/api/postTransactionStatus.cjs +0 -11
- package/dist/api/postTransactionStatus.d.cts +0 -559
- package/dist/apiState-CdzxTxYd.d.cts +0 -6
- package/dist/chunk-33K6EESX.js +0 -10
- package/dist/chunk-3N7XVGLX.js +0 -269
- package/dist/chunk-3OZQ35X3.js +0 -3597
- package/dist/chunk-44PBLFB5.cjs +0 -24
- package/dist/chunk-4JJWOILI.js +0 -13
- package/dist/chunk-4R6OCWRR.cjs +0 -1346
- package/dist/chunk-BQTQJQ5E.js +0 -10
- package/dist/chunk-BRJDNGYH.js +0 -22
- package/dist/chunk-BRMONS6A.js +0 -130
- package/dist/chunk-C2EDPY6J.js +0 -10
- package/dist/chunk-DW4U6YI6.js +0 -10
- package/dist/chunk-ED2OY55G.cjs +0 -136
- package/dist/chunk-GARVPN2H.js +0 -16
- package/dist/chunk-HAR3IXDE.cjs +0 -705
- package/dist/chunk-JTIHU43D.js +0 -183
- package/dist/chunk-KNV72XRZ.js +0 -10
- package/dist/chunk-KZOSEIWH.cjs +0 -10
- package/dist/chunk-MGVXJ2U4.js +0 -11
- package/dist/chunk-MTMPHY3Y.js +0 -9
- package/dist/chunk-PRQ2NHRZ.js +0 -11
- package/dist/chunk-RDRDFJQE.js +0 -10
- package/dist/chunk-RMP3HM5N.js +0 -14
- package/dist/chunk-SFMBRLUS.cjs +0 -18
- package/dist/chunk-SQGWZAUC.js +0 -2229
- package/dist/chunk-TW77BXMT.js +0 -44
- package/dist/chunk-VMPFHQ7U.js +0 -93
- package/dist/chunk-W2U2UOFA.js +0 -1790
- package/dist/chunk-W6TBGBV3.js +0 -675
- package/dist/chunk-WWNTHZ6I.cjs +0 -1812
- package/dist/client-types-qvyKvyFh.d.cts +0 -60
- package/dist/executeRoute-BKRpODCc.d.cts +0 -69
- package/dist/generateApi-C0amiydg.d.cts +0 -22
- package/dist/index.cjs +0 -209
- package/dist/index.d.cts +0 -35
- package/dist/public-functions/executeRoute.cjs +0 -21
- package/dist/public-functions/executeRoute.d.cts +0 -9
- package/dist/public-functions/getFeeInfoForChain.cjs +0 -14
- package/dist/public-functions/getFeeInfoForChain.d.cts +0 -9
- package/dist/public-functions/getRecommendedGasPrice.cjs +0 -16
- package/dist/public-functions/getRecommendedGasPrice.d.cts +0 -9
- package/dist/public-functions/getSigningStargateClient.cjs +0 -13
- package/dist/public-functions/getSigningStargateClient.d.cts +0 -13
- package/dist/public-functions/setApiOptions.cjs +0 -11
- package/dist/public-functions/setApiOptions.d.cts +0 -9
- package/dist/public-functions/setClientOptions.cjs +0 -13
- package/dist/public-functions/setClientOptions.d.cts +0 -9
- package/dist/setClientOptions-CT6CHI9I.d.cts +0 -19
- package/dist/swaggerTypes-O9-gvCT1.d.cts +0 -1890
package/dist/chunk-3N7XVGLX.js
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
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';
|
|
12
|
-
|
|
13
|
-
var createBaseVestingAccount = () => {
|
|
14
|
-
return {
|
|
15
|
-
// @ts-expect-error
|
|
16
|
-
baseAccount: void 0,
|
|
17
|
-
originalVesting: [],
|
|
18
|
-
delegatedFree: [],
|
|
19
|
-
delegatedVesting: [],
|
|
20
|
-
endTime: BigInt(0)
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
var BaseVestingAccount = {
|
|
24
|
-
encode(message, writer = BinaryWriter.create()) {
|
|
25
|
-
if (message.baseAccount !== void 0) {
|
|
26
|
-
BaseAccount.encode(
|
|
27
|
-
message.baseAccount,
|
|
28
|
-
writer.uint32(10).fork()
|
|
29
|
-
).ldelim();
|
|
30
|
-
}
|
|
31
|
-
for (const v of message.originalVesting) {
|
|
32
|
-
Coin.encode(v, writer.uint32(18).fork()).ldelim();
|
|
33
|
-
}
|
|
34
|
-
for (const v of message.delegatedFree) {
|
|
35
|
-
Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
36
|
-
}
|
|
37
|
-
for (const v of message.delegatedVesting) {
|
|
38
|
-
Coin.encode(v, writer.uint32(34).fork()).ldelim();
|
|
39
|
-
}
|
|
40
|
-
if (message.endTime !== BigInt(0)) {
|
|
41
|
-
writer.uint32(40).int64(message.endTime);
|
|
42
|
-
}
|
|
43
|
-
return writer;
|
|
44
|
-
},
|
|
45
|
-
decode(input, length) {
|
|
46
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
47
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
48
|
-
const message = createBaseVestingAccount();
|
|
49
|
-
while (reader.pos < end) {
|
|
50
|
-
const tag = reader.uint32();
|
|
51
|
-
switch (tag >>> 3) {
|
|
52
|
-
case 1:
|
|
53
|
-
message.baseAccount = BaseAccount.decode(reader, reader.uint32());
|
|
54
|
-
break;
|
|
55
|
-
case 2:
|
|
56
|
-
message.originalVesting.push(Coin.decode(reader, reader.uint32()));
|
|
57
|
-
break;
|
|
58
|
-
case 3:
|
|
59
|
-
message.delegatedFree.push(Coin.decode(reader, reader.uint32()));
|
|
60
|
-
break;
|
|
61
|
-
case 4:
|
|
62
|
-
message.delegatedVesting.push(Coin.decode(reader, reader.uint32()));
|
|
63
|
-
break;
|
|
64
|
-
case 5:
|
|
65
|
-
message.endTime = reader.int64();
|
|
66
|
-
break;
|
|
67
|
-
default:
|
|
68
|
-
reader.skipType(tag & 7);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return message;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
function createBasePeriod() {
|
|
76
|
-
return {
|
|
77
|
-
startTime: BigInt(0),
|
|
78
|
-
length: BigInt(0),
|
|
79
|
-
amount: [],
|
|
80
|
-
actionType: 0
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
var Period = {
|
|
84
|
-
encode(message, writer = BinaryWriter.create()) {
|
|
85
|
-
if (message.startTime !== BigInt(0)) {
|
|
86
|
-
writer.uint32(8).int64(message.startTime);
|
|
87
|
-
}
|
|
88
|
-
if (message.length !== BigInt(0)) {
|
|
89
|
-
writer.uint32(16).int64(message.length);
|
|
90
|
-
}
|
|
91
|
-
for (const v of message.amount) {
|
|
92
|
-
Coin.encode(v, writer.uint32(26).fork()).ldelim();
|
|
93
|
-
}
|
|
94
|
-
if (message.actionType !== 0) {
|
|
95
|
-
writer.uint32(32).int32(message.actionType);
|
|
96
|
-
}
|
|
97
|
-
return writer;
|
|
98
|
-
},
|
|
99
|
-
decode(input, length) {
|
|
100
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
101
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
102
|
-
const message = createBasePeriod();
|
|
103
|
-
while (reader.pos < end) {
|
|
104
|
-
const tag = reader.uint32();
|
|
105
|
-
switch (tag >>> 3) {
|
|
106
|
-
case 1:
|
|
107
|
-
message.startTime = reader.int64();
|
|
108
|
-
break;
|
|
109
|
-
case 2:
|
|
110
|
-
message.length = reader.int64();
|
|
111
|
-
break;
|
|
112
|
-
case 3:
|
|
113
|
-
message.amount.push(Coin.decode(reader, reader.uint32()));
|
|
114
|
-
break;
|
|
115
|
-
case 4:
|
|
116
|
-
message.actionType = reader.int32();
|
|
117
|
-
break;
|
|
118
|
-
default:
|
|
119
|
-
reader.skipType(tag & 7);
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return message;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
function createBaseStridePeriodicVestingAccount() {
|
|
127
|
-
return {
|
|
128
|
-
//eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
129
|
-
//@ts-ignore
|
|
130
|
-
baseVestingAccount: void 0,
|
|
131
|
-
vestingPeriods: []
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
var StridePeriodicVestingAccount = {
|
|
135
|
-
encode(message, writer = BinaryWriter.create()) {
|
|
136
|
-
if (message.baseVestingAccount !== void 0) {
|
|
137
|
-
BaseVestingAccount.encode(
|
|
138
|
-
message.baseVestingAccount,
|
|
139
|
-
writer.uint32(10).fork()
|
|
140
|
-
).ldelim();
|
|
141
|
-
}
|
|
142
|
-
for (const v of message.vestingPeriods) {
|
|
143
|
-
Period.encode(v, writer.uint32(26).fork()).ldelim();
|
|
144
|
-
}
|
|
145
|
-
return writer;
|
|
146
|
-
},
|
|
147
|
-
decode(input, length) {
|
|
148
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
149
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
150
|
-
const message = createBaseStridePeriodicVestingAccount();
|
|
151
|
-
while (reader.pos < end) {
|
|
152
|
-
const tag = reader.uint32();
|
|
153
|
-
switch (tag >>> 3) {
|
|
154
|
-
case 1:
|
|
155
|
-
message.baseVestingAccount = BaseVestingAccount.decode(
|
|
156
|
-
reader,
|
|
157
|
-
reader.uint32()
|
|
158
|
-
);
|
|
159
|
-
break;
|
|
160
|
-
case 3:
|
|
161
|
-
message.vestingPeriods.push(Period.decode(reader, reader.uint32()));
|
|
162
|
-
break;
|
|
163
|
-
default:
|
|
164
|
-
reader.skipType(tag & 7);
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return message;
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var accountParser = (acc) => {
|
|
172
|
-
switch (acc.typeUrl) {
|
|
173
|
-
case "/stride.vesting.StridePeriodicVestingAccount": {
|
|
174
|
-
const baseAccount = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount?.baseAccount;
|
|
175
|
-
assertDefinedAndNotNull(baseAccount);
|
|
176
|
-
return {
|
|
177
|
-
address: baseAccount.address,
|
|
178
|
-
pubkey: baseAccount.pubKey ? decodePubkey(baseAccount.pubKey) : null,
|
|
179
|
-
accountNumber: Number(baseAccount.accountNumber),
|
|
180
|
-
sequence: Number(baseAccount.sequence)
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
case "/injective.types.v1beta1.EthAccount":
|
|
184
|
-
return accountEthParser(
|
|
185
|
-
acc,
|
|
186
|
-
"/injective.crypto.v1beta1.ethsecp256k1.PubKey"
|
|
187
|
-
);
|
|
188
|
-
case "/ethermint.types.v1.EthAccount":
|
|
189
|
-
return accountEthParser(acc, "/ethermint.crypto.v1.ethsecp256k1.PubKey");
|
|
190
|
-
default: {
|
|
191
|
-
if (acc.typeUrl === "/cosmos.auth.v1beta1.BaseAccount") {
|
|
192
|
-
const { address, pubKey, accountNumber, sequence } = BaseAccount.decode(
|
|
193
|
-
acc.value
|
|
194
|
-
);
|
|
195
|
-
if (pubKey?.typeUrl === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
|
|
196
|
-
const { key } = PubKey.decode(pubKey.value);
|
|
197
|
-
const pk = encodeSecp256k1Pubkey(key);
|
|
198
|
-
return {
|
|
199
|
-
address,
|
|
200
|
-
pubkey: pk,
|
|
201
|
-
accountNumber: Number(accountNumber),
|
|
202
|
-
sequence: Number(sequence)
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return accountFromAny(acc);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
// src/private-functions/getRpcEndpointForChain.ts
|
|
212
|
-
var getRpcEndpointForChain = async (chainId) => {
|
|
213
|
-
if (ClientState.endpointOptions.getRpcEndpointForChain) {
|
|
214
|
-
return ClientState.endpointOptions.getRpcEndpointForChain(chainId);
|
|
215
|
-
}
|
|
216
|
-
if (ClientState.endpointOptions.endpoints && ClientState.endpointOptions.endpoints[chainId]) {
|
|
217
|
-
const endpointOptions = ClientState.endpointOptions.endpoints[chainId];
|
|
218
|
-
if (endpointOptions?.rpc) {
|
|
219
|
-
return endpointOptions.rpc;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
console.warn(
|
|
223
|
-
"Warning: You are using unreliable public endpoints. We strongly recommend overriding them via endpointOptions for use beyond development settings."
|
|
224
|
-
);
|
|
225
|
-
const chain = chains().find((chain2) => chain2.chain_id === chainId);
|
|
226
|
-
if (!chain) {
|
|
227
|
-
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
228
|
-
}
|
|
229
|
-
if (chain.apis?.rpc?.length === 0 || !chain.apis?.rpc) {
|
|
230
|
-
throw new Error(
|
|
231
|
-
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
const endpoints = chain.apis?.rpc?.map((api) => api.address);
|
|
235
|
-
const endpoint = await findFirstWorkingEndpoint(endpoints, "rpc");
|
|
236
|
-
if (!endpoint) {
|
|
237
|
-
throw new Error(
|
|
238
|
-
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
return endpoint;
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
// src/public-functions/getSigningStargateClient.ts
|
|
245
|
-
var getSigningStargateClient = async ({
|
|
246
|
-
chainId,
|
|
247
|
-
getOfflineSigner
|
|
248
|
-
}) => {
|
|
249
|
-
if (!getOfflineSigner) {
|
|
250
|
-
throw new Error("'getCosmosSigner' is not provided or configured in skip router");
|
|
251
|
-
}
|
|
252
|
-
if (!ClientState.signingStargateClientByChainId?.[chainId]) {
|
|
253
|
-
const [signer, endpoint] = await Promise.all([
|
|
254
|
-
getOfflineSigner(chainId),
|
|
255
|
-
getRpcEndpointForChain(chainId)
|
|
256
|
-
]);
|
|
257
|
-
ClientState.signingStargateClientByChainId[chainId] = await SigningStargateClient.connectWithSigner(endpoint, signer, {
|
|
258
|
-
aminoTypes: ClientState.aminoTypes,
|
|
259
|
-
registry: ClientState.registry,
|
|
260
|
-
accountParser
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
return {
|
|
264
|
-
stargateClient: ClientState.signingStargateClientByChainId[chainId],
|
|
265
|
-
signer: await getOfflineSigner(chainId)
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
export { accountParser, getRpcEndpointForChain, getSigningStargateClient };
|