@rash2x/bridge-widget 0.7.5 → 0.7.7
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-HUIu1V_6.js → index-D2IOd6mV.js} +2 -2
- package/dist/{index-HUIu1V_6.js.map → index-D2IOd6mV.js.map} +1 -1
- package/dist/{index-DXcV5o9h.cjs → index-DnrWUlYr.cjs} +34 -43
- package/dist/index-DnrWUlYr.cjs.map +1 -0
- package/dist/{index-CeW-ueEx.js → index-KQ4SsUup.js} +34 -43
- package/dist/index-KQ4SsUup.js.map +1 -0
- package/dist/{index-CQTSauOr.cjs → index-x-S2vNi4.cjs} +2 -2
- package/dist/{index-CQTSauOr.cjs.map → index-x-S2vNi4.cjs.map} +1 -1
- package/dist/index.d.ts +32 -2
- package/package.json +1 -1
- package/dist/index-CeW-ueEx.js.map +0 -1
- package/dist/index-DXcV5o9h.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;
|
|
@@ -471,7 +479,9 @@ declare interface PollUntilDeliveredParams {
|
|
|
471
479
|
|
|
472
480
|
export declare interface Quote {
|
|
473
481
|
route: string;
|
|
474
|
-
error:
|
|
482
|
+
error: {
|
|
483
|
+
message: string;
|
|
484
|
+
} | null;
|
|
475
485
|
srcAmount: string;
|
|
476
486
|
dstAmount: string;
|
|
477
487
|
srcAmountMax: string;
|
|
@@ -558,6 +568,26 @@ declare interface SettingsState {
|
|
|
558
568
|
declare type Store = TransactionState & TransactionActions;
|
|
559
569
|
|
|
560
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
|
+
*/
|
|
561
591
|
onSwapStart?: (data: SwapStartData) => boolean | Promise<boolean> | void;
|
|
562
592
|
onSwapSuccess?: (data: SwapSuccessData) => void;
|
|
563
593
|
onSwapError?: (error: SwapErrorData) => void;
|
package/package.json
CHANGED