Skip to content

@lelantos-org/sdk / services/relayer / RelayerClient

Class: RelayerClient โ€‹

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:9

HTTP client for the relayer wire protocol. The wire format here is the SDK's expectation โ€” every relayer service speaking it MUST match these shapes.

Constructors โ€‹

Constructor โ€‹

ts
new RelayerClient(baseUrl, opts?): RelayerClient;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:11

Parameters โ€‹

ParameterType
baseUrlstring
opts?HttpClientOptions

Returns โ€‹

RelayerClient

Methods โ€‹

estimateDeposit() โ€‹

ts
estimateDeposit(chainId): Promise<EstimateResponse>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:41

What the relayer charges to flush a deposit.

Priced against flushBatch rather than a spend: a deposit is not relayed at submit time, and the cost the relayer is recovering is the batch it will later prove and broadcast.

Parameters โ€‹

ParameterType
chainIdnumber | bigint

Returns โ€‹

Promise<EstimateResponse>


estimateSpend() โ€‹

ts
estimateSpend(chainId, kind): Promise<EstimateResponse>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:32

What this relayer will charge to relay a spend of kind.

A function of (chainId, kind) alone, so it takes neither a payload nor a proof โ€” an estimate fired for an amount the user may never send would otherwise name nullifiers that never reach the chain.

The quote is advisory: it is not signed, and the relayer re-derives the requirement when the spend arrives. Pay at least FeeQuote.circuitAmount; the relayer's graceBps is what absorbs the drift in between.

Parameters โ€‹

ParameterType
chainIdnumber | bigint
kindSpendKind

Returns โ€‹

Promise<EstimateResponse>


estimateSwap() โ€‹

ts
estimateSwap(chainId): Promise<EstimateResponse>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:33

Parameters โ€‹

ParameterType
chainIdnumber | bigint

Returns โ€‹

Promise<EstimateResponse>


getChains() โ€‹

ts
getChains(): Promise<ChainsResponse>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:19

The chain registry a client boots from: ids, contract addresses, the asset table, and the shielded fee terms where a relayer charges one.

Cacheable and identical for every caller โ€” it carries nothing per-user, which is why it is a GET with no parameters.

Returns โ€‹

Promise<ChainsResponse>


submitSwap() โ€‹

ts
submitSwap(payload): Promise<RelayerSubmitResponse>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:43

Parameters โ€‹

ParameterType
payloadSubmitSwapPayload

Returns โ€‹

Promise<RelayerSubmitResponse>


submitTransact() โ€‹

ts
submitTransact(payload): Promise<RelayerSubmitResponse>;

Defined in: @lelantos-org/sdk/dist/services/relayer/client.d.ts:42

Parameters โ€‹

ParameterType
payloadSubmitTransactPayload

Returns โ€‹

Promise<RelayerSubmitResponse>

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub