@rash2x/bridge-widget 0.7.6 → 0.7.8
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 +1 -1
- package/dist/evaa-bridge.mjs +1 -1
- package/dist/{index-DzUouoJg.cjs → index-Btnz7slS.cjs} +2 -2
- package/dist/{index-DzUouoJg.cjs.map → index-Btnz7slS.cjs.map} +1 -1
- package/dist/{index-CF3yEUFF.js → index-CEcrJo_G.js} +58 -34
- package/dist/index-CEcrJo_G.js.map +1 -0
- package/dist/{index-CDaFAnWU.js → index-DIK7UXln.js} +2 -2
- package/dist/{index-CDaFAnWU.js.map → index-DIK7UXln.js.map} +1 -1
- package/dist/{index-CbuEGPY8.cjs → index-bZ0S5sNd.cjs} +231 -191
- package/dist/index-bZ0S5sNd.cjs.map +1 -0
- package/dist/index.d.ts +29 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/index-CF3yEUFF.js.map +0 -1
- package/dist/index-CbuEGPY8.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -198,7 +198,7 @@ declare class ChainStrategyRegistry {
|
|
|
198
198
|
* Compute fee breakdown: message fee in native token, bridge fee in transfer token,
|
|
199
199
|
* gas on destination in dst native token, total in USD
|
|
200
200
|
*/
|
|
201
|
-
export declare function computeFeeBreakdownUsd(quote: Quote | undefined, srcToken: Token | undefined, tokens: Token[] | undefined, chains: Chain[] | undefined, srcChain?: Chain, dstChain?: Chain): FeeBreakdown;
|
|
201
|
+
export declare function computeFeeBreakdownUsd(quote: Quote | undefined, srcToken: Token | undefined, dstToken: Token | undefined, tokens: Token[] | undefined, chains: Chain[] | undefined, srcChain?: Chain, dstChain?: Chain): FeeBreakdown;
|
|
202
202
|
|
|
203
203
|
declare interface ConnectedWalletActions {
|
|
204
204
|
setTonConnected: (connected: boolean) => void;
|
|
@@ -276,6 +276,14 @@ export declare interface EvaaBridgeProps {
|
|
|
276
276
|
urlParams?: BridgeUrlParams;
|
|
277
277
|
onUrlParamsChange?: (params: BridgeUrlParams) => void;
|
|
278
278
|
onInitialized?: () => void;
|
|
279
|
+
/**
|
|
280
|
+
* Called before swap transaction starts. Can be used for authorization checks.
|
|
281
|
+
* - Return `true` or `undefined` to proceed with the transaction
|
|
282
|
+
* - Return `false` to cancel the transaction
|
|
283
|
+
* - Return a Promise to await authorization (e.g., user accepting policy)
|
|
284
|
+
* - Promise resolves to `true`: transaction continues
|
|
285
|
+
* - Promise resolves to `false`: transaction is cancelled
|
|
286
|
+
*/
|
|
279
287
|
onSwapStart?: (data: SwapStartData) => boolean | Promise<boolean> | void;
|
|
280
288
|
onSwapSuccess?: (data: SwapSuccessData) => void;
|
|
281
289
|
onSwapError?: (error: SwapErrorData) => void;
|
|
@@ -560,6 +568,26 @@ declare interface SettingsState {
|
|
|
560
568
|
declare type Store = TransactionState & TransactionActions;
|
|
561
569
|
|
|
562
570
|
export declare interface SwapCallbacks {
|
|
571
|
+
/**
|
|
572
|
+
* Called before swap transaction starts. Can be used for authorization checks.
|
|
573
|
+
* - Return `true` or `undefined` to proceed with the transaction
|
|
574
|
+
* - Return `false` to cancel the transaction
|
|
575
|
+
* - Return a Promise to await authorization (e.g., user accepting policy)
|
|
576
|
+
* - Promise resolves to `true`: transaction continues
|
|
577
|
+
* - Promise resolves to `false`: transaction is cancelled
|
|
578
|
+
*
|
|
579
|
+
* @example
|
|
580
|
+
* ```typescript
|
|
581
|
+
* // Simple synchronous check
|
|
582
|
+
* onSwapStart: () => isUserAuthorized()
|
|
583
|
+
*
|
|
584
|
+
* // Async authorization that waits for user action
|
|
585
|
+
* onSwapStart: async () => {
|
|
586
|
+
* const authorized = await showAuthModalAndWait();
|
|
587
|
+
* return authorized; // true to continue, false to cancel
|
|
588
|
+
* }
|
|
589
|
+
* ```
|
|
590
|
+
*/
|
|
563
591
|
onSwapStart?: (data: SwapStartData) => boolean | Promise<boolean> | void;
|
|
564
592
|
onSwapSuccess?: (data: SwapSuccessData) => void;
|
|
565
593
|
onSwapError?: (error: SwapErrorData) => void;
|