@wormhole-foundation/wormhole-connect 0.3.0-beta.5-development → 0.3.0-beta.6-development
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/assets/{cosmos-kgv6VeE_.js → cosmos-RixGz7q4.js} +1 -1
- package/dist/assets/index-bti7uInf.js +3 -0
- package/dist/assets/solana-QOFlt-jY.js +7 -0
- package/dist/assets/{solanaEmbed.esm-8lU7Qhqn.js → solanaEmbed.esm-bag_3ej_.js} +1 -1
- package/dist/main.js +12 -12
- package/dist/src/hooks/useExternalSearch.d.ts.map +1 -1
- package/dist/src/hooks/useFetchTokenPrices.d.ts.map +1 -1
- package/dist/src/routes/cctpManual/utils/attestation.d.ts.map +1 -1
- package/dist/src/routes/porticoBridge/porticoBridge.d.ts.map +1 -1
- package/dist/src/utils/gas.d.ts +2 -1
- package/dist/src/utils/gas.d.ts.map +1 -1
- package/dist/src/utils/wallet/solana.d.ts.map +1 -1
- package/lib/{aptos-8Mrl9X6i.mjs → aptos-7hQ_IS5t.mjs} +1 -1
- package/lib/{aptos-tebQQ3ZA.js → aptos-EZZ4vyca.js} +1 -1
- package/lib/{ccip-HJnlX_9S.mjs → ccip-ohkOozN9.mjs} +3 -3
- package/lib/{ccip-dCpwpTC_.js → ccip-u8Q1GMxv.js} +1 -1
- package/lib/{cosmos-AFJ1XOrO.js → cosmos-3Gt7cUDB.js} +1 -1
- package/lib/{cosmos-nV16HvSD.mjs → cosmos-PIwquxsw.mjs} +3 -3
- package/lib/{evm-qZTmZv6E.js → evm-saDYNhJf.js} +3 -3
- package/lib/{evm-s1VmSVD6.mjs → evm-vT1ZVL3-.mjs} +4 -4
- package/lib/{index-TfurvHOR.js → index-AKo5eATF.js} +1 -1
- package/lib/{index-cLXEckE0.js → index-F0BS_9xZ.js} +1 -1
- package/lib/{index-8tyGYsKa.mjs → index-NZz0XX-5.mjs} +1 -1
- package/lib/{index-Bb3TApAn.mjs → index-ULDt6LMZ.mjs} +1 -1
- package/lib/{index-aaFEhMHj.mjs → index-cBaSjpJV.mjs} +118 -84
- package/lib/{index-Hc9ZLfg9.js → index-jepLJzNk.js} +7 -7
- package/lib/{index-H90aaVbT.js → index-k_YLuMt9.js} +1 -1
- package/lib/{index-5FmABmsD.mjs → index-paIfKwUN.mjs} +2 -2
- package/lib/{index-QjIV7nR2.js → index-quCA27Bt.js} +1 -1
- package/lib/{index-NwD9aAK2.mjs → index-rmtepuch.mjs} +3 -3
- package/lib/{index.es-KO4vFhJP.js → index.es-BN0z2ngs.js} +2 -2
- package/lib/{index.es-Z0ywZ73m.js → index.es-IEyghF-G.js} +1 -1
- package/lib/{index.es-wpPOI0qn.mjs → index.es-TUoB7sfE.mjs} +1 -1
- package/lib/{index.es-HWWujjOD.js → index.es-fnZHyvXX.js} +1 -1
- package/lib/{index.es-sXBX8dsm.mjs → index.es-gqToJTmT.mjs} +2 -2
- package/lib/{index.es-qv9yd3Ok.mjs → index.es-zGIo5JL8.mjs} +4 -4
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-mnGNKT5v.mjs → libsodium-wrappers-DP3nPahW.mjs} +1 -1
- package/lib/{libsodium-wrappers-Bp8SfOD4.js → libsodium-wrappers-If1nP_iH.js} +1 -1
- package/lib/{sei-fE2ayrOo.mjs → sei-3C70k9jz.mjs} +2 -2
- package/lib/{sei-Ou4E9w5L.js → sei-tvwmFF3t.js} +1 -1
- package/lib/{solana-thpdGOoo.js → solana-3Wvs0AFj.js} +1 -1
- package/lib/{solana-aFYDy2Js.mjs → solana-NH0jIkNC.mjs} +206 -205
- package/lib/{solanaEmbed.esm-XmdisVOz.js → solanaEmbed.esm-0611Kxne.js} +1 -1
- package/lib/{solanaEmbed.esm-sDjJSYg0.mjs → solanaEmbed.esm-qf2QuRqn.mjs} +2 -2
- package/lib/src/hooks/useExternalSearch.d.ts.map +1 -1
- package/lib/src/hooks/useFetchTokenPrices.d.ts.map +1 -1
- package/lib/src/routes/cctpManual/utils/attestation.d.ts.map +1 -1
- package/lib/src/routes/porticoBridge/porticoBridge.d.ts.map +1 -1
- package/lib/src/utils/gas.d.ts +2 -1
- package/lib/src/utils/gas.d.ts.map +1 -1
- package/lib/src/utils/wallet/solana.d.ts.map +1 -1
- package/lib/{sui-OJe7CfrJ.js → sui-0eIV4GIx.js} +1 -1
- package/lib/{sui-ftfGMqx7.mjs → sui-CXHqb7cf.mjs} +1 -1
- package/package.json +1 -1
- package/dist/assets/index-7UgR9Epe.js +0 -3
- package/dist/assets/solana-3KZTbTeS.js +0 -7
|
@@ -202778,7 +202778,7 @@ class SolContracts extends ContractsAbstract {
|
|
|
202778
202778
|
throw new Error(`Wormhole circle relayer contract for domain ${Re} not found`);
|
|
202779
202779
|
}
|
|
202780
202780
|
}
|
|
202781
|
-
const SOLANA_SEQ_LOG = "Program log: Sequence: ", SOLANA_CHAIN_NAME = MAINNET_CONFIG$1.chains.solana.key, SOLANA_MAINNET_EMMITER_ID = "ec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5", SOLANA_TESTNET_EMITTER_ID = "3b26409f8aaded3f5ddca184695aa6a0fa829b0c85caf84856324896d214ca98";
|
|
202781
|
+
const SOLANA_SEQ_LOG = "Program log: Sequence: ", SOLANA_CHAIN_NAME = MAINNET_CONFIG$1.chains.solana.key, SOLANA_FEE_PERCENTILE = 0.75, SOLANA_MAINNET_EMMITER_ID = "ec7372995d5cc8732397fb0ad35c0121e0eaa90d26f828a534cab54391b3a4f5", SOLANA_TESTNET_EMITTER_ID = "3b26409f8aaded3f5ddca184695aa6a0fa829b0c85caf84856324896d214ca98";
|
|
202782
202782
|
class SolanaContext extends RelayerAbstract {
|
|
202783
202783
|
constructor(Re, Fe) {
|
|
202784
202784
|
super(), this.type = Context.SOLANA, this.context = Re;
|
|
@@ -202887,7 +202887,12 @@ class SolanaContext extends RelayerAbstract {
|
|
|
202887
202887
|
throw new Error("no connection");
|
|
202888
202888
|
if (await this.getAssociatedTokenAccount(Re, Fe))
|
|
202889
202889
|
return;
|
|
202890
|
-
const qe = await this.mustGetForeignAsset(Re, SOLANA_CHAIN_NAME), We = await this.getAssociatedTokenAddress(Re, Fe), Ke = new PublicKey$4(Fe), Xe = new PublicKey$4(qe), Ze = new PublicKey$4(We), it = createAssociatedTokenAccountInstruction(Ke, Ze, Ke, Xe), Cn = new Transaction()
|
|
202890
|
+
const qe = await this.mustGetForeignAsset(Re, SOLANA_CHAIN_NAME), We = await this.getAssociatedTokenAddress(Re, Fe), Ke = new PublicKey$4(Fe), Xe = new PublicKey$4(qe), Ze = new PublicKey$4(We), it = createAssociatedTokenAccountInstruction(Ke, Ze, Ke, Xe), Cn = new Transaction();
|
|
202891
|
+
Cn.add(...await this.determineComputeBudget([
|
|
202892
|
+
Xe,
|
|
202893
|
+
Ze
|
|
202894
|
+
])), Cn.add(it);
|
|
202895
|
+
const { blockhash: dt } = await this.connection.getLatestBlockhash(Qe);
|
|
202891
202896
|
return Cn.recentBlockhash = dt, Cn.feePayer = Ke, Cn;
|
|
202892
202897
|
}
|
|
202893
202898
|
/**
|
|
@@ -202928,7 +202933,7 @@ class SolanaContext extends RelayerAbstract {
|
|
|
202928
202933
|
//Remaining funds destination
|
|
202929
202934
|
it
|
|
202930
202935
|
), { blockhash: tr } = await this.connection.getLatestBlockhash(Ke), Wn = new Transaction();
|
|
202931
|
-
return Wn.recentBlockhash = tr, Wn.feePayer = it, Wn.add(dt, sn, yt, Dt, $n, Fn), Wn.partialSign(yn, Cn), Wn;
|
|
202936
|
+
return Wn.add(...await this.determineComputeBudget([NATIVE_MINT])), Wn.recentBlockhash = tr, Wn.feePayer = it, Wn.add(dt, sn, yt, Dt, $n, Fn), Wn.partialSign(yn, Cn), Wn;
|
|
202932
202937
|
}
|
|
202933
202938
|
/**
|
|
202934
202939
|
* Prepare the transfer instructions for a token bridge transfer from Solana
|
|
@@ -202956,7 +202961,12 @@ class SolanaContext extends RelayerAbstract {
|
|
|
202956
202961
|
throw new Error("contracts not found");
|
|
202957
202962
|
const sn = this.context.toChainId(Qe);
|
|
202958
202963
|
Xe === void 0 && (Xe = Re);
|
|
202959
|
-
const yt = createNonce().readUInt32LE(0), Dt = createApproveAuthoritySignerInstruction(dt.token_bridge, qe, new PublicKey$4(Xe), Fe), yn = Keypair.generate(), $n = We === void 0 || We === CHAIN_ID_SOLANA$1 ? it ? createTransferNativeWithPayloadInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Ke, yt, Fe, Je, sn, it) : createTransferNativeInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Ke, yt, Fe, Ze || BigInt(0), Je, sn) : it ? createTransferWrappedWithPayloadInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Xe, We, Ke, yt, Fe, Je, sn, it) : createTransferWrappedInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Xe, We, Ke, yt, Fe, Ze || BigInt(0), Je, sn), Fn = new Transaction()
|
|
202964
|
+
const yt = createNonce().readUInt32LE(0), Dt = createApproveAuthoritySignerInstruction(dt.token_bridge, qe, new PublicKey$4(Xe), Fe), yn = Keypair.generate(), $n = We === void 0 || We === CHAIN_ID_SOLANA$1 ? it ? createTransferNativeWithPayloadInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Ke, yt, Fe, Je, sn, it) : createTransferNativeInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Ke, yt, Fe, Ze || BigInt(0), Je, sn) : it ? createTransferWrappedWithPayloadInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Xe, We, Ke, yt, Fe, Je, sn, it) : createTransferWrappedInstruction(this.connection, dt.token_bridge, dt.core, Re, yn.publicKey, qe, Xe, We, Ke, yt, Fe, Ze || BigInt(0), Je, sn), Fn = new Transaction();
|
|
202965
|
+
Fn.add(...await this.determineComputeBudget([
|
|
202966
|
+
new PublicKey$4(qe),
|
|
202967
|
+
new PublicKey$4(Ke)
|
|
202968
|
+
])), Fn.add(Dt, $n);
|
|
202969
|
+
const { blockhash: tr } = await this.connection.getLatestBlockhash(Cn);
|
|
202960
202970
|
return Fn.recentBlockhash = tr, Fn.feePayer = new PublicKey$4(Re), Fn.partialSign(yn), Fn;
|
|
202961
202971
|
}
|
|
202962
202972
|
async send(Re, Fe, Qe, Je, qe, We, Ke, Xe) {
|
|
@@ -203099,7 +203109,9 @@ class SolanaContext extends RelayerAbstract {
|
|
|
203099
203109
|
const Xe = parseTokenTransferVaa(Fe), { to: Ze } = this.parseRelayerPayload(Xe.tokenTransferPayload), it = new PublicKey$4(utils$P.arrayify(Ze));
|
|
203100
203110
|
if (!it.equals(new PublicKey$4(Je)))
|
|
203101
203111
|
throw new Error("recipient address does not match payer address");
|
|
203102
|
-
const Cn = Xe.tokenChain === MAINNET_CHAINS$1.solana, dt = Cn ? new PublicKey$4(Xe.tokenAddress) : deriveWrappedMintKey(We, Xe.tokenChain, Xe.tokenAddress), sn = new Transaction()
|
|
203112
|
+
const Cn = Xe.tokenChain === MAINNET_CHAINS$1.solana, dt = Cn ? new PublicKey$4(Xe.tokenAddress) : deriveWrappedMintKey(We, Xe.tokenChain, Xe.tokenAddress), sn = new Transaction();
|
|
203113
|
+
sn.add(...await this.determineComputeBudget([dt]));
|
|
203114
|
+
const yt = getAssociatedTokenAddressSync(dt, it);
|
|
203103
203115
|
await this.connection.getAccountInfo(yt) || sn.add(createAssociatedTokenAccountInstruction(it, yt, it, dt));
|
|
203104
203116
|
let yn;
|
|
203105
203117
|
Cn ? yn = await createCompleteNativeTransferWithRelayInstruction(this.connection, Ke, it, We, qe, Fe, it) : yn = await createCompleteWrappedTransferWithRelayInstruction(this.connection, Ke, it, We, qe, Fe, it), sn.add(yn);
|
|
@@ -203132,11 +203144,12 @@ class SolanaContext extends RelayerAbstract {
|
|
|
203132
203144
|
if (!Ze || !it || !Cn)
|
|
203133
203145
|
throw new Error("contracts not found");
|
|
203134
203146
|
const dt = this.context.getContext(We), sn = utils$P.arrayify(dt.formatAddress(Ke)), yt = this.context.toChainId(We), Dt = createNonce().readUint32LE(), yn = new Transaction();
|
|
203135
|
-
let Qn;
|
|
203136
203147
|
if (Re === NATIVE || Re.chain === SOLANA_CHAIN_NAME) {
|
|
203137
|
-
const
|
|
203138
|
-
|
|
203148
|
+
const $n = Re === NATIVE ? NATIVE_MINT : Re.address, Fn = Re === NATIVE;
|
|
203149
|
+
let tr = [NATIVE_MINT];
|
|
203150
|
+
if (Fn) {
|
|
203139
203151
|
const Wn = getAssociatedTokenAddressSync(NATIVE_MINT, new PublicKey$4(qe));
|
|
203152
|
+
tr.push(Wn);
|
|
203140
203153
|
try {
|
|
203141
203154
|
await getAccount(this.connection, Wn);
|
|
203142
203155
|
} catch (Kn) {
|
|
@@ -203147,14 +203160,13 @@ class SolanaContext extends RelayerAbstract {
|
|
|
203147
203160
|
throw Kn;
|
|
203148
203161
|
}
|
|
203149
203162
|
}
|
|
203150
|
-
|
|
203163
|
+
yn.add(...await this.determineComputeBudget(tr)), yn.add(await createTransferNativeTokensWithRelayInstruction(this.connection, Cn, qe, it, Ze, $n, BigInt(Fe), BigInt(Qe), sn, yt, Dt, Fn));
|
|
203151
203164
|
} else {
|
|
203152
|
-
const
|
|
203153
|
-
|
|
203165
|
+
const $n = await this.mustGetForeignAsset(Re, Je);
|
|
203166
|
+
yn.add(...await this.determineComputeBudget([new PublicKey$4($n)])), yn.add(await createTransferWrappedTokensWithRelayInstruction(this.connection, Cn, qe, it, Ze, $n, BigInt(Fe), BigInt(Qe), sn, yt, Dt));
|
|
203154
203167
|
}
|
|
203155
|
-
|
|
203156
|
-
|
|
203157
|
-
return yn.recentBlockhash = $n, yn.feePayer = new PublicKey$4(qe), yn;
|
|
203168
|
+
const { blockhash: Qn } = await this.connection.getLatestBlockhash("finalized");
|
|
203169
|
+
return yn.recentBlockhash = Qn, yn.feePayer = new PublicKey$4(qe), yn;
|
|
203158
203170
|
}
|
|
203159
203171
|
async calculateNativeTokenAmt(Re, Fe, Qe, Je) {
|
|
203160
203172
|
const qe = this.contracts.mustGetTokenBridgeRelayer(Re), We = await this.mustGetForeignAsset(Fe, Re), Ke = await this.fetchTokenDecimals(We, Re), Xe = await qe.calculateNativeSwapAmountOut(new PublicKey$4(We), BigNumber$2.from(Qe).toBigInt(), Ke);
|
|
@@ -203177,6 +203189,29 @@ class SolanaContext extends RelayerAbstract {
|
|
|
203177
203189
|
chain: "solana"
|
|
203178
203190
|
};
|
|
203179
203191
|
}
|
|
203192
|
+
async determineComputeBudget(Re = []) {
|
|
203193
|
+
var Qe;
|
|
203194
|
+
let Fe = 1e5;
|
|
203195
|
+
try {
|
|
203196
|
+
const Je = await ((Qe = this.connection) == null ? void 0 : Qe.getRecentPrioritizationFees({
|
|
203197
|
+
lockedWritableAccounts: Re
|
|
203198
|
+
}));
|
|
203199
|
+
if (Je) {
|
|
203200
|
+
const qe = Je.map((We) => We.prioritizationFee).sort((We, Ke) => We - Ke);
|
|
203201
|
+
Fe = qe[Math.floor(qe.length * SOLANA_FEE_PERCENTILE)];
|
|
203202
|
+
}
|
|
203203
|
+
} catch (Je) {
|
|
203204
|
+
console.error("Error fetching Solana recent fees", Je);
|
|
203205
|
+
}
|
|
203206
|
+
return console.info(`Setting Solana compute unit price to ${Fe} microLamports`), [
|
|
203207
|
+
ComputeBudgetProgram.setComputeUnitLimit({
|
|
203208
|
+
units: 25e4
|
|
203209
|
+
}),
|
|
203210
|
+
ComputeBudgetProgram.setComputeUnitPrice({
|
|
203211
|
+
microLamports: Fe
|
|
203212
|
+
})
|
|
203213
|
+
];
|
|
203214
|
+
}
|
|
203180
203215
|
}
|
|
203181
203216
|
class SuiRelayer {
|
|
203182
203217
|
constructor(Re, Fe, Qe) {
|
|
@@ -288026,7 +288061,7 @@ const walletConnection = {
|
|
|
288026
288061
|
if (Fe.getNetworkInfo().chainId !== e) {
|
|
288027
288062
|
if (Qe.context === Context.ETH)
|
|
288028
288063
|
try {
|
|
288029
|
-
const { switchChain: qe } = await import("./evm-
|
|
288064
|
+
const { switchChain: qe } = await import("./evm-vT1ZVL3-.mjs").then((We) => We.f);
|
|
288030
288065
|
await qe(Fe, e);
|
|
288031
288066
|
} catch (qe) {
|
|
288032
288067
|
if (qe instanceof NotSupported)
|
|
@@ -288034,7 +288069,7 @@ const walletConnection = {
|
|
|
288034
288069
|
throw qe;
|
|
288035
288070
|
}
|
|
288036
288071
|
if (Qe.context === Context.COSMOS) {
|
|
288037
|
-
const { switchChain: qe } = await import("./cosmos-
|
|
288072
|
+
const { switchChain: qe } = await import("./cosmos-PIwquxsw.mjs");
|
|
288038
288073
|
await qe(Fe, e);
|
|
288039
288074
|
}
|
|
288040
288075
|
return Fe.getAddress();
|
|
@@ -288043,7 +288078,7 @@ const walletConnection = {
|
|
|
288043
288078
|
const Re = walletConnection[e];
|
|
288044
288079
|
Re && await Re.disconnect();
|
|
288045
288080
|
}, watchAsset = async (e, Re) => {
|
|
288046
|
-
const Fe = walletConnection[Re], { watchAsset: Qe } = await import("./evm-
|
|
288081
|
+
const Fe = walletConnection[Re], { watchAsset: Qe } = await import("./evm-vT1ZVL3-.mjs").then((Je) => Je.f);
|
|
288047
288082
|
await Qe(e, Fe);
|
|
288048
288083
|
}, signAndSendTransaction = async (e, Re, Fe) => {
|
|
288049
288084
|
const Qe = config$1.chains[e], Je = walletConnection[Fe];
|
|
@@ -288053,23 +288088,23 @@ const walletConnection = {
|
|
|
288053
288088
|
case Context.ETH:
|
|
288054
288089
|
return Re.transactionHash;
|
|
288055
288090
|
case Context.SOLANA: {
|
|
288056
|
-
const { signAndSendTransaction: qe } = await import("./solana-
|
|
288091
|
+
const { signAndSendTransaction: qe } = await import("./solana-NH0jIkNC.mjs");
|
|
288057
288092
|
return (await qe(Re, Je)).id;
|
|
288058
288093
|
}
|
|
288059
288094
|
case Context.SUI: {
|
|
288060
|
-
const { signAndSendTransaction: qe } = await import("./sui-
|
|
288095
|
+
const { signAndSendTransaction: qe } = await import("./sui-CXHqb7cf.mjs");
|
|
288061
288096
|
return (await qe(Re, Je)).id;
|
|
288062
288097
|
}
|
|
288063
288098
|
case Context.APTOS: {
|
|
288064
|
-
const { signAndSendTransaction: qe } = await import("./aptos-
|
|
288099
|
+
const { signAndSendTransaction: qe } = await import("./aptos-7hQ_IS5t.mjs");
|
|
288065
288100
|
return (await qe(Re, Je)).id;
|
|
288066
288101
|
}
|
|
288067
288102
|
case Context.SEI: {
|
|
288068
|
-
const { signAndSendTransaction: qe } = await import("./sei-
|
|
288103
|
+
const { signAndSendTransaction: qe } = await import("./sei-3C70k9jz.mjs");
|
|
288069
288104
|
return (await qe(Re, Je)).id;
|
|
288070
288105
|
}
|
|
288071
288106
|
case Context.COSMOS: {
|
|
288072
|
-
const { signAndSendTransaction: qe } = await import("./cosmos-
|
|
288107
|
+
const { signAndSendTransaction: qe } = await import("./cosmos-PIwquxsw.mjs");
|
|
288073
288108
|
return (await qe(Re, Je)).id;
|
|
288074
288109
|
}
|
|
288075
288110
|
default:
|
|
@@ -288102,30 +288137,30 @@ const walletConnection = {
|
|
|
288102
288137
|
if (e === void 0)
|
|
288103
288138
|
return [];
|
|
288104
288139
|
if (e.context === Context.ETH) {
|
|
288105
|
-
const { wallets: Re } = await import("./evm-
|
|
288140
|
+
const { wallets: Re } = await import("./evm-vT1ZVL3-.mjs").then((Fe) => Fe.f);
|
|
288106
288141
|
return Object.values(mapWallets(Re, Context.ETH));
|
|
288107
288142
|
} else if (e.context === Context.SOLANA) {
|
|
288108
|
-
const { fetchOptions: Re } = await import("./solana-
|
|
288143
|
+
const { fetchOptions: Re } = await import("./solana-NH0jIkNC.mjs"), Fe = Re();
|
|
288109
288144
|
return Object.values(mapWallets(Fe, Context.SOLANA));
|
|
288110
288145
|
} else if (e.context === Context.SUI) {
|
|
288111
|
-
const Fe = await (await import("./sui-
|
|
288146
|
+
const Fe = await (await import("./sui-CXHqb7cf.mjs")).fetchOptions();
|
|
288112
288147
|
return Object.values(mapWallets(Fe, Context.SUI));
|
|
288113
288148
|
} else if (e.context === Context.APTOS) {
|
|
288114
|
-
const Fe = (await import("./aptos-
|
|
288149
|
+
const Fe = (await import("./aptos-7hQ_IS5t.mjs")).fetchOptions();
|
|
288115
288150
|
return Object.values(mapWallets(Fe, Context.APTOS));
|
|
288116
288151
|
} else if (e.context === Context.SEI) {
|
|
288117
|
-
const Fe = await (await import("./sei-
|
|
288152
|
+
const Fe = await (await import("./sei-3C70k9jz.mjs")).fetchOptions();
|
|
288118
288153
|
return Object.values(mapWallets(Fe, Context.SEI));
|
|
288119
288154
|
} else if (e.context === Context.COSMOS)
|
|
288120
288155
|
if (e.id !== CHAIN_ID_EVMOS$1) {
|
|
288121
288156
|
const {
|
|
288122
288157
|
wallets: { cosmos: Re }
|
|
288123
|
-
} = await import("./cosmos-
|
|
288158
|
+
} = await import("./cosmos-PIwquxsw.mjs");
|
|
288124
288159
|
return Object.values(mapWallets(Re, Context.COSMOS));
|
|
288125
288160
|
} else {
|
|
288126
288161
|
const {
|
|
288127
288162
|
wallets: { cosmosEvm: Re }
|
|
288128
|
-
} = await import("./cosmos-
|
|
288163
|
+
} = await import("./cosmos-PIwquxsw.mjs");
|
|
288129
288164
|
return Object.values(
|
|
288130
288165
|
mapWallets(Re, Context.COSMOS, ["OKX Wallet"])
|
|
288131
288166
|
);
|
|
@@ -291204,7 +291239,7 @@ const fetchIsVAAEnqueued = async (e) => {
|
|
|
291204
291239
|
var Xe;
|
|
291205
291240
|
const Ke = We.data;
|
|
291206
291241
|
if (!(!Ke || !((Xe = Ke.destinationTx) != null && Xe.txHash)))
|
|
291207
|
-
return
|
|
291242
|
+
return Ke.destinationTx.txHash;
|
|
291208
291243
|
}).catch(function(We) {
|
|
291209
291244
|
throw We;
|
|
291210
291245
|
});
|
|
@@ -291958,12 +291993,12 @@ function getForeignUSDCAddress(e) {
|
|
|
291958
291993
|
throw new Error("No foreign native USDC address");
|
|
291959
291994
|
return (Fe = Re.tokenId) == null ? void 0 : Fe.address;
|
|
291960
291995
|
}
|
|
291961
|
-
const CIRCLE_ATTESTATION = config$1.isMainnet ? "https://iris-api.circle.com/attestations/" : "https://iris-api-sandbox.circle.com/attestations/";
|
|
291962
291996
|
async function tryGetCircleAttestation(e) {
|
|
291963
|
-
|
|
291964
|
-
}).
|
|
291965
|
-
|
|
291966
|
-
|
|
291997
|
+
const Re = config$1.isMainnet ? "https://iris-api.circle.com/attestations/" : "https://iris-api-sandbox.circle.com/attestations/";
|
|
291998
|
+
return await axios$1.get(`${Re}${e}`).catch((Fe) => {
|
|
291999
|
+
}).then(async (Fe) => {
|
|
292000
|
+
if (Fe && Fe.status === 200 && Fe.data.status === "complete")
|
|
292001
|
+
return Fe.data.attestation;
|
|
291967
292002
|
});
|
|
291968
292003
|
}
|
|
291969
292004
|
const CCTP_LOG_TokenMessenger_DepositForBurn = "0x2fa9ca894982930190727e75500a97d8dc500233a5065e0f3126c48fbe0343c0", CCTP_LOG_MessageSent = "0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036";
|
|
@@ -295788,7 +295823,42 @@ async function getQuote(e, Re, Fe, Qe, Je) {
|
|
|
295788
295823
|
0
|
|
295789
295824
|
]))[0] };
|
|
295790
295825
|
}
|
|
295791
|
-
const CREATE_ORDER_API_URL = "https://thermae.fly.dev/api/order/create", FEE_TIER = 100, SLIPPAGE_BPS = 15, BPS_PER_HUNDRED_PERCENT = 1e4, RELAYER_FEE_API_URL = "https://gfx.relayers.xlabs.xyz/api/v1/swap/quote", OKU_TRADE_BASE_URL = "https://oku.trade/app", SWAP_ERROR = "This transaction will not succeed due to price movement."
|
|
295826
|
+
const CREATE_ORDER_API_URL = "https://thermae.fly.dev/api/order/create", FEE_TIER = 100, SLIPPAGE_BPS = 15, BPS_PER_HUNDRED_PERCENT = 1e4, RELAYER_FEE_API_URL = "https://gfx.relayers.xlabs.xyz/api/v1/swap/quote", OKU_TRADE_BASE_URL = "https://oku.trade/app", SWAP_ERROR = "This transaction will not succeed due to price movement.", getGasFallback = (e, Re, Fe) => {
|
|
295827
|
+
var Ke;
|
|
295828
|
+
const Qe = config$1.wh.toChainName(e), Je = (Ke = config$1.gasEstimates[Qe]) == null ? void 0 : Ke[Re];
|
|
295829
|
+
if (!Je || !Je[Fe])
|
|
295830
|
+
return BigNumber$2.from(0);
|
|
295831
|
+
const qe = BigNumber$2.from(Je[Fe]);
|
|
295832
|
+
return config$1.chains[Qe].context === Context.ETH ? parseUnits(qe.toString(), "gwei") : qe;
|
|
295833
|
+
}, estimateSendGas = async (e, Re, Fe, Qe, Je, qe, We, Ke) => {
|
|
295834
|
+
let Xe;
|
|
295835
|
+
try {
|
|
295836
|
+
Xe = await RouteOperator.getRoute(e).estimateSendGas(
|
|
295837
|
+
Re,
|
|
295838
|
+
Fe,
|
|
295839
|
+
Qe,
|
|
295840
|
+
Je,
|
|
295841
|
+
qe,
|
|
295842
|
+
We,
|
|
295843
|
+
Ke
|
|
295844
|
+
);
|
|
295845
|
+
} catch {
|
|
295846
|
+
Re === NATIVE ? Xe = getGasFallback(Qe, e, "sendNative") : Xe = getGasFallback(Qe, e, "sendToken");
|
|
295847
|
+
}
|
|
295848
|
+
if (!Xe)
|
|
295849
|
+
throw new Error("could not estimate send gas");
|
|
295850
|
+
return formatGasFee(Qe, Xe);
|
|
295851
|
+
}, estimateClaimGas = async (e, Re, Fe) => {
|
|
295852
|
+
let Qe;
|
|
295853
|
+
try {
|
|
295854
|
+
Qe = await RouteOperator.getRoute(e).estimateClaimGas(Re, Fe);
|
|
295855
|
+
} catch {
|
|
295856
|
+
Qe = getGasFallback(Re, e, "claim");
|
|
295857
|
+
}
|
|
295858
|
+
if (!Qe)
|
|
295859
|
+
throw new Error("could not estimate send gas");
|
|
295860
|
+
return formatGasFee(Re, Qe);
|
|
295861
|
+
}, estimateAverageGasFee = async (e, Re) => (await config$1.wh.mustGetProvider(e).getGasPrice()).mul(Re).mul(130).div(100);
|
|
295792
295862
|
class PorticoBridge extends BaseRoute {
|
|
295793
295863
|
constructor(Fe, Qe) {
|
|
295794
295864
|
super();
|
|
@@ -295925,10 +295995,10 @@ class PorticoBridge extends BaseRoute {
|
|
|
295925
295995
|
throw new Error("not implemented");
|
|
295926
295996
|
}
|
|
295927
295997
|
async estimateSendGas(Fe, Qe, Je, qe, We, Ke, Xe) {
|
|
295928
|
-
|
|
295998
|
+
return await estimateAverageGasFee(Je, 15e4);
|
|
295929
295999
|
}
|
|
295930
296000
|
async estimateClaimGas(Fe, Qe) {
|
|
295931
|
-
|
|
296001
|
+
return BigNumber$2.from(0);
|
|
295932
296002
|
}
|
|
295933
296003
|
getMinSendAmount(Fe) {
|
|
295934
296004
|
return 0;
|
|
@@ -314893,42 +314963,7 @@ function AlertBanner(e) {
|
|
|
314893
314963
|
}
|
|
314894
314964
|
) });
|
|
314895
314965
|
}
|
|
314896
|
-
const
|
|
314897
|
-
var Ke;
|
|
314898
|
-
const Qe = config$1.wh.toChainName(e), Je = (Ke = config$1.gasEstimates[Qe]) == null ? void 0 : Ke[Re];
|
|
314899
|
-
if (!Je || !Je[Fe])
|
|
314900
|
-
return BigNumber$2.from(0);
|
|
314901
|
-
const qe = BigNumber$2.from(Je[Fe]);
|
|
314902
|
-
return config$1.chains[Qe].context === Context.ETH ? parseUnits(qe.toString(), "gwei") : qe;
|
|
314903
|
-
}, estimateSendGas = async (e, Re, Fe, Qe, Je, qe, We, Ke) => {
|
|
314904
|
-
let Xe;
|
|
314905
|
-
try {
|
|
314906
|
-
Xe = await RouteOperator.getRoute(e).estimateSendGas(
|
|
314907
|
-
Re,
|
|
314908
|
-
Fe,
|
|
314909
|
-
Qe,
|
|
314910
|
-
Je,
|
|
314911
|
-
qe,
|
|
314912
|
-
We,
|
|
314913
|
-
Ke
|
|
314914
|
-
);
|
|
314915
|
-
} catch {
|
|
314916
|
-
Re === NATIVE ? Xe = getGasFallback(Qe, e, "sendNative") : Xe = getGasFallback(Qe, e, "sendToken");
|
|
314917
|
-
}
|
|
314918
|
-
if (!Xe)
|
|
314919
|
-
throw new Error("could not estimate send gas");
|
|
314920
|
-
return formatGasFee(Qe, Xe);
|
|
314921
|
-
}, estimateClaimGas = async (e, Re, Fe) => {
|
|
314922
|
-
let Qe;
|
|
314923
|
-
try {
|
|
314924
|
-
Qe = await RouteOperator.getRoute(e).estimateClaimGas(Re, Fe);
|
|
314925
|
-
} catch {
|
|
314926
|
-
Qe = getGasFallback(Re, e, "claim");
|
|
314927
|
-
}
|
|
314928
|
-
if (!Qe)
|
|
314929
|
-
throw new Error("could not estimate send gas");
|
|
314930
|
-
return formatGasFee(Re, Qe);
|
|
314931
|
-
}, useStyles$E = makeStyles()((e) => ({
|
|
314966
|
+
const useStyles$E = makeStyles()((e) => ({
|
|
314932
314967
|
body: {
|
|
314933
314968
|
width: "100%"
|
|
314934
314969
|
},
|
|
@@ -317985,24 +318020,24 @@ const FETCH_SWAP_INFO_INTERVAL = 6e4, usePorticoSwapInfo = () => {
|
|
|
317985
318020
|
We,
|
|
317986
318021
|
e
|
|
317987
318022
|
]);
|
|
317988
|
-
}, PRICES_FETCH_INTERVAL = 6e4 * 5, COINGECKO_URL = "https://api.coingecko.com/", COINGECKO_URL_PRO = "https://pro-api.coingecko.com/",
|
|
318023
|
+
}, PRICES_FETCH_INTERVAL = 6e4 * 5, COINGECKO_URL = "https://api.coingecko.com/", COINGECKO_URL_PRO = "https://pro-api.coingecko.com/", useFetchTokenPrices = () => {
|
|
317989
318024
|
const e = useDispatch();
|
|
317990
318025
|
useEffect(() => {
|
|
317991
318026
|
let Re = !1;
|
|
317992
|
-
const Fe = new AbortController(), Qe = Fe.signal, Je = new Headers({
|
|
318027
|
+
const Fe = new AbortController(), Qe = Fe.signal, Je = Object.values(config$1.tokens).filter((Ke) => !!Ke.coinGeckoId).map(({ coinGeckoId: Ke }) => Ke).join(","), qe = new Headers({
|
|
317993
318028
|
"Content-Type": "application/json",
|
|
317994
318029
|
...config$1.coinGeckoApiKey ? { "x-cg-pro-api-key": config$1.coinGeckoApiKey } : {}
|
|
317995
318030
|
});
|
|
317996
318031
|
return (async () => {
|
|
317997
318032
|
for (; !Re; ) {
|
|
317998
318033
|
try {
|
|
317999
|
-
const
|
|
318000
|
-
`${config$1.coinGeckoApiKey ? COINGECKO_URL_PRO : COINGECKO_URL}api/v3/simple/price?ids=${
|
|
318001
|
-
{ signal: Qe, headers:
|
|
318034
|
+
const Xe = await (await fetch(
|
|
318035
|
+
`${config$1.coinGeckoApiKey ? COINGECKO_URL_PRO : COINGECKO_URL}api/v3/simple/price?ids=${Je}&vs_currencies=usd${config$1.coinGeckoApiKey ? `?x_cg_pro_api_key=${config$1.coinGeckoApiKey}` : ""}`,
|
|
318036
|
+
{ signal: Qe, headers: qe }
|
|
318002
318037
|
)).json();
|
|
318003
|
-
Re || e(setPrices(
|
|
318004
|
-
} catch (
|
|
318005
|
-
Re || e(setPricesError(`Error fetching token prices: ${
|
|
318038
|
+
Re || e(setPrices(Xe));
|
|
318039
|
+
} catch (Ke) {
|
|
318040
|
+
Re || e(setPricesError(`Error fetching token prices: ${Ke}`));
|
|
318006
318041
|
}
|
|
318007
318042
|
await sleep(PRICES_FETCH_INTERVAL);
|
|
318008
318043
|
}
|
|
@@ -319586,7 +319621,6 @@ function Terms() {
|
|
|
319586
319621
|
config$1.showHamburgerMenu ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(FooterNavBar, {})
|
|
319587
319622
|
] });
|
|
319588
319623
|
}
|
|
319589
|
-
const VALID_CHAINS = config$1.chainsArr.filter((e) => e.key !== "wormchain").map((e) => e.key);
|
|
319590
319624
|
function useExternalSearch() {
|
|
319591
319625
|
const [e, Re] = useState(!1), [Fe, Qe] = useState(), [Je, qe] = useState();
|
|
319592
319626
|
return useEffect(() => {
|
|
@@ -319596,7 +319630,7 @@ function useExternalSearch() {
|
|
|
319596
319630
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
319597
319631
|
config$1.searchTx.chainName
|
|
319598
319632
|
);
|
|
319599
|
-
|
|
319633
|
+
config$1.chainsArr.filter((it) => it.key !== "wormchain").map((it) => it.key).includes(Xe) && (Re(!0), Qe(config$1.searchTx.txHash), qe(Xe));
|
|
319600
319634
|
}
|
|
319601
319635
|
}, []), {
|
|
319602
319636
|
hasExternalSearch: e,
|