@rash2x/bridge-widget 0.5.9 → 0.6.1
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/evaa-bridge.cjs +2 -1
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +43 -42
- package/dist/{index-BXdYB1Ge.js → index-BZISqglL.js} +212 -44
- package/dist/index-BZISqglL.js.map +1 -0
- package/dist/{index-Ciui5BKt.js → index-B_5fHaUO.js} +2 -2
- package/dist/{index-Ciui5BKt.js.map → index-B_5fHaUO.js.map} +1 -1
- package/dist/{index-CphEQoZi.cjs → index-DJobWPVa.cjs} +171 -3
- package/dist/index-DJobWPVa.cjs.map +1 -0
- package/dist/{index-Bdh_cEEE.cjs → index-Gy63MKy2.cjs} +2 -2
- package/dist/{index-Bdh_cEEE.cjs.map → index-Gy63MKy2.cjs.map} +1 -1
- package/dist/index.d.ts +102 -0
- package/package.json +1 -1
- package/dist/index-BXdYB1Ge.js.map +0 -1
- package/dist/index-CphEQoZi.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,81 @@ export declare type BalancesMap = Record<string, {
|
|
|
37
37
|
address: string;
|
|
38
38
|
}>;
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Bridge data interface exposing all relevant transaction information
|
|
42
|
+
* for external consumption
|
|
43
|
+
*/
|
|
44
|
+
export declare interface BridgeData {
|
|
45
|
+
token: {
|
|
46
|
+
symbol: string;
|
|
47
|
+
address: string;
|
|
48
|
+
decimals: number;
|
|
49
|
+
name: string;
|
|
50
|
+
iconUrl: string;
|
|
51
|
+
} | null;
|
|
52
|
+
sourceNetwork: {
|
|
53
|
+
chainKey: string;
|
|
54
|
+
name: string;
|
|
55
|
+
chainId: number;
|
|
56
|
+
chainType: string;
|
|
57
|
+
iconUrl: string;
|
|
58
|
+
} | null;
|
|
59
|
+
destinationNetwork: {
|
|
60
|
+
chainKey: string;
|
|
61
|
+
name: string;
|
|
62
|
+
chainId: number;
|
|
63
|
+
chainType: string;
|
|
64
|
+
iconUrl: string;
|
|
65
|
+
} | null;
|
|
66
|
+
gateway: {
|
|
67
|
+
route: string;
|
|
68
|
+
routeType: RouteType;
|
|
69
|
+
} | null;
|
|
70
|
+
amounts: {
|
|
71
|
+
input: string;
|
|
72
|
+
inputHuman: number;
|
|
73
|
+
output: string;
|
|
74
|
+
outputHuman: number;
|
|
75
|
+
outputRounded: string;
|
|
76
|
+
minimumReceived: number;
|
|
77
|
+
} | null;
|
|
78
|
+
fees: {
|
|
79
|
+
source: {
|
|
80
|
+
amount: number;
|
|
81
|
+
symbol: string;
|
|
82
|
+
usd: number;
|
|
83
|
+
} | null;
|
|
84
|
+
destination: {
|
|
85
|
+
amount: number;
|
|
86
|
+
symbol: string;
|
|
87
|
+
usd: number;
|
|
88
|
+
} | null;
|
|
89
|
+
protocol: {
|
|
90
|
+
usd: number;
|
|
91
|
+
} | null;
|
|
92
|
+
message: {
|
|
93
|
+
usd: number;
|
|
94
|
+
} | null;
|
|
95
|
+
service: {
|
|
96
|
+
usd: number;
|
|
97
|
+
} | null;
|
|
98
|
+
blockchain: {
|
|
99
|
+
usd: number;
|
|
100
|
+
} | null;
|
|
101
|
+
total: {
|
|
102
|
+
usd: number;
|
|
103
|
+
};
|
|
104
|
+
} | null;
|
|
105
|
+
estimatedTime: {
|
|
106
|
+
seconds: number;
|
|
107
|
+
formatted: string;
|
|
108
|
+
} | null;
|
|
109
|
+
status: "idle" | "loading" | "success" | "error";
|
|
110
|
+
isReady: boolean;
|
|
111
|
+
error?: string;
|
|
112
|
+
noRoute: boolean;
|
|
113
|
+
}
|
|
114
|
+
|
|
40
115
|
declare interface BridgeQuoteActions {
|
|
41
116
|
setInputAmount: (v: string) => void;
|
|
42
117
|
setLoading: () => void;
|
|
@@ -226,6 +301,7 @@ export declare interface EvaaBridgeProps {
|
|
|
226
301
|
onSwapError?: (error: SwapErrorData) => void;
|
|
227
302
|
onAmountChange?: (amount: string) => void;
|
|
228
303
|
onChainChange?: (data: ChainChangeData) => void;
|
|
304
|
+
onBridgeDataUpdate?: (data: BridgeData) => void;
|
|
229
305
|
}
|
|
230
306
|
|
|
231
307
|
declare interface EvmMonitorReceipt {
|
|
@@ -653,6 +729,32 @@ export declare type TxStatus = "success" | "failed" | "timeout";
|
|
|
653
729
|
|
|
654
730
|
declare type TxStatus_2 = "idle" | "pending" | "executing" | "processing" | "completed" | "failed" | "expired";
|
|
655
731
|
|
|
732
|
+
/**
|
|
733
|
+
* Hook to access all bridge transaction data
|
|
734
|
+
*
|
|
735
|
+
* This hook provides a unified interface to access all relevant bridge data
|
|
736
|
+
* including tokens, networks, fees, amounts, and routing information.
|
|
737
|
+
*
|
|
738
|
+
* @returns BridgeData object with all bridge information
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
* ```tsx
|
|
742
|
+
* function MyComponent() {
|
|
743
|
+
* const bridgeData = useBridgeData();
|
|
744
|
+
*
|
|
745
|
+
* if (bridgeData.isReady) {
|
|
746
|
+
* console.log('Token:', bridgeData.token?.symbol);
|
|
747
|
+
* console.log('From:', bridgeData.sourceNetwork?.name);
|
|
748
|
+
* console.log('To:', bridgeData.destinationNetwork?.name);
|
|
749
|
+
* console.log('Gateway:', bridgeData.gateway?.route);
|
|
750
|
+
* console.log('Total fee:', bridgeData.fees?.total.usd);
|
|
751
|
+
* console.log('ETA:', bridgeData.estimatedTime?.formatted);
|
|
752
|
+
* }
|
|
753
|
+
* }
|
|
754
|
+
* ```
|
|
755
|
+
*/
|
|
756
|
+
export declare function useBridgeData(): BridgeData;
|
|
757
|
+
|
|
656
758
|
export declare const useBridgeQuoteStore: UseBoundStore<StoreApi<BridgeQuoteStore>>;
|
|
657
759
|
|
|
658
760
|
export declare const useChainsStore: UseBoundStore<Omit<StoreApi<ChainStoreType>, "setState" | "persist"> & {
|
package/package.json
CHANGED