@silentswap/react 0.0.42 → 0.0.43

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.
@@ -30,5 +30,6 @@ export declare function useOrderSigning(walletClient: WalletClient | undefined,
30
30
  sourceSender: {
31
31
  contactId: string;
32
32
  };
33
+ integratorId?: string;
33
34
  }, overrideFacilitatorGroup?: HdFacilitatorGroup) => Promise<OrderResponse>;
34
35
  };
@@ -84,5 +84,7 @@ export interface ExecuteSwapParams {
84
84
  splits: number[];
85
85
  /** Contact ID of the sender (e.g., "caip10:eip155:*:0x...") */
86
86
  senderContactId: string;
87
+ /** Optional integrator ID for tracking */
88
+ integratorId?: string;
87
89
  }
88
90
  export declare function useSilentQuote({ client, address, evmAddress, solAddress, walletClient, connector, wallet, walletLoading, onStatus, solanaConnector, solanaConnection, solanaRpcUrl, getPrice, setDestinations, }: useSilentQuoteOptions): useSilentQuoteReturn;
@@ -86,7 +86,7 @@ export function useSilentQuote({ client, address, evmAddress, solAddress, wallet
86
86
  * 5. Executes deposit transaction
87
87
  * 6. Returns swap result with order ID and transaction hashes
88
88
  */
89
- const executeSwap = useCallback(async ({ sourceAsset, sourceAmount, destinations, splits, senderContactId, }) => {
89
+ const executeSwap = useCallback(async ({ sourceAsset, sourceAmount, destinations, splits, senderContactId, integratorId, }) => {
90
90
  if (!rawAddress) {
91
91
  throw new Error('Address required for swap execution');
92
92
  }
@@ -157,7 +157,8 @@ export function useSilentQuote({ client, address, evmAddress, solAddress, wallet
157
157
  // Handle Solana swaps
158
158
  if (isSourceSolana) {
159
159
  const result = await executeSolanaSwap(quoteResponse, sourceAsset, sourceAmountInUnits, effectiveUsdcAmount, senderContactId, solanaConnector, evmSignerAddress, // Use EVM signer address, not normalizedAddress
160
- viewingAuth, createOrder, executeSolanaBridge, resolvedGroup);
160
+ viewingAuth, createOrder, executeSolanaBridge, resolvedGroup, // Pass resolved group for order creation
161
+ integratorId);
161
162
  setOrderId(result.orderId);
162
163
  setViewingAuth(result.viewingAuth);
163
164
  return result;
@@ -175,6 +176,7 @@ export function useSilentQuote({ client, address, evmAddress, solAddress, wallet
175
176
  sourceSender: {
176
177
  contactId: senderContactId,
177
178
  },
179
+ ...(integratorId && { integratorId }),
178
180
  }, resolvedGroup);
179
181
  // Handle ERC-20 approvals if needed
180
182
  if (effectiveAllowanceTarget && !isDepositingDirectly && evmSignerAddress) {
@@ -191,7 +193,8 @@ export function useSilentQuote({ client, address, evmAddress, solAddress, wallet
191
193
  // In Svelte: zg_amount_src_usdc is passed directly to bridge execution (line 1028)
192
194
  const result = await executeEvmSwap(sourceAsset, sourceAmountInUnits, effectiveUsdcAmount, // Use amount from solveOptimalUsdcAmount (matches Svelte)
193
195
  providerForSwap, orderResponse, evmSignerAddress, // Use EVM signer address, not normalizedAddress
194
- viewingAuth, executeEvmBridge, senderContactId);
196
+ viewingAuth, executeEvmBridge, senderContactId, // Pass sender contact ID to extract sender address
197
+ integratorId);
195
198
  setOrderId(result.orderId);
196
199
  setViewingAuth(result.viewingAuth);
197
200
  return result;
@@ -275,7 +278,7 @@ export function useSilentQuote({ client, address, evmAddress, solAddress, wallet
275
278
  * 4. Returns swap result
276
279
  */
277
280
  async function executeSolanaSwap(quoteResponse, sourceAsset, sourceAmount, usdcAmount, senderContactId, solanaConnector, evmSignerAddress, // EVM signer address (matches Svelte's s0x_signer)
278
- viewingAuth, createOrder, executeSolanaBridge, facilitatorGroup) {
281
+ viewingAuth, createOrder, executeSolanaBridge, facilitatorGroup, integratorId) {
279
282
  if (!solanaConnector) {
280
283
  throw new Error('Solana connector required for Solana swaps');
281
284
  }
@@ -300,6 +303,7 @@ viewingAuth, createOrder, executeSolanaBridge, facilitatorGroup) {
300
303
  sourceSender: {
301
304
  contactId: senderContactId,
302
305
  },
306
+ ...(integratorId && { integratorId }),
303
307
  }, facilitatorGroup);
304
308
  // Get deposit parameters from order
305
309
  const depositParams = orderResponse.transaction.metadata?.params;
@@ -337,7 +341,8 @@ viewingAuth, createOrder, executeSolanaBridge, facilitatorGroup) {
337
341
  * 4. Returns swap result
338
342
  */
339
343
  async function executeEvmSwap(sourceAsset, sourceAmount, usdcAmount, provider, orderResponse, evmSignerAddress, // EVM signer address (matches Svelte's s0x_signer)
340
- viewingAuth, executeEvmBridge, senderContactId) {
344
+ viewingAuth, executeEvmBridge, senderContactId, // Sender contact ID to extract sender address
345
+ integratorId) {
341
346
  // Parse source asset to get chain ID and token address
342
347
  const sourceEvmParsed = parseEvmCaip19(sourceAsset);
343
348
  if (!sourceEvmParsed) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/react",
3
3
  "type": "module",
4
- "version": "0.0.42",
4
+ "version": "0.0.43",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@ensdomains/ensjs": "^4.2.0",
26
- "@silentswap/sdk": "0.0.42",
27
- "@silentswap/ui-kit": "0.0.42",
26
+ "@silentswap/sdk": "0.0.43",
27
+ "@silentswap/ui-kit": "0.0.43",
28
28
  "@solana/codecs-strings": "^5.1.0",
29
29
  "@solana/kit": "^5.1.0",
30
30
  "@solana/rpc": "^5.1.0",