@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.
- package/dist/esm/AppDrawer.style.d.ts +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/Avatar/Avatar.style.d.ts +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.d.ts +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/CardHeader.d.ts +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
- package/dist/esm/components/Card/InputCard.d.ts +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +2 -2
- package/dist/esm/components/Header/SettingsButton.style.d.ts +2 -2
- package/dist/esm/components/ListItem/ListItem.d.ts +1 -1
- package/dist/esm/components/Search/SearchInput.style.d.ts +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
- package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +3 -3
- package/dist/esm/components/StepActions/StepActions.style.d.ts +1 -1
- package/dist/esm/components/Tabs/Tabs.style.d.ts +2 -2
- package/dist/esm/components/Tabs/Tabs.style.js +5 -2
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -2
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +1 -0
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/config/defaultChainIds.js +1 -0
- package/dist/esm/config/defaultChainIds.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/cross/adapters/LifiAdapter.d.ts +3 -0
- package/dist/esm/cross/adapters/LifiAdapter.js +272 -44
- package/dist/esm/cross/adapters/LifiAdapter.js.map +1 -1
- package/dist/esm/cross/adapters/NearIntentsAdapter.js +1 -0
- package/dist/esm/cross/adapters/NearIntentsAdapter.js.map +1 -1
- package/dist/esm/cross/adapters/RelayAdapter.js +3 -2
- package/dist/esm/cross/adapters/RelayAdapter.js.map +1 -1
- package/dist/esm/cross/adapters/index.d.ts +1 -0
- package/dist/esm/cross/adapters/index.js +1 -1
- package/dist/esm/cross/adapters/index.js.map +1 -1
- package/dist/esm/cross/constants/index.d.ts +13 -1
- package/dist/esm/cross/constants/index.js +13 -0
- package/dist/esm/cross/constants/index.js.map +1 -1
- package/dist/esm/cross/crossChainQuote.js +11 -5
- package/dist/esm/cross/crossChainQuote.js.map +1 -1
- package/dist/esm/cross/factory.d.ts +3 -1
- package/dist/esm/cross/factory.js +10 -14
- package/dist/esm/cross/factory.js.map +1 -1
- package/dist/esm/i18n/en.json +3 -1
- package/dist/esm/i18n/ja.json +3 -1
- package/dist/esm/i18n/zh.json +3 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +5 -5
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
- package/dist/esm/services/DebridgeService.js +8 -0
- package/dist/esm/services/DebridgeService.js.map +1 -1
- package/dist/esm/services/ExecuteRoute.js +2 -1
- package/dist/esm/services/ExecuteRoute.js.map +1 -1
- package/package.json +4 -4
- package/src/components/Tabs/Tabs.style.tsx +5 -2
- package/src/components/TokenList/VirtualizedTokenList.tsx +15 -15
- package/src/config/defaultChainIds.ts +1 -0
- package/src/config/version.ts +1 -1
- package/src/cross/adapters/LifiAdapter.ts +305 -51
- package/src/cross/adapters/NearIntentsAdapter.ts +1 -0
- package/src/cross/adapters/RelayAdapter.ts +3 -2
- package/src/cross/adapters/index.ts +1 -1
- package/src/cross/constants/index.ts +13 -0
- package/src/cross/crossChainQuote.ts +11 -5
- package/src/cross/factory.ts +12 -11
- package/src/i18n/en.json +3 -1
- package/src/i18n/ja.json +3 -1
- package/src/i18n/zh.json +3 -1
- package/src/services/DebridgeService.ts +55 -47
- 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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
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
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
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
|
|
946
|
+
throw new Error(`Unsupported wallet: ${connector?.name || 'Unknown'}`);
|
|
946
947
|
}
|
|
947
948
|
}
|
|
948
949
|
);
|