@openocean.finance/widget 1.0.46 → 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/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 +2 -2
- 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/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.js +3 -1
- 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/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 +1 -1
- package/dist/esm/cross/crossChainQuote.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +4 -4
- 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 +1 -1
- package/dist/esm/services/ExecuteRoute.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Tabs/Tabs.style.tsx +5 -2
- package/src/config/defaultChainIds.ts +1 -0
- package/src/config/version.ts +1 -1
- package/src/cross/adapters/LifiAdapter.ts +4 -2
- package/src/cross/adapters/NearIntentsAdapter.ts +1 -0
- package/src/cross/adapters/RelayAdapter.ts +3 -2
- package/src/cross/constants/index.ts +13 -0
- package/src/cross/crossChainQuote.ts +1 -1
- package/src/services/DebridgeService.ts +55 -47
- package/src/services/ExecuteRoute.ts +1 -1
|
@@ -166,6 +166,18 @@ export const NativeCurrencies = {
|
|
|
166
166
|
address: '0x4200000000000000000000000000000000000006',
|
|
167
167
|
},
|
|
168
168
|
},
|
|
169
|
+
[ChainId.FLR]: {
|
|
170
|
+
name: 'Flare',
|
|
171
|
+
symbol: 'FLR',
|
|
172
|
+
decimals: 18,
|
|
173
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
174
|
+
wrapped: {
|
|
175
|
+
name: 'Wrapped FLR',
|
|
176
|
+
symbol: 'WFLR',
|
|
177
|
+
decimals: 18,
|
|
178
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
169
181
|
}
|
|
170
182
|
export const MAINNET_NETWORKS = [
|
|
171
183
|
ChainId.ETH,
|
|
@@ -185,6 +197,7 @@ export const MAINNET_NETWORKS = [
|
|
|
185
197
|
ChainId.SCL,
|
|
186
198
|
ChainId.CEL,
|
|
187
199
|
ChainId.MONAD,
|
|
200
|
+
ChainId.FLR,
|
|
188
201
|
] as const
|
|
189
202
|
|
|
190
203
|
export interface Currency {
|
|
@@ -90,7 +90,7 @@ export async function getCrossChainQuote({
|
|
|
90
90
|
quoteResults.push({ adapter, quote })
|
|
91
91
|
}
|
|
92
92
|
} catch (error) {
|
|
93
|
-
errorMsg = error instanceof Error
|
|
93
|
+
errorMsg = error instanceof Error ? error.message : (error && typeof error === 'object' && 'message' in error ? String(error.message) : 'Unknown error')
|
|
94
94
|
// Ignore individual adapter errors, continue getting quotes from other adapters
|
|
95
95
|
console.warn(`Failed to get quote from ${adapter.getName()}:`, error)
|
|
96
96
|
}
|
|
@@ -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;
|