PublicClient.ts
This module provides the agnostic public client.
Added in v0.4.0
constructors
Section titled “constructors”Signature
export declare const make: (options: PublicClient.MakeOptions) => Effect.Effect<PublicClient, never>Added in v0.4.0
models
Section titled “models”DestinationPublicClient (class)
Section titled “DestinationPublicClient (class)”Signature
export declare class DestinationPublicClientAdded in v0.4.0
PublicClient
Section titled “PublicClient”Signature
export declare const PublicClient: Context.Tag<PublicClient, PublicClient>Added in v0.4.0
PublicClient (interface)
Section titled “PublicClient (interface)”Signature
export interface PublicClient { readonly [TypeId]: TypeId
readonly getLatestHeight: ( lightClientAddress: Domain.LightClientAddress, clientId: number ) => Effect.Effect<bigint, SdkError, never> readonly getLatestBlockNumber: Effect.Effect<bigint, SdkError> readonly readBalance: (options: PublicClient.ReadBalanceOptions) => Effect.Effect<PublicClient.BalanceInfo, SdkError> readonly readBalanceAtHeight: ( options: PublicClient.ReadBalanceAtHeightOptions ) => Effect.Effect<PublicClient.BalanceAtHeightInfo, SdkError> readonly getLightClientAddress: ( ibcStoreAddress: Domain.IbcCoreAddress, clientId: number ) => Effect.Effect<Domain.LightClientAddress, SdkError, never> readonly getStateRootIndex: ( zAssetAddress: Domain.ZAssetAddress, clientId: number ) => Effect.Effect<bigint, SdkError, never> readonly getConsensusState: ( lightClientAddress: Domain.LightClientAddress, clientId: number, height: bigint, satteRootIndex: bigint ) => Effect.Effect<ConsensusState, SdkError, never> readonly getIbcHandlerAddress: ( zAssetAddress: Domain.ZAssetAddress ) => Effect.Effect<Domain.IbcCoreAddress, SdkError, never> readonly getCounterparty: ( zAssetAddress: Domain.ZAssetAddress, clientId: number ) => Effect.Effect<CounterpartyInfo, SdkError, never> readonly getProof: (options: { address: `0x${string}` storageKeys: `0x${string}`[] blockNumber: bigint }) => Effect.Effect<GetProofReturnType, SdkError, never> readonly waitForBlock: (targetHeight: bigint) => Effect.Effect<bigint, SdkError, never>}Added in v0.4.0
PublicClient (namespace)
Section titled “PublicClient (namespace)”Added in v0.4.0
BalanceAtHeightInfo (interface)
Section titled “BalanceAtHeightInfo (interface)”Balance information at a specific height
Signature
export interface BalanceAtHeightInfo { readonly confirmed: bigint readonly redeemed: bigint readonly available: bigint readonly pending: bigint readonly latestHeight: bigint}Added in v0.4.0
BalanceInfo (interface)
Section titled “BalanceInfo (interface)”Full balance information including light client height
Signature
export interface BalanceInfo extends BalanceAtHeightInfo { readonly lightClientHeight: bigint}Added in v0.4.0
ConsensusState (interface)
Section titled “ConsensusState (interface)”Consensus state from a light client
Signature
export interface ConsensusState { readonly stateRoot: `0x${string}`}Added in v0.4.0
MakeOptions (interface)
Section titled “MakeOptions (interface)”Signature
export interface MakeOptions { readonly getLatestHeight: PublicClient["getLatestHeight"] readonly getLatestBlockNumber: PublicClient["getLatestBlockNumber"] readonly readBalance: PublicClient["readBalance"] readonly readBalanceAtHeight: PublicClient["readBalanceAtHeight"] readonly getProof: PublicClient["getProof"] readonly waitForBlock: PublicClient["waitForBlock"] readonly getLightClientAddress: PublicClient["getLightClientAddress"] readonly getStateRootIndex: PublicClient["getStateRootIndex"] readonly getConsensusState: PublicClient["getConsensusState"] readonly getIbcHandlerAddress: PublicClient["getIbcHandlerAddress"] readonly getCounterparty: PublicClient["getCounterparty"]}Added in v0.4.0
ReadBalanceAtHeightOptions (interface)
Section titled “ReadBalanceAtHeightOptions (interface)”Options for readBalanceAtHeight
Signature
export interface ReadBalanceAtHeightOptions { readonly srcErc20Address: Domain.Erc20Address readonly dstErc20Address: Domain.Erc20Address readonly srcChainId: Domain.UniversalChainId readonly dstChainId: Domain.UniversalChainId readonly depositAddress: `0x${string}` readonly nullifier: Domain.Nullifier readonly height: bigint}Added in v0.4.0
ReadBalanceOptions (interface)
Section titled “ReadBalanceOptions (interface)”Options for readBalance
Signature
export interface ReadBalanceOptions { readonly srcErc20Address: Domain.Erc20Address readonly srcChainId: Domain.UniversalChainId readonly dstErc20Address: Domain.Erc20Address readonly dstChainId: Domain.UniversalChainId readonly depositAddress: `0x${string}` readonly nullifier: Domain.Nullifier readonly clientId: number}Added in v0.4.0
SourcePublicClient (class)
Section titled “SourcePublicClient (class)”Signature
export declare class SourcePublicClientAdded in v0.4.0
type ids
Section titled “type ids”TypeId
Section titled “TypeId”Signature
export declare const TypeId: typeof TypeIdAdded in v0.4.0
TypeId (type alias)
Section titled “TypeId (type alias)”Signature
export type TypeId = typeof TypeIdAdded in v0.4.0