Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/abi/escrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export const SETTLER_ESCROW_ABI = [
}
],
outputs: [],
stateMutability: "nonpayable"
stateMutability: "payable"
},
{
type: "function",
Expand Down
4 changes: 1 addition & 3 deletions src/lib/components/InputTokenModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
active = false;
}

const uniqueInputTokens = $derived([
...new Set(store.availableTokens.map((v) => v.name).filter((v) => v !== "eth"))
]);
const uniqueInputTokens = $derived([...new Set(store.availableTokens.map((v) => v.name))]);
Comment thread
artyomabrahamyan marked this conversation as resolved.

// svelte-ignore state_referenced_locally
let selectedTokenName = $state<string>(currentInputTokens[0].token.name);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export const coinList = (mainnet: boolean) => {
address: ADDRESS_ZERO,
name: "eth",
chainId: arbitrumSepolia.id,
decimals: 6
decimals: 18
},
{
address: `0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14`,
Expand Down
12 changes: 11 additions & 1 deletion src/lib/libraries/intentExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { isTronChain } from "$lib/utils/chainType";
import type { TxRef } from "$lib/utils/txRef";
import { getTronReads, getTronSigner } from "$lib/tron/client";
import { openEscrow as openTronEscrow } from "$lib/tron/writes";
import { nativeValueOfInputs } from "$lib/tron/encode";
import { getSolanaReads } from "$lib/solana/client";
import { createSolanaPrograms } from "$lib/solana/program";
import { getSolanaSigner } from "$lib/solana/wallet";
Expand Down Expand Up @@ -122,14 +123,16 @@ export async function openEscrowIntent(
}
await switchWalletChain(walletClient, Number(order.originChainId));
const chain = getChain(order.originChainId);
const nativeValue = nativeValueOfInputs(order.inputs);
return [
await walletClient.writeContract({
chain,
account,
address: INPUT_SETTLER_ESCROW_LIFI,
abi: SETTLER_ESCROW_ABI,
functionName: "open",
args: [order]
args: [order],
...(nativeValue > 0n ? { value: nativeValue } : {})
})
];
}
Expand All @@ -142,6 +145,13 @@ export async function openEscrowIntent(
if (tronComponent) {
throw new Error("Multichain orders with Tron inputs are not supported");
}
// The multichain settler's open is nonpayable, so native inputs cannot be escrowed.
const nativeComponent = components.find(
({ orderComponent }) => nativeValueOfInputs(orderComponent.inputs) > 0n
);
if (nativeComponent) {
throw new Error("Multichain orders with native inputs are not supported");
}
const results: `0x${string}`[] = [];
for (const { chainId, orderComponent } of components) {
const chain = getChain(chainId);
Expand Down
Loading