@rash2x/bridge-widget 0.6.80 → 0.6.81

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/index.d.ts CHANGED
@@ -65,6 +65,42 @@ declare type BridgeQuoteStatus = "idle" | "loading" | "success" | "error";
65
65
 
66
66
  declare type BridgeQuoteStore = BridgeQuoteState & BridgeQuoteActions;
67
67
 
68
+ declare interface BridgeReportActions {
69
+ setConfig: (config: BridgeReportConfig) => void;
70
+ setAuthToken: (token?: string) => void;
71
+ setEnabled: (enabled: boolean) => void;
72
+ }
73
+
74
+ export declare interface BridgeReportConfig {
75
+ enabled: boolean;
76
+ authToken?: string;
77
+ baseUrl?: string;
78
+ }
79
+
80
+ declare interface BridgeReportState {
81
+ config: BridgeReportConfig;
82
+ }
83
+
84
+ export declare interface BridgeTransactionReportParams {
85
+ lz_tx_hash: string;
86
+ from_address: string;
87
+ to_address: string;
88
+ amount: string;
89
+ token: string;
90
+ from_network: string;
91
+ to_network: string;
92
+ estimated_fee: string;
93
+ sent_at: string;
94
+ user_address?: string;
95
+ wallet_connected?: boolean;
96
+ }
97
+
98
+ export declare interface BridgeTransactionReportResponse {
99
+ status: 'ok' | 'error';
100
+ error?: string;
101
+ messages?: string[];
102
+ }
103
+
68
104
  export declare interface BridgeUrlParams {
69
105
  srcToken?: string;
70
106
  srcChain?: string;
@@ -251,6 +287,11 @@ export declare interface EvaaBridgeProps {
251
287
  onSwapSuccess?: (data: SwapSuccessData) => void;
252
288
  onSwapError?: (error: SwapErrorData) => void;
253
289
  onDataUpdate?: (data: BridgeExternalData) => void;
290
+ /**
291
+ * Configuration for reporting bridge transactions to backend.
292
+ * When enabled, sends transaction data to the specified endpoint after each transaction.
293
+ */
294
+ bridgeReport?: BridgeReportConfig;
254
295
  }
255
296
 
256
297
  declare interface EvmMonitorReceipt {
@@ -517,6 +558,8 @@ export declare type QuoteSendResponse = {
517
558
  };
518
559
  };
519
560
 
561
+ export declare function reportBridgeTransaction(params: BridgeTransactionReportParams, config: BridgeReportConfig): Promise<BridgeTransactionReportResponse>;
562
+
520
563
  export declare function resolveTokenOnChain(tokens: Token[], assetSymbol: string, chainKey: string): Token | undefined;
521
564
 
522
565
  export declare function resolveTokenOnChainFromMatrix(assetMatrix: Record<string, Record<string, Token>> | undefined, assetSymbol: string | undefined, chainKey: string | undefined): Token | undefined;
@@ -559,6 +602,8 @@ declare interface SourceCost {
559
602
 
560
603
  declare type Store = TransactionState & TransactionActions;
561
604
 
605
+ declare type Store_2 = BridgeReportState & BridgeReportActions;
606
+
562
607
  export declare function sumFeeByTokenLD(fees: Array<{
563
608
  amount?: string;
564
609
  token?: string;
@@ -749,6 +794,8 @@ declare interface UseBridgeExternalDataOptions {
749
794
 
750
795
  export declare const useBridgeQuoteStore: UseBoundStore<StoreApi<BridgeQuoteStore>>;
751
796
 
797
+ export declare const useBridgeReportStore: UseBoundStore<StoreApi<Store_2>>;
798
+
752
799
  export declare const useChainsStore: UseBoundStore<Omit<StoreApi<ChainStoreType>, "setState" | "persist"> & {
753
800
  setState(partial: ChainStoreType | Partial<ChainStoreType> | ((state: ChainStoreType) => ChainStoreType | Partial<ChainStoreType>), replace?: false | undefined): unknown;
754
801
  setState(state: ChainStoreType | ((state: ChainStoreType) => ChainStoreType), replace: true): unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rash2x/bridge-widget",
3
- "version": "0.6.80",
3
+ "version": "0.6.81",
4
4
  "description": "Cross-chain bridge widget powered by Stargate Protocol with multi-chain wallet support",
5
5
  "type": "module",
6
6
  "main": "./dist/evaa-bridge.cjs",