Evm.ts
This module handles EVM related functionality.
Added in v0.0.0
Signature
export declare class ChannelDestination
Added in v0.0.0
Source: src/Evm.ts:210
Signature
export declare class ChannelSource
Added in v0.0.0
Source: src/Evm.ts:224
A neutral public client that can be used for general-purpose operations that don’t specifically target source or destination chains
Signature
export declare class PublicClient
Added in v0.0.0
Source: src/Evm.ts:266
Signature
export declare class PublicClientDestination
Added in v0.0.0
Source: src/Evm.ts:250
Signature
export declare class PublicClientSource
Added in v0.0.0
Source: src/Evm.ts:239
A wallet client that can be used for signing transactions
Signature
export declare class WalletClient
Added in v0.0.0
Source: src/Evm.ts:279
Signature
export declare class CreatePublicClientError
Added in v0.0.0
Source: src/Evm.ts:306
Signature
export declare class CreateWalletClientError
Added in v0.0.0
Source: src/Evm.ts:316
Signature
export declare class ReadContractError
Added in v0.0.0
Source: src/Evm.ts:290
Signature
export declare class WaitForTransactionReceiptError
Added in v0.0.0
Source: src/Evm.ts:107
Signature
export declare class WriteContractError
Added in v0.0.0
Source: src/Evm.ts:298
Added in v0.0.0
Signature
export interface Channel { readonly ucs03address: Address readonly channelId: number}
Source: src/Evm.ts:58
Added in v0.0.0
Signature
export interface PublicClient { readonly client: ViemPublicClient}
Source: src/Evm.ts:40
Added in v0.0.0
Signature
export interface WalletClient { readonly client: ViemWalletClient readonly account: ViemAccount readonly chain: ViemChain}
Source: src/Evm.ts:48
Added in v0.0.0
Signature
export declare const channelBalance: ( path: bigint, token: Hex) => Effect.Effect<bigint, ReadContractError, PublicClientDestination | ChannelDestination>
Source: src/Evm.ts:68
Added in v0.0.0
Signature
export declare const channelBalanceAtBlock: ( path: bigint, token: Hex, blockNumber: bigint) => Effect.Effect<bigint, ReadContractError, PublicClientDestination | ChannelDestination>
Source: src/Evm.ts:87
Added in v0.0.0
Increase the allowance of an ERC20 token for a specific spender
Signature
export declare const increaseErc20Allowance: ( tokenAddress: Address, spenderAddress: Address, amount: bigint) => Effect.Effect<`0x${string}`, WriteContractError, WalletClient>
Source: src/Evm.ts:535
Added in v0.0.0
A type-safe wrapper around viem’s readContract that handles error cases and returns an Effect with proper type inference. Extracts all error info
Signature
export declare const readContract: < TAbi extends Abi, TFunctionName extends ContractFunctionName<TAbi, "pure" | "view"> = ContractFunctionName<TAbi, "pure" | "view">, TArgs extends ContractFunctionArgs<TAbi, "pure" | "view", TFunctionName> = ContractFunctionArgs< TAbi, "pure" | "view", TFunctionName >>( client: ViemPublicClient, params: ReadContractParameters<TAbi, TFunctionName, TArgs>) => Effect.Effect<ContractFunctionReturnType<TAbi, "pure" | "view", TFunctionName, TArgs>, ReadContractError, never>
Source: src/Evm.ts:147
Added in v0.0.0
Read the allowance of an ERC20 token for a specific owner and spender
Signature
export declare const readErc20Allowance: ( tokenAddress: Address, ownerAddress: Address, spenderAddress: Address) => Effect.Effect<bigint, ReadContractError, PublicClient>
Source: src/Evm.ts:509
Added in v0.0.0
Read the balance of an ERC20 token for a specific address
Signature
export declare const readErc20Balance: ( tokenAddress: Address, ownerAddress: Address) => Effect.Effect<bigint, ReadContractError, PublicClient>
Source: src/Evm.ts:363
Added in v0.0.0
Read the balance of an ERC20 token for a specific address
Signature
export declare const readErc20BalanceAtBlock: ( tokenAddress: Address, ownerAddress: Address, blockNumber: bigint) => Effect.Effect<bigint, ReadContractError, PublicClient>
Source: src/Evm.ts:385
Added in v0.0.0
Read the decimals of an ERC20 token
Signature
export declare const readErc20Decimals: ( tokenAddress: Address) => Effect.Effect<number, ReadContractError, PublicClient>
Source: src/Evm.ts:448
Added in v0.0.0
Read ERC20 token metadata (name, symbol, decimals)
Signature
export declare const readErc20Meta: ( tokenAddress: Address, chainId: UniversalChainId) => Effect.Effect<{ name: string; symbol: string; decimals: number }, ReadContractError, PublicClient>
Source: src/Evm.ts:331
Added in v0.0.0
Read the name of an ERC20 token
Signature
export declare const readErc20Name: (tokenAddress: Address) => Effect.Effect<string, ReadContractError, PublicClient>
Source: src/Evm.ts:410
Added in v0.0.0
Read the symbol of an ERC20 token
Signature
export declare const readErc20Symbol: (tokenAddress: Address) => Effect.Effect<string, ReadContractError, PublicClient>
Source: src/Evm.ts:429
Added in v0.0.0
Read the TotalSupply of an ERC20 token
Signature
export declare const readErc20TotalSupply: ( tokenAddress: Address) => Effect.Effect<bigint, ReadContractError, PublicClient>
Source: src/Evm.ts:488
Added in v0.0.0
Read the TotalSupply of an ERC20 token
Signature
export declare const readErc20TotalSupplyAtBlock: ( tokenAddress: Address, blockNumber: bigint) => Effect.Effect<bigint, ReadContractError, PublicClient>
Source: src/Evm.ts:468
Added in v0.0.0
Signature
export declare const sendInstruction: ( instruction: Ucs03.Instruction) => Effect.Effect<`0x${string}`, WriteContractError | Utils.CryptoError | ParseError, WalletClient | ChannelSource>
Source: src/Evm.ts:557
Added in v0.0.0
Wait for a transaction receipt
Signature
export declare const waitForTransactionReceipt: ( hash: Hash) => Effect.Effect<TransactionReceipt, WaitForTransactionReceiptError, PublicClient>
Source: src/Evm.ts:121
Added in v0.0.0
A type-safe wrapper around viem’s writeContract that handles error cases and returns an Effect with proper type inference. Extracts all error info
Signature
export declare const writeContract: < TAbi extends Abi, TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName< TAbi, "nonpayable" | "payable" >, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs< TAbi, "nonpayable" | "payable", TFunctionName >>( params: WriteContractParameters<TAbi, TFunctionName, TArgs>) => Effect.Effect<`0x${string}`, WriteContractError, WalletClient>
Source: src/Evm.ts:179
Added in v0.0.0