0xtrails 0.2.5 → 0.2.6
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/abortController.d.ts +8 -0
- package/dist/abortController.d.ts.map +1 -0
- package/dist/{ccip-CXlshvBY.js → ccip-Xjh9d1gb.js} +7 -7
- package/dist/constants.d.ts +2 -0
- package/dist/constants.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-BnhdZ8Ho.js} +34769 -34247
- package/dist/index.js +726 -520
- package/dist/prepareSend.d.ts +11 -77
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/transactions.d.ts +4 -2
- 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 -2
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.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/Earn.d.ts +2 -2
- 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/Fund.d.ts +2 -2
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundSwap.d.ts +2 -2
- 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 -2
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +3 -2
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts +3 -2
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts +1 -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 -2
- 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/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 +1 -1
- package/dist/widget/hooks/useQuote.d.ts +83 -0
- package/dist/widget/hooks/useQuote.d.ts.map +1 -0
- package/dist/widget/hooks/useSendForm.d.ts +2 -2
- package/dist/widget/hooks/useSendForm.d.ts.map +1 -1
- package/dist/widget/index.js +2 -2
- package/dist/widget/widget.d.ts +5 -0
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/abortController.ts +35 -0
- package/src/constants.ts +3 -0
- package/src/fees.ts +199 -0
- package/src/prepareSend.ts +225 -398
- package/src/trails.ts +3 -3
- package/src/transactions.ts +62 -18
- package/src/widget/compiled.css +1 -1
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +22 -0
- package/src/widget/components/AccountSettings.tsx +48 -36
- package/src/widget/components/ChainFilterDropdown.tsx +24 -3
- package/src/widget/components/ClassicSwap.tsx +24 -62
- package/src/widget/components/ConnectWallet.tsx +4 -1
- package/src/widget/components/ConnectedWallets.tsx +21 -21
- package/src/widget/components/DynamicInputStyles.tsx +76 -0
- package/src/widget/components/Earn.tsx +34 -29
- package/src/widget/components/ErrorAnimationIcon.tsx +130 -0
- package/src/widget/components/FeeBreakdown.tsx +155 -0
- package/src/widget/components/Fund.tsx +10 -26
- package/src/widget/components/FundSwap.tsx +2 -2
- 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 +65 -63
- package/src/widget/components/PoolDeposit.tsx +206 -230
- package/src/widget/components/PoolWithdraw.tsx +219 -238
- package/src/widget/components/PriceImpactWarning.tsx +1 -1
- package/src/widget/components/QuoteDetails.tsx +25 -8
- 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 -2
- 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 +1 -1
- package/src/widget/components/WaasFeeOptions.tsx +124 -5
- package/src/widget/components/WalletConfirmation.tsx +23 -13
- package/src/widget/components/WalletConnect.tsx +93 -29
- package/src/widget/hooks/useQuote.ts +413 -0
- package/src/widget/hooks/useSendForm.ts +8 -4
- package/src/widget/widget.tsx +175 -190
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const abortControllerRegistry: {
|
|
2
|
+
register: (id: string, controller: AbortController) => void;
|
|
3
|
+
unregister: (id: string) => void;
|
|
4
|
+
abort: (id: string) => void;
|
|
5
|
+
abortAll: () => void;
|
|
6
|
+
getAll: () => string[];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=abortController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abortController.d.ts","sourceRoot":"","sources":["../src/abortController.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB;mBACnB,MAAM,cAAc,eAAe;qBAIjC,MAAM;gBAIX,MAAM;;;CAmBnB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aj as b, ak as x, al as F, am as S, an as $, ao as O, ap as E, aq as D, ar as w, as as G, at as R, au as C, av as I, aw as y, ax as L, ay as M, az as m, aA as T, aB as v, aC as H, aD as j, aE as B, aF as A, aG as U } from "./index-BnhdZ8Ho.js";
|
|
2
2
|
function _(a) {
|
|
3
|
-
const { abi: r, data: e } = a, s = b(e, 0, 4), t = r.find((n) => n.type === "function" && s === x(
|
|
3
|
+
const { abi: r, data: e } = a, s = b(e, 0, 4), t = r.find((n) => n.type === "function" && s === x(F(n)));
|
|
4
4
|
if (!t)
|
|
5
5
|
throw new S(s, {
|
|
6
6
|
docsPath: "/docs/contract/decodeFunctionData"
|
|
@@ -15,28 +15,28 @@ function k(a) {
|
|
|
15
15
|
const { abi: r, errorName: e, args: s } = a;
|
|
16
16
|
let t = r[0];
|
|
17
17
|
if (e) {
|
|
18
|
-
const d =
|
|
18
|
+
const d = O({ abi: r, args: s, name: e });
|
|
19
19
|
if (!d)
|
|
20
20
|
throw new E(e, { docsPath: p });
|
|
21
21
|
t = d;
|
|
22
22
|
}
|
|
23
23
|
if (t.type !== "error")
|
|
24
24
|
throw new E(void 0, { docsPath: p });
|
|
25
|
-
const n =
|
|
25
|
+
const n = F(t), o = x(n);
|
|
26
26
|
let c = "0x";
|
|
27
27
|
if (s && s.length > 0) {
|
|
28
28
|
if (!t.inputs)
|
|
29
29
|
throw new D(t.name, { docsPath: p });
|
|
30
30
|
c = w(t.inputs, s);
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return G([o, c]);
|
|
33
33
|
}
|
|
34
34
|
const h = "/docs/contract/encodeFunctionResult";
|
|
35
35
|
function z(a) {
|
|
36
36
|
const { abi: r, functionName: e, result: s } = a;
|
|
37
37
|
let t = r[0];
|
|
38
38
|
if (e) {
|
|
39
|
-
const o =
|
|
39
|
+
const o = O({ abi: r, name: e });
|
|
40
40
|
if (!o)
|
|
41
41
|
throw new R(e, { docsPath: h });
|
|
42
42
|
t = o;
|
|
@@ -44,7 +44,7 @@ function z(a) {
|
|
|
44
44
|
if (t.type !== "function")
|
|
45
45
|
throw new R(void 0, { docsPath: h });
|
|
46
46
|
if (!t.outputs)
|
|
47
|
-
throw new
|
|
47
|
+
throw new C(t.name, { docsPath: h });
|
|
48
48
|
const n = (() => {
|
|
49
49
|
if (t.outputs.length === 0)
|
|
50
50
|
return [];
|
package/dist/constants.d.ts
CHANGED
|
@@ -23,4 +23,6 @@ export declare const DATABEAT_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcH
|
|
|
23
23
|
export declare const DEFAULT_WALLETCONNECT_PROJECT_ID = "10c5ac56159da00924d110c07c3f6e3a";
|
|
24
24
|
export declare const SITE_URL = "https://trails.build/";
|
|
25
25
|
export declare const DEFAULT_SLIPPAGE_TOLERANCE = "0.05";
|
|
26
|
+
export declare const DEFAULT_MODE = "pay";
|
|
27
|
+
export declare const DEFAULT_THEME = "light";
|
|
26
28
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAEjC,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,OAMxD,CAAA;AAED,eAAO,MAAM,wCAAwC,EAAE,gBAKlC,CAAA;AAErB,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,OACE,CAAA;AAE9C,eAAO,MAAM,gCAAgC,EAAE,OAAO,CAAC,OACT,CAAA;AAE9C,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC,OACF,CAAA;AAE9C,eAAO,MAAM,oBAAoB,SAAS,CAAA;AAE1C,eAAO,MAAM,8BAA8B,+BAA+B,CAAA;AAC1E,eAAO,MAAM,yBAAyB,iCAAiC,CAAA;AACvE,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAC/D,eAAO,MAAM,mBAAmB,oCAAoC,CAAA;AACpE,eAAO,MAAM,6BAA6B,mCAAmC,CAAA;AAC7E,eAAO,MAAM,wBAAwB,qCAAqC,CAAA;AAC1E,eAAO,MAAM,oBAAoB,iCAAiC,CAAA;AAClE,eAAO,MAAM,kBAAkB,4CAA4C,CAAA;AAE3E,eAAO,MAAM,oBAAoB,0BAA0B,CAAA;AAG3D,eAAO,MAAM,gCAAgC,wCACN,CAAA;AACvC,eAAO,MAAM,+BAA+B,wCACL,CAAA;AAEvC,eAAO,MAAM,eAAe,kCAAkC,CAAA;AAC9D,eAAO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M,YAAY,wIAC8G,CAAA;AAEvI,eAAO,MAAM,gCAAgC,qCACT,CAAA;AAEpC,eAAO,MAAM,QAAQ,0BAA0B,CAAA;AAE/C,eAAO,MAAM,0BAA0B,SAAS,CAAA;AAEhD,eAAO,MAAM,YAAY,QAAQ,CAAA;AACjC,eAAO,MAAM,aAAa,UAAU,CAAA"}
|
package/dist/fees.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GetIntentCallsPayloadsReturn } from './intents.js';
|
|
2
|
+
export interface FeeItem {
|
|
3
|
+
amount: string;
|
|
4
|
+
tokenSymbol: string;
|
|
5
|
+
tokenAddress: string;
|
|
6
|
+
chainId: number;
|
|
7
|
+
usdValue: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TrailsFeeBreakdown {
|
|
10
|
+
originRelayFee?: FeeItem;
|
|
11
|
+
destinationRelayFee?: FeeItem;
|
|
12
|
+
providerFee?: FeeItem;
|
|
13
|
+
trailsFee?: FeeItem;
|
|
14
|
+
totalUsdValue?: string;
|
|
15
|
+
originChainId?: number;
|
|
16
|
+
destinationChainId?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function extractTrailsFeeBreakdown(intent: GetIntentCallsPayloadsReturn): Promise<TrailsFeeBreakdown | null>;
|
|
19
|
+
//# sourceMappingURL=fees.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../src/fees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAKhE,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AA+BD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAgJpC"}
|