@lelantos-org/sdk / advanced / ChainReader
Interface: ChainReader
Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:129
Everything a chain can answer without a signing key, which is all the spend path uses.
fetchAsset is required because every amount the wallet formats, every fee it quotes and every asset it names resolves through the registry.
Implementations must be deterministic w.r.t. constructor inputs (no hidden global state).
Extends
RegistryReads.TreeReads.TokenReads.ReceiptReads.NameReads
Extended by
Properties
isKnownRoot?
optional isKnownRoot?: IsKnownRoot;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:45
Whether the pool would accept a proof against root, from the ring of recent roots it keeps. Authoritative; the commitment mirror approximates it. Optional: without it the mirror decides.
Inherited from
TreeReads.isKnownRootMethods
blockNumber()?
optional blockNumber(): Promise<number>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:51
Current chain tip. Feeds SelectOpts.tipBlock, without which the selector's spend cooldown is inert. The request names no address and no topic. Optional.
Returns
Promise<number>
Inherited from
TreeReads.blockNumbercancelDelay()?
optional cancelDelay(): Promise<number>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:34
Blocks, in the EVM's block.number, after submittedAt before cancelDeposit is allowed. Optional.
Returns
Promise<number>
Inherited from
RegistryReads.cancelDelaychainId()
chainId(): Promise<bigint>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:7
Returns
Promise<bigint>
Inherited from
RegistryReads.chainIdfetchAsset()
fetchAsset(id): Promise<AssetEntry>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:20
The registry entry, including the asset's protocol fee rates, which are per-asset and per-leg. 0 bps disables a leg's fee.
Parameters
| Parameter | Type |
|---|---|
id | AssetId |
Returns
Promise<AssetEntry>
Inherited from
RegistryReads.fetchAssetfetchDepositEscrowed()?
optional fetchDepositEscrowed(id, fromBlock?): Promise<DepositEscrowedRecord | null>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:29
The decoded DepositEscrowed log for escrow id, or null when none is found from fromBlock (default: an adapter-chosen recent window) to the tip. cancelDeposit({ depositId }) rebuilds its cancel inputs from it. Optional.
Parameters
| Parameter | Type |
|---|---|
id | bigint |
fromBlock? | bigint |
Returns
Promise<DepositEscrowedRecord | null>
Inherited from
RegistryReads.fetchDepositEscrowedfetchNotePayload()?
optional fetchNotePayload(txHash, cm): Promise<PublishedNote | null>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:117
The decoded NotePayload the pool emitted for commitment cm in mined transaction txHash, or null when that transaction carries none from the pool. A payment proof needs the output's published clue, ephPub and ciphertext. Optional.
A transaction the node holds no receipt for (unknown, or not yet mined) is "not found": resolve null without waiting for it. verifyPaymentProof passes a hash from a proof it has not checked, and reports null as not-published. Reject only when the node could not be asked, so an RPC failure is not read as "no such payment".
Parameters
| Parameter | Type |
|---|---|
txHash | Hex32 |
cm | Hex32 |
Returns
Promise<PublishedNote | null>
Inherited from
ReceiptReads.fetchNotePayloadgetEscrowed()?
optional getEscrowed(id): Promise<EscrowedDepositView | null>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:22
MASP.escrowed(id); null if flushed or cancelled. Optional.
Parameters
| Parameter | Type |
|---|---|
id | bigint |
Returns
Promise<EscrowedDepositView | null>
Inherited from
RegistryReads.getEscrowedmaspAddress()
maspAddress(): Promise<EvmAddress>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:9
Used as the Permit2 spender.
Returns
Promise<EvmAddress>
Inherited from
RegistryReads.maspAddressnameAvailable()?
optional nameAvailable(registrar, label): Promise<boolean>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:80
Whether label is valid and unregistered.
Parameters
| Parameter | Type |
|---|---|
registrar | EvmAddress |
label | string |
Returns
Promise<boolean>
Inherited from
NameReads.nameAvailablenameFee()?
optional nameFee(registrar): Promise<NameFee>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:81
Parameters
| Parameter | Type |
|---|---|
registrar | EvmAddress |
Returns
Promise<NameFee>
Inherited from
NameReads.nameFeenameRecord()?
optional nameRecord(registrar, label): Promise<NameRecord>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:78
Parameters
| Parameter | Type |
|---|---|
registrar | EvmAddress |
label | string |
Returns
Promise<NameRecord>
Inherited from
NameReads.nameRecordnativeAdapterAddress()?
optional nativeAdapterAddress(): EvmAddress | undefined;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:15
NativeAdapter address, or undefined where none is deployed: the payer a native deposit names. Also read by withdraw({ native }). Optional.
Returns
EvmAddress | undefined
Inherited from
RegistryReads.nativeAdapterAddressnativeBalance()?
optional nativeBalance(account): Promise<bigint>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:70
Wei. Optional.
Parameters
| Parameter | Type |
|---|---|
account | EvmAddress |
Returns
Promise<bigint>
Inherited from
TokenReads.nativeBalancepermit2Address()?
optional permit2Address(): EvmAddress;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:36
Optional: omitted by adapters that do not use Permit2.
Returns
Inherited from
RegistryReads.permit2Addresspermit2Allowance()?
optional permit2Allowance(
token,
owner,
spender
): Promise<{
amount: TokenAmount;
expiration: number;
nonce: number;
}>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:56
IAllowanceTransfer.allowance: cap, expiry, nonce. Optional.
Parameters
| Parameter | Type |
|---|---|
token | EvmAddress |
owner | EvmAddress |
spender | EvmAddress |
Returns
Promise<{ amount: TokenAmount; expiration: number; nonce: number; }>
Inherited from
TokenReads.permit2Allowancepermit2Nonce()?
optional permit2Nonce(): Promise<bigint>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:65
Free slot in Permit2's unordered nonce bitmap. Optional: omitted by adapters returning a deterministic nonce.
Returns
Promise<bigint>
Inherited from
TokenReads.permit2NoncetokenAllowance()?
optional tokenAllowance(
tokenAddr,
owner,
spender
): Promise<TokenAmount>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:71
Parameters
| Parameter | Type |
|---|---|
tokenAddr | EvmAddress |
owner | EvmAddress |
spender | EvmAddress |
Returns
Promise<TokenAmount>
Inherited from
TokenReads.tokenAllowancetokenBalanceOf()?
optional tokenBalanceOf(tokenAddr, account): Promise<TokenAmount>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:68
Parameters
| Parameter | Type |
|---|---|
tokenAddr | EvmAddress |
account | EvmAddress |
Returns
Promise<TokenAmount>
Inherited from
TokenReads.tokenBalanceOftokenMeta()?
optional tokenMeta(tokenAddr): Promise<TokenMeta>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:67
Optional; callers feature-check before calling.
Parameters
| Parameter | Type |
|---|---|
tokenAddr | EvmAddress |
Returns
Promise<TokenMeta>
Inherited from
TokenReads.tokenMetatxReceiptLogs()?
optional txReceiptLogs(txHash): Promise<readonly TxLog[]>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:104
Every log of a mined transaction's receipt, in receipt order.
Read after a relayed spend to find the wallet's own operation in a transaction the relayer may have bundled with others', and by a payment proof to find an output's slot. Only the hash is sent; matching against the wallet's commitments happens locally. Optional: without it a spend result carries no operation and paymentProof is unsupported.
Its callers pass a hash they have reason to believe mined, so an implementation may wait briefly for a node that lags, and rejects when no receipt arrives. A transaction the node does not know is not an empty list.
Parameters
| Parameter | Type |
|---|---|
txHash | Hex32 |
Returns
Promise<readonly TxLog[]>
Inherited from
ReceiptReads.txReceiptLogswaitTxReceipt()?
optional waitTxReceipt(txHash, confirmations?): Promise<{
blockNumber: number;
status: number;
}>;Defined in: @lelantos-org/sdk/dist/chain/port.d.ts:86
Block number and receipt status (1 = success, 0 = revert).
Parameters
| Parameter | Type |
|---|---|
txHash | Hex32 |
confirmations? | number |
Returns
Promise<{ blockNumber: number; status: number; }>
Inherited from
ReceiptReads.waitTxReceipt