Class EvmSwapChainClient
- Namespace
- NArk.ArkadeIntents.Evm
- Assembly
- NArk.ArkadeIntents.dll
Proves an ERC20Swap lock and submits and verifies its permissionless claim.
public sealed class EvmSwapChainClient
- Inheritance
-
EvmSwapChainClient
- Inherited Members
Constructors
EvmSwapChainClient(IEvmSwapRpc, IEvmTransactionSender, EvmSendPolicy, TimeProvider?)
Creates a client over host-provided read and signing seams.
public EvmSwapChainClient(IEvmSwapRpc rpc, IEvmTransactionSender sender, EvmSendPolicy policy, TimeProvider? timeProvider = null)
Parameters
rpcIEvmSwapRpcRead-only chain adapter.
senderIEvmTransactionSenderHost-controlled signer and broadcaster.
policyEvmSendPolicyConfigured chain and proof facts.
timeProviderTimeProviderClock used for block-age proof.
Methods
ClaimForAsync(Erc20SwapValues, byte[], Func<EvmPreparedTransaction, CancellationToken, Task>?, long?, CancellationToken)
Claims while also rechecking the Arkade refund margin at execution time.
public Task<EvmClaimResult> ClaimForAsync(Erc20SwapValues values, byte[] preimage, Func<EvmPreparedTransaction, CancellationToken, Task>? onPrepared, long? arkadeRefundLocktime, CancellationToken cancellationToken = default)
Parameters
valuesErc20SwapValuesValidated six-field swap tuple.
preimagebyte[]The 32-byte swap preimage.
onPreparedFunc<EvmPreparedTransaction, CancellationToken, Task>Must durably save the full signed transaction before returning.
arkadeRefundLocktimelong?Absolute Arkade refund time, when composing both legs.
cancellationTokenCancellationTokenCancels proof, preparation, persistence, broadcast, or verification.
Returns
- Task<EvmClaimResult>
Verified transaction-local delivery.
ClaimForAsync(Erc20SwapValues, byte[], Func<EvmPreparedTransaction, CancellationToken, Task>?, CancellationToken)
Claims while durably journaling the signed transaction before broadcast.
public Task<EvmClaimResult> ClaimForAsync(Erc20SwapValues values, byte[] preimage, Func<EvmPreparedTransaction, CancellationToken, Task>? onPrepared, CancellationToken cancellationToken = default)
Parameters
valuesErc20SwapValuesValidated six-field swap tuple.
preimagebyte[]The 32-byte swap preimage.
onPreparedFunc<EvmPreparedTransaction, CancellationToken, Task>Must durably save the full signed transaction before returning.
cancellationTokenCancellationTokenCancels proof, preparation, persistence, broadcast, or verification.
Returns
- Task<EvmClaimResult>
Verified transaction-local delivery.
ClaimForAsync(Erc20SwapValues, byte[], CancellationToken)
Claims after proving the lock, then verifies receipt, events, and consumed state.
public Task<EvmClaimResult> ClaimForAsync(Erc20SwapValues values, byte[] preimage, CancellationToken cancellationToken = default)
Parameters
valuesErc20SwapValuesValidated six-field swap tuple.
preimagebyte[]The 32-byte swap preimage.
cancellationTokenCancellationTokenCancels reads or submission.
Returns
- Task<EvmClaimResult>
Verified transaction-local delivery.
ProveLockAsync(Erc20SwapValues, CancellationToken)
Requires swaps(key) at tip and the configured depth probe.
public Task<EvmLockProof> ProveLockAsync(Erc20SwapValues values, CancellationToken cancellationToken = default)
Parameters
valuesErc20SwapValuesValidated six-field swap tuple.
cancellationTokenCancellationTokenCancels chain reads.
Returns
- Task<EvmLockProof>
Public lock proof coordinates.
ResumeClaimAsync(EvmPreparedTransaction, Erc20SwapValues, byte[], long?, CancellationToken)
Verifies a prepared claim, or safely rebroadcasts its exact bytes while both windows remain open.
public Task<EvmClaimResult> ResumeClaimAsync(EvmPreparedTransaction prepared, Erc20SwapValues values, byte[] preimage, long? arkadeRefundLocktime, CancellationToken cancellationToken = default)
Parameters
preparedEvmPreparedTransactionPreviously persisted transaction hash and signed bytes.
valuesErc20SwapValuesValidated six-field swap tuple.
preimagebyte[]The 32-byte swap preimage.
arkadeRefundLocktimelong?Absolute Arkade refund time, when composing both legs.
cancellationTokenCancellationTokenCancels receipt lookup, safety checks, rebroadcast, or verification.
Returns
- Task<EvmClaimResult>
Verified transaction-local delivery.
Remarks
Receipt verification deliberately precedes current deadline checks: a transaction mined before or at a deadline is still authoritative after the host restarts. Only a receipt timeout permits rebroadcast, and then only after rechecking both the EVM claim window and Arkade refund margin.
VerifyClaimAsync(string, Erc20SwapValues, byte[], CancellationToken)
Resumes receipt verification for a previously journaled claim transaction.
public Task<EvmClaimResult> VerifyClaimAsync(string transactionHash, Erc20SwapValues values, byte[] preimage, CancellationToken cancellationToken = default)
Parameters
transactionHashstringvaluesErc20SwapValuespreimagebyte[]cancellationTokenCancellationToken