@skip-go/client 1.3.6 → 1.4.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/cjs/api/getAssets.cjs +4 -4
- package/dist/cjs/api/getAssetsBetweenChains.cjs +3 -3
- package/dist/cjs/api/getBridges.cjs +3 -3
- package/dist/cjs/api/getChains.cjs +3 -3
- package/dist/cjs/api/getVenues.cjs +3 -3
- package/dist/cjs/api/postAssetsFromSource.cjs +4 -4
- package/dist/cjs/api/postBalances.cjs +3 -3
- package/dist/cjs/api/postIbcOriginAssets.cjs +3 -3
- package/dist/cjs/api/postMessages.cjs +3 -3
- package/dist/cjs/api/postMessagesDirect.cjs +3 -3
- package/dist/cjs/api/postRecommendAssets.cjs +3 -3
- package/dist/cjs/api/postRoute.cjs +3 -3
- package/dist/cjs/api/postSubmitTransaction.cjs +3 -3
- package/dist/cjs/api/postTrackTransaction.cjs +3 -3
- package/dist/cjs/api/postTransactionStatus.cjs +3 -3
- package/dist/cjs/chunk-3M7YYWGL.cjs +295 -0
- package/dist/cjs/{chunk-IE22IVFA.cjs → chunk-46VB6RQK.cjs} +8 -8
- package/dist/cjs/{chunk-MW3TE7DC.cjs → chunk-5AYPH3ZR.cjs} +2 -2
- package/dist/cjs/{chunk-2CCLIBCC.cjs → chunk-5HDKZVOL.cjs} +2 -2
- package/dist/cjs/{chunk-3FYU3BJ7.cjs → chunk-6LA66667.cjs} +126 -16
- package/dist/cjs/chunk-7MC3BVQN.cjs +370 -0
- package/dist/cjs/{chunk-YYBGBKRE.cjs → chunk-A26H4FVN.cjs} +4 -4
- package/dist/cjs/{chunk-P7CDAHIX.cjs → chunk-AXYRULAI.cjs} +2 -2
- package/dist/cjs/{chunk-WMXUOVHN.cjs → chunk-DWOE6N5S.cjs} +248 -532
- package/dist/cjs/{chunk-7I2KQNIU.cjs → chunk-EJMC4JXF.cjs} +2 -2
- package/dist/cjs/{chunk-HKQ5VION.cjs → chunk-ERGJBZUC.cjs} +5 -1
- package/dist/cjs/{chunk-J5RC6ZU5.cjs → chunk-FNB244QI.cjs} +6 -6
- package/dist/cjs/{chunk-2EKCOIWV.cjs → chunk-IDEJORRT.cjs} +155 -154
- package/dist/cjs/{chunk-DBDB2XWX.cjs → chunk-JBKNEFXB.cjs} +3 -3
- package/dist/cjs/{chunk-N3LR7KTI.cjs → chunk-KM2D7PJL.cjs} +33 -57
- package/dist/cjs/{chunk-XGBCEYWI.cjs → chunk-LHY62HPI.cjs} +2 -2
- package/dist/cjs/{chunk-EXK2GDR5.cjs → chunk-LUVMRHAJ.cjs} +2 -2
- package/dist/cjs/{chunk-QSISUSYP.cjs → chunk-N4UW74AG.cjs} +4 -4
- package/dist/cjs/{chunk-FY56EEFB.cjs → chunk-OZUCMWNE.cjs} +2 -2
- package/dist/cjs/{chunk-JTB3SPCH.cjs → chunk-Q43XCBMX.cjs} +6 -6
- package/dist/cjs/{chunk-2VQ2TNFM.cjs → chunk-QPM7H2YL.cjs} +2 -2
- package/dist/cjs/{chunk-FO25SR66.cjs → chunk-RCGCQD6T.cjs} +6 -6
- package/dist/cjs/chunk-VIG2BHYJ.cjs +185 -0
- package/dist/cjs/{chunk-DCFIIF7G.cjs → chunk-X5AJHZ2J.cjs} +2 -2
- package/dist/cjs/{chunk-SZ64FWGB.cjs → chunk-ZAATXQBG.cjs} +2 -2
- package/dist/cjs/{chunk-MCZ3F457.cjs → chunk-ZBPDDVQ2.cjs} +2 -2
- package/dist/cjs/{chunk-VGS46RWR.cjs → chunk-ZKBSNSHQ.cjs} +188 -209
- package/dist/cjs/index.cjs +57 -51
- package/dist/cjs/public-functions/executeRoute.cjs +16 -15
- package/dist/cjs/public-functions/getCosmosGasAmountForMessage.cjs +5 -4
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +5 -5
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +6 -6
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +6 -5
- package/dist/cjs/public-functions/setApiOptions.cjs +3 -3
- package/dist/cjs/public-functions/setClientOptions.cjs +6 -5
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +26 -0
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +9 -8
- package/dist/cjs/public-functions/waitForTransaction.cjs +5 -5
- package/dist/esm/api/getAssets.js +2 -2
- package/dist/esm/api/getAssetsBetweenChains.js +2 -2
- package/dist/esm/api/getBridges.js +2 -2
- package/dist/esm/api/getChains.js +2 -2
- package/dist/esm/api/getVenues.js +2 -2
- package/dist/esm/api/postAssetsFromSource.js +3 -3
- package/dist/esm/api/postBalances.js +2 -2
- package/dist/esm/api/postIbcOriginAssets.js +2 -2
- package/dist/esm/api/postMessages.js +2 -2
- package/dist/esm/api/postMessagesDirect.js +2 -2
- package/dist/esm/api/postRecommendAssets.js +2 -2
- package/dist/esm/api/postRoute.js +2 -2
- package/dist/esm/api/postSubmitTransaction.js +2 -2
- package/dist/esm/api/postTrackTransaction.d.ts +2 -1
- package/dist/esm/api/postTrackTransaction.js +2 -2
- package/dist/esm/api/postTransactionStatus.d.ts +1 -1
- package/dist/esm/api/postTransactionStatus.js +2 -2
- package/dist/esm/callbacks-B3kjKg0v.d.ts +175 -0
- package/dist/esm/chunk-3J6O2PVK.js +180 -0
- package/dist/esm/{chunk-SJP6W2SK.js → chunk-3XOGEVJL.js} +1 -1
- package/dist/esm/{chunk-ZL6XF5A3.js → chunk-4RLJWCQR.js} +2 -2
- package/dist/esm/{chunk-JSY7M43P.js → chunk-52PEBJRQ.js} +1 -1
- package/dist/esm/{chunk-7ITTEUMR.js → chunk-7X4ERB3R.js} +1 -1
- package/dist/esm/{chunk-LZI7A4JI.js → chunk-A6KSECAH.js} +5 -1
- package/dist/esm/{chunk-7LSTJXAF.js → chunk-AND7HVIU.js} +1 -1
- package/dist/esm/{chunk-MXCJ2M3K.js → chunk-APRMN34M.js} +1 -1
- package/dist/esm/{chunk-6ZLEWCU2.js → chunk-BAJFQZDT.js} +146 -167
- package/dist/esm/{chunk-5KIWNRW4.js → chunk-CIAOTO3M.js} +1 -1
- package/dist/esm/{chunk-JYUNVL4F.js → chunk-FH2YHZVV.js} +1 -1
- package/dist/esm/{chunk-ADUNNC4O.js → chunk-GHNH5QC3.js} +3 -3
- package/dist/esm/{chunk-OHV2LZEG.js → chunk-JQ4F4WBG.js} +1 -1
- package/dist/esm/{chunk-TV2XPAIF.js → chunk-KNXMSLOB.js} +3 -26
- package/dist/esm/{chunk-YLVFZDR5.js → chunk-KYDY7QRT.js} +109 -3
- package/dist/esm/{chunk-IWXRHEX4.js → chunk-LHNGF5J2.js} +2 -2
- package/dist/esm/{chunk-JIADJKRD.js → chunk-OTS5KO43.js} +1 -1
- package/dist/esm/{chunk-CU6W3622.js → chunk-QIS6ILPS.js} +3 -3
- package/dist/esm/chunk-QO2CYYF5.js +278 -0
- package/dist/esm/{chunk-OL7CWCPB.js → chunk-REWUSU53.js} +4 -3
- package/dist/esm/chunk-RQ7DXNSS.js +365 -0
- package/dist/esm/{chunk-XXTECZG3.js → chunk-S4RO2LHD.js} +1 -1
- package/dist/esm/{chunk-7YN3UVVF.js → chunk-UI3SIFZN.js} +1 -1
- package/dist/esm/{chunk-TD63P2AG.js → chunk-UIDIKXMB.js} +65 -340
- package/dist/esm/{chunk-HT6O3BQ7.js → chunk-Y2YCODZK.js} +1 -1
- package/dist/esm/{chunk-IPHFFTGO.js → chunk-ZI3SYUQH.js} +1 -1
- package/dist/esm/{chunk-2L7PKZDY.js → chunk-ZOUYAZU6.js} +1 -1
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +27 -25
- package/dist/esm/public-functions/executeRoute.d.ts +7 -76
- package/dist/esm/public-functions/executeRoute.js +15 -14
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.js +3 -2
- package/dist/esm/public-functions/getFeeInfoForChain.js +4 -4
- package/dist/esm/public-functions/getRecommendedGasPrice.js +5 -5
- package/dist/esm/public-functions/getSigningStargateClient.js +5 -4
- package/dist/esm/public-functions/setApiOptions.js +2 -2
- package/dist/esm/public-functions/setClientOptions.js +5 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +12 -0
- package/dist/esm/public-functions/subscribeToRouteStatus.js +5 -0
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +3 -2
- package/dist/esm/public-functions/validateCosmosGasBalance.js +8 -7
- package/dist/esm/public-functions/waitForTransaction.d.ts +5 -1
- package/dist/esm/public-functions/waitForTransaction.js +4 -4
- package/package.json +3 -3
- package/dist/cjs/chunk-MN763TPC.cjs +0 -187
- package/dist/esm/callbacks-CuL50GnB.d.ts +0 -38
- package/dist/esm/chunk-VBWLUZXT.js +0 -182
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { TxStatusResponse } from './api/postTransactionStatus.js';
|
|
2
|
+
import { aS as TransferState, k as AxelarTransferState, p as CCTPTransferState, a8 as HyperlaneTransferState, aO as OPInitTransferState, w as GoFastTransferState, s as StargateTransferState, aP as LayerZeroTransferState, bf as RouteResponse, W as CosmosMsg, an as PostHandler, aT as TransferAssetRelease, aJ as TransactionState, aq as Route, aU as TransferStatus, T as Erc20Approval } from './swaggerTypes-DDwqIjap.js';
|
|
3
|
+
import { A as ApiRequest } from './generateApi-C_xgtxrO.js';
|
|
4
|
+
import { S as SignerGetters, b as GasOptions, U as UserAddress, T as TxResult } from './client-types-B7Fin0mq.js';
|
|
5
|
+
import { TrackTxPollingProps } from './api/postTrackTransaction.js';
|
|
6
|
+
|
|
7
|
+
type TransferEventStatus = "unconfirmed" | "signing" | "pending" | "completed" | "failed" | "approving" | "incomplete";
|
|
8
|
+
type ClientTransferEvent = {
|
|
9
|
+
fromChainId: string;
|
|
10
|
+
toChainId: string;
|
|
11
|
+
state: TransferState | AxelarTransferState | CCTPTransferState | HyperlaneTransferState | OPInitTransferState | GoFastTransferState | StargateTransferState | LayerZeroTransferState;
|
|
12
|
+
status?: TransferEventStatus;
|
|
13
|
+
fromExplorerLink?: string;
|
|
14
|
+
toExplorerLink?: string;
|
|
15
|
+
explorerLink?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** Execute Route Options */
|
|
19
|
+
type ExecuteRouteOptions = SignerGetters & GasOptions & TransactionCallbacks & Pick<ApiRequest<"msgs">, "timeoutSeconds"> & {
|
|
20
|
+
route: RouteResponse;
|
|
21
|
+
/**
|
|
22
|
+
* Addresses should be in the same order with the `chainIDs` in the `route`
|
|
23
|
+
*/
|
|
24
|
+
userAddresses: UserAddress[];
|
|
25
|
+
simulate?: boolean;
|
|
26
|
+
slippageTolerancePercent?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Arbitrary Tx to be executed before or after route msgs
|
|
29
|
+
*/
|
|
30
|
+
beforeMsg?: CosmosMsg;
|
|
31
|
+
afterMsg?: CosmosMsg;
|
|
32
|
+
/**
|
|
33
|
+
* Set allowance amount to max if EVM transaction requires allowance approval.
|
|
34
|
+
*/
|
|
35
|
+
useUnlimitedApproval?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
/**
|
|
38
|
+
* If `skipApproval` is set to `true`, the router will bypass checking whether
|
|
39
|
+
* the signer has granted approval for the specified token contract on an EVM chain.
|
|
40
|
+
* This can be useful if approval has already been handled externally or there are race conditions.
|
|
41
|
+
*/
|
|
42
|
+
bypassApprovalCheck?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* defaults to true
|
|
45
|
+
* If `batchSimulate` is set to `true`, it will simulate all messages in a batch before the first tx run.
|
|
46
|
+
* If `batchSimulate` is set to `false`, it will simulate each message one by one.
|
|
47
|
+
*/
|
|
48
|
+
batchSimulate?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Optional configuration for transaction polling behavior.
|
|
51
|
+
* - `maxRetries`: Maximum number of polling attempts (default: 5)
|
|
52
|
+
* - `retryInterval`: Retry interval in milliseconds (default: 1000)
|
|
53
|
+
* - `backoffMultiplier`: Exponential backoff multiplier for increasing delay between retries (default: 2.5)
|
|
54
|
+
* Example backoff with retryInterval = 1000 and backoffMultiplier = 2:
|
|
55
|
+
* 1st retry: 1000ms → 2nd: 2000ms → 3rd: 4000ms → 4th: 8000ms ...
|
|
56
|
+
*/
|
|
57
|
+
trackTxPollingOptions?: TrackTxPollingProps;
|
|
58
|
+
/**
|
|
59
|
+
* If `batchSignTxs` is set to `true`, it will sign all transactions in a batch up front.
|
|
60
|
+
* If `batchSignTxs` is set to `false`, it will sign each transaction one by one.
|
|
61
|
+
*/
|
|
62
|
+
batchSignTxs?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Specify actions to perform after the route is completed
|
|
65
|
+
*/
|
|
66
|
+
postRouteHandler?: PostHandler;
|
|
67
|
+
/**
|
|
68
|
+
* If `cosmosPriorityFeeDenom` is provided, it will be used to set the priority fee for Cosmos transactions.
|
|
69
|
+
* It should be a function that takes a chainId and returns the denom for the priority fee.
|
|
70
|
+
*/
|
|
71
|
+
getCosmosPriorityFeeDenom?: (chainId: string) => Promise<string | undefined>;
|
|
72
|
+
/**
|
|
73
|
+
* SVM Fee Payer
|
|
74
|
+
*
|
|
75
|
+
* This is used to pay for the transaction fees on SVM chains.
|
|
76
|
+
* It should be an object with the following properties:
|
|
77
|
+
* `address`: The address of the fee payer.
|
|
78
|
+
* `signTransaction`: A function that takes the data to sign and returns a Promise that resolves to the signed transaction.
|
|
79
|
+
*/
|
|
80
|
+
svmFeePayer?: {
|
|
81
|
+
address: string;
|
|
82
|
+
signTransaction: (dataToSign: Buffer) => Promise<Uint8Array>;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
declare const executeRoute: (options: ExecuteRouteOptions) => Promise<void>;
|
|
86
|
+
|
|
87
|
+
type RouteStatus = "unconfirmed" | "validating" | "allowance" | "signing" | "pending" | "completed" | "incomplete" | "failed";
|
|
88
|
+
type TransactionStatus = "pending" | "success" | "failed";
|
|
89
|
+
type TransactionDetails = {
|
|
90
|
+
chainId: string;
|
|
91
|
+
txHash?: string;
|
|
92
|
+
status?: TransactionStatus;
|
|
93
|
+
statusResponse?: TxStatusResponse;
|
|
94
|
+
explorerLink?: string;
|
|
95
|
+
};
|
|
96
|
+
type SimpleRoute = Partial<Pick<Route, "amountIn" | "amountOut" | "sourceAssetDenom" | "sourceAssetChainId" | "destAssetDenom" | "destAssetChainId" | "estimatedRouteDurationSeconds">>;
|
|
97
|
+
type RouteDetails = {
|
|
98
|
+
id: string;
|
|
99
|
+
timestamp: number;
|
|
100
|
+
status: RouteStatus;
|
|
101
|
+
route: SimpleRoute;
|
|
102
|
+
txsRequired: number;
|
|
103
|
+
txsSigned: number;
|
|
104
|
+
transactionDetails: TransactionDetails[];
|
|
105
|
+
transferEvents: ClientTransferEvent[];
|
|
106
|
+
transferAssetRelease?: TransferAssetRelease;
|
|
107
|
+
senderAddress: string;
|
|
108
|
+
receiverAddress: string;
|
|
109
|
+
};
|
|
110
|
+
declare function getTransactionStatus(state?: TransactionState): TransactionStatus;
|
|
111
|
+
type subscribeToRouteStatusProps = {
|
|
112
|
+
routeDetails?: RouteDetails;
|
|
113
|
+
onRouteStatusUpdated?: ExecuteRouteOptions["onRouteStatusUpdated"];
|
|
114
|
+
unsubscribe?: () => void;
|
|
115
|
+
};
|
|
116
|
+
type executeAndSubscribeToRouteStatusProps = {
|
|
117
|
+
routeDetails?: RouteDetails;
|
|
118
|
+
transactionDetails?: TransactionDetails[];
|
|
119
|
+
trackTxPollingOptions?: ExecuteRouteOptions["trackTxPollingOptions"];
|
|
120
|
+
onRouteStatusUpdated?: ExecuteRouteOptions["onRouteStatusUpdated"];
|
|
121
|
+
executeTransaction?: (index: number) => Promise<TxResult>;
|
|
122
|
+
onTransactionTracked?: ExecuteRouteOptions["onTransactionTracked"];
|
|
123
|
+
onTransactionCompleted?: ExecuteRouteOptions["onTransactionCompleted"];
|
|
124
|
+
options?: ExecuteRouteOptions;
|
|
125
|
+
routeId?: string;
|
|
126
|
+
isCancelled?: () => boolean;
|
|
127
|
+
};
|
|
128
|
+
declare const subscribeToRouteStatus: (props: subscribeToRouteStatusProps) => () => void;
|
|
129
|
+
declare const executeAndSubscribeToRouteStatus: ({ transactionDetails, executeTransaction, trackTxPollingOptions, onTransactionTracked, onTransactionCompleted, routeDetails, onRouteStatusUpdated, options, routeId, isCancelled, }: executeAndSubscribeToRouteStatusProps) => Promise<void>;
|
|
130
|
+
type updateRouteDetailsProps = {
|
|
131
|
+
routeDetails?: RouteDetails;
|
|
132
|
+
transactionDetails?: TransactionDetails[];
|
|
133
|
+
options?: Partial<ExecuteRouteOptions>;
|
|
134
|
+
status?: RouteStatus;
|
|
135
|
+
routeId?: string;
|
|
136
|
+
};
|
|
137
|
+
declare const updateRouteDetails: ({ transactionDetails, routeDetails, options, status, routeId, }: updateRouteDetailsProps) => RouteDetails;
|
|
138
|
+
|
|
139
|
+
type CallbackStatus = "error" | "pending" | "completed";
|
|
140
|
+
type TransactionCallbacks = {
|
|
141
|
+
onTransactionSignRequested?: (value: {
|
|
142
|
+
chainId: string;
|
|
143
|
+
txIndex: number;
|
|
144
|
+
signerAddress?: string;
|
|
145
|
+
}) => Promise<void>;
|
|
146
|
+
onTransactionSigned?: (txInfo: {
|
|
147
|
+
chainId: string;
|
|
148
|
+
}) => Promise<void>;
|
|
149
|
+
onTransactionBroadcast?: (txInfo: {
|
|
150
|
+
txHash: string;
|
|
151
|
+
chainId: string;
|
|
152
|
+
}) => Promise<void>;
|
|
153
|
+
onTransactionTracked?: (txInfo: {
|
|
154
|
+
txHash: string;
|
|
155
|
+
chainId: string;
|
|
156
|
+
explorerLink: string;
|
|
157
|
+
}) => Promise<void>;
|
|
158
|
+
onTransactionCompleted?: (txInfo: {
|
|
159
|
+
chainId: string;
|
|
160
|
+
txHash: string;
|
|
161
|
+
status?: TransferStatus;
|
|
162
|
+
}) => Promise<void>;
|
|
163
|
+
onRouteStatusUpdated?: (routeStatus: RouteDetails) => void;
|
|
164
|
+
onValidateGasBalance?: (value: {
|
|
165
|
+
chainId?: string;
|
|
166
|
+
txIndex?: number;
|
|
167
|
+
status: CallbackStatus;
|
|
168
|
+
}) => Promise<void>;
|
|
169
|
+
onApproveAllowance?: (value: {
|
|
170
|
+
allowance?: Erc20Approval;
|
|
171
|
+
status: CallbackStatus;
|
|
172
|
+
}) => Promise<void>;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export { type ExecuteRouteOptions as E, type RouteDetails as R, type TransactionDetails as T, type RouteStatus as a, type TransferEventStatus as b, type TransactionCallbacks as c, type TransactionStatus as d, executeRoute as e, type subscribeToRouteStatusProps as f, getTransactionStatus as g, type executeAndSubscribeToRouteStatusProps as h, executeAndSubscribeToRouteStatus as i, subscribeToRouteStatus as s, updateRouteDetails as u };
|