@openocean.finance/widget 1.0.45 → 1.0.49

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.
Files changed (73) hide show
  1. package/dist/esm/AppDrawer.style.d.ts +1 -1
  2. package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
  3. package/dist/esm/components/AmountInput/AmountInput.style.d.ts +1 -1
  4. package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
  5. package/dist/esm/components/Avatar/Avatar.style.d.ts +1 -1
  6. package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
  7. package/dist/esm/components/ButtonTertiary.d.ts +1 -1
  8. package/dist/esm/components/Card/CardHeader.d.ts +1 -1
  9. package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
  10. package/dist/esm/components/Card/InputCard.d.ts +1 -1
  11. package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
  12. package/dist/esm/components/Header/Header.style.d.ts +2 -2
  13. package/dist/esm/components/Header/SettingsButton.style.d.ts +2 -2
  14. package/dist/esm/components/ListItem/ListItem.d.ts +1 -1
  15. package/dist/esm/components/Search/SearchInput.style.d.ts +1 -1
  16. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  17. package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  18. package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +3 -3
  19. package/dist/esm/components/StepActions/StepActions.style.d.ts +1 -1
  20. package/dist/esm/components/Tabs/Tabs.style.d.ts +2 -2
  21. package/dist/esm/components/Tabs/Tabs.style.js +5 -2
  22. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  23. package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -2
  24. package/dist/esm/components/TokenList/VirtualizedTokenList.js +1 -0
  25. package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
  26. package/dist/esm/config/defaultChainIds.js +1 -0
  27. package/dist/esm/config/defaultChainIds.js.map +1 -1
  28. package/dist/esm/config/version.d.ts +1 -1
  29. package/dist/esm/config/version.js +1 -1
  30. package/dist/esm/cross/adapters/LifiAdapter.d.ts +3 -0
  31. package/dist/esm/cross/adapters/LifiAdapter.js +272 -44
  32. package/dist/esm/cross/adapters/LifiAdapter.js.map +1 -1
  33. package/dist/esm/cross/adapters/NearIntentsAdapter.js +1 -0
  34. package/dist/esm/cross/adapters/NearIntentsAdapter.js.map +1 -1
  35. package/dist/esm/cross/adapters/RelayAdapter.js +3 -2
  36. package/dist/esm/cross/adapters/RelayAdapter.js.map +1 -1
  37. package/dist/esm/cross/adapters/index.d.ts +1 -0
  38. package/dist/esm/cross/adapters/index.js +1 -1
  39. package/dist/esm/cross/adapters/index.js.map +1 -1
  40. package/dist/esm/cross/constants/index.d.ts +13 -1
  41. package/dist/esm/cross/constants/index.js +13 -0
  42. package/dist/esm/cross/constants/index.js.map +1 -1
  43. package/dist/esm/cross/crossChainQuote.js +11 -5
  44. package/dist/esm/cross/crossChainQuote.js.map +1 -1
  45. package/dist/esm/cross/factory.d.ts +3 -1
  46. package/dist/esm/cross/factory.js +10 -14
  47. package/dist/esm/cross/factory.js.map +1 -1
  48. package/dist/esm/i18n/en.json +3 -1
  49. package/dist/esm/i18n/ja.json +3 -1
  50. package/dist/esm/i18n/zh.json +3 -1
  51. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +5 -5
  52. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
  53. package/dist/esm/services/DebridgeService.js +8 -0
  54. package/dist/esm/services/DebridgeService.js.map +1 -1
  55. package/dist/esm/services/ExecuteRoute.js +2 -1
  56. package/dist/esm/services/ExecuteRoute.js.map +1 -1
  57. package/package.json +4 -4
  58. package/src/components/Tabs/Tabs.style.tsx +5 -2
  59. package/src/components/TokenList/VirtualizedTokenList.tsx +15 -15
  60. package/src/config/defaultChainIds.ts +1 -0
  61. package/src/config/version.ts +1 -1
  62. package/src/cross/adapters/LifiAdapter.ts +305 -51
  63. package/src/cross/adapters/NearIntentsAdapter.ts +1 -0
  64. package/src/cross/adapters/RelayAdapter.ts +3 -2
  65. package/src/cross/adapters/index.ts +1 -1
  66. package/src/cross/constants/index.ts +13 -0
  67. package/src/cross/crossChainQuote.ts +11 -5
  68. package/src/cross/factory.ts +12 -11
  69. package/src/i18n/en.json +3 -1
  70. package/src/i18n/ja.json +3 -1
  71. package/src/i18n/zh.json +3 -1
  72. package/src/services/DebridgeService.ts +55 -47
  73. package/src/services/ExecuteRoute.ts +2 -1
@@ -68,6 +68,7 @@ const DEBRIDGE_CHAIN_IDS: Record<number | string, string> = {
68
68
  5000: '100000023', // Mantle
69
69
  747: '100000009', // Flow
70
70
  32769: '100000008', // Zilliqa
71
+ 14: '14', // Flare
71
72
  // Other EVM chain IDs use numeric strings directly
72
73
  }
73
74
 
@@ -168,6 +169,13 @@ const NATIVE_TOKENS: Record<number, Asset> = {
168
169
  symbol: 'SOL',
169
170
  icon: 'https://s3.openocean.finance/token_logos/logos/solana/So11111111111111111111111111111111111111112.png',
170
171
  },
172
+ 14: {
173
+ chainId: 14,
174
+ name: 'Flare',
175
+ address: '0x0000000000000000000000000000000000000000',
176
+ decimals: 18,
177
+ symbol: 'FLR',
178
+ },
171
179
  }
172
180
 
173
181
  export class DebridgeService {
@@ -358,40 +366,40 @@ export class DebridgeService {
358
366
  const queryParams =
359
367
  account && receiver
360
368
  ? {
361
- srcChainId: debridgeSrcChainId,
362
- srcChainTokenIn: debridgeSrcToken,
363
- srcChainTokenInAmount: inAmount,
364
- dstChainId: debridgeDstChainId,
365
- dstChainTokenOut: debridgeDstToken,
366
- dstChainTokenOutRecipient: receiver || account,
367
- senderAddress: account,
368
- referralCode: DebridgeService.REFERRAL_CODE.toString(), // Ensure referralCode is string
369
- srcChainRefundAddress: account,
370
- srcChainOrderAuthorityAddress: account,
371
- dstChainOrderAuthorityAddress: receiver || account,
372
- enableEstimate: false,
373
- prependOperatingExpenses: true,
374
- additionalTakerRewardBps: 0,
375
- allowedTaker:
376
- debridgeDstChainId === '7565164'
377
- ? '2snHHreXbpJ7UwZxPe37gnUNf7Wx7wv6UKDSR2JckKuS'
378
- : '0x555CE236C0220695b68341bc48C68d52210cC35b',
379
- deBridgeApp: 'DESWAP',
380
- ptp: false,
381
- tab: new Date().getTime(),
382
- }
369
+ srcChainId: debridgeSrcChainId,
370
+ srcChainTokenIn: debridgeSrcToken,
371
+ srcChainTokenInAmount: inAmount,
372
+ dstChainId: debridgeDstChainId,
373
+ dstChainTokenOut: debridgeDstToken,
374
+ dstChainTokenOutRecipient: receiver || account,
375
+ senderAddress: account,
376
+ referralCode: DebridgeService.REFERRAL_CODE.toString(), // Ensure referralCode is string
377
+ srcChainRefundAddress: account,
378
+ srcChainOrderAuthorityAddress: account,
379
+ dstChainOrderAuthorityAddress: receiver || account,
380
+ enableEstimate: false,
381
+ prependOperatingExpenses: true,
382
+ additionalTakerRewardBps: 0,
383
+ allowedTaker:
384
+ debridgeDstChainId === '7565164'
385
+ ? '2snHHreXbpJ7UwZxPe37gnUNf7Wx7wv6UKDSR2JckKuS'
386
+ : '0x555CE236C0220695b68341bc48C68d52210cC35b',
387
+ deBridgeApp: 'DESWAP',
388
+ ptp: false,
389
+ tab: new Date().getTime(),
390
+ }
383
391
  : {
384
- srcChainId: debridgeSrcChainId,
385
- srcChainTokenIn: debridgeSrcToken,
386
- srcChainTokenInAmount: inAmount,
387
- dstChainTokenOutAmount: 'auto',
388
- dstChainId: debridgeDstChainId,
389
- dstChainTokenOut: debridgeDstToken,
390
- referralCode: DebridgeService.REFERRAL_CODE.toString(), // Ensure referralCode is string
391
- prependOperatingExpenses: true,
392
- additionalTakerRewardBps: 0,
393
- tab: new Date().getTime(),
394
- }
392
+ srcChainId: debridgeSrcChainId,
393
+ srcChainTokenIn: debridgeSrcToken,
394
+ srcChainTokenInAmount: inAmount,
395
+ dstChainTokenOutAmount: 'auto',
396
+ dstChainId: debridgeDstChainId,
397
+ dstChainTokenOut: debridgeDstToken,
398
+ referralCode: DebridgeService.REFERRAL_CODE.toString(), // Ensure referralCode is string
399
+ prependOperatingExpenses: true,
400
+ additionalTakerRewardBps: 0,
401
+ tab: new Date().getTime(),
402
+ }
395
403
 
396
404
  const url = new URL(
397
405
  `${DebridgeService.DEBRIDGE_QUOTE_URL}/dln/order/create-tx`
@@ -430,10 +438,10 @@ export class DebridgeService {
430
438
  Number.parseFloat(slippage_tolerance.toString()) / 100
431
439
  const minOutAmount = outAmount
432
440
  ? (
433
- (BigInt(outAmount) *
434
- BigInt(Math.floor((1 - slippagePercent) * 10000))) /
435
- BigInt(10000)
436
- ).toString()
441
+ (BigInt(outAmount) *
442
+ BigInt(Math.floor((1 - slippagePercent) * 10000))) /
443
+ BigInt(10000)
444
+ ).toString()
437
445
  : '0'
438
446
 
439
447
  // Determine fee token (native token of source chain)
@@ -486,16 +494,16 @@ export class DebridgeService {
486
494
  // Fee details
487
495
  feeCosts: finalFeeToken
488
496
  ? [
489
- {
490
- name: 'Debridge Fee',
491
- description: 'Protocol fee charged by Debridge',
492
- token: finalFeeToken,
493
- amount: feeAmount,
494
- amountUSD: '0', // USD value of fee not directly available
495
- percentage: '0', // Percentage calculation complex
496
- included: false, // Assume fee is paid separately or via tx.value
497
- },
498
- ]
497
+ {
498
+ name: 'Debridge Fee',
499
+ description: 'Protocol fee charged by Debridge',
500
+ token: finalFeeToken,
501
+ amount: feeAmount,
502
+ amountUSD: '0', // USD value of fee not directly available
503
+ percentage: '0', // Percentage calculation complex
504
+ included: false, // Assume fee is paid separately or via tx.value
505
+ },
506
+ ]
499
507
  : [],
500
508
  // Include potential operating expense as another fee?
501
509
  // const operatingExpense = estimation?.srcChainTokenIn?.approximateOperatingExpense;
@@ -288,6 +288,7 @@ async function executeSolanaSwap(
288
288
  process: Process,
289
289
  route: ExtendedRoute
290
290
  ): Promise<void> {
291
+ debugger
291
292
  try {
292
293
  // Check wallet connection status
293
294
  if (!options.account || !options.account.connector) {
@@ -942,7 +943,7 @@ async function executeBitcoinSwap(
942
943
 
943
944
 
944
945
  default:
945
- throw new Error(`Unsupported wallet: ${connector.name}`);
946
+ throw new Error(`Unsupported wallet: ${connector?.name || 'Unknown'}`);
946
947
  }
947
948
  }
948
949
  );