@skip-go/client 1.6.0-alpha.2 → 1.6.0-alpha.3

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.
Files changed (158) hide show
  1. package/package.json +1 -1
  2. package/dist/cjs/api/getAssets.cjs +0 -16
  3. package/dist/cjs/api/getAssetsBetweenChains.cjs +0 -12
  4. package/dist/cjs/api/getBridges.cjs +0 -12
  5. package/dist/cjs/api/getChains.cjs +0 -12
  6. package/dist/cjs/api/getVenues.cjs +0 -12
  7. package/dist/cjs/api/postAssetsFromSource.cjs +0 -13
  8. package/dist/cjs/api/postBalances.cjs +0 -12
  9. package/dist/cjs/api/postIbcOriginAssets.cjs +0 -12
  10. package/dist/cjs/api/postMessages.cjs +0 -12
  11. package/dist/cjs/api/postMessagesDirect.cjs +0 -12
  12. package/dist/cjs/api/postRecommendAssets.cjs +0 -12
  13. package/dist/cjs/api/postRoute.cjs +0 -12
  14. package/dist/cjs/api/postSubmitTransaction.cjs +0 -12
  15. package/dist/cjs/api/postTrackTransaction.cjs +0 -12
  16. package/dist/cjs/api/postTransactionStatus.cjs +0 -12
  17. package/dist/cjs/chunk-25TA7Z7R.cjs +0 -460
  18. package/dist/cjs/chunk-2QPPD3BB.cjs +0 -210
  19. package/dist/cjs/chunk-2SA3OAIJ.cjs +0 -18
  20. package/dist/cjs/chunk-4BWE7SOV.cjs +0 -68
  21. package/dist/cjs/chunk-4GHUZDDP.cjs +0 -16
  22. package/dist/cjs/chunk-4ZIVDKQN.cjs +0 -387
  23. package/dist/cjs/chunk-A3UNNRKD.cjs +0 -574
  24. package/dist/cjs/chunk-A5S6SIYN.cjs +0 -12
  25. package/dist/cjs/chunk-AQTXZWLA.cjs +0 -55
  26. package/dist/cjs/chunk-ASDMDYTC.cjs +0 -11
  27. package/dist/cjs/chunk-ATW6UNT5.cjs +0 -136
  28. package/dist/cjs/chunk-AUTOIM57.cjs +0 -22
  29. package/dist/cjs/chunk-AVWWCQ5P.cjs +0 -2264
  30. package/dist/cjs/chunk-CIZTNJ3K.cjs +0 -24
  31. package/dist/cjs/chunk-CK6CQWQU.cjs +0 -49
  32. package/dist/cjs/chunk-EAZQ2ECA.cjs +0 -185
  33. package/dist/cjs/chunk-F3EB2AQG.cjs +0 -28
  34. package/dist/cjs/chunk-FCTBCHOT.cjs +0 -12
  35. package/dist/cjs/chunk-IJIBMN2F.cjs +0 -12
  36. package/dist/cjs/chunk-JRXPJ45U.cjs +0 -12
  37. package/dist/cjs/chunk-LJF74VNZ.cjs +0 -214
  38. package/dist/cjs/chunk-LJV45UGL.cjs +0 -582
  39. package/dist/cjs/chunk-MUJBB64F.cjs +0 -291
  40. package/dist/cjs/chunk-NCFH5MGF.cjs +0 -39
  41. package/dist/cjs/chunk-NM4PISTQ.cjs +0 -3359
  42. package/dist/cjs/chunk-OJISEAMX.cjs +0 -13
  43. package/dist/cjs/chunk-OVKHTOBP.cjs +0 -99
  44. package/dist/cjs/chunk-PDNKS5R2.cjs +0 -13
  45. package/dist/cjs/chunk-TEH6UMUR.cjs +0 -280
  46. package/dist/cjs/chunk-UXW4XVHF.cjs +0 -15
  47. package/dist/cjs/chunk-WVMDZODS.cjs +0 -1495
  48. package/dist/cjs/chunk-YX56UXDX.cjs +0 -189
  49. package/dist/cjs/index.cjs +0 -349
  50. package/dist/cjs/public-functions/executeMultipleRoutes.cjs +0 -27
  51. package/dist/cjs/public-functions/executeRoute.cjs +0 -27
  52. package/dist/cjs/public-functions/getCosmosGasAmountForMessage.cjs +0 -16
  53. package/dist/cjs/public-functions/getEvmGasAmountForMessage.cjs +0 -11
  54. package/dist/cjs/public-functions/getFeeInfoForChain.cjs +0 -14
  55. package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +0 -15
  56. package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +0 -41
  57. package/dist/cjs/public-functions/getSigningStargateClient.cjs +0 -15
  58. package/dist/cjs/public-functions/setApiOptions.cjs +0 -12
  59. package/dist/cjs/public-functions/setClientOptions.cjs +0 -16
  60. package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +0 -26
  61. package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +0 -18
  62. package/dist/cjs/public-functions/waitForTransaction.cjs +0 -18
  63. package/dist/esm/api/getAssets.d.ts +0 -19
  64. package/dist/esm/api/getAssets.js +0 -3
  65. package/dist/esm/api/getAssetsBetweenChains.d.ts +0 -56
  66. package/dist/esm/api/getAssetsBetweenChains.js +0 -3
  67. package/dist/esm/api/getBridges.d.ts +0 -55
  68. package/dist/esm/api/getBridges.js +0 -3
  69. package/dist/esm/api/getChains.d.ts +0 -41
  70. package/dist/esm/api/getChains.js +0 -3
  71. package/dist/esm/api/getVenues.d.ts +0 -13
  72. package/dist/esm/api/getVenues.js +0 -3
  73. package/dist/esm/api/postAssetsFromSource.d.ts +0 -22
  74. package/dist/esm/api/postAssetsFromSource.js +0 -4
  75. package/dist/esm/api/postBalances.d.ts +0 -35
  76. package/dist/esm/api/postBalances.js +0 -3
  77. package/dist/esm/api/postIbcOriginAssets.d.ts +0 -32
  78. package/dist/esm/api/postIbcOriginAssets.js +0 -3
  79. package/dist/esm/api/postMessages.d.ts +0 -101
  80. package/dist/esm/api/postMessages.js +0 -3
  81. package/dist/esm/api/postMessagesDirect.d.ts +0 -640
  82. package/dist/esm/api/postMessagesDirect.js +0 -3
  83. package/dist/esm/api/postRecommendAssets.d.ts +0 -40
  84. package/dist/esm/api/postRecommendAssets.js +0 -3
  85. package/dist/esm/api/postRoute.d.ts +0 -530
  86. package/dist/esm/api/postRoute.js +0 -3
  87. package/dist/esm/api/postSubmitTransaction.d.ts +0 -17
  88. package/dist/esm/api/postSubmitTransaction.js +0 -3
  89. package/dist/esm/api/postTrackTransaction.d.ts +0 -12
  90. package/dist/esm/api/postTrackTransaction.js +0 -3
  91. package/dist/esm/api/postTransactionStatus.d.ts +0 -639
  92. package/dist/esm/api/postTransactionStatus.js +0 -3
  93. package/dist/esm/apiState-1VvikVK-.d.ts +0 -8
  94. package/dist/esm/callbacks-DdC6QMlE.d.ts +0 -158
  95. package/dist/esm/chunk-3DIX6KRJ.js +0 -566
  96. package/dist/esm/chunk-3JHLVPRG.js +0 -10
  97. package/dist/esm/chunk-5WYMRZIO.js +0 -97
  98. package/dist/esm/chunk-6QW6MRVQ.js +0 -53
  99. package/dist/esm/chunk-A5NZMSTI.js +0 -10
  100. package/dist/esm/chunk-CGJRRAFS.js +0 -22
  101. package/dist/esm/chunk-DMJMN4J3.js +0 -379
  102. package/dist/esm/chunk-E4NRDAVO.js +0 -65
  103. package/dist/esm/chunk-ETBJVFQP.js +0 -10
  104. package/dist/esm/chunk-F2LQB2DP.js +0 -3323
  105. package/dist/esm/chunk-F66EKL3W.js +0 -203
  106. package/dist/esm/chunk-GV2QOWB4.js +0 -26
  107. package/dist/esm/chunk-GZJLX2CP.js +0 -2258
  108. package/dist/esm/chunk-HNU2Y3JI.js +0 -13
  109. package/dist/esm/chunk-J24LYWJE.js +0 -130
  110. package/dist/esm/chunk-KZKAL5ZN.js +0 -16
  111. package/dist/esm/chunk-N4PTRCNT.js +0 -11
  112. package/dist/esm/chunk-NUHMTWHP.js +0 -180
  113. package/dist/esm/chunk-OMOVHXSC.js +0 -212
  114. package/dist/esm/chunk-P36PE4CR.js +0 -37
  115. package/dist/esm/chunk-PZ2624FK.js +0 -187
  116. package/dist/esm/chunk-QYXGDTUU.js +0 -47
  117. package/dist/esm/chunk-R2GHDOWX.js +0 -272
  118. package/dist/esm/chunk-RH7PDDI5.js +0 -433
  119. package/dist/esm/chunk-RTDD7HZ3.js +0 -275
  120. package/dist/esm/chunk-SXBG57J3.js +0 -20
  121. package/dist/esm/chunk-TGTOO2ZQ.js +0 -14
  122. package/dist/esm/chunk-UHCKOKBM.js +0 -9
  123. package/dist/esm/chunk-ULUX2CVU.js +0 -557
  124. package/dist/esm/chunk-UN46DUOV.js +0 -11
  125. package/dist/esm/chunk-XNU3TKKM.js +0 -10
  126. package/dist/esm/chunk-ZVFYCNA5.js +0 -1492
  127. package/dist/esm/client-types-D03Tellv.d.ts +0 -114
  128. package/dist/esm/generateApi-Bv02Xt5y.d.ts +0 -56
  129. package/dist/esm/index.d.ts +0 -1859
  130. package/dist/esm/index.js +0 -32
  131. package/dist/esm/public-functions/executeMultipleRoutes.d.ts +0 -80
  132. package/dist/esm/public-functions/executeMultipleRoutes.js +0 -18
  133. package/dist/esm/public-functions/executeRoute.d.ts +0 -12
  134. package/dist/esm/public-functions/executeRoute.js +0 -18
  135. package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +0 -8
  136. package/dist/esm/public-functions/getCosmosGasAmountForMessage.js +0 -3
  137. package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +0 -14
  138. package/dist/esm/public-functions/getEvmGasAmountForMessage.js +0 -2
  139. package/dist/esm/public-functions/getFeeInfoForChain.d.ts +0 -9
  140. package/dist/esm/public-functions/getFeeInfoForChain.js +0 -5
  141. package/dist/esm/public-functions/getRecommendedGasPrice.d.ts +0 -9
  142. package/dist/esm/public-functions/getRecommendedGasPrice.js +0 -6
  143. package/dist/esm/public-functions/getRouteWithGasOnReceive.d.ts +0 -20
  144. package/dist/esm/public-functions/getRouteWithGasOnReceive.js +0 -32
  145. package/dist/esm/public-functions/getSigningStargateClient.d.ts +0 -13
  146. package/dist/esm/public-functions/getSigningStargateClient.js +0 -6
  147. package/dist/esm/public-functions/setApiOptions.d.ts +0 -9
  148. package/dist/esm/public-functions/setApiOptions.js +0 -3
  149. package/dist/esm/public-functions/setClientOptions.d.ts +0 -11
  150. package/dist/esm/public-functions/setClientOptions.js +0 -7
  151. package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +0 -12
  152. package/dist/esm/public-functions/subscribeToRouteStatus.js +0 -5
  153. package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +0 -44
  154. package/dist/esm/public-functions/validateCosmosGasBalance.js +0 -9
  155. package/dist/esm/public-functions/waitForTransaction.d.ts +0 -1279
  156. package/dist/esm/public-functions/waitForTransaction.js +0 -5
  157. package/dist/esm/setClientOptions-CTwe8YVX.d.ts +0 -76
  158. package/dist/esm/swaggerTypes-CzGbnX_b.d.ts +0 -2067
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- var viem = require('viem');
4
-
5
- // src/public-functions/getEvmGasAmountForMessage.ts
6
- async function getEVMGasAmountForMessage(signer, tx, getFallbackGasAmount) {
7
- const { to, data, value } = tx;
8
- if (!signer.account) throw new Error("estimateGasForEvmTx: No account found");
9
- const extendedSigner = signer.extend(viem.publicActions);
10
- const fee = await extendedSigner.estimateFeesPerGas();
11
- try {
12
- const gasAmount = await extendedSigner.estimateGas({
13
- account: signer.account,
14
- to,
15
- data: `0x${data}`,
16
- value: value === "" ? void 0 : BigInt(value ?? "")
17
- });
18
- return gasAmount * fee.maxFeePerGas;
19
- } catch (error) {
20
- const fallbackGasAmount = await getFallbackGasAmount?.(tx.chainId ?? "", "evm" /* Evm */);
21
- if (fallbackGasAmount) {
22
- return BigInt(fallbackGasAmount) * fee.maxFeePerGas;
23
- }
24
- throw error;
25
- }
26
- }
27
-
28
- exports.getEVMGasAmountForMessage = getEVMGasAmountForMessage;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
4
-
5
- // src/api/getVenues.ts
6
- var venues = chunk2QPPD3BB_cjs.api({
7
- methodName: "venues",
8
- path: "v2/fungible/venues",
9
- transformResponse: (response) => response.venues
10
- });
11
-
12
- exports.venues = venues;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
4
-
5
- // src/api/getBridges.ts
6
- var bridges = chunk2QPPD3BB_cjs.api({
7
- methodName: "bridges",
8
- path: "v2/info/bridges",
9
- transformResponse: (response) => response.bridges
10
- });
11
-
12
- exports.bridges = bridges;
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
4
-
5
- // src/api/postSubmitTransaction.ts
6
- var submitTransaction = chunk2QPPD3BB_cjs.api({
7
- methodName: "submit",
8
- method: "post",
9
- path: "v2/tx/submit"
10
- });
11
-
12
- exports.submitTransaction = submitTransaction;
@@ -1,214 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkWVMDZODS_cjs = require('./chunk-WVMDZODS.cjs');
4
- var chunkA3UNNRKD_cjs = require('./chunk-A3UNNRKD.cjs');
5
- var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
6
- var chunkAUTOIM57_cjs = require('./chunk-AUTOIM57.cjs');
7
- var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
8
-
9
- // src/public-functions/executeMultipleRoutes.ts
10
- var executeMultipleRoutes = async (options) => {
11
- const {
12
- route,
13
- userAddresses,
14
- appendCosmosMsgs,
15
- postRouteHandler,
16
- slippageTolerancePercent,
17
- ...restOptions
18
- } = options;
19
- const addressList = {};
20
- for (const [routeKey, routeValue] of Object.entries(route)) {
21
- const _userAddresses = userAddresses[routeKey];
22
- if (_userAddresses === void 0) {
23
- throw new Error(
24
- `executeMultipleRoutes error: no user addresses found for route: ${routeKey}`
25
- );
26
- }
27
- const routeAddressList = await chunkWVMDZODS_cjs.createValidAddressList({
28
- userAddresses: _userAddresses,
29
- route: routeValue
30
- });
31
- addressList[routeKey] = routeAddressList;
32
- }
33
- const msgsResponses = await Promise.all(
34
- Object.entries(route).map(async ([routeKey, routeValue]) => {
35
- const routeAddressList = addressList[routeKey];
36
- if (routeAddressList === void 0) {
37
- throw new Error(
38
- `executeMultipleRoutes error: address list not found for route ${routeKey}`
39
- );
40
- }
41
- return await chunkNCFH5MGF_cjs.messages({
42
- timeoutSeconds: options.timeoutSeconds,
43
- amountIn: routeValue?.amountIn,
44
- amountOut: routeValue.estimatedAmountOut || "0",
45
- sourceAssetChainId: routeValue?.sourceAssetChainId,
46
- sourceAssetDenom: routeValue?.sourceAssetDenom,
47
- destAssetChainId: routeValue?.destAssetChainId,
48
- destAssetDenom: routeValue?.destAssetDenom,
49
- operations: routeValue?.operations,
50
- addressList: routeAddressList,
51
- slippageTolerancePercent: slippageTolerancePercent?.[routeKey] || "1",
52
- chainIdsToAffiliates: chunk2QPPD3BB_cjs.ApiState.chainIdsToAffiliates,
53
- postRouteHandler: postRouteHandler?.[routeKey],
54
- feePayerAddress: options.svmFeePayer?.address
55
- });
56
- })
57
- );
58
- let msgsRecord = {};
59
- msgsResponses.forEach((msg, index2) => {
60
- const routeKey = Object.keys(route)[index2];
61
- if (!routeKey) {
62
- throw new Error(
63
- `executeMultipleRoutes error: route key not found for index ${index2}`
64
- );
65
- }
66
- const addedCosmosMsgs = appendCosmosMsgs?.[routeKey];
67
- if (addedCosmosMsgs) {
68
- Object.entries(addedCosmosMsgs).forEach(([chainId, msgs]) => {
69
- const txIndex = msg?.txs?.findIndex(
70
- (tx2) => "cosmosTx" in tx2 && tx2.cosmosTx.chainId === chainId
71
- );
72
- if (txIndex === void 0 || txIndex === -1) return;
73
- const tx = msg?.txs?.[txIndex];
74
- if (tx && "cosmosTx" in tx) {
75
- tx.cosmosTx.msgs?.unshift(...msgs);
76
- }
77
- });
78
- }
79
- msgsRecord[routeKey] = msg;
80
- });
81
- let transferIndexToRouteKey = void 0;
82
- const cosmosTxIndex0Map = /* @__PURE__ */ new Map();
83
- let transferIndex = 0;
84
- for (const [routeKey, msgs] of Object.entries(msgsRecord)) {
85
- const firstTx = msgs?.txs?.[0];
86
- if (firstTx && "cosmosTx" in firstTx) {
87
- const { chainId, msgs: firstTxMsgs } = firstTx.cosmosTx;
88
- if (!transferIndexToRouteKey) {
89
- transferIndexToRouteKey = {};
90
- }
91
- transferIndexToRouteKey[transferIndex] = routeKey;
92
- transferIndex++;
93
- if (!cosmosTxIndex0Map.has(chainId)) {
94
- cosmosTxIndex0Map.set(chainId, {
95
- routeKey,
96
- firstCosmosTx: firstTx.cosmosTx
97
- });
98
- } else {
99
- const existing = cosmosTxIndex0Map.get(chainId);
100
- if (existing && firstTxMsgs) {
101
- const modifyTarget = msgsRecord[existing.routeKey]?.txs?.[0];
102
- if (modifyTarget && "cosmosTx" in modifyTarget) {
103
- modifyTarget.cosmosTx.msgs?.push(...firstTxMsgs);
104
- msgsRecord[routeKey]?.txs?.shift();
105
- }
106
- }
107
- }
108
- }
109
- }
110
- Object.entries(msgsRecord).forEach(([routeKey, msgs]) => {
111
- if (msgs?.txs?.length === 0) {
112
- delete msgsRecord[routeKey];
113
- }
114
- });
115
- let mainRouteId = void 0;
116
- let msgsRecordIndexToRouteId = {};
117
- let index = 0;
118
- const transactionDetailsList = {};
119
- const executeTransactionList = {};
120
- const mergedMainAndSecondaryRoutes = Object.entries(msgsRecord).length !== Object.entries(route).length;
121
- for (const [routeKey, msgsResponse] of Object.entries(msgsRecord)) {
122
- const { id: routeId } = chunkA3UNNRKD_cjs.updateRouteDetails({
123
- status: "unconfirmed",
124
- options: {
125
- route: route[routeKey],
126
- ...restOptions
127
- },
128
- mainRouteId,
129
- transferIndexToRouteKey
130
- });
131
- msgsRecordIndexToRouteId[index] = routeId;
132
- if (routeKey === "mainRoute") {
133
- mainRouteId = routeId;
134
- }
135
- const { transactionDetails, executeTransaction: _executeTransaction } = await chunkWVMDZODS_cjs.executeTransactions({
136
- ...restOptions,
137
- routeId,
138
- txs: msgsResponse?.txs,
139
- route: route[routeKey],
140
- userAddresses: userAddresses[routeKey],
141
- isMultiRoutes: true
142
- });
143
- const executeTransaction = async (index2) => {
144
- const txResult = await _executeTransaction(index2);
145
- if (routeKey !== "mainRoute" || mergedMainAndSecondaryRoutes) {
146
- const relatedRoutes = Object.entries(route).filter(([key]) => key !== "mainRoute").map(([key, route2]) => ({ route: route2, routeKey: key, status: "pending" }));
147
- chunkA3UNNRKD_cjs.updateRouteDetails({
148
- options: {
149
- route: route[routeKey],
150
- ...restOptions
151
- },
152
- routeId: mainRouteId,
153
- transferIndexToRouteKey,
154
- relatedRoutes
155
- });
156
- }
157
- return txResult;
158
- };
159
- if (transactionDetails[0]?.chainType === "evm" /* Evm */) {
160
- for (const [index2, transactionDetail] of transactionDetails.entries()) {
161
- const txResult = await executeTransaction(index2);
162
- if (txResult.txHash) {
163
- const trackResponse = await chunkAUTOIM57_cjs.trackTransaction({
164
- chainId: transactionDetail.chainId,
165
- txHash: txResult.txHash,
166
- ...options.trackTxPollingOptions
167
- });
168
- await options?.onTransactionTracked?.({
169
- txHash: txResult.txHash,
170
- chainId: transactionDetail.chainId,
171
- explorerLink: trackResponse.explorerLink
172
- });
173
- transactionDetail.txHash = txResult.txHash;
174
- transactionDetail.explorerLink = trackResponse.explorerLink;
175
- }
176
- }
177
- } else {
178
- executeTransactionList[index] = executeTransaction;
179
- }
180
- transactionDetailsList[index] = transactionDetails;
181
- index++;
182
- }
183
- await Promise.all(
184
- Object.entries(msgsRecord).map(([routeKey, msgsResponse], index2) => {
185
- return chunkA3UNNRKD_cjs.executeAndSubscribeToRouteStatus({
186
- transactionDetails: transactionDetailsList[index2],
187
- executeTransaction: executeTransactionList[index2],
188
- routeId: msgsRecordIndexToRouteId[index2],
189
- options: {
190
- route: route[routeKey],
191
- userAddresses: userAddresses[routeKey],
192
- ...restOptions,
193
- onRouteStatusUpdated: (routeStatus) => {
194
- const relatedRoutes = Object.entries(route).filter(([key]) => key !== "mainRoute").map(([key, route2]) => ({ route: route2, routeKey: key, status: routeStatus.status }));
195
- if (routeKey !== "mainRoute") {
196
- chunkA3UNNRKD_cjs.updateRouteDetails({
197
- options: {
198
- route: route[routeKey],
199
- ...restOptions
200
- },
201
- routeId: mainRouteId,
202
- transferIndexToRouteKey,
203
- relatedRoutes
204
- });
205
- }
206
- options.onRouteStatusUpdated?.(routeStatus);
207
- }
208
- }
209
- });
210
- })
211
- );
212
- };
213
-
214
- exports.executeMultipleRoutes = executeMultipleRoutes;