0xtrails 0.2.5 → 0.3.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/aave.d.ts +2 -0
- package/dist/aave.d.ts.map +1 -1
- package/dist/abortController.d.ts +8 -0
- package/dist/abortController.d.ts.map +1 -0
- package/dist/{ccip-CXlshvBY.js → ccip-BMB3uDZt.js} +1 -1
- package/dist/config.d.ts +0 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +4 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/error.d.ts +4 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/fees.d.ts +19 -0
- package/dist/fees.d.ts.map +1 -0
- package/dist/{index-_QuyGrjU.js → index-QXPUrZVv.js} +48719 -50852
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +811 -784
- package/dist/intentReceiptMonitor.d.ts +24 -0
- package/dist/intentReceiptMonitor.d.ts.map +1 -0
- package/dist/intentReceiptPoller.d.ts +69 -0
- package/dist/intentReceiptPoller.d.ts.map +1 -0
- package/dist/intents.d.ts +15 -11
- package/dist/intents.d.ts.map +1 -1
- package/dist/morpho.d.ts +6 -5
- package/dist/morpho.d.ts.map +1 -1
- package/dist/mutations.d.ts +16 -0
- package/dist/mutations.d.ts.map +1 -0
- package/dist/preconditions.d.ts +5 -4
- package/dist/preconditions.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +7 -258
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prices.d.ts +9 -6
- package/dist/prices.d.ts.map +1 -1
- package/dist/sequenceWallet.d.ts +3 -16
- package/dist/sequenceWallet.d.ts.map +1 -1
- package/dist/tokenBalances.d.ts +17 -13
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/trails.d.ts +24 -40
- package/dist/trails.d.ts.map +1 -1
- package/dist/transactionIntent/constants.d.ts +7 -0
- package/dist/transactionIntent/constants.d.ts.map +1 -0
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +44 -0
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -0
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +30 -0
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -0
- package/dist/transactionIntent/deposits/index.d.ts +4 -0
- package/dist/transactionIntent/deposits/index.d.ts.map +1 -0
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +30 -0
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -0
- package/dist/transactionIntent/execution/index.d.ts +2 -0
- package/dist/transactionIntent/execution/index.d.ts.map +1 -0
- package/dist/transactionIntent/execution/transactionState.d.ts +5 -0
- package/dist/transactionIntent/execution/transactionState.d.ts.map +1 -0
- package/dist/transactionIntent/handlers/crossChain.d.ts +82 -0
- package/dist/transactionIntent/handlers/crossChain.d.ts.map +1 -0
- package/dist/transactionIntent/handlers/index.d.ts +4 -0
- package/dist/transactionIntent/handlers/index.d.ts.map +1 -0
- package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts +62 -0
- package/dist/transactionIntent/handlers/sameChainDifferentToken.d.ts.map +1 -0
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts +72 -0
- package/dist/transactionIntent/handlers/sameChainSameToken.d.ts.map +1 -0
- package/dist/transactionIntent/index.d.ts +9 -0
- package/dist/transactionIntent/index.d.ts.map +1 -0
- package/dist/transactionIntent/quote/feeExtractors.d.ts +17 -0
- package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -0
- package/dist/transactionIntent/quote/index.d.ts +4 -0
- package/dist/transactionIntent/quote/index.d.ts.map +1 -0
- package/dist/transactionIntent/quote/normalizeQuote.d.ts +34 -0
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -0
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +5 -0
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -0
- package/dist/transactionIntent/types.d.ts +131 -0
- package/dist/transactionIntent/types.d.ts.map +1 -0
- package/dist/transactionIntent/utils/balanceChecker.d.ts +18 -0
- package/dist/transactionIntent/utils/balanceChecker.d.ts.map +1 -0
- package/dist/transactionIntent/utils/index.d.ts +4 -0
- package/dist/transactionIntent/utils/index.d.ts.map +1 -0
- package/dist/transactionIntent/utils/lifiHelpers.d.ts +10 -0
- package/dist/transactionIntent/utils/lifiHelpers.d.ts.map +1 -0
- package/dist/transactionIntent/utils/testnetHelpers.d.ts +3 -0
- package/dist/transactionIntent/utils/testnetHelpers.d.ts.map +1 -0
- package/dist/transactionIntent/validators.d.ts +6 -0
- package/dist/transactionIntent/validators.d.ts.map +1 -0
- package/dist/transactions.d.ts +6 -3
- package/dist/transactions.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts +4 -0
- package/dist/widget/components/AccountIntentTransactionHistoryButton.d.ts.map +1 -0
- package/dist/widget/components/AccountSettings.d.ts.map +1 -1
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +2 -3
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConfigDisplay.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/DynamicInputStyles.d.ts +18 -0
- package/dist/widget/components/DynamicInputStyles.d.ts.map +1 -0
- package/dist/widget/components/DynamicSizeInputField.d.ts +13 -0
- package/dist/widget/components/DynamicSizeInputField.d.ts.map +1 -0
- package/dist/widget/components/Earn.d.ts +2 -3
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/ErrorAnimationIcon.d.ts +2 -0
- package/dist/widget/components/ErrorAnimationIcon.d.ts.map +1 -0
- package/dist/widget/components/FeeBreakdown.d.ts +9 -0
- package/dist/widget/components/FeeBreakdown.d.ts.map +1 -0
- package/dist/widget/components/FeeOptions.d.ts +5 -13
- package/dist/widget/components/FeeOptions.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +2 -3
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/FundSwap.d.ts +2 -3
- package/dist/widget/components/FundSwap.d.ts.map +1 -1
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/Identicon.d.ts.map +1 -1
- package/dist/widget/components/MeshConnectExchanges.d.ts +0 -3
- package/dist/widget/components/MeshConnectExchanges.d.ts.map +1 -1
- package/dist/widget/components/Modal.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts +2 -3
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +3 -3
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts +3 -20
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts +2 -0
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts +2 -3
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/ThemeProvider.d.ts.map +1 -1
- package/dist/widget/components/TokenDisplayNonSelectable.d.ts +11 -0
- package/dist/widget/components/TokenDisplayNonSelectable.d.ts.map +1 -0
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/Tooltip.d.ts +9 -0
- package/dist/widget/components/Tooltip.d.ts.map +1 -0
- package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.d.ts +1 -0
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +2 -2
- package/dist/widget/hooks/useCheckout.d.ts +17 -4
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
- package/dist/widget/hooks/useQuote.d.ts +82 -0
- package/dist/widget/hooks/useQuote.d.ts.map +1 -0
- package/dist/widget/hooks/useSelectedFeeToken.d.ts +1 -0
- package/dist/widget/hooks/useSelectedFeeToken.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts +5 -6
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/hooks/useTokenList.d.ts.map +1 -1
- package/dist/widget/hooks/useWalletConnectionContext.d.ts +25 -0
- package/dist/widget/hooks/useWalletConnectionContext.d.ts.map +1 -0
- package/dist/widget/index.js +2 -2
- package/dist/widget/widget.d.ts +17 -7
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +19 -21
- package/src/aave.ts +54 -1
- package/src/abortController.ts +35 -0
- package/src/config.ts +57 -58
- package/src/constants.ts +11 -9
- package/src/error.ts +21 -3
- package/src/fees.ts +210 -0
- package/src/index.ts +35 -13
- package/src/intentReceiptMonitor.ts +102 -0
- package/src/intentReceiptPoller.ts +299 -0
- package/src/intents.ts +205 -171
- package/src/morpho.ts +58 -9
- package/src/mutations.ts +129 -0
- package/src/preconditions.ts +16 -21
- package/src/prepareSend.ts +92 -4699
- package/src/prices.ts +26 -22
- package/src/relaySdk.ts +2 -2
- package/src/sequenceWallet.ts +6 -73
- package/src/tokenBalances.ts +175 -69
- package/src/trails.ts +230 -722
- package/src/transactionIntent/constants.ts +11 -0
- package/src/transactionIntent/deposits/depositOrchestrator.ts +210 -0
- package/src/transactionIntent/deposits/gaslessDeposit.ts +588 -0
- package/src/transactionIntent/deposits/index.ts +3 -0
- package/src/transactionIntent/deposits/standardDeposit.ts +379 -0
- package/src/transactionIntent/execution/index.ts +1 -0
- package/src/transactionIntent/execution/transactionState.ts +35 -0
- package/src/transactionIntent/handlers/crossChain.ts +1707 -0
- package/src/transactionIntent/handlers/index.ts +3 -0
- package/src/transactionIntent/handlers/sameChainDifferentToken.ts +323 -0
- package/src/transactionIntent/handlers/sameChainSameToken.ts +712 -0
- package/src/transactionIntent/index.ts +9 -0
- package/src/transactionIntent/quote/feeExtractors.ts +81 -0
- package/src/transactionIntent/quote/index.ts +3 -0
- package/src/transactionIntent/quote/normalizeQuote.ts +367 -0
- package/src/transactionIntent/quote/quoteHelpers.ts +53 -0
- package/src/transactionIntent/types.ts +157 -0
- package/src/transactionIntent/utils/balanceChecker.ts +96 -0
- package/src/transactionIntent/utils/index.ts +3 -0
- package/src/transactionIntent/utils/lifiHelpers.ts +68 -0
- package/src/transactionIntent/utils/testnetHelpers.ts +10 -0
- package/src/transactionIntent/validators.ts +57 -0
- package/src/transactions.ts +98 -71
- package/src/widget/compiled.css +2 -2
- package/src/widget/components/AccountIntentTransactionHistory.tsx +36 -36
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +22 -0
- package/src/widget/components/AccountSettings.tsx +70 -41
- package/src/widget/components/ChainFilterDropdown.tsx +24 -3
- package/src/widget/components/ClassicSwap.tsx +44 -107
- package/src/widget/components/ConfigDisplay.tsx +0 -11
- package/src/widget/components/ConnectWallet.tsx +4 -1
- package/src/widget/components/ConnectedWallets.tsx +51 -25
- package/src/widget/components/DynamicInputStyles.tsx +76 -0
- package/src/widget/components/DynamicSizeInputField.tsx +109 -0
- package/src/widget/components/Earn.tsx +34 -45
- package/src/widget/components/ErrorAnimationIcon.tsx +130 -0
- package/src/widget/components/FeeBreakdown.tsx +155 -0
- package/src/widget/components/FeeOption.tsx +2 -2
- package/src/widget/components/FeeOptions.tsx +151 -112
- package/src/widget/components/Fund.tsx +10 -29
- package/src/widget/components/FundMethods.tsx +4 -3
- package/src/widget/components/FundSwap.tsx +2 -3
- package/src/widget/components/FundingMethodSelectorButton.tsx +24 -14
- package/src/widget/components/Identicon.tsx +164 -95
- package/src/widget/components/MeshConnectExchanges.tsx +2 -15
- package/src/widget/components/Modal.tsx +0 -12
- package/src/widget/components/Pay.tsx +72 -75
- package/src/widget/components/PoolDeposit.tsx +221 -242
- package/src/widget/components/PoolWithdraw.tsx +347 -469
- package/src/widget/components/PriceImpactWarning.tsx +1 -1
- package/src/widget/components/QuoteDetails.tsx +906 -484
- package/src/widget/components/Receipt.tsx +16 -2
- package/src/widget/components/RecipientSelectorButton.tsx +7 -5
- package/src/widget/components/Recipients.tsx +1 -1
- package/src/widget/components/ScreenHeader.tsx +60 -36
- package/src/widget/components/Swap.tsx +2 -3
- package/src/widget/components/ThemeProvider.tsx +2 -1
- package/src/widget/components/TokenDisplayNonSelectable.tsx +40 -0
- package/src/widget/components/TokenImage.tsx +1 -1
- package/src/widget/components/TokenSelector.tsx +62 -53
- package/src/widget/components/TokenSelectorButton.tsx +38 -15
- package/src/widget/components/Tooltip.tsx +51 -0
- package/src/widget/components/TransferPendingVertical.tsx +12 -8
- package/src/widget/components/WaasFeeOptions.tsx +139 -4
- package/src/widget/components/WalletConfirmation.tsx +23 -13
- package/src/widget/components/WalletConnect.tsx +93 -29
- package/src/widget/hooks/useAmountUsd.ts +9 -9
- package/src/widget/hooks/useCheckout.ts +97 -9
- package/src/widget/hooks/useDefaultTokenSelection.tsx +27 -21
- package/src/widget/hooks/useQuote.ts +466 -0
- package/src/widget/hooks/useSelectedFeeToken.tsx +32 -37
- package/src/widget/hooks/useSendForm.ts +45 -51
- package/src/widget/hooks/useTokenList.ts +34 -26
- package/src/widget/hooks/useWalletConnectionContext.tsx +128 -0
- package/src/widget/widget.tsx +365 -390
- package/dist/apiClient.d.ts +0 -9
- package/dist/apiClient.d.ts.map +0 -1
- package/dist/intentEntrypoint.d.ts +0 -114
- package/dist/intentEntrypoint.d.ts.map +0 -1
- package/dist/metaTxnMonitor.d.ts +0 -15
- package/dist/metaTxnMonitor.d.ts.map +0 -1
- package/dist/metaTxns.d.ts +0 -11
- package/dist/metaTxns.d.ts.map +0 -1
- package/dist/relayer.d.ts +0 -43
- package/dist/relayer.d.ts.map +0 -1
- package/src/apiClient.ts +0 -35
- package/src/intentEntrypoint.ts +0 -203
- package/src/metaTxnMonitor.ts +0 -171
- package/src/metaTxns.ts +0 -45
- package/src/relayer.ts +0 -289
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TrailsClient } from './trailsClient.js';
|
|
2
|
+
import { IntentReceipt } from '@0xsequence/trails-api';
|
|
3
|
+
export type IntentReceiptStatus = {
|
|
4
|
+
intentReceipt: IntentReceipt | null;
|
|
5
|
+
done: boolean;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
isError: boolean;
|
|
8
|
+
error: Error | null;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Hook to monitor intent execution status using the WaitIntentReceipt API.
|
|
12
|
+
* This replaces the old useMetaTxnsMonitor approach which polled individual meta-transactions.
|
|
13
|
+
*
|
|
14
|
+
* The WaitIntentReceipt API is a long-polling endpoint that:
|
|
15
|
+
* - Blocks up to 28 seconds waiting for status changes
|
|
16
|
+
* - Returns unified status for both origin and destination transactions
|
|
17
|
+
* - Sets done=true when intent reaches terminal status (SUCCEEDED or FAILED)
|
|
18
|
+
*
|
|
19
|
+
* @param intentId - The intent ID to monitor (usually committedOriginIntentAddress)
|
|
20
|
+
* @param trailsClient - TrailsClient instance for API calls
|
|
21
|
+
* @returns IntentReceiptStatus with current receipt, done flag, and loading states
|
|
22
|
+
*/
|
|
23
|
+
export declare const useIntentReceiptMonitor: (intentId: string | undefined, trailsClient: TrailsClient) => IntentReceiptStatus;
|
|
24
|
+
//# sourceMappingURL=intentReceiptMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intentReceiptMonitor.d.ts","sourceRoot":"","sources":["../src/intentReceiptMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,wBAAwB,CAAA;AAM/B,MAAM,MAAM,mBAAmB,GAAG;IAChC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,GAAG,SAAS,EAC5B,cAAc,YAAY,KACzB,mBAmEF,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TrailsClient } from './trailsClient.js';
|
|
2
|
+
import { IntentReceipt } from '@0xsequence/trails-api';
|
|
3
|
+
/**
|
|
4
|
+
* Callback invoked when the deposit transaction hash is discovered (for gasless flows).
|
|
5
|
+
* @param txHash - The transaction hash of the deposit transaction
|
|
6
|
+
* @param receipt - The full IntentReceipt containing additional metadata
|
|
7
|
+
*/
|
|
8
|
+
export type OnDepositTransactionFound = (txHash: string, receipt: IntentReceipt) => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Callback invoked when the origin transaction hash is discovered.
|
|
11
|
+
* @param txHash - The transaction hash of the origin transaction
|
|
12
|
+
* @param receipt - The full IntentReceipt containing additional metadata
|
|
13
|
+
*/
|
|
14
|
+
export type OnOriginTransactionFound = (txHash: string, receipt: IntentReceipt) => Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Callback invoked when the destination transaction hash is discovered.
|
|
17
|
+
* @param txHash - The transaction hash of the destination transaction
|
|
18
|
+
* @param receipt - The full IntentReceipt containing additional metadata
|
|
19
|
+
*/
|
|
20
|
+
export type OnDestinationTransactionFound = (txHash: string, receipt: IntentReceipt) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Callback invoked when the intent receipt is updated (regardless of which field changed).
|
|
23
|
+
* @param receipt - The full IntentReceipt
|
|
24
|
+
* @param done - Whether the intent has reached a terminal status
|
|
25
|
+
*/
|
|
26
|
+
export type OnReceiptUpdate = (receipt: IntentReceipt, done: boolean) => Promise<void>;
|
|
27
|
+
export interface IntentReceiptPollerCallbacks {
|
|
28
|
+
onDepositTransactionFound?: OnDepositTransactionFound;
|
|
29
|
+
onOriginTransactionFound?: OnOriginTransactionFound;
|
|
30
|
+
onDestinationTransactionFound?: OnDestinationTransactionFound;
|
|
31
|
+
onReceiptUpdate?: OnReceiptUpdate;
|
|
32
|
+
}
|
|
33
|
+
export interface IntentReceiptPollerOptions {
|
|
34
|
+
intentId: string;
|
|
35
|
+
trailsClient: TrailsClient;
|
|
36
|
+
callbacks?: IntentReceiptPollerCallbacks;
|
|
37
|
+
maxWaitTime?: number;
|
|
38
|
+
pollInterval?: number;
|
|
39
|
+
abortSignal?: AbortSignal;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Unified intent receipt poller that monitors a single intent ID and invokes callbacks
|
|
43
|
+
* as origin and destination transactions are discovered. This consolidates what was
|
|
44
|
+
* previously done via separate polling loops.
|
|
45
|
+
*
|
|
46
|
+
* @param options - Configuration for polling including intent ID, client, and callbacks
|
|
47
|
+
* @returns A promise that resolves when the intent reaches a terminal status or times out
|
|
48
|
+
*
|
|
49
|
+
* Usage:
|
|
50
|
+
* ```
|
|
51
|
+
* const poller = pollIntentReceipt({
|
|
52
|
+
* intentId: intent.intentId,
|
|
53
|
+
* trailsClient,
|
|
54
|
+
* callbacks: {
|
|
55
|
+
* onOriginTransactionFound: async (txHash, receipt) => {
|
|
56
|
+
* // Handle origin transaction discovery
|
|
57
|
+
* },
|
|
58
|
+
* onDestinationTransactionFound: async (txHash, receipt) => {
|
|
59
|
+
* // Handle destination transaction discovery
|
|
60
|
+
* },
|
|
61
|
+
* onReceiptUpdate: async (receipt, done) => {
|
|
62
|
+
* // Handle any receipt update
|
|
63
|
+
* },
|
|
64
|
+
* },
|
|
65
|
+
* })
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function pollIntentReceipt(options: IntentReceiptPollerOptions): Promise<IntentReceipt | null>;
|
|
69
|
+
//# sourceMappingURL=intentReceiptPoller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intentReceiptPoller.d.ts","sourceRoot":"","sources":["../src/intentReceiptPoller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,wBAAwB,CAAA;AAM/B;;;;GAIG;AACH,MAAM,MAAM,yBAAyB,GAAG,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,KACnB,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,OAAO,KACV,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB,MAAM,WAAW,4BAA4B;IAC3C,yBAAyB,CAAC,EAAE,yBAAyB,CAAA;IACrD,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;IACnD,6BAA6B,CAAC,EAAE,6BAA6B,CAAA;IAC7D,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,YAAY,CAAA;IAC1B,SAAS,CAAC,EAAE,4BAA4B,CAAA;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA0M/B"}
|
package/dist/intents.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuoteIntentRequest, CommitIntentResponse, Intent, IntentCalls, TrailsAPIClient, GasFeeOptions, DepositSignature } from '@0xsequence/trails-api';
|
|
2
2
|
import { TrailsClient } from './trailsClient.js';
|
|
3
3
|
import { Context } from '@0xsequence/wallet-primitives';
|
|
4
4
|
import { Address, Hex } from 'ox';
|
|
5
5
|
import { Account, Chain, WalletClient } from 'viem';
|
|
6
|
-
export type {
|
|
6
|
+
export type { IntentCalls, TransactionPrecondition, } from '@0xsequence/trails-api';
|
|
7
7
|
export type IntentRequestParams = {
|
|
8
8
|
userAddress: string;
|
|
9
9
|
originChainId: number;
|
|
@@ -53,7 +53,7 @@ export interface TrailsFee {
|
|
|
53
53
|
quoteProvider?: string;
|
|
54
54
|
}
|
|
55
55
|
export type QuoteProvider = "lifi" | "relay" | "cctp";
|
|
56
|
-
export type {
|
|
56
|
+
export type { Intent };
|
|
57
57
|
export type OriginCallParams = {
|
|
58
58
|
to: `0x${string}` | null;
|
|
59
59
|
data: Hex.Hex | null;
|
|
@@ -70,14 +70,18 @@ export type SendOriginCallTxArgs = {
|
|
|
70
70
|
maxFeePerGas?: bigint;
|
|
71
71
|
maxPriorityFeePerGas?: bigint;
|
|
72
72
|
};
|
|
73
|
-
export declare function getLocalClientIfEnabled(
|
|
74
|
-
export declare function
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
export declare function getLocalClientIfEnabled(trailsClient: TrailsAPIClient): Promise<TrailsAPIClient>;
|
|
74
|
+
export declare function getIntent(trailsClient: TrailsAPIClient, args: QuoteIntentRequest, additionalTrackingProps?: Record<string, string>): Promise<{
|
|
75
|
+
intent: Intent;
|
|
76
|
+
gasFeeOptions?: GasFeeOptions;
|
|
77
|
+
}>;
|
|
78
|
+
export declare function calculateIntentAddress(mainSigner: string, calls: Array<IntentCalls>): `0x${string}`;
|
|
79
|
+
export declare function calculateOriginAndDestinationIntentAddresses(mainSigner: string, calls: Array<IntentCalls>): {
|
|
77
80
|
originIntentAddress: `0x${string}`;
|
|
78
81
|
destinationIntentAddress: `0x${string}`;
|
|
79
82
|
};
|
|
80
|
-
export declare function
|
|
83
|
+
export declare function commitIntent(trailsClient: TrailsClient, intent: Intent, additionalTrackingProps?: Record<string, string>): Promise<CommitIntentResponse>;
|
|
84
|
+
export declare function executeIntent(trailsClient: TrailsClient, intentId: string, depositTransactionHash?: string, depositSignature?: DepositSignature): Promise<import('@0xsequence/trails-api').ExecuteIntentResponse>;
|
|
81
85
|
export declare function sendOriginTransaction(account: Account, walletClient: WalletClient, originParams: SendOriginCallTxArgs, additionalTrackingProps?: Record<string, string>): Promise<`0x${string}`>;
|
|
82
86
|
export interface OriginTokenParam {
|
|
83
87
|
address: Address.Address;
|
|
@@ -92,15 +96,15 @@ export declare function hashIntentParams({ userAddress, nonce, originTokens, des
|
|
|
92
96
|
userAddress: Address.Address;
|
|
93
97
|
nonce: bigint;
|
|
94
98
|
originTokens: OriginTokenParam[];
|
|
95
|
-
destinationCalls: Array<
|
|
99
|
+
destinationCalls: Array<IntentCalls>;
|
|
96
100
|
destinationTokens: DestinationTokenParam[];
|
|
97
101
|
}): string;
|
|
98
|
-
export declare function calculateIntentConfigurationAddress(mainSigner: Address.Address, calls: Array<
|
|
102
|
+
export declare function calculateIntentConfigurationAddress(mainSigner: Address.Address, calls: Array<IntentCalls>, context: Context.Context): Address.Address;
|
|
99
103
|
/**
|
|
100
104
|
* Build transaction parameters for same-chain same-token transactions
|
|
101
105
|
* Centralizes the logic for determining transaction destination, data, and value
|
|
102
106
|
*/
|
|
103
|
-
export declare function
|
|
107
|
+
export declare function buildSameChainSameTokenTransactionParams({ hasCustomCalldata, recipient, effectiveOriginTokenAddress, destinationCalldata, swapAmount, effectiveOriginChainId, effectiveOriginChain, }: {
|
|
104
108
|
hasCustomCalldata: boolean;
|
|
105
109
|
recipient: string;
|
|
106
110
|
effectiveOriginTokenAddress: string;
|
package/dist/intents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../src/intents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"intents.d.ts","sourceRoot":"","sources":["../src/intents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,WAAW,EAEX,eAAe,EAEf,aAAa,EACb,gBAAgB,EACjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,YAAY,EACV,WAAW,EACX,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAU,KAAK,OAAO,EAAW,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAEL,OAAO,EAIP,KAAK,GAAG,EACT,MAAM,IAAI,CAAA;AACX,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,YAAY,EAGlB,MAAM,MAAM,CAAA;AAwBb,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,iBAAiB,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,uBAAuB,EAAE,MAAM,CAAA;IAC/B,sBAAsB,EAA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AmB,EACnB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,GACrB,EAAE;IACD,iBAAiB,EAAE,OAAO,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,2BAA2B,EAAE,MAAM,CAAA;IACnC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,oBAAoB,EAAE,KAAK,CAAA;CAC5B;;;;;;EAoBA;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,GAAG,EACH,aAAa,EACb,KAAK,GACN,EAAE;IACD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,KAAK,CAAA;CACb;;;;;;EAmBA"}
|
package/dist/morpho.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, PublicClient } from 'viem';
|
|
1
|
+
import { Address, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
export interface VaultConfig {
|
|
3
3
|
address: Address;
|
|
4
4
|
name: string;
|
|
@@ -61,11 +61,12 @@ export declare function getVaultsForChain(chainId: number, _publicClient: Public
|
|
|
61
61
|
export declare function getAllVaults(_publicClient: PublicClient): Promise<Pool[]>;
|
|
62
62
|
/**
|
|
63
63
|
* Generate Morpho vault withdraw calldata
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
64
|
+
* @param amount - The amount of underlying assets to withdraw in wei
|
|
65
|
+
* @param to - The address that will receive the underlying tokens (receiver)
|
|
66
|
+
* @param owner - Optional owner address (defaults to 'to' if not provided)
|
|
67
67
|
* @returns Encoded calldata for Morpho withdraw function
|
|
68
68
|
*/
|
|
69
|
-
export declare function generateMorphoWithdrawCalldata(
|
|
69
|
+
export declare function generateMorphoWithdrawCalldata(amount: bigint, to: string, owner?: string): `0x${string}`;
|
|
70
|
+
export declare const generateMorphoDepositCalldata: (walletClient: WalletClient, amount: string) => `0x${string}` | undefined;
|
|
70
71
|
export default useMorphoVaults;
|
|
71
72
|
//# sourceMappingURL=morpho.d.ts.map
|
package/dist/morpho.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../src/morpho.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"morpho.d.ts","sourceRoot":"","sources":["../src/morpho.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAS/D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;CACF;AAaD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B,CAAC,EAAE,MAAM,CAAA;CACpC;AA4FD;;GAEG;AACH,wBAAsB,cAAc,CAClC,YAAY,EAAE,OAAO,EACrB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAyErB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAsCpD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CAQ1D;AAwED;;GAEG;AACH,wBAAgB,eAAe;;;;EAuC9B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,YAAY,GAC1B,OAAO,CAAC,IAAI,EAAE,CAAC,CASjB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,aAAa,EAAE,YAAY,GAC1B,OAAO,CAAC,IAAI,EAAE,CAAC,CAQjB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,MAAM,GACb,KAAK,MAAM,EAAE,CAmBf;AAGD,eAAO,MAAM,6BAA6B,GACxC,cAAc,YAAY,EAC1B,QAAQ,MAAM,8BA2Cf,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Intent, DepositSignature } from '@0xsequence/trails-api';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for committing an intent to the Trails API
|
|
4
|
+
* Wraps trailsClient.commitIntent with mutation state and analytics tracking
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCommitIntent(): import('@tanstack/react-query').UseMutationResult<import('@0xsequence/trails-api').CommitIntentResponse, Error, Intent, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Hook for executing an intent
|
|
9
|
+
* Wraps trailsClient.executeIntent with mutation state and analytics tracking
|
|
10
|
+
*/
|
|
11
|
+
export declare function useExecuteIntent(): import('@tanstack/react-query').UseMutationResult<import('@0xsequence/trails-api').ExecuteIntentResponse, Error, {
|
|
12
|
+
intentId: string;
|
|
13
|
+
depositTransactionHash?: string;
|
|
14
|
+
depositSignature?: DepositSignature;
|
|
15
|
+
}, unknown>;
|
|
16
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../src/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAUtE;;;GAGG;AACH,wBAAgB,eAAe,qIAgE9B;AAED;;;GAGG;AACH,wBAAgB,gBAAgB;cAShB,MAAM;6BACS,MAAM;uBACZ,gBAAgB;YAgCxC"}
|
package/dist/preconditions.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { TransactionPrecondition } from '@0xsequence/trails-api';
|
|
2
|
+
export type IntentPrecondition = TransactionPrecondition;
|
|
3
|
+
export declare function findPreconditionAddresses(preconditions: TransactionPrecondition[], originChainId: number, destinationChainId: number): {
|
|
3
4
|
originAddress?: string;
|
|
4
5
|
destinationAddress?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare function findChainAndAddressesFromPreconditions(preconditions:
|
|
7
|
+
export declare function findChainAndAddressesFromPreconditions(preconditions: TransactionPrecondition[]): {
|
|
7
8
|
chainId: number;
|
|
8
9
|
address: string;
|
|
9
10
|
}[];
|
|
10
|
-
export declare function findFirstPreconditionForChainId(preconditions:
|
|
11
|
+
export declare function findFirstPreconditionForChainId(preconditions: TransactionPrecondition[], chainId: number): TransactionPrecondition | null;
|
|
11
12
|
//# sourceMappingURL=preconditions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preconditions.d.ts","sourceRoot":"","sources":["../src/preconditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"preconditions.d.ts","sourceRoot":"","sources":["../src/preconditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAGrE,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,CAAA;AAExD,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,uBAAuB,EAAE,EACxC,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,MAAM,GACzB;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,CAYzD;AAED,wBAAgB,sCAAsC,CACpD,aAAa,EAAE,uBAAuB,EAAE,GACvC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAWxC;AAED,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,uBAAuB,EAAE,EACxC,OAAO,EAAE,MAAM,GACd,uBAAuB,GAAG,IAAI,CAKhC"}
|
package/dist/prepareSend.d.ts
CHANGED
|
@@ -1,260 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { MetaTxnReceipt, RelayerEnv } from './relayer.js';
|
|
6
|
-
import { RelayQuote } from './relaySdk.js';
|
|
7
|
-
import { SupportedToken } from './tokens.js';
|
|
8
|
-
import { TransactionState } from './transactions.js';
|
|
9
|
-
import { CheckoutOnHandlers } from './widget/hooks/useCheckout.js';
|
|
10
|
-
import { SequenceAPIClient } from '@0xsequence/api';
|
|
11
|
-
export declare enum TradeType {
|
|
12
|
-
EXACT_INPUT = "EXACT_INPUT",
|
|
13
|
-
EXACT_OUTPUT = "EXACT_OUTPUT"
|
|
14
|
-
}
|
|
15
|
-
export type PrepareSendOptions = {
|
|
16
|
-
account: Account;
|
|
17
|
-
originTokenAddress: string;
|
|
18
|
-
originChainId: number;
|
|
19
|
-
originTokenBalance: string;
|
|
20
|
-
destinationChainId: number;
|
|
21
|
-
recipient: string;
|
|
22
|
-
destinationTokenAddress: string;
|
|
23
|
-
swapAmount: string;
|
|
24
|
-
tradeType?: TradeType;
|
|
25
|
-
originTokenSymbol: string;
|
|
26
|
-
destinationTokenSymbol: string;
|
|
27
|
-
sequenceProjectAccessKey?: string;
|
|
28
|
-
fee: string;
|
|
29
|
-
client?: WalletClient;
|
|
30
|
-
dryMode: boolean;
|
|
31
|
-
apiClient: SequenceAPIClient;
|
|
32
|
-
trailsClient: TrailsAPIClient;
|
|
33
|
-
originRelayer: Relayer.RpcRelayer;
|
|
34
|
-
destinationRelayer: Relayer.RpcRelayer;
|
|
35
|
-
destinationCalldata?: string;
|
|
36
|
-
onTransactionStateChange: (transactionStates: TransactionState[]) => void;
|
|
37
|
-
sourceTokenPriceUsd?: number | null;
|
|
38
|
-
destinationTokenPriceUsd?: number | null;
|
|
39
|
-
sourceTokenDecimals: number;
|
|
40
|
-
destinationTokenDecimals: number;
|
|
41
|
-
paymasterUrl?: string;
|
|
42
|
-
gasless?: boolean;
|
|
43
|
-
slippageTolerance?: string;
|
|
44
|
-
originNativeTokenPriceUsd?: number | null;
|
|
45
|
-
quoteProvider?: string | null;
|
|
46
|
-
fundMethod?: string;
|
|
47
|
-
mode?: "pay" | "fund" | "earn" | "swap" | "receive";
|
|
48
|
-
checkoutOnHandlers?: CheckoutOnHandlers;
|
|
49
|
-
refundAddress?: string;
|
|
50
|
-
selectedFeeToken?: any;
|
|
51
|
-
walletId?: string;
|
|
52
|
-
};
|
|
53
|
-
export type PrepareSendFees = {
|
|
54
|
-
feeTokenAddress: string | null;
|
|
55
|
-
totalFeeAmount: string | null;
|
|
56
|
-
totalFeeAmountUsd: string | null;
|
|
57
|
-
totalFeeAmountUsdDisplay: string | null;
|
|
58
|
-
};
|
|
59
|
-
export type PrepareSendQuote = {
|
|
60
|
-
originDepositAddress: string;
|
|
61
|
-
destinationDepositAddress: string;
|
|
62
|
-
destinationAddress: string;
|
|
63
|
-
destinationCalldata: string;
|
|
64
|
-
originChain: Chain;
|
|
65
|
-
destinationChain: Chain;
|
|
66
|
-
originAmount: string;
|
|
67
|
-
originAmountDisplay: string;
|
|
68
|
-
originAmountMin: string;
|
|
69
|
-
originAmountMinDisplay: string;
|
|
70
|
-
originAmountMinUsdFormatted: string;
|
|
71
|
-
originAmountMinUsdDisplay: string;
|
|
72
|
-
destinationAmount: string;
|
|
73
|
-
destinationAmountDisplay: string;
|
|
74
|
-
destinationAmountMin: string;
|
|
75
|
-
destinationAmountMinDisplay: string;
|
|
76
|
-
destinationAmountMinUsdFormatted: string;
|
|
77
|
-
destinationAmountMinUsdDisplay: string;
|
|
78
|
-
originAmountFormatted: string;
|
|
79
|
-
originAmountUsdFormatted: string;
|
|
80
|
-
originAmountUsdDisplay: string;
|
|
81
|
-
destinationAmountFormatted: string;
|
|
82
|
-
destinationAmountUsdFormatted: string;
|
|
83
|
-
destinationAmountUsdDisplay: string;
|
|
84
|
-
originToken: SupportedToken;
|
|
85
|
-
destinationToken: SupportedToken;
|
|
86
|
-
fees: PrepareSendFees;
|
|
87
|
-
slippageTolerance: string;
|
|
88
|
-
priceImpact: string;
|
|
89
|
-
priceImpactUsdDisplay: string;
|
|
90
|
-
completionEstimateSeconds: number;
|
|
91
|
-
transactionStates: TransactionState[];
|
|
92
|
-
gasCostUsd: number;
|
|
93
|
-
gasCostUsdDisplay: string;
|
|
94
|
-
gasCost: string;
|
|
95
|
-
gasCostFormatted: string;
|
|
96
|
-
originTokenRate: string;
|
|
97
|
-
destinationTokenRate: string;
|
|
98
|
-
quoteProvider: QuoteProviderInfo | null;
|
|
99
|
-
noSufficientBalance: boolean;
|
|
100
|
-
};
|
|
101
|
-
export type PrepareSendReturn = {
|
|
102
|
-
quote: PrepareSendQuote;
|
|
103
|
-
feeOptions?: any;
|
|
104
|
-
send: ({ onOriginSend, selectedFeeToken, }: {
|
|
105
|
-
onOriginSend?: () => void;
|
|
106
|
-
selectedFeeToken?: any;
|
|
107
|
-
}) => Promise<SendReturn>;
|
|
108
|
-
};
|
|
109
|
-
export type SendReturn = {
|
|
110
|
-
originUserTxReceipt: TransactionReceipt | null;
|
|
111
|
-
originMetaTxnReceipt: MetaTxnReceipt | null;
|
|
112
|
-
destinationMetaTxnReceipt: MetaTxnReceipt | null;
|
|
113
|
-
totalCompletionSeconds?: number;
|
|
114
|
-
};
|
|
115
|
-
export declare function getIsToSameChain(originChainId: number, destinationChainId: number): boolean;
|
|
116
|
-
export declare function getIsToSameToken(originTokenAddress: string, destinationTokenAddress: string): boolean;
|
|
117
|
-
export declare function getIsToSameChainAndToken(originChainId: number, originTokenAddress: string, destinationChainId: number, destinationTokenAddress: string): boolean;
|
|
118
|
-
export declare function getUseCctp(originTokenAddress: string, destinationTokenAddress: string, originChainId: number, destinationChainId: number): boolean;
|
|
119
|
-
export declare function validateCctpDestinationToken(destinationTokenAddress: string, destinationChainId: number, quoteProvider?: string | null): void;
|
|
1
|
+
import { PrepareSendOptions, PrepareSendReturn } from './transactionIntent/index.js';
|
|
2
|
+
export { TradeType } from './transactionIntent/index.js';
|
|
3
|
+
export type { PrepareSendOptions, PrepareSendFees, PrepareSendQuote, PrepareSendReturn, SendReturn, SelectedFeeToken, } from './transactionIntent/index.js';
|
|
4
|
+
export { isSameChain, isSameToken, validateCctpDestinationToken, } from './transactionIntent/index.js';
|
|
120
5
|
export declare function prepareSend(options: PrepareSendOptions): Promise<PrepareSendReturn>;
|
|
121
|
-
export
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
onOriginSend?: () => void;
|
|
125
|
-
publicClient: PublicClient;
|
|
126
|
-
walletClient: WalletClient;
|
|
127
|
-
originChainId: number;
|
|
128
|
-
chain: Chain;
|
|
129
|
-
account: Account;
|
|
130
|
-
fee: string;
|
|
131
|
-
dryMode: boolean;
|
|
132
|
-
sourceTokenPriceUsd?: number | null;
|
|
133
|
-
destinationTokenPriceUsd?: number | null;
|
|
134
|
-
swapAmount: string;
|
|
135
|
-
destinationTokenDecimals: number;
|
|
136
|
-
sourceTokenDecimals: number;
|
|
137
|
-
originIntentAddress: string;
|
|
138
|
-
onTransactionStateChange: (transactionStates: TransactionState[]) => void;
|
|
139
|
-
transactionStates: TransactionState[];
|
|
140
|
-
originTokenSymbol: string;
|
|
141
|
-
destinationTokenSymbol: string;
|
|
142
|
-
depositAmountUsd: number;
|
|
143
|
-
}): Promise<TransactionReceipt | null>;
|
|
144
|
-
export declare function getDoGasless(originTokenAddress: string, gasless: boolean, feeOptions?: any, selectedFeeToken?: any, walletId?: string): boolean;
|
|
145
|
-
export type UseQuoteProps = {
|
|
146
|
-
walletClient?: any;
|
|
147
|
-
fromTokenAddress?: string | null;
|
|
148
|
-
fromChainId?: number | null;
|
|
149
|
-
toTokenAddress?: string | null;
|
|
150
|
-
toChainId?: number | null;
|
|
151
|
-
toCalldata?: string | null;
|
|
152
|
-
swapAmount?: string | bigint;
|
|
153
|
-
toRecipient?: string | null;
|
|
154
|
-
tradeType?: TradeType | null;
|
|
155
|
-
slippageTolerance?: string | number | null;
|
|
156
|
-
onStatusUpdate?: ((transactionStates: TransactionState[]) => void) | null;
|
|
157
|
-
quoteProvider?: string | null;
|
|
158
|
-
gasless?: boolean;
|
|
159
|
-
paymasterUrl?: string;
|
|
160
|
-
selectedFeeToken?: {
|
|
161
|
-
tokenAddress: string;
|
|
162
|
-
tokenSymbol?: string;
|
|
163
|
-
} | null;
|
|
164
|
-
};
|
|
165
|
-
export type SwapReturn = {
|
|
166
|
-
originTransaction: {
|
|
167
|
-
transactionHash?: string | null;
|
|
168
|
-
explorerUrl?: string | null;
|
|
169
|
-
receipt: TransactionReceipt | MetaTxnReceipt | null;
|
|
170
|
-
};
|
|
171
|
-
destinationTransaction: {
|
|
172
|
-
transactionHash?: string | null;
|
|
173
|
-
explorerUrl?: string | null;
|
|
174
|
-
receipt: MetaTxnReceipt | null;
|
|
175
|
-
};
|
|
176
|
-
totalCompletionSeconds?: number;
|
|
177
|
-
};
|
|
178
|
-
export type QuoteProviderInfo = {
|
|
179
|
-
id: string;
|
|
180
|
-
name: string;
|
|
181
|
-
url: string;
|
|
182
|
-
};
|
|
183
|
-
export type Quote = {
|
|
184
|
-
fromAmount: string;
|
|
185
|
-
fromAmountMin: string;
|
|
186
|
-
toAmount: string;
|
|
187
|
-
toAmountMin: string;
|
|
188
|
-
originToken: SupportedToken;
|
|
189
|
-
destinationToken: SupportedToken;
|
|
190
|
-
originChain: Chain;
|
|
191
|
-
destinationChain: Chain;
|
|
192
|
-
fees: PrepareSendFees;
|
|
193
|
-
slippageTolerance: string;
|
|
194
|
-
priceImpact: string;
|
|
195
|
-
completionEstimateSeconds: number;
|
|
196
|
-
transactionStates?: TransactionState[];
|
|
197
|
-
originTokenRate?: string;
|
|
198
|
-
quoteProvider?: QuoteProviderInfo | null;
|
|
199
|
-
destinationTokenRate?: string;
|
|
200
|
-
fromAmountUsdDisplay?: string;
|
|
201
|
-
toAmountUsdDisplay?: string;
|
|
202
|
-
gasCostUsd?: number;
|
|
203
|
-
gasCostUsdDisplay?: string;
|
|
204
|
-
gasCost?: string;
|
|
205
|
-
gasCostFormatted?: string;
|
|
206
|
-
};
|
|
207
|
-
export type UseQuoteReturn = {
|
|
208
|
-
quote: Quote | null;
|
|
209
|
-
swap: (() => Promise<SwapReturn | null>) | null;
|
|
210
|
-
isLoadingQuote: boolean;
|
|
211
|
-
quoteError: unknown;
|
|
212
|
-
refetchQuote: () => void;
|
|
213
|
-
};
|
|
214
|
-
export declare function useQuote({ walletClient, fromTokenAddress, fromChainId, toTokenAddress, toChainId, swapAmount, tradeType, toRecipient, toCalldata, slippageTolerance, onStatusUpdate, quoteProvider, gasless, paymasterUrl, selectedFeeToken, relayerEnv, nodeGatewayEnv, }?: Partial<UseQuoteProps & {
|
|
215
|
-
relayerEnv?: RelayerEnv;
|
|
216
|
-
nodeGatewayEnv?: SequenceEnv;
|
|
217
|
-
}>): UseQuoteReturn;
|
|
218
|
-
export declare function getFeesFromIntent(intent: GetIntentCallsPayloadsReturn, { tradeType, fromAmountUsd, toAmountUsd, }: {
|
|
219
|
-
tradeType: TradeType;
|
|
220
|
-
fromAmountUsd: number;
|
|
221
|
-
toAmountUsd: number;
|
|
222
|
-
}): PrepareSendFees;
|
|
223
|
-
export declare function getSlippageToleranceFromIntent(intent: GetIntentCallsPayloadsReturn): string;
|
|
224
|
-
export declare function getPriceImpactFromIntent(intent: GetIntentCallsPayloadsReturn): string;
|
|
225
|
-
export declare function getPriceImpactUsdFromIntent(intent: GetIntentCallsPayloadsReturn): string;
|
|
226
|
-
export declare function getFeesFromRelaySdkQuote(quote: RelayQuote): PrepareSendFees;
|
|
227
|
-
export declare function getSlippageToleranceFromRelaySdkQuote(quote: RelayQuote): string;
|
|
228
|
-
export declare function getPriceImpactFromRelaySdkQuote(quote: RelayQuote): string;
|
|
229
|
-
export declare function getPriceImpactUsdFromRelaySdkQuote(quote: RelayQuote): string;
|
|
230
|
-
export declare function getZeroFees(): PrepareSendFees;
|
|
231
|
-
export declare function getCompletionEstimateSeconds({ originChainId, destinationChainId, }: {
|
|
232
|
-
originChainId: number;
|
|
233
|
-
destinationChainId: number;
|
|
234
|
-
}): number;
|
|
235
|
-
export declare function getNormalizedQuoteObject({ originDepositAddress, destinationDepositAddress, destinationAddress, destinationCalldata, originChainId, destinationChainId, originAmount, originAmountMin, destinationAmount, destinationAmountMin, originTokenAddress, destinationTokenAddress, originTokenPriceUsd, destinationTokenPriceUsd, transactionStates, fees, slippageTolerance, priceImpact, priceImpactUsd, originNativeTokenPriceUsd, quoteProvider, noSufficientBalance, estimatedGasLimit, }: {
|
|
236
|
-
originDepositAddress?: string;
|
|
237
|
-
destinationDepositAddress?: string;
|
|
238
|
-
destinationAddress?: string;
|
|
239
|
-
destinationCalldata?: string;
|
|
240
|
-
originChainId: number;
|
|
241
|
-
destinationChainId?: number;
|
|
242
|
-
originAmount: string;
|
|
243
|
-
originAmountMin?: string;
|
|
244
|
-
destinationAmount: string;
|
|
245
|
-
destinationAmountMin?: string;
|
|
246
|
-
originTokenAddress: string;
|
|
247
|
-
destinationTokenAddress?: string;
|
|
248
|
-
originTokenPriceUsd?: string | null;
|
|
249
|
-
destinationTokenPriceUsd?: string | null;
|
|
250
|
-
transactionStates?: TransactionState[];
|
|
251
|
-
fees?: PrepareSendFees;
|
|
252
|
-
slippageTolerance?: string;
|
|
253
|
-
priceImpact?: string;
|
|
254
|
-
priceImpactUsd?: string;
|
|
255
|
-
originNativeTokenPriceUsd?: number | null;
|
|
256
|
-
quoteProvider?: string;
|
|
257
|
-
noSufficientBalance?: boolean;
|
|
258
|
-
estimatedGasLimit?: bigint;
|
|
259
|
-
}): Promise<PrepareSendQuote>;
|
|
6
|
+
export type { UseQuoteProps, Quote, UseQuoteReturn, SwapReturn, QuoteProviderInfo, } from './widget/hooks/useQuote.js';
|
|
7
|
+
export { useQuote } from './widget/hooks/useQuote.js';
|
|
8
|
+
export { getFeesFromIntent, getSlippageToleranceFromIntent, getPriceImpactFromIntent, getPriceImpactUsdFromIntent, getFeesFromRelaySdkQuote, getSlippageToleranceFromRelaySdkQuote, getPriceImpactFromRelaySdkQuote, getPriceImpactUsdFromRelaySdkQuote, getZeroFees, getCompletionEstimateSeconds, getNormalizedQuoteObject, } from './transactionIntent/index.js';
|
|
260
9
|
//# sourceMappingURL=prepareSend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareSend.d.ts","sourceRoot":"","sources":["../src/prepareSend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepareSend.d.ts","sourceRoot":"","sources":["../src/prepareSend.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAMvB,MAAM,8BAA8B,CAAA;AAGrC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,GACjB,MAAM,8BAA8B,CAAA;AAGrC,OAAO,EACL,WAAW,EACX,WAAW,EACX,4BAA4B,GAC7B,MAAM,8BAA8B,CAAA;AAErC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAsW5B;AAGD,YAAY,EACV,aAAa,EACb,KAAK,EACL,cAAc,EACd,UAAU,EACV,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAGrD,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,qCAAqC,EACrC,+BAA+B,EAC/B,kCAAkC,EAClC,WAAW,EACX,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,8BAA8B,CAAA"}
|
package/dist/prices.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Token, TokenPrice } from '@0xsequence/trails-api';
|
|
2
|
+
import { TrailsClient } from './trailsClient.js';
|
|
3
|
+
export declare const fetchGetTokenPrices: (trailsClient: TrailsClient, tokens: Token[]) => Promise<TokenPrice[]>;
|
|
3
4
|
export declare function normalizeToken(token: Token & {
|
|
4
5
|
tokenID?: string;
|
|
5
6
|
symbol?: string;
|
|
7
|
+
contractAddress?: string;
|
|
8
|
+
tokenId?: string;
|
|
6
9
|
}): Token;
|
|
7
|
-
export declare const getTokenPrices: (
|
|
8
|
-
export declare const getTokenPrice: (
|
|
9
|
-
export declare const useTokenPrices: (tokens: Token[],
|
|
10
|
+
export declare const getTokenPrices: (trailsClient: TrailsClient, tokens: Token[]) => Promise<TokenPrice[]>;
|
|
11
|
+
export declare const getTokenPrice: (trailsClient: TrailsClient, token: Token) => Promise<TokenPrice | null>;
|
|
12
|
+
export declare const useTokenPrices: (tokens: Token[], trailsClient: TrailsClient) => {
|
|
10
13
|
tokenPrices: TokenPrice[] | undefined;
|
|
11
14
|
isLoadingTokenPrices: boolean;
|
|
12
15
|
};
|
|
13
|
-
export declare const useTokenPrice: (token?: Token | null,
|
|
16
|
+
export declare const useTokenPrice: (token?: Token | null, trailsClient?: TrailsClient) => {
|
|
14
17
|
tokenPrice: TokenPrice | null | undefined;
|
|
15
18
|
isLoadingTokenPrice: boolean;
|
|
16
19
|
};
|
package/dist/prices.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prices.d.ts","sourceRoot":"","sources":["../src/prices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"prices.d.ts","sourceRoot":"","sources":["../src/prices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAuErD,eAAO,MAAM,mBAAmB,GAC9B,cAAc,YAAY,EAC1B,QAAQ,KAAK,EAAE,KACd,OAAO,CAAC,UAAU,EAAE,CAgBtB,CAAA;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,GAAG;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GACA,KAAK,CAOP;AAED,eAAO,MAAM,cAAc,GACzB,cAAc,YAAY,EAC1B,QAAQ,KAAK,EAAE,KACd,OAAO,CAAC,UAAU,E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