0xtrails 0.2.2 → 0.2.5
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 +8 -0
- package/dist/aave.d.ts.map +1 -1
- package/dist/{ccip-ConT1gDe.js → ccip-CXlshvBY.js} +1 -1
- package/dist/chains.d.ts +5 -1
- package/dist/chains.d.ts.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +5 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/error.d.ts +1 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/estimate.d.ts +52 -0
- package/dist/estimate.d.ts.map +1 -1
- package/dist/{index-CMh8uEbV.js → index-_QuyGrjU.js} +86304 -83380
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/intentEntrypoint.d.ts +0 -8
- package/dist/intentEntrypoint.d.ts.map +1 -1
- package/dist/intents.d.ts +40 -0
- package/dist/intents.d.ts.map +1 -1
- package/dist/metaTxnMonitor.d.ts +5 -4
- package/dist/metaTxnMonitor.d.ts.map +1 -1
- package/dist/metaTxns.d.ts +3 -3
- package/dist/metaTxns.d.ts.map +1 -1
- package/dist/morpho.d.ts +8 -0
- package/dist/morpho.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +16 -6
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/queryParams.d.ts.map +1 -1
- package/dist/relayer.d.ts +10 -7
- package/dist/relayer.d.ts.map +1 -1
- package/dist/sequenceWallet.d.ts +3 -2
- package/dist/sequenceWallet.d.ts.map +1 -1
- package/dist/tokenBalances.d.ts +7 -0
- package/dist/tokenBalances.d.ts.map +1 -1
- package/dist/tokens.d.ts +2 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/trails.d.ts +2 -2
- package/dist/trails.d.ts.map +1 -1
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountActionsDropdown.d.ts.map +1 -1
- package/dist/widget/components/AccountSettings.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts +2 -0
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts +4 -0
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/EarnPools.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +1 -0
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/{FundSendForm.d.ts → FundSwap.d.ts} +11 -5
- package/dist/widget/components/FundSwap.d.ts.map +1 -0
- package/dist/widget/components/FundingMethodSelectorButton.d.ts +4 -0
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -0
- package/dist/widget/components/Modal.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts +1 -0
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PercentageMaxButtons.d.ts +12 -0
- package/dist/widget/components/PercentageMaxButtons.d.ts.map +1 -0
- package/dist/widget/components/{PaySendForm.d.ts → PoolDeposit.d.ts} +11 -34
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -0
- package/dist/widget/components/{SimpleSwap.d.ts → PoolWithdraw.d.ts} +16 -8
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -0
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receive.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts +4 -0
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -0
- package/dist/widget/components/Recipients.d.ts.map +1 -1
- package/dist/widget/components/RefundWarning.d.ts +1 -0
- package/dist/widget/components/RefundWarning.d.ts.map +1 -1
- package/dist/widget/components/RequiredPropsError.d.ts +8 -0
- package/dist/widget/components/RequiredPropsError.d.ts.map +1 -0
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/SlippageToleranceSettings.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts +1 -0
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/SwapSettings.d.ts.map +1 -1
- package/dist/widget/components/TokenImage.d.ts +1 -0
- package/dist/widget/components/TokenImage.d.ts.map +1 -1
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TokenSelectorButton.d.ts +16 -0
- package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -0
- package/dist/widget/components/UserPreferences.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.d.ts +8 -0
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -0
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletList.d.ts.map +1 -1
- package/dist/widget/css/compiled.css +2 -0
- package/dist/widget/css/index.css +554 -0
- package/dist/widget/hooks/useBack.d.ts +6 -0
- package/dist/widget/hooks/useBack.d.ts.map +1 -1
- package/dist/widget/hooks/useCheckout.d.ts +1 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts +1 -1
- package/dist/widget/hooks/useCurrentScreen.d.ts.map +1 -1
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts +3 -3
- package/dist/widget/hooks/useDefaultTokenSelection.d.ts.map +1 -1
- package/dist/widget/hooks/useInitialRedirect.d.ts +7 -0
- package/dist/widget/hooks/useInitialRedirect.d.ts.map +1 -0
- package/dist/widget/hooks/usePayMessage.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFeeToken.d.ts.map +1 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts +12 -0
- package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +1 -0
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +1 -1
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/index.js +1 -1
- package/dist/widget/widget.d.ts +4 -4
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +30 -23
- package/src/aave.ts +32 -0
- package/src/chains.ts +23 -3
- package/src/config.ts +12 -4
- package/src/constants.ts +11 -16
- package/src/error.ts +20 -2
- package/src/estimate.ts +416 -5
- package/src/index.ts +8 -3
- package/src/intentEntrypoint.ts +0 -15
- package/src/intents.ts +161 -11
- package/src/metaTxnMonitor.ts +28 -22
- package/src/metaTxns.ts +3 -3
- package/src/morpho.ts +32 -0
- package/src/prepareSend.ts +710 -458
- package/src/queryParams.ts +2 -1
- package/src/relayer.ts +15 -16
- package/src/sequenceWallet.ts +7 -3
- package/src/tokenBalances.ts +47 -0
- package/src/tokens.ts +17 -1
- package/src/trails.ts +2 -2
- package/src/wallets.ts +8 -0
- package/src/widget/compiled.css +2 -2
- package/src/widget/components/AccountActionsDropdown.tsx +9 -15
- package/src/widget/components/AccountIntentTransactionHistory.tsx +1 -1
- package/src/widget/components/AccountSettings.tsx +10 -27
- package/src/widget/components/ChainFilterDropdown.tsx +1 -1
- package/src/widget/components/ChainList.tsx +1 -1
- package/src/widget/components/ClassicSwap.tsx +111 -155
- package/src/widget/components/ConnectWallet.tsx +10 -39
- package/src/widget/components/ConnectedWallets.tsx +113 -58
- package/src/widget/components/Earn.tsx +73 -589
- package/src/widget/components/EarnPools.tsx +2 -1
- package/src/widget/components/Fund.tsx +81 -109
- package/src/widget/components/FundMethods.tsx +82 -159
- package/src/widget/components/FundSwap.tsx +52 -0
- package/src/widget/components/FundingMethodSelectorButton.tsx +60 -0
- package/src/widget/components/Modal.tsx +6 -2
- package/src/widget/components/Pay.tsx +198 -200
- package/src/widget/components/PercentageMaxButtons.tsx +77 -0
- package/src/widget/components/PoolDeposit.tsx +593 -0
- package/src/widget/components/PoolWithdraw.tsx +903 -0
- package/src/widget/components/QuoteDetails.tsx +22 -8
- package/src/widget/components/Receive.tsx +1 -3
- package/src/widget/components/RecipientSelectorButton.tsx +42 -0
- package/src/widget/components/Recipients.tsx +64 -156
- package/src/widget/components/RefundWarning.tsx +5 -1
- package/src/widget/components/RequiredPropsError.tsx +33 -0
- package/src/widget/components/ScreenHeader.tsx +5 -1
- package/src/widget/components/SlippageToleranceSettings.tsx +2 -1
- package/src/widget/components/Swap.tsx +2 -43
- package/src/widget/components/SwapSettings.tsx +3 -15
- package/src/widget/components/TokenImage.tsx +21 -4
- package/src/widget/components/TokenList.tsx +0 -1
- package/src/widget/components/TokenSelector.tsx +2 -1
- package/src/widget/components/TokenSelectorButton.tsx +75 -0
- package/src/widget/components/UserPreferences.tsx +6 -24
- package/src/widget/components/WaasFeeOptions.tsx +331 -0
- package/src/widget/components/WalletConfirmation.tsx +55 -3
- package/src/widget/components/WalletList.tsx +7 -5
- package/src/widget/hooks/useBack.tsx +113 -9
- package/src/widget/hooks/useCheckout.ts +36 -20
- package/src/widget/hooks/useCurrentScreen.tsx +1 -0
- package/src/widget/hooks/useDefaultTokenSelection.tsx +104 -28
- package/src/widget/hooks/useInitialRedirect.tsx +70 -0
- package/src/widget/hooks/usePayMessage.tsx +86 -11
- package/src/widget/hooks/useSelectedFeeToken.tsx +10 -16
- package/src/widget/hooks/useSelectedFundMethod.tsx +41 -0
- package/src/widget/hooks/useSelectedRecipient.tsx +10 -0
- package/src/widget/hooks/useSendForm.ts +34 -12
- package/src/widget/hooks/useTokenList.ts +1 -1
- package/src/widget/index.css +27 -0
- package/src/widget/widget.tsx +245 -208
- package/dist/widget/components/FundSendForm.d.ts.map +0 -1
- package/dist/widget/components/PaySendForm.d.ts.map +0 -1
- package/dist/widget/components/SimpleSwap.d.ts.map +0 -1
- package/dist/widget/hooks/useSwapSettings.d.ts +0 -16
- package/dist/widget/hooks/useSwapSettings.d.ts.map +0 -1
- package/src/widget/components/FundSendForm.tsx +0 -903
- package/src/widget/components/PaySendForm.tsx +0 -869
- package/src/widget/components/SimpleSwap.tsx +0 -983
- package/src/widget/hooks/useSwapSettings.tsx +0 -100
- /package/dist/{style.css → 0xtrails.css} +0 -0
package/src/queryParams.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useEffect, useState } from "react"
|
|
2
|
+
import { logger } from "./logger.js"
|
|
2
3
|
|
|
3
4
|
export function getQueryParam(key: string): string | null {
|
|
4
5
|
try {
|
|
5
6
|
if (typeof window === "undefined") return null
|
|
6
7
|
return new URLSearchParams(window.location.search).get(key)
|
|
7
8
|
} catch (error) {
|
|
8
|
-
console.error("Error getting query param", error)
|
|
9
|
+
logger.console.error("Error getting query param", error)
|
|
9
10
|
return null
|
|
10
11
|
}
|
|
11
12
|
}
|
package/src/relayer.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Relayer } from "@0xsequence/
|
|
1
|
+
import { Relayer } from "@0xsequence/relayer"
|
|
2
2
|
import { useMemo } from "react"
|
|
3
3
|
import { getChainInfo, getRpcUrl } from "./chains.js"
|
|
4
4
|
import { Hex } from "ox"
|
|
@@ -45,7 +45,10 @@ export interface MetaTxnReceipt {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export type RelayerOperationStatus = Relayer.OperationStatus
|
|
48
|
-
export type
|
|
48
|
+
export type RelayerOperationFailedStatus = Relayer.OperationFailedStatus
|
|
49
|
+
export type RelayerOperationPendingStatus = Relayer.OperationPendingStatus
|
|
50
|
+
export type RelayerOperationConfirmedStatus = Relayer.OperationConfirmedStatus
|
|
51
|
+
export type RelayerOperationUnknownStatus = Relayer.OperationUnknownStatus
|
|
49
52
|
|
|
50
53
|
export type RelayerConfig = {
|
|
51
54
|
hostname: string
|
|
@@ -120,15 +123,15 @@ function wrappedFetch(
|
|
|
120
123
|
|
|
121
124
|
export function getBackupRelayer(
|
|
122
125
|
chainId: number,
|
|
123
|
-
): Relayer.
|
|
126
|
+
): Relayer.RpcRelayer | undefined {
|
|
124
127
|
if (chainId === 42161) {
|
|
125
|
-
return new Relayer.
|
|
128
|
+
return new Relayer.RpcRelayer(
|
|
126
129
|
"https://a1b4a8c5d856.ngrok.app/",
|
|
127
130
|
chainId,
|
|
128
131
|
getRpcUrl(chainId)!,
|
|
129
132
|
)
|
|
130
133
|
} else if (chainId === 8453) {
|
|
131
|
-
return new Relayer.
|
|
134
|
+
return new Relayer.RpcRelayer(
|
|
132
135
|
"https://644a6aeb891e.ngrok.app/",
|
|
133
136
|
chainId,
|
|
134
137
|
getRpcUrl(chainId)!,
|
|
@@ -187,7 +190,7 @@ export function getRelayer(
|
|
|
187
190
|
env: getSequenceEnv() as RelayerEnv,
|
|
188
191
|
},
|
|
189
192
|
chainId: number,
|
|
190
|
-
): Relayer.
|
|
193
|
+
): Relayer.RpcRelayer {
|
|
191
194
|
const chain = getChainInfo(chainId)
|
|
192
195
|
|
|
193
196
|
if (!chain) {
|
|
@@ -201,7 +204,7 @@ export function getRelayer(
|
|
|
201
204
|
|
|
202
205
|
const relayerUrl = getRelayerUrl(config, chainId)
|
|
203
206
|
|
|
204
|
-
const relayer = new Relayer.
|
|
207
|
+
const relayer = new Relayer.RpcRelayer(
|
|
205
208
|
relayerUrl,
|
|
206
209
|
chainId,
|
|
207
210
|
rpcUrl,
|
|
@@ -258,20 +261,16 @@ export function useRelayers(
|
|
|
258
261
|
env: getSequenceEnv() as RelayerEnv,
|
|
259
262
|
},
|
|
260
263
|
): {
|
|
261
|
-
relayers: Map<number, Relayer.
|
|
262
|
-
getRelayer: (chainId: number) => Relayer.
|
|
263
|
-
getBackupRelayer: (
|
|
264
|
-
chainId: number,
|
|
265
|
-
) => Relayer.Standard.Rpc.RpcRelayer | undefined
|
|
264
|
+
relayers: Map<number, Relayer.RpcRelayer>
|
|
265
|
+
getRelayer: (chainId: number) => Relayer.RpcRelayer
|
|
266
|
+
getBackupRelayer: (chainId: number) => Relayer.RpcRelayer | undefined
|
|
266
267
|
} {
|
|
267
268
|
const relayers = useMemo(() => {
|
|
268
|
-
const relayerMap = new Map<number, Relayer.
|
|
269
|
+
const relayerMap = new Map<number, Relayer.RpcRelayer>()
|
|
269
270
|
return relayerMap
|
|
270
271
|
}, [])
|
|
271
272
|
|
|
272
|
-
const getCachedRelayer = (
|
|
273
|
-
chainId: number,
|
|
274
|
-
): Relayer.Standard.Rpc.RpcRelayer => {
|
|
273
|
+
const getCachedRelayer = (chainId: number): Relayer.RpcRelayer => {
|
|
275
274
|
let relayer = relayers.get(chainId)
|
|
276
275
|
|
|
277
276
|
if (!relayer) {
|
package/src/sequenceWallet.ts
CHANGED
|
@@ -14,10 +14,11 @@ import {
|
|
|
14
14
|
toHex,
|
|
15
15
|
type WalletClient,
|
|
16
16
|
} from "viem"
|
|
17
|
-
import type {
|
|
17
|
+
import type { RelayerEnvConfig, RelayerEnv } from "./relayer.js"
|
|
18
18
|
import { getRelayerUrl } from "./relayer.js"
|
|
19
19
|
import { getSequenceProjectAccessKey, getSequenceEnv } from "./config.js"
|
|
20
20
|
import { logger } from "./logger.js"
|
|
21
|
+
import type { Relayer } from "@0xsequence/relayer"
|
|
21
22
|
|
|
22
23
|
export type FlatTransaction = {
|
|
23
24
|
to: string
|
|
@@ -527,11 +528,14 @@ export class StaticSigner implements signers.SapientSigner {
|
|
|
527
528
|
}
|
|
528
529
|
|
|
529
530
|
export async function getFeeOptions(
|
|
530
|
-
relayer: Relayer.
|
|
531
|
+
relayer: Relayer.RpcRelayer,
|
|
531
532
|
wallet: string,
|
|
532
533
|
chainId: number,
|
|
533
534
|
calls: Payload.Call[],
|
|
534
|
-
) {
|
|
535
|
+
): Promise<{
|
|
536
|
+
options: Relayer.FeeOption[]
|
|
537
|
+
quote?: Relayer.FeeQuote
|
|
538
|
+
}> {
|
|
535
539
|
const feeOptions = await relayer.feeOptions(
|
|
536
540
|
wallet as `0x${string}`,
|
|
537
541
|
chainId,
|
package/src/tokenBalances.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { useIndexerGatewayClient } from "./indexerClient.js"
|
|
|
17
17
|
import { getTokenPrices, useTokenPrices } from "./prices.js"
|
|
18
18
|
import { logger } from "./logger.js"
|
|
19
19
|
import { getChainInfo } from "./chains.js"
|
|
20
|
+
import { getTokenImageUrl } from "./tokens.js"
|
|
20
21
|
|
|
21
22
|
export type { NativeTokenBalance, TokenBalance }
|
|
22
23
|
|
|
@@ -58,6 +59,10 @@ export interface TokenBalanceWithPrice extends TokenBalance {
|
|
|
58
59
|
balanceUsd?: number
|
|
59
60
|
balanceUsdFormatted?: string
|
|
60
61
|
chainName?: string
|
|
62
|
+
imageUrl?: string
|
|
63
|
+
symbol?: string
|
|
64
|
+
name?: string
|
|
65
|
+
decimals?: number
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
export interface NativeTokenBalanceWithPrice extends NativeTokenBalance {
|
|
@@ -66,6 +71,9 @@ export interface NativeTokenBalanceWithPrice extends NativeTokenBalance {
|
|
|
66
71
|
balanceUsdFormatted?: string
|
|
67
72
|
symbol?: string
|
|
68
73
|
chainName?: string
|
|
74
|
+
imageUrl?: string
|
|
75
|
+
name?: string
|
|
76
|
+
decimals?: number
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
export type TokenBalanceExtended =
|
|
@@ -268,11 +276,32 @@ export function useTokenBalances(
|
|
|
268
276
|
...token,
|
|
269
277
|
contractAddress: zeroAddress, // Native tokens always use zero address
|
|
270
278
|
chainName: getChainInfo(token.chainId)?.name || "",
|
|
279
|
+
symbol: token.symbol ?? (token as any).contractInfo?.symbol,
|
|
280
|
+
name: (token as any).name ?? (token as any).contractInfo?.name,
|
|
281
|
+
decimals:
|
|
282
|
+
(token as any).decimals ??
|
|
283
|
+
(token as any).contractInfo?.decimals ??
|
|
284
|
+
18, // Use token decimals or default to 18
|
|
285
|
+
imageUrl: getTokenImageUrl({
|
|
286
|
+
chainId: token.chainId,
|
|
287
|
+
contractAddress: zeroAddress,
|
|
288
|
+
symbol: token.symbol ?? (token as any).contractInfo?.symbol,
|
|
289
|
+
fallbackImageUrl: (token as any).contractInfo?.logoURI,
|
|
290
|
+
}),
|
|
271
291
|
})),
|
|
272
292
|
...tokenBalancesData.balances.map((token) => ({
|
|
273
293
|
...token,
|
|
274
294
|
contractAddress: token.contractAddress,
|
|
275
295
|
chainName: getChainInfo(token.contractInfo?.chainId)?.name || "",
|
|
296
|
+
symbol: token.contractInfo?.symbol,
|
|
297
|
+
name: token.contractInfo?.name,
|
|
298
|
+
decimals: token.contractInfo?.decimals,
|
|
299
|
+
imageUrl: getTokenImageUrl({
|
|
300
|
+
chainId: token.contractInfo?.chainId || 0,
|
|
301
|
+
contractAddress: token.contractAddress,
|
|
302
|
+
symbol: token.contractInfo?.symbol,
|
|
303
|
+
fallbackImageUrl: token.contractInfo?.logoURI,
|
|
304
|
+
}),
|
|
276
305
|
})),
|
|
277
306
|
].filter((token) => {
|
|
278
307
|
try {
|
|
@@ -614,6 +643,15 @@ export async function getTokenBalancesFlatArray({
|
|
|
614
643
|
...b,
|
|
615
644
|
contractAddress: b.contractAddress ?? zeroAddress,
|
|
616
645
|
tokenId: b.contractInfo?.symbol,
|
|
646
|
+
symbol: b.contractInfo?.symbol,
|
|
647
|
+
name: b.contractInfo?.name,
|
|
648
|
+
decimals: b.contractInfo?.decimals,
|
|
649
|
+
imageUrl: getTokenImageUrl({
|
|
650
|
+
chainId: b.contractInfo?.chainId || 0,
|
|
651
|
+
contractAddress: b.contractAddress ?? zeroAddress,
|
|
652
|
+
symbol: b.contractInfo?.symbol,
|
|
653
|
+
fallbackImageUrl: b.contractInfo?.logoURI,
|
|
654
|
+
}),
|
|
617
655
|
},
|
|
618
656
|
)
|
|
619
657
|
})
|
|
@@ -625,6 +663,15 @@ export async function getTokenBalancesFlatArray({
|
|
|
625
663
|
...b,
|
|
626
664
|
contractAddress: b.contractAddress ?? zeroAddress,
|
|
627
665
|
tokenId: b.symbol,
|
|
666
|
+
symbol: b.symbol,
|
|
667
|
+
name: b.name,
|
|
668
|
+
decimals: b.decimals ?? b.contractInfo?.decimals ?? 18, // Use token decimals or default to 18
|
|
669
|
+
imageUrl: getTokenImageUrl({
|
|
670
|
+
chainId: b.chainId,
|
|
671
|
+
contractAddress: zeroAddress,
|
|
672
|
+
symbol: b.symbol,
|
|
673
|
+
fallbackImageUrl: b.contractInfo?.logoURI,
|
|
674
|
+
}),
|
|
628
675
|
})
|
|
629
676
|
})
|
|
630
677
|
}
|
package/src/tokens.ts
CHANGED
|
@@ -44,6 +44,10 @@ export const commonTokenImages: Record<string, string> = {
|
|
|
44
44
|
XTZ: "https://assets.sequence.info/images/tokens/large/42793/0x0000000000000000000000000000000000000000.webp",
|
|
45
45
|
WXTZ: "https://assets.coingecko.com/coins/images/976/standard/Tezos-logo.png?1696502091",
|
|
46
46
|
SOMI: "https://assets.sequence.info/images/tokens/large/5031/0x0000000000000000000000000000000000000000.webp",
|
|
47
|
+
XAI: "https://assets.coingecko.com/coins/images/34258/large/round_icon_2048_px.png?1719523838",
|
|
48
|
+
APE: "https://assets.sequence.info/images/tokens/large/33139/0x0000000000000000000000000000000000000000.webp",
|
|
49
|
+
ANIME:
|
|
50
|
+
"https://assets.coingecko.com/coins/images/53575/large/anime.jpg?1736748703",
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
const cacheVersion = "01"
|
|
@@ -697,10 +701,11 @@ export function getCommonTokenImageUrl({
|
|
|
697
701
|
contractAddress?: string | null
|
|
698
702
|
chainId?: number | null
|
|
699
703
|
}) {
|
|
700
|
-
if (!
|
|
704
|
+
if (!contractAddress || !chainId) {
|
|
701
705
|
return ""
|
|
702
706
|
}
|
|
703
707
|
|
|
708
|
+
// If no symbol provided, try to look it up from contract address
|
|
704
709
|
if (!symbol) {
|
|
705
710
|
const token = commonTokens.find(
|
|
706
711
|
(t) =>
|
|
@@ -717,6 +722,7 @@ export function getCommonTokenImageUrl({
|
|
|
717
722
|
}
|
|
718
723
|
|
|
719
724
|
const symbolKey = tokenImageSymbolMap[symbol] ?? symbol
|
|
725
|
+
|
|
720
726
|
if (commonTokenImages[symbolKey]) {
|
|
721
727
|
return commonTokenImages[symbolKey]
|
|
722
728
|
}
|
|
@@ -728,10 +734,12 @@ export function getTokenImageUrl({
|
|
|
728
734
|
chainId,
|
|
729
735
|
contractAddress,
|
|
730
736
|
symbol,
|
|
737
|
+
fallbackImageUrl,
|
|
731
738
|
}: {
|
|
732
739
|
chainId?: number
|
|
733
740
|
contractAddress?: string
|
|
734
741
|
symbol?: string
|
|
742
|
+
fallbackImageUrl?: string
|
|
735
743
|
}) {
|
|
736
744
|
if (!chainId || !contractAddress || !symbol) {
|
|
737
745
|
return ""
|
|
@@ -757,6 +765,10 @@ export function getTokenImageUrl({
|
|
|
757
765
|
}
|
|
758
766
|
}
|
|
759
767
|
|
|
768
|
+
if (fallbackImageUrl) {
|
|
769
|
+
return fallbackImageUrl
|
|
770
|
+
}
|
|
771
|
+
|
|
760
772
|
const imageUrl = `https://assets.sequence.info/images/tokens/large/${chainId}/${contractAddress.toLowerCase()}.webp`
|
|
761
773
|
return imageUrl
|
|
762
774
|
}
|
|
@@ -960,6 +972,10 @@ export const tokenImageSymbolMap: Record<string, string> = {
|
|
|
960
972
|
BAT: "BAT",
|
|
961
973
|
ARB: "ARB",
|
|
962
974
|
LINK: "LINK",
|
|
975
|
+
|
|
976
|
+
// vault tokens
|
|
977
|
+
aBasUSDC: "USDC",
|
|
978
|
+
steakUSDC: "USDC",
|
|
963
979
|
}
|
|
964
980
|
|
|
965
981
|
export const commonTokens: SupportedToken[] = [
|
package/src/trails.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
IntentPrecondition,
|
|
7
7
|
} from "@0xsequence/trails-api"
|
|
8
8
|
import type { TrailsClient } from "./trailsClient.js"
|
|
9
|
-
import type {
|
|
9
|
+
import type { RelayerOperationStatus } from "./relayer.js"
|
|
10
10
|
import { useMutation, useQuery } from "@tanstack/react-query"
|
|
11
11
|
import { Address } from "ox"
|
|
12
12
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
@@ -154,7 +154,7 @@ export type UseTrailsReturn = {
|
|
|
154
154
|
sendMetaTxnError: Error | null
|
|
155
155
|
sendMetaTxnArgs: { selectedId: string | null } | undefined
|
|
156
156
|
clearIntent: () => void
|
|
157
|
-
metaTxnMonitorStatuses: { [key: string]:
|
|
157
|
+
metaTxnMonitorStatuses: { [key: string]: RelayerOperationStatus }
|
|
158
158
|
createIntent: (args: GetIntentCallsPayloadsArgs) => void
|
|
159
159
|
createIntentPending: boolean
|
|
160
160
|
createIntentSuccess: boolean
|
package/src/wallets.ts
CHANGED
|
@@ -172,6 +172,7 @@ export const connectors = [
|
|
|
172
172
|
zerionConnector,
|
|
173
173
|
ambireConnector,
|
|
174
174
|
rabbyConnector,
|
|
175
|
+
sequenceConnector,
|
|
175
176
|
]
|
|
176
177
|
|
|
177
178
|
export const WALLET_CONFIGS: Record<string, WalletConfig> = {
|
|
@@ -282,6 +283,12 @@ export const WALLET_CONFIGS: Record<string, WalletConfig> = {
|
|
|
282
283
|
connector: sequenceConnector,
|
|
283
284
|
icon: SequenceLogo as string,
|
|
284
285
|
},
|
|
286
|
+
"sequence-waas": {
|
|
287
|
+
id: "sequence-waas",
|
|
288
|
+
name: "Sequence WaaS",
|
|
289
|
+
connector: sequenceConnector,
|
|
290
|
+
icon: SequenceLogo as string,
|
|
291
|
+
},
|
|
285
292
|
}
|
|
286
293
|
|
|
287
294
|
export const topShownWallets = [
|
|
@@ -320,6 +327,7 @@ export const wagmiConnectorToWalletId = (wagmiConnector: any): string => {
|
|
|
320
327
|
if (wagmiConnectorName.includes("okx")) return "okxwallet"
|
|
321
328
|
if (wagmiConnectorName.includes("privy")) return "privy"
|
|
322
329
|
if (wagmiConnectorName.includes("gemini")) return "gemini"
|
|
330
|
+
if (wagmiConnectorName.includes("waas")) return "sequence-waas"
|
|
323
331
|
if (wagmiConnectorName.includes("sequence")) return "sequence"
|
|
324
332
|
return wagmiConnector.id || "injected"
|
|
325
333
|
}
|