thirdweb 5.99.3 → 5.100.0-nightly-713ebe0a2d6d8a409e41ce0f0317fc34b1f221bb-20250520000414
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/bridge/Buy.js +16 -12
- package/dist/cjs/bridge/Buy.js.map +1 -1
- package/dist/cjs/bridge/Chains.js +2 -2
- package/dist/cjs/bridge/Chains.js.map +1 -1
- package/dist/cjs/bridge/Routes.js +2 -2
- package/dist/cjs/bridge/Routes.js.map +1 -1
- package/dist/cjs/bridge/Sell.js +17 -13
- package/dist/cjs/bridge/Sell.js.map +1 -1
- package/dist/cjs/bridge/Status.js +15 -2
- package/dist/cjs/bridge/Status.js.map +1 -1
- package/dist/cjs/bridge/Transfer.js +229 -0
- package/dist/cjs/bridge/Transfer.js.map +1 -0
- package/dist/cjs/bridge/index.js +2 -1
- package/dist/cjs/bridge/index.js.map +1 -1
- package/dist/cjs/bridge/types/Token.js +3 -0
- package/dist/cjs/bridge/types/Token.js.map +1 -0
- package/dist/cjs/pay/buyWithCrypto/getQuote.js +159 -53
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js +160 -14
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js +95 -37
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/cjs/pay/utils/definitions.js +1 -31
- package/dist/cjs/pay/utils/definitions.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +23 -21
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -15
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +0 -135
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +83 -34
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +2 -2
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/utils/any-evm/zksync/constants.js +1 -0
- package/dist/cjs/utils/any-evm/zksync/constants.js.map +1 -1
- package/dist/cjs/utils/domains.js +3 -0
- package/dist/cjs/utils/domains.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bridge/Buy.js +16 -12
- package/dist/esm/bridge/Buy.js.map +1 -1
- package/dist/esm/bridge/Chains.js +2 -2
- package/dist/esm/bridge/Chains.js.map +1 -1
- package/dist/esm/bridge/Routes.js +2 -2
- package/dist/esm/bridge/Routes.js.map +1 -1
- package/dist/esm/bridge/Sell.js +17 -13
- package/dist/esm/bridge/Sell.js.map +1 -1
- package/dist/esm/bridge/Status.js +15 -2
- package/dist/esm/bridge/Status.js.map +1 -1
- package/dist/esm/bridge/Transfer.js +226 -0
- package/dist/esm/bridge/Transfer.js.map +1 -0
- package/dist/esm/bridge/index.js +1 -0
- package/dist/esm/bridge/index.js.map +1 -1
- package/dist/esm/bridge/types/Token.js +2 -0
- package/dist/esm/bridge/types/Token.js.map +1 -0
- package/dist/esm/pay/buyWithCrypto/getQuote.js +159 -53
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js +160 -14
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js +95 -37
- package/dist/esm/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/esm/pay/utils/definitions.js +0 -25
- package/dist/esm/pay/utils/definitions.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +23 -21
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -15
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +1 -134
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +84 -34
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +2 -2
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/utils/any-evm/zksync/constants.js +1 -0
- package/dist/esm/utils/any-evm/zksync/constants.js.map +1 -1
- package/dist/esm/utils/domains.js +3 -0
- package/dist/esm/utils/domains.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/bridge/Buy.d.ts +10 -8
- package/dist/types/bridge/Buy.d.ts.map +1 -1
- package/dist/types/bridge/Sell.d.ts +12 -10
- package/dist/types/bridge/Sell.d.ts.map +1 -1
- package/dist/types/bridge/Status.d.ts.map +1 -1
- package/dist/types/bridge/Transfer.d.ts +199 -0
- package/dist/types/bridge/Transfer.d.ts.map +1 -0
- package/dist/types/bridge/index.d.ts +1 -0
- package/dist/types/bridge/index.d.ts.map +1 -1
- package/dist/types/bridge/types/Route.d.ts +3 -17
- package/dist/types/bridge/types/Route.d.ts.map +1 -1
- package/dist/types/bridge/types/Status.d.ts +15 -0
- package/dist/types/bridge/types/Status.d.ts.map +1 -1
- package/dist/types/bridge/types/Token.d.ts +10 -0
- package/dist/types/bridge/types/Token.d.ts.map +1 -0
- package/dist/types/pay/buyWithCrypto/commonTypes.d.ts +0 -9
- package/dist/types/pay/buyWithCrypto/commonTypes.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getTransfer.d.ts.map +1 -1
- package/dist/types/pay/utils/definitions.d.ts +0 -25
- package/dist/types/pay/utils/definitions.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts +2 -13
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +8 -4
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/utils/any-evm/zksync/constants.d.ts.map +1 -1
- package/dist/types/utils/domains.d.ts +6 -0
- package/dist/types/utils/domains.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bridge/Buy.ts +18 -12
- package/src/bridge/Chains.ts +2 -2
- package/src/bridge/Routes.ts +2 -2
- package/src/bridge/Sell.ts +19 -13
- package/src/bridge/Status.ts +15 -2
- package/src/bridge/Transfer.test.ts +76 -0
- package/src/bridge/Transfer.ts +270 -0
- package/src/bridge/index.ts +1 -0
- package/src/bridge/types/Route.ts +3 -17
- package/src/bridge/types/Status.ts +15 -1
- package/src/bridge/types/Token.ts +10 -0
- package/src/pay/buyWithCrypto/commonTypes.ts +0 -10
- package/src/pay/buyWithCrypto/getQuote.ts +210 -100
- package/src/pay/buyWithCrypto/getStatus.ts +213 -20
- package/src/pay/buyWithCrypto/getTransfer.ts +129 -61
- package/src/pay/utils/definitions.ts +0 -34
- package/src/react/core/hooks/transaction/useSendTransaction.ts +27 -33
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +29 -35
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts +2 -181
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +1 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +118 -63
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +0 -2
- package/src/utils/any-evm/zksync/constants.ts +1 -0
- package/src/utils/domain.test.ts +1 -0
- package/src/utils/domains.ts +8 -0
- package/src/version.ts +1 -1
- package/dist/cjs/bridge/constants.js +0 -5
- package/dist/cjs/bridge/constants.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +0 -54
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -52
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +0 -1
- package/dist/esm/bridge/constants.js +0 -2
- package/dist/esm/bridge/constants.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +0 -51
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -48
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +0 -1
- package/dist/types/bridge/constants.d.ts +0 -2
- package/dist/types/bridge/constants.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts +0 -9
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts.map +0 -1
- package/src/bridge/constants.ts +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.tsx +0 -163
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +0 -127
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pendingSwapTx.js","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;
|
1
|
+
{"version":3,"file":"pendingSwapTx.js","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AAarE,MAAM,mBAAmB,GAAG,eAAe,CAAC,IAAA,sBAAW,EAAkB,EAAE,CAAC,CAAC;AAE7E;;GAEG;AACI,MAAM,YAAY,GAAG,CAAC,MAAqB,EAAE,EAAE;IACpD,MAAM,YAAY,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;IACpD,6BAA6B;IAC7B,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC;AAC1D,CAAC,CAAC;AAJW,QAAA,YAAY,gBAIvB"}
|
@@ -1,45 +1,67 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.fetchBuySupportedDestinations = fetchBuySupportedDestinations;
|
4
3
|
exports.useBuySupportedDestinations = useBuySupportedDestinations;
|
5
4
|
exports.useBuySupportedSources = useBuySupportedSources;
|
6
5
|
const react_query_1 = require("@tanstack/react-query");
|
6
|
+
const ox_1 = require("ox");
|
7
|
+
const Bridge = require("../../../../../../../bridge/index.js");
|
7
8
|
const utils_js_1 = require("../../../../../../../chains/utils.js");
|
8
|
-
const definitions_js_1 = require("../../../../../../../pay/utils/definitions.js");
|
9
|
-
const fetch_js_1 = require("../../../../../../../utils/fetch.js");
|
10
|
-
const json_js_1 = require("../../../../../../../utils/json.js");
|
11
9
|
const withCache_js_1 = require("../../../../../../../utils/promise/withCache.js");
|
12
|
-
async function fetchBuySupportedDestinations(client,
|
10
|
+
async function fetchBuySupportedDestinations({ client, originChainId, originTokenAddress, }) {
|
13
11
|
return (0, withCache_js_1.withCache)(async () => {
|
14
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
const routes = await Bridge.routes({
|
13
|
+
client,
|
14
|
+
originChainId,
|
15
|
+
originTokenAddress,
|
16
|
+
maxSteps: 1,
|
17
|
+
sortBy: "popularity",
|
18
|
+
limit: 1000000,
|
19
|
+
});
|
20
|
+
const tokens = new Set();
|
21
|
+
const chains = new Set();
|
22
|
+
const destinationTokens = [];
|
23
|
+
for (const route of routes) {
|
24
|
+
const key = `${route.destinationToken.chainId}:${route.destinationToken.address}`;
|
25
|
+
if (!tokens.has(key)) {
|
26
|
+
tokens.add(key);
|
27
|
+
if (!chains.has(route.destinationToken.chainId)) {
|
28
|
+
chains.add(route.destinationToken.chainId);
|
29
|
+
}
|
30
|
+
const existing = destinationTokens[route.destinationToken.chainId];
|
31
|
+
if (!existing) {
|
32
|
+
destinationTokens[route.destinationToken.chainId] = [];
|
33
|
+
}
|
34
|
+
destinationTokens[route.destinationToken.chainId] = [
|
35
|
+
...(existing || []),
|
36
|
+
{
|
37
|
+
address: ox_1.Address.checksum(route.destinationToken.address),
|
38
|
+
// We support both options for all tokens
|
39
|
+
buyWithCryptoEnabled: true,
|
40
|
+
buyWithFiatEnabled: true,
|
41
|
+
name: route.destinationToken.name,
|
42
|
+
symbol: route.destinationToken.symbol,
|
43
|
+
icon: route.destinationToken.iconUri,
|
44
|
+
},
|
45
|
+
];
|
46
|
+
}
|
19
47
|
}
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
24
|
-
return data.result.map((item) => ({
|
25
|
-
chain: (0, utils_js_1.defineChain)({
|
26
|
-
id: item.chainId,
|
27
|
-
}),
|
28
|
-
tokens: item.tokens,
|
48
|
+
return [...chains].map((chainId) => ({
|
49
|
+
chain: (0, utils_js_1.getCachedChain)(chainId),
|
50
|
+
tokens: destinationTokens[chainId] || [],
|
29
51
|
}));
|
30
52
|
}, {
|
31
|
-
cacheKey:
|
53
|
+
cacheKey: `buy-supported-destinations-${originChainId}:${originTokenAddress}`,
|
32
54
|
cacheTime: 5 * 60 * 1000,
|
33
55
|
});
|
34
56
|
}
|
35
57
|
/**
|
36
58
|
* @internal
|
37
59
|
*/
|
38
|
-
function useBuySupportedDestinations(client,
|
60
|
+
function useBuySupportedDestinations(client, _isTestMode) {
|
39
61
|
return (0, react_query_1.useQuery)({
|
40
62
|
queryKey: ["destination-tokens", client],
|
41
63
|
queryFn: async () => {
|
42
|
-
return fetchBuySupportedDestinations(client
|
64
|
+
return fetchBuySupportedDestinations({ client });
|
43
65
|
},
|
44
66
|
});
|
45
67
|
}
|
@@ -47,18 +69,45 @@ function useBuySupportedSources(options) {
|
|
47
69
|
return (0, react_query_1.useQuery)({
|
48
70
|
queryKey: ["source-tokens", options],
|
49
71
|
queryFn: async () => {
|
50
|
-
const
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
72
|
+
const routes = await Bridge.routes({
|
73
|
+
client: options.client,
|
74
|
+
destinationChainId: options.destinationChainId,
|
75
|
+
destinationTokenAddress: options.destinationTokenAddress,
|
76
|
+
maxSteps: 1,
|
77
|
+
sortBy: "popularity",
|
78
|
+
limit: 50,
|
79
|
+
});
|
80
|
+
const tokens = new Set();
|
81
|
+
const chains = new Set();
|
82
|
+
const originTokens = [];
|
83
|
+
for (const route of routes) {
|
84
|
+
const key = `${route.originToken.chainId}:${route.originToken.address}`;
|
85
|
+
if (!tokens.has(key)) {
|
86
|
+
tokens.add(key);
|
87
|
+
if (!chains.has(route.originToken.chainId)) {
|
88
|
+
chains.add(route.originToken.chainId);
|
89
|
+
}
|
90
|
+
const existing = originTokens[route.originToken.chainId];
|
91
|
+
if (!existing) {
|
92
|
+
originTokens[route.originToken.chainId] = [];
|
93
|
+
}
|
94
|
+
originTokens[route.originToken.chainId] = [
|
95
|
+
...(existing || []),
|
96
|
+
{
|
97
|
+
address: ox_1.Address.checksum(route.originToken.address),
|
98
|
+
// We support both options for all tokens
|
99
|
+
buyWithCryptoEnabled: true,
|
100
|
+
buyWithFiatEnabled: true,
|
101
|
+
name: route.originToken.name,
|
102
|
+
symbol: route.originToken.symbol,
|
103
|
+
icon: route.originToken.iconUri,
|
104
|
+
},
|
105
|
+
];
|
106
|
+
}
|
107
|
+
}
|
108
|
+
return [...chains].map((chainId) => ({
|
109
|
+
chain: (0, utils_js_1.getCachedChain)(chainId),
|
110
|
+
tokens: originTokens[chainId] || [],
|
62
111
|
}));
|
63
112
|
},
|
64
113
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSwapSupportedChains.js","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"useSwapSupportedChains.js","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts"],"names":[],"mappings":";;AAgGA,kEAUC;AAED,wDAgEC;AA5KD,uDAAiD;AACjD,2BAA4C;AAC5C,+DAA+D;AAE/D,mEAAsE;AAGtE,kFAA4E;AAc5E,KAAK,UAAU,6BAA6B,CAAC,EAC3C,MAAM,EACN,aAAa,EACb,kBAAkB,GAKnB;IACC,OAAO,IAAA,wBAAS,EACd,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACjC,MAAM;YACN,aAAa;YACb,kBAAkB;YAClB,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QACjC,MAAM,iBAAiB,GAUnB,EAAE,CAAC;QACP,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,IAAI,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAClF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;oBAChD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAC7C,CAAC;gBACD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBACnE,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,i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ACxC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;wBACnB;4BACE,OAAO,EAAE,YAAW,CAAC,QAAQ,CAC3B,KAAK,CAAC,WAAW,CAAC,OAAO,CACf;4BACZ,yCAAyC;4BACzC,oBAAoB,EAAE,IAAI;4BAC1B,kBAAkB,EAAE,IAAI;4BACxB,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI;4BAC5B,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM;4BAChC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO;yBAChC;qBACF,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACnC,KAAK,EAAE,IAAA,yBAAc,EAAC,OAAO,CAAC;gBAC9B,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;aACpC,CAAC,CAAC,CAAC;QACN,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -44,9 +44,9 @@ function ExecutingTxScreen(props) {
|
|
44
44
|
done.current = true;
|
45
45
|
sendTx();
|
46
46
|
}, [sendTx]);
|
47
|
-
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { p: "lg", children: [(0, jsx_runtime_1.jsx)(basic_js_1.ModalHeader, { title: "Transaction", onBack: props.onBack }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxl" }), (0, jsx_runtime_1.
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { p: "lg", children: [(0, jsx_runtime_1.jsx)(basic_js_1.ModalHeader, { title: "Transaction", onBack: props.onBack }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxl" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", center: "x", children: [status === "loading" && (0, jsx_runtime_1.jsx)(Spinner_js_1.Spinner, { size: "xxl", color: "accentText" }), status === "failed" && (0, jsx_runtime_1.jsx)(AccentFailIcon_js_1.AccentFailIcon, { size: index_js_1.iconSize["3xl"] }), status === "sent" && ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { color: "success", flex: "row", center: "both", children: (0, jsx_runtime_1.jsx)(react_icons_1.CheckCircledIcon, { width: index_js_1.iconSize["3xl"], height: index_js_1.iconSize["3xl"] }) }))] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsxs)(text_js_1.Text, { color: "primaryText", center: true, size: "lg", children: [status === "loading" && "Sending transaction", status === "failed" && "Transaction failed", status === "sent" && "Transaction sent"] }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { color: "danger", center: true, size: "sm", children: status === "failed" && sendTxCore.error
|
48
48
|
? sendTxCore.error.message
|
49
|
-
: "" }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxl" }),
|
49
|
+
: "" }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xxl" }), status === "failed" && ((0, jsx_runtime_1.jsx)(buttons_js_1.Button, { variant: "accent", fullWidth: true, onClick: sendTx, children: "Try Again" })), status === "sent" && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(buttons_js_1.Button, { variant: "accent", fullWidth: true, onClick: props.closeModal, children: "Done" }), txHash && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsxs)(buttons_js_1.ButtonLink, { fullWidth: true, variant: "outline", href: (0, url_js_1.formatExplorerTxUrl)(chainExplorers.explorers[0]?.url ?? "", txHash), target: "_blank", as: "a", gap: "xs", style: {
|
50
50
|
textDecoration: "none",
|
51
51
|
color: "inherit",
|
52
52
|
}, children: ["View on Explorer", (0, jsx_runtime_1.jsx)(react_icons_1.ExternalLinkIcon, { width: index_js_1.iconSize.sm, height: index_js_1.iconSize.sm })] })] }))] }))] }));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExecutingScreen.js","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/ExecutingScreen.tsx"],"names":[],"mappings":";;AAgBA,
|
1
|
+
{"version":3,"file":"ExecutingScreen.js","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/ExecutingScreen.tsx"],"names":[],"mappings":";;AAgBA,8CAgHC;;AAhID,uDAA2E;AAC3E,iCAAiE;AAIjE,qDAA+D;AAC/D,mEAAgE;AAChE,kFAAgF;AAChF,yFAAmF;AACnF,gFAA0E;AAC1E,uDAAiD;AACjD,yDAAmD;AACnD,qDAAgE;AAChE,yDAA8D;AAC9D,mDAA6C;AAE7C,SAAgB,iBAAiB,CAAC,KAKjC;IACC,MAAM,UAAU,GAAG,IAAA,0CAAkB,EAAC;QACpC,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,GAAmB,CAAC;IACxD,MAAM,cAAc,GAAG,IAAA,oCAAiB,EAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAClC,SAAS,CACV,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QACpC,SAAS,CAAC,SAAS,CAAC,CAAC;QACrB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACtD,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YAClC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACvB,SAAS,CAAC,MAAM,CAAC,CA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;iCACjB,iCAGD,uBAAC,8BAAgB,IAAC,KAAK,EAAE,mBAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,mBAAQ,CAAC,EAAE,GAAI,IAClD,IACZ,CACJ,IACA,CACJ,IACS,CACb,CAAC;AACJ,CAAC"}
|
@@ -4,6 +4,7 @@ exports.twProxyBytecode = exports.twProxyAbi = exports.singletonFactoryBytecode
|
|
4
4
|
exports.ZKSYNC_SINGLETON_FACTORY = "0xa51baf6a9c0ef5Db8C1898d5aDD92Bf3227d6088";
|
5
5
|
exports.CONTRACT_DEPLOYER_ADDRESS = "0x0000000000000000000000000000000000008006";
|
6
6
|
exports.KNOWN_CODES_STORAGE = "0x0000000000000000000000000000000000008004";
|
7
|
+
// biome-ignore lint/nursery/noProcessEnv: Used for testing
|
7
8
|
exports.PUBLISHED_PRIVATE_KEY = process.env.ZKSYNC_PUBLISHED_PRIVATE_KEY;
|
8
9
|
exports.singletonFactoryAbi = [
|
9
10
|
"function deploy(bytes32,bytes32,bytes) external payable",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/utils/any-evm/zksync/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GACnC,4CAAqD,CAAC;AAC3C,QAAA,yBAAyB,GACpC,4CAAqD,CAAC;AAC3C,QAAA,mBAAmB,GAAG,4CAA4C,CAAC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/utils/any-evm/zksync/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GACnC,4CAAqD,CAAC;AAC3C,QAAA,yBAAyB,GACpC,4CAAqD,CAAC;AAC3C,QAAA,mBAAmB,GAAG,4CAA4C,CAAC;AAChF,2DAA2D;AAC9C,QAAA,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;AAEjE,QAAA,mBAAmB,GAAG;IACjC,yDAAyD;CACjD,CAAC;AAEE,QAAA,wBAAwB,GACnC,o0LAA60L,CAAC;AAEn0L,QAAA,UAAU,GAAG;IACxB;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;aACd;SACF;QACD,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,aAAa;KACpB;IACD;QACE,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,SAAS;KAChB;CACO,CAAC;AAEE,QAAA,eAAe,GAC1B,osSAA6sS,CAAC"}
|
@@ -10,6 +10,7 @@ const DEFAULT_BUNDLER_URL = "bundler.thirdweb.com";
|
|
10
10
|
const DEFAULT_ANALYTICS_URL = "c.thirdweb.com";
|
11
11
|
const DEFAULT_INSIGHT_URL = "insight.thirdweb.com";
|
12
12
|
const DEFAULT_ENGINE_CLOUD_URL = "engine.thirdweb.com";
|
13
|
+
const DEFAULT_BRIDGE_URL = "bridge.thirdweb.com";
|
13
14
|
let domains = {
|
14
15
|
rpc: exports.DEFAULT_RPC_URL,
|
15
16
|
inAppWallet: DEFAULT_IN_APP_WALLET_URL,
|
@@ -20,6 +21,7 @@ let domains = {
|
|
20
21
|
analytics: DEFAULT_ANALYTICS_URL,
|
21
22
|
insight: DEFAULT_INSIGHT_URL,
|
22
23
|
engineCloud: DEFAULT_ENGINE_CLOUD_URL,
|
24
|
+
bridge: DEFAULT_BRIDGE_URL,
|
23
25
|
};
|
24
26
|
const setThirdwebDomains = (DomainOverrides) => {
|
25
27
|
domains = {
|
@@ -32,6 +34,7 @@ const setThirdwebDomains = (DomainOverrides) => {
|
|
32
34
|
analytics: DomainOverrides.analytics ?? DEFAULT_ANALYTICS_URL,
|
33
35
|
insight: DomainOverrides.insight ?? DEFAULT_INSIGHT_URL,
|
34
36
|
engineCloud: DomainOverrides.engineCloud ?? DEFAULT_ENGINE_CLOUD_URL,
|
37
|
+
bridge: DomainOverrides.bridge ?? DEFAULT_BRIDGE_URL,
|
35
38
|
};
|
36
39
|
};
|
37
40
|
exports.setThirdwebDomains = setThirdwebDomains;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":";;;AAqDa,QAAA,eAAe,GAAG,kBAAkB,CAAC;AAClD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AACjD,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AACjE,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAC/C,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AACnD,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AACvD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEjD,IAAI,OAAO,GAA+C;IACxD,GAAG,EAAE,uBAAe;IACpB,WAAW,EAAE,yBAAyB;IACtC,MAAM,EAAE,kBAAkB;IAC1B,GAAG,EAAE,eAAe;IACpB,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mBAAmB;IAC5B,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,mBAAmB;IAC5B,WAAW,EAAE,wBAAwB;IACrC,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEK,MAAM,kBAAkB,GAAG,CAAC,eAAgC,EAAE,EAAE;IACrE,OAAO,GAAG;QACR,GAAG,EAAE,eAAe,CAAC,GAAG,IAAI,uBAAe;QAC3C,WAAW,EAAE,eAAe,CAAC,WAAW,IAAI,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@
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,yEAAyE,CAAC"}
|
package/dist/esm/bridge/Buy.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineChain } from "../chains/utils.js";
|
2
|
+
import { getThirdwebBaseUrl } from "../utils/domains.js";
|
2
3
|
import { getClientFetch } from "../utils/fetch.js";
|
3
4
|
import { stringify } from "../utils/json.js";
|
4
|
-
import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
5
5
|
/**
|
6
6
|
* Retrieves a Universal Bridge quote for the provided buy intent. The quote will specify the necessary `originAmount` to receive the desired `destinationAmount`, which is specified with the `buyAmountWei` option.
|
7
7
|
*
|
@@ -100,12 +100,13 @@ export async function quote(options) {
|
|
100
100
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, client, maxSteps, } = options;
|
101
101
|
const amount = "buyAmountWei" in options ? options.buyAmountWei : options.amount;
|
102
102
|
const clientFetch = getClientFetch(client);
|
103
|
-
const url = new URL(`${
|
103
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/buy/quote`);
|
104
104
|
url.searchParams.set("originChainId", originChainId.toString());
|
105
105
|
url.searchParams.set("originTokenAddress", originTokenAddress);
|
106
106
|
url.searchParams.set("destinationChainId", destinationChainId.toString());
|
107
107
|
url.searchParams.set("destinationTokenAddress", destinationTokenAddress);
|
108
108
|
url.searchParams.set("buyAmountWei", amount.toString());
|
109
|
+
url.searchParams.set("amount", amount.toString());
|
109
110
|
if (maxSteps) {
|
110
111
|
url.searchParams.set("maxSteps", maxSteps.toString());
|
111
112
|
}
|
@@ -152,7 +153,7 @@ export async function quote(options) {
|
|
152
153
|
* This will return a quote that might look like:
|
153
154
|
* ```typescript
|
154
155
|
* {
|
155
|
-
* originAmount:
|
156
|
+
* originAmount: 2000030000n,
|
156
157
|
* destinationAmount: 1000000000000000000n,
|
157
158
|
* blockNumber: 22026509n,
|
158
159
|
* timestamp: 1741730936680,
|
@@ -161,11 +162,11 @@ export async function quote(options) {
|
|
161
162
|
* {
|
162
163
|
* originToken: {
|
163
164
|
* chainId: 1,
|
164
|
-
* address: "
|
165
|
-
* symbol: "
|
166
|
-
* name: "
|
167
|
-
* decimals:
|
168
|
-
* priceUsd:
|
165
|
+
* address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
166
|
+
* symbol: "USDC",
|
167
|
+
* name: "USDC",
|
168
|
+
* decimals: 6,
|
169
|
+
* priceUsd: 1,
|
169
170
|
* iconUri: "https://..."
|
170
171
|
* },
|
171
172
|
* destinationToken: {
|
@@ -177,7 +178,7 @@ export async function quote(options) {
|
|
177
178
|
* priceUsd: 2000,
|
178
179
|
* iconUri: "https://..."
|
179
180
|
* },
|
180
|
-
* originAmount:
|
181
|
+
* originAmount: 2000030000n,
|
181
182
|
* destinationAmount: 1000000000000000000n,
|
182
183
|
* estimatedExecutionTimeMs: 1000
|
183
184
|
* transactions: [
|
@@ -203,7 +204,7 @@ export async function quote(options) {
|
|
203
204
|
* expiration: 1741730936680,
|
204
205
|
* intent: {
|
205
206
|
* originChainId: 1,
|
206
|
-
* originTokenAddress: "
|
207
|
+
* originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
207
208
|
* destinationChainId: 10,
|
208
209
|
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
209
210
|
* amount: 1000000000000000000n
|
@@ -273,14 +274,15 @@ export async function quote(options) {
|
|
273
274
|
export async function prepare(options) {
|
274
275
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, sender, receiver, client, amount, purchaseData, maxSteps, } = options;
|
275
276
|
const clientFetch = getClientFetch(client);
|
276
|
-
const url = new URL(`${
|
277
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/buy/prepare`);
|
277
278
|
const response = await clientFetch(url.toString(), {
|
278
279
|
method: "POST",
|
279
280
|
headers: {
|
280
281
|
"Content-Type": "application/json",
|
281
282
|
},
|
282
283
|
body: stringify({
|
283
|
-
buyAmountWei: amount.toString(),
|
284
|
+
buyAmountWei: amount.toString(), // legacy
|
285
|
+
amount: amount.toString(),
|
284
286
|
originChainId: originChainId.toString(),
|
285
287
|
originTokenAddress,
|
286
288
|
destinationChainId: destinationChainId.toString(),
|
@@ -317,6 +319,8 @@ export async function prepare(options) {
|
|
317
319
|
destinationChainId,
|
318
320
|
destinationTokenAddress,
|
319
321
|
amount,
|
322
|
+
sender,
|
323
|
+
receiver,
|
320
324
|
},
|
321
325
|
};
|
322
326
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Buy.js","sourceRoot":"","sources":["../../../src/bridge/Buy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"Buy.js","sourceRoot":"","sources":["../../../src/bridge/Buy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAsB;IAChD,MAAM,EACJ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,MAAM,EACN,QAAQ,GACT,GA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K,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;gBAChE,MAAM;gBACN,KAAK,EAAE,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC;aACxC,CAAC,CAAC;SACJ,CAAC,CAAC;QACH,MAAM,EAAE;YACN,aAAa;YACb,kBAAkB;YAClB,kBAAkB;YAClB,uBAAuB;YACvB,MAAM;YACN,MAAM;YACN,QAAQ;SACT;KACF,CAAC;AACJ,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { getThirdwebBaseUrl } from "../utils/domains.js";
|
1
2
|
import { getClientFetch } from "../utils/fetch.js";
|
2
|
-
import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
3
3
|
/**
|
4
4
|
* Retrieves supported Universal Bridge chains.
|
5
5
|
*
|
@@ -50,7 +50,7 @@ import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
|
50
50
|
export async function chains(options) {
|
51
51
|
const { client } = options;
|
52
52
|
const clientFetch = getClientFetch(client);
|
53
|
-
const url = new URL(`${
|
53
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/chains`);
|
54
54
|
const response = await clientFetch(url.toString());
|
55
55
|
if (!response.ok) {
|
56
56
|
const errorJson = await response.json();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chains.js","sourceRoot":"","sources":["../../../src/bridge/Chains.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"Chains.js","sourceRoot":"","sources":["../../../src/bridge/Chains.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAuB;IAClD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEjE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAsB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { getThirdwebBaseUrl } from "../utils/domains.js";
|
1
2
|
import { getClientFetch } from "../utils/fetch.js";
|
2
|
-
import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
3
3
|
/**
|
4
4
|
* Retrieves supported Universal Bridge routes based on the provided filters.
|
5
5
|
*
|
@@ -118,7 +118,7 @@ import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
|
118
118
|
export async function routes(options) {
|
119
119
|
const { client, originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, maxSteps, sortBy, limit, offset, } = options;
|
120
120
|
const clientFetch = getClientFetch(client);
|
121
|
-
const url = new URL(`${
|
121
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/routes`);
|
122
122
|
if (originChainId) {
|
123
123
|
url.searchParams.set("originChainId", originChainId.toString());
|
124
124
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Routes.js","sourceRoot":"","sources":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C;IAC3E,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAsB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/esm/bridge/Sell.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineChain } from "../chains/utils.js";
|
2
|
+
import { getThirdwebBaseUrl } from "../utils/domains.js";
|
2
3
|
import { getClientFetch } from "../utils/fetch.js";
|
3
4
|
import { stringify } from "../utils/json.js";
|
4
|
-
import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
5
5
|
/**
|
6
6
|
* Retrieves a Universal Bridge quote for the provided sell intent. The quote will specify the expected `destinationAmount` that will be received in exchange for the specified `originAmount`, which is specified with the `sellAmountWei` option.
|
7
7
|
*
|
@@ -99,12 +99,13 @@ import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
|
99
99
|
export async function quote(options) {
|
100
100
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, amount, client, maxSteps, } = options;
|
101
101
|
const clientFetch = getClientFetch(client);
|
102
|
-
const url = new URL(`${
|
102
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/sell/quote`);
|
103
103
|
url.searchParams.set("originChainId", originChainId.toString());
|
104
104
|
url.searchParams.set("originTokenAddress", originTokenAddress);
|
105
105
|
url.searchParams.set("destinationChainId", destinationChainId.toString());
|
106
106
|
url.searchParams.set("destinationTokenAddress", destinationTokenAddress);
|
107
107
|
url.searchParams.set("sellAmountWei", amount.toString());
|
108
|
+
url.searchParams.set("amount", amount.toString());
|
108
109
|
if (typeof maxSteps !== "undefined") {
|
109
110
|
url.searchParams.set("maxSteps", maxSteps.toString());
|
110
111
|
}
|
@@ -150,7 +151,7 @@ export async function quote(options) {
|
|
150
151
|
* This will return a quote that might look like:
|
151
152
|
* ```typescript
|
152
153
|
* {
|
153
|
-
* originAmount:
|
154
|
+
* originAmount: 2000000000n,
|
154
155
|
* destinationAmount: 9980000000000000000n,
|
155
156
|
* blockNumber: 22026509n,
|
156
157
|
* timestamp: 1741730936680,
|
@@ -159,11 +160,11 @@ export async function quote(options) {
|
|
159
160
|
* {
|
160
161
|
* originToken: {
|
161
162
|
* chainId: 1,
|
162
|
-
* address: "
|
163
|
-
* symbol: "
|
164
|
-
* name: "
|
165
|
-
* decimals:
|
166
|
-
* priceUsd:
|
163
|
+
* address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
164
|
+
* symbol: "USDC",
|
165
|
+
* name: "USDC",
|
166
|
+
* decimals: 6,
|
167
|
+
* priceUsd: 1,
|
167
168
|
* iconUri: "https://..."
|
168
169
|
* },
|
169
170
|
* destinationToken: {
|
@@ -175,7 +176,7 @@ export async function quote(options) {
|
|
175
176
|
* priceUsd: 2000,
|
176
177
|
* iconUri: "https://..."
|
177
178
|
* },
|
178
|
-
* originAmount:
|
179
|
+
* originAmount: 2000000000n,
|
179
180
|
* destinationAmount: 9980000000000000000n,
|
180
181
|
* estimatedExecutionTimeMs: 1000
|
181
182
|
* }
|
@@ -201,10 +202,10 @@ export async function quote(options) {
|
|
201
202
|
* expiration: 1741730936680,
|
202
203
|
* intent: {
|
203
204
|
* originChainId: 1,
|
204
|
-
* originTokenAddress:
|
205
|
+
* originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
205
206
|
* destinationChainId: 10,
|
206
|
-
* destinationTokenAddress:
|
207
|
-
* amount:
|
207
|
+
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
208
|
+
* amount: 2000000000n
|
208
209
|
* }
|
209
210
|
* }
|
210
211
|
* ```
|
@@ -271,7 +272,7 @@ export async function quote(options) {
|
|
271
272
|
export async function prepare(options) {
|
272
273
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, amount, sender, receiver, client, purchaseData, maxSteps, } = options;
|
273
274
|
const clientFetch = getClientFetch(client);
|
274
|
-
const url = new URL(`${
|
275
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/sell/prepare`);
|
275
276
|
const response = await clientFetch(url.toString(), {
|
276
277
|
method: "POST",
|
277
278
|
headers: {
|
@@ -279,6 +280,7 @@ export async function prepare(options) {
|
|
279
280
|
},
|
280
281
|
body: stringify({
|
281
282
|
sellAmountWei: amount.toString(),
|
283
|
+
amount: amount.toString(),
|
282
284
|
originChainId: originChainId.toString(),
|
283
285
|
originTokenAddress,
|
284
286
|
destinationChainId: destinationChainId.toString(),
|
@@ -316,6 +318,8 @@ export async function prepare(options) {
|
|
316
318
|
destinationChainId,
|
317
319
|
destinationTokenAddress,
|
318
320
|
amount,
|
321
|
+
sender,
|
322
|
+
receiver,
|
319
323
|
purchaseData,
|
320
324
|
},
|
321
325
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Sell.js","sourceRoot":"","sources":["../../../src/bridge/Sell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"Sell.js","sourceRoot":"","sources":["../../../src/bridge/Sell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAsB;IAChD,MAAM,EACJ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,MAAM,EACN,MAAM,EACN,QAAQ,GACT,GAAG,OAAO,CAAC;IAEZ,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,kBAAkB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACrE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;IAC/D,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,QAAQ,EAAE,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