@cfxdevkit/core / CoreWalletClient
Class: CoreWalletClient
Defined in: packages/core/src/clients/core.ts:506
Core Space Wallet Client Implementation
Implements
Constructors
Constructor
new CoreWalletClient(
config):CoreWalletClient
Defined in: packages/core/src/clients/core.ts:516
Parameters
config
Returns
CoreWalletClient
Properties
address
readonlyaddress:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`
Defined in: packages/core/src/clients/core.ts:508
Implementation of
chainId
readonlychainId:number
Defined in: packages/core/src/clients/core.ts:509
chainType
readonlychainType:"core"
Defined in: packages/core/src/clients/core.ts:507
Implementation of
Accessors
civePublicClient
Get Signature
get civePublicClient():
object
Defined in: packages/core/src/clients/core.ts:883
Access the underlying cive PublicClient for advanced read operations.
Returns
account
account:
undefined
The Account of the Client.
batch?
optionalbatch:object
Flags for batch settings.
batch.multicall?
optionalmulticall:boolean| {batchSize?:number;wait?:number; }
Toggle to enable eth_call multicall aggregation.
Type Declaration
boolean
{ batchSize?: number; wait?: number; }
cacheTime
cacheTime:
number
Time (in ms) that cached data will remain in memory.
call()
call: (
args) =>Promise<CallReturnType>
Virtually calls a contract, returns the output data. The transaction will not be added to the blockchain. The error message of cfx_call is similar to cfx_estimateGasAndCollateral and error solutions can be found in cfx_estimateGasAndCollateral behaviour#errors.
Parameters
args
CallParameters
CallParameters
Returns
Promise<CallReturnType>
- CallReturnType
ccipRead?
optionalccipRead:false| {request?: (parameters) =>Promise<`0x${string}`>; }
CCIP Read configuration.
Type Declaration
false
{ request?: (parameters) => Promise<`0x${string}`>; }
chain
chain:
Chain|undefined
Chain for the client.
checkBalanceAgainstTransaction()
checkBalanceAgainstTransaction: (
args) =>Promise<CheckBalanceAgainstTransactionReturnType>
Check if a user’s balance is enough to send a transaction with the specified gas and storage limits to the specified contract. The balance is enough if the user can cover the up-front payment of both execution and storage, or if these costs are sponsored by the contract.
-JSON-RPC Method: cfx_checkBalanceAgainstTransaction
Parameters
args
CheckBalanceAgainstTransactionParameters
CheckBalanceAgainstTransactionParameters
Returns
Promise<CheckBalanceAgainstTransactionReturnType>
- CheckBalanceAgainstTransactionReturnType
createBlockFilter()
createBlockFilter: () =>
Promise<{id:`0x${string}`;request:EIP1193RequestFn<readonly [{Method:"cfx_getFilterChanges";Parameters: [`0x${string}`];ReturnType:`0x${string}`[] |RpcLog[]; }, {Method:"cfx_getFilterLogs";Parameters: [`0x${string}`];ReturnType:RpcLog[]; }, {Method:"cfx_uninstallFilter";Parameters: [`0x${string}`];ReturnType:boolean; }]>;type:"block"; }>
/**
- Create a block filter for following up usage. Returns the block filter id which can be used via cfx_getFilterChanges to retrieve latest executed blocks.
-
- JSON-RPC Method:
cfx_newBlockFilter
- JSON-RPC Method:
Returns
Promise<{ id: `0x${string}`; request: EIP1193RequestFn<readonly [{ Method: "cfx_getFilterChanges"; Parameters: [`0x${string}`]; ReturnType: `0x${string}`[] | RpcLog[]; }, { Method: "cfx_getFilterLogs"; Parameters: [`0x${string}`]; ReturnType: RpcLog[]; }, { Method: "cfx_uninstallFilter"; Parameters: [`0x${string}`]; ReturnType: boolean; }]>; type: "block"; }>
- CreateBlockFilterReturnType
createContractEventFilter()
createContractEventFilter: <
abi,eventName,args,strict>(args) =>Promise<CreateContractEventFilterReturnType<abi,eventName,args,strict>>
Type Parameters
abi
abi extends Abi | readonly unknown[]
eventName
eventName extends string | undefined
args
args extends Record<string, unknown> | readonly unknown[] | undefined
strict
strict extends boolean | undefined = undefined
Parameters
args
CreateContractEventFilterParameters<abi, eventName, args, strict>
CreateContractEventFilterParameters
Returns
Promise<CreateContractEventFilterReturnType<abi, eventName, args, strict>>
- CreateContractEventFilterReturnType
createEventFilter()
createEventFilter: <
TAbiEvent,TAbiEvents,TStrict,TFromEpoch,TToEpoch,_EventName,_Args>(args?) =>Promise<{ [K in string | number | symbol]: Filter<“event”, TAbiEvents, _EventName, _Args, TStrict, TFromEpoch, TToEpoch>[K] }>
This function creates a log filter for tracking usage. It returns a log filter ID, which can be employed through the cfx_getFilterChanges command to retrieve logs newly generated from recently executed transactions. The from* field in this context will be disregarded by this RPC (Remote Procedure Call). This function can also be used via cfx_getFilterLogs to retrieve all logs that match the filter criteria. In this instance, the from* fields are considered.
- JSON-RPC Method:
cfx_newFilter
Type Parameters
TAbiEvent
TAbiEvent extends AbiEvent | undefined = undefined
TAbiEvents
TAbiEvents extends readonly unknown[] | readonly AbiEvent[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined
TStrict
TStrict extends boolean | undefined = undefined
TFromEpoch
TFromEpoch extends bigint | EpochTag | undefined = undefined
TToEpoch
TToEpoch extends bigint | EpochTag | undefined = undefined
_EventName
_EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>
_Args
_Args extends Record<string, unknown> | readonly unknown[] | undefined = undefined
Parameters
args?
CreateEventFilterParameters<TAbiEvent, TAbiEvents, TStrict, _EventName, _Args>
CreateEventFilterParameters
Returns
Promise<{ [K in string | number | symbol]: Filter<“event”, TAbiEvents, _EventName, _Args, TStrict, TFromEpoch, TToEpoch>[K] }>
- CreateEventFilterReturnType
createPendingTransactionFilter()
createPendingTransactionFilter: () =>
Promise<{id:`0x${string}`;request:EIP1193RequestFn<readonly [{Method:"cfx_getFilterChanges";Parameters: [`0x${string}`];ReturnType:`0x${string}`[] |RpcLog[]; }, {Method:"cfx_getFilterLogs";Parameters: [`0x${string}`];ReturnType:RpcLog[]; }, {Method:"cfx_uninstallFilter";Parameters: [`0x${string}`];ReturnType:boolean; }]>;type:"transaction"; }>
Create a pending transaction filter for following up usage. Returns the transaction filter id which can be used via cfx_getFilterChanges to retrieve ready but not executed transactions.
- JSON-RPC Method:
cfx_newPendingTransactionFilter
Returns
Promise<{ id: `0x${string}`; request: EIP1193RequestFn<readonly [{ Method: "cfx_getFilterChanges"; Parameters: [`0x${string}`]; ReturnType: `0x${string}`[] | RpcLog[]; }, { Method: "cfx_getFilterLogs"; Parameters: [`0x${string}`]; ReturnType: RpcLog[]; }, { Method: "cfx_uninstallFilter"; Parameters: [`0x${string}`]; ReturnType: boolean; }]>; type: "transaction"; }>
- CreatePendingTransactionFilterReturnType
estimateContractGasAndCollateral()
estimateContractGasAndCollateral: <
chain,abi,functionName,args>(args) =>Promise<EstimateGasAndCollateralReturnType>
Type Parameters
chain
chain extends Chain | undefined
abi
abi extends Abi | readonly unknown[]
functionName
functionName extends string
args
args extends unknown
Parameters
args
EstimateContractGasAndCollateralParameters<abi, functionName, args, chain>
EstimateContractGasAndCollateralParameters
Returns
Promise<EstimateGasAndCollateralReturnType>
- EstimateContractGasAndCollateralReturnType
estimateGasAndCollateral()
estimateGasAndCollateral: (
args) =>Promise<EstimateGasAndCollateralReturnType>
Virtually executes a transaction, returns an estimate for the size of storage collateralized and the gas used by the transaction. The transaction will not be added to the blockchain.
- JSON-RPC Method:
cfx_estimateGasAndCollateral
Parameters
args
EstimateGasAndCollateralParameters
EstimateGasAndCollateralParameters
Returns
Promise<EstimateGasAndCollateralReturnType>
an estimate result object EstimateGasAndCollateralReturnType
estimateMaxPriorityFeePerGas()
estimateMaxPriorityFeePerGas: () =>
Promise<bigint>
Returns the current priority fee per gas in Drip.
- JSON-RPC Method:
cfx_maxPriorityFeePerGas
Returns
Promise<bigint>
extend()
extend: <
client>(fn) =>Client<Transport,Chain|undefined,undefined,PublicRpcSchema, { [K in string | number | symbol]: client[K] } &PublicActions<Transport,Chain|undefined>>
Type Parameters
client
client extends object & ExactPartial<ExtendableProtectedActions<Transport, Chain | undefined, undefined>>
Parameters
fn
(client) => client
Returns
Client<Transport, Chain | undefined, undefined, PublicRpcSchema, { [K in string | number | symbol]: client[K] } & PublicActions<Transport, Chain | undefined>>
getAccount()
getAccount: (
args) =>Promise<GetChainAccountReturnType>
Returns an account, identified by its address.
- JSON-RPC Method:
cfx_getAccount
Parameters
args
GetChainAccountParameters
GetChainAccountParameters
Returns
Promise<GetChainAccountReturnType>
- the state of the given account:
getAccountPendingInfo()
getAccountPendingInfo: (
args) =>Promise<GetAccountPendingInfoReturnType>
Returns transaction pool pending info of one account
- JSON-RPC Method:
cfx_getAccountPendingInfo
Parameters
args
GetAccountPendingInfoParameters
GetAccountPendingInfoParameters
Returns
Promise<GetAccountPendingInfoReturnType>
- GetAccountPendingInfoReturnType
getAccountPendingTransactions()
getAccountPendingTransactions: (
args) =>Promise<GetAccountPendingTransactionsReturnType>
Returns pending transactions in pool of one account
- JSON-RPC Method:
cfx_getAccountPendingTransactions
Parameters
args
GetAccountPendingTransactionsParameters
Returns
Promise<GetAccountPendingTransactionsReturnType>
getAccumulateInterestRate()
getAccumulateInterestRate: (
args) =>Promise<bigint>
Returns the accumulate interest rate at the given epoch.
- JSON-RPC Method:
cfx_getAccumulateInterestRate
Parameters
args
GetAccumulateInterestRateParameters
GetAccumulateInterestRateParameters
Returns
Promise<bigint>
the accumulate interest rate at the given epoch. GetAccumulateInterestRateReturnType
getAdmin()
getAdmin: (
args) =>Promise<GetAdminReturnType>
Returns the admin of the specified contract.
- JSON-RPC Methods:
cfx_getAdmin
Parameters
args
GetAdminParameters
GetAdminParameters
Returns
Promise<GetAdminReturnType>
-address of admin, or null if the contract does not exist. GetAdminReturnType
getBalance()
getBalance: (
args) =>Promise<bigint>
Returns the balance of the given account, identified by its address.
- JSON-RPC Methods:
cfx_getbalance
Parameters
args
GetBalanceParameters
GetBalanceParameters
Returns
Promise<bigint>
integer of the current balance in Drip. GetBalanceReturnType
getBastBlockHash()
getBastBlockHash: () =>
Promise<`0x${string}`>
Returns the hash of the best block.
- JSON-RPC Methods:
cfx_getbestblockhash
Returns
Promise<`0x${string}`>
hash of the best block. GetBastBlockHashReturn
getBlock()
getBlock: <
TIncludeTransactions,TEpochTag>(args?) =>Promise<{adaptive:boolean;baseFeePerGas:TEpochTagextends"earliest"|"latest_checkpoint"?null:bigint;blame:bigint;blockNumber:bigint;custom:`0x${string}`[];deferredLogsBloomHash:`0x${string}`;deferredReceiptsRoot:`0x${string}`;difficulty:bigint;epochNumber:bigint;gasLimit:bigint;gasUsed:TEpochTagextends"earliest"|"latest_checkpoint"|"latest_mined"?null:bigint;hash:`0x${string}`;height:bigint;miner:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;nonce:TEpochTagextends"latest_checkpoint"|"latest_mined"?null:`0x${string}`;parentHash:`0x${string}`;posReference:TEpochTagextends"earliest"|"latest_checkpoint"?null:`0x${string}`;powQuality:TEpochTagextends"latest_checkpoint"|"latest_mined"?null:`0x${string}`;refereeHashes:`0x${string}`[];size:bigint;timestamp:bigint;transactions:TIncludeTransactionsextendstrue? ({accessList?:undefined;blockHash:TEpochTagextends"latest_state"?false:trueextendstrue?null:`0x${string}`;chainId?:number;contractCreated:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;data:`0x${string}`;epochHeight:bigint|null;from:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;gas:bigint;gasPrice:bigint;hash:`0x${string}`;maxFeePerGas?:undefined;maxPriorityFeePerGas?:undefined;nonce:number;r:`0x${string}`;s:`0x${string}`;status:bigint|null;storageLimit:bigint;to:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;transactionIndex:number|null;type:"legacy";v:bigint;value:bigint;yParity?:undefined; } | {accessList:AccessList;blockHash:TEpochTagextends"latest_state"?false:trueextendstrue?null:`0x${string}`;chainId:number;contractCreated:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;data:`0x${string}`;epochHeight:bigint|null;from:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;gas:bigint;gasPrice:bigint;hash:`0x${string}`;maxFeePerGas?:undefined;maxPriorityFeePerGas?:undefined;nonce:number;r:`0x${string}`;s:`0x${string}`;status:bigint|null;storageLimit:bigint;to:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;transactionIndex:number|null;type:"eip2930";v:bigint;value:bigint;yParity?:undefined; } | {accessList:AccessList;blockHash:TEpochTagextends"latest_state"?false:trueextendstrue?null:`0x${string}`;chainId:number;contractCreated:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;data:`0x${string}`;epochHeight:bigint|null;from:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;gas:bigint;gasPrice?:undefined;hash:`0x${string}`;maxFeePerGas:bigint;maxPriorityFeePerGas:bigint;nonce:number;r:`0x${string}`;s:`0x${string}`;status:bigint|null;storageLimit:bigint;to:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;transactionIndex:number|null;type:"eip1559";v:bigint;value:bigint;yParity?:undefined; })[] :`0x${string}`[];transactionsRoot:`0x${string}`; }>
Returns information about a block, identified by its hash or number or tag
- JSON-RPC Methods:
- Calls
cfx_getblockbyhash - Calls
cfx_getBlockByEpochNumber - Calls
cfx_getBlockByBlockNumber
Type Parameters
TIncludeTransactions
TIncludeTransactions extends boolean = false
TEpochTag
TEpochTag extends "latest_state" | "earliest" | "latest_checkpoint" | "latest_confirmed" | "latest_mined" = "latest_state"
Parameters
args?
GetBlockParameters<TIncludeTransactions, TEpochTag>
GetBlockParameters
Returns
Promise<{ adaptive: boolean; baseFeePerGas: TEpochTag extends "earliest" | "latest_checkpoint" ? null : bigint; blame: bigint; blockNumber: bigint; custom: `0x${string}`[]; deferredLogsBloomHash: `0x${string}`; deferredReceiptsRoot: `0x${string}`; difficulty: bigint; epochNumber: bigint; gasLimit: bigint; gasUsed: TEpochTag extends "earliest" | "latest_checkpoint" | "latest_mined" ? null : bigint; hash: `0x${string}`; height: bigint; miner: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; nonce: TEpochTag extends "latest_checkpoint" | "latest_mined" ? null : `0x${string}`; parentHash: `0x${string}`; posReference: TEpochTag extends "earliest" | "latest_checkpoint" ? null : `0x${string}`; powQuality: TEpochTag extends "latest_checkpoint" | "latest_mined" ? null : `0x${string}`; refereeHashes: `0x${string}`[]; size: bigint; timestamp: bigint; transactions: TIncludeTransactions extends true ? ({ accessList?: undefined; blockHash: TEpochTag extends "latest_state" ? false : true extends true ? null : `0x${string}`; chainId?: number; contractCreated: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; data: `0x${string}`; epochHeight: bigint | null; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas: bigint; gasPrice: bigint; hash: `0x${string}`; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; status: bigint | null; storageLimit: bigint; to: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; transactionIndex: number | null; type: "legacy"; v: bigint; value: bigint; yParity?: undefined; } | { accessList: AccessList; blockHash: TEpochTag extends "latest_state" ? false : true extends true ? null : `0x${string}`; chainId: number; contractCreated: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; data: `0x${string}`; epochHeight: bigint | null; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas: bigint; gasPrice: bigint; hash: `0x${string}`; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; status: bigint | null; storageLimit: bigint; to: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; transactionIndex: number | null; type: "eip2930"; v: bigint; value: bigint; yParity?: undefined; } | { accessList: AccessList; blockHash: TEpochTag extends "latest_state" ? false : true extends true ? null : `0x${string}`; chainId: number; contractCreated: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; data: `0x${string}`; epochHeight: bigint | null; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; status: bigint | null; storageLimit: bigint; to: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; transactionIndex: number | null; type: "eip1559"; v: bigint; value: bigint; yParity?: undefined; })[] : `0x${string}`[]; transactionsRoot: `0x${string}`; }>
GetBlockReturnType
getBlockByHashWithPivotAssumption()
getBlockByHashWithPivotAssumption: (
args) =>Promise<GetBlockByHashWithPivotAssumptionReturnType>
Returns the requested block if the provided pivot hash is correct, returns an error otherwise.
- JSON-RPC Method:
cfx_getBlockByHashWithPivotAssumption
Parameters
args
GetBlockByHashWithPivotAssumptionParameters
GetBlockByHashWithPivotAssumptionParameters
Returns
Promise<GetBlockByHashWithPivotAssumptionReturnType>
- GetBlockByHashWithPivotAssumptionReturnType
getBlockRewardInfo()
getBlockRewardInfo: (
args?) =>Promise<GetBlockRewardInfoReturnType>
Returns the reward info for all executed blocks in the specified epoch.
- JSON-RPC Method:
cfx_getBlockRewardInfo
Parameters
args?
GetBlockRewardInfoParameters
GetBlockRewardInfoParameters
Returns
Promise<GetBlockRewardInfoReturnType>
array of reward info objects GetBlockRewardInfoReturnType
getBlocksByEpoch()
getBlocksByEpoch: (
args?) =>Promise<GetBlocksByEpochReturnType>
Returns the block hashes in the specified epoch.
- JSON-RPC Methods:
cfx_getBlocksByEpoch
Parameters
args?
GetBlocksByEpochParameters
GetBlocksByEpochParameters
Returns
Promise<GetBlocksByEpochReturnType>
- GetBlocksByEpochReturnType
getChainId()
getChainId: () =>
Promise<number>
get chain id (call the getStatus method to get the chain id)
Returns
Promise<number>
- GetChainIdReturnType
getClientVersion()
getClientVersion: () =>
Promise<string>
Returns the conflux-rust version.
- JSON-RPC Method:
cfx_clientVersion
Returns
Promise<string>
- GetClientVersionReturnType
getCode()
getCode: (
args) =>Promise<GetCodeReturnType>
Returns the code of the specified contract. If contract not exist will return 0x
- JSON-RPC Methods:
cfx_getCode
Parameters
args
GetCodeParameters
GetCodeParameters
Returns
Promise<GetCodeReturnType>
byte code of the contract, or 0x if the account has no code. GetCodeReturnType
getCollateralForStorage()
getCollateralForStorage: (
args) =>Promise<bigint>
Returns the size of the collateral storage of a given address, in bytes.
- JSON-RPC Methods:
cfx_getCollateralForStorage
Parameters
args
GetCollateralForStorageParameters
GetCollateralForStorageParameters
Returns
Promise<bigint>
-integer of the collateral storage in Byte. GetCollateralForStorageReturnType
getCollateralInfo()
getCollateralInfo: (
args?) =>Promise<GetCollateralInfoReturnType>
Returns current chain collateral status info.
- JSON-RPC Method:
cfx_getCollateralInfo
Parameters
args?
GetCollateralInfoParameters
GetCollateralInfoParameters
Returns
Promise<GetCollateralInfoReturnType>
- GetCollateralForStorageReturnType
getConfirmationRiskByHash()
getConfirmationRiskByHash: (
args) =>Promise<GetConfirmationRiskByHashReturnType>
Returns the confirmation risk of a given block, identified by its hash.
- JSON-RPC Method:
cfx_getConfirmationRiskByHash
Parameters
args
GetConfirmationRiskByHashParameters
the block hash. GetConfirmationRiskByHashParameters
Returns
Promise<GetConfirmationRiskByHashReturnType>
the integer confirmation risk, or undefined if the block does not exist. GetConfirmationRiskByHashReturnType
getContractEvents()
getContractEvents: <
abi,eventName,strict>(args) =>Promise<GetContractEventsReturnType<abi,eventName,strict>>
Type Parameters
abi
abi extends Abi | readonly unknown[]
eventName
eventName extends string | undefined = undefined
strict
strict extends boolean | undefined = undefined
Parameters
args
GetContractEventsParameters<abi, eventName, strict>
GetContractEventsParameters
Returns
Promise<GetContractEventsReturnType<abi, eventName, strict>>
- GetContractEventsReturnType
getDepositList()
getDepositList: (
args) =>Promise<GetDepositListReturnType>
Returns the deposit list of the given account, identified by its address.
- JSON-RPC Method:
cfx_getDepositList
Parameters
args
GetDepositListParameters
GetDepositListParameters
Returns
Promise<GetDepositListReturnType>
- GetDepositListReturnType
getEpochNumber()
getEpochNumber: (
args?) =>Promise<bigint>
Returns the epoch number corresponding to the given tag.
- JSON-RPC Methods:
cfx_epochNumber
Parameters
args?
GetEpochNumberParameters
GetEpochNumberParameters
Returns
Promise<bigint>
GetEpochNumberReturnType
getEpochReceipts()
getEpochReceipts: (
args?) =>Promise<GetEpochReceiptsReturnType>
Get one epoch’s all receipts in one RPC call
- JSON-RPC Method:
cfx_getEpochReceipts
Parameters
args?
GetEpochReceiptsParameters
GetEpochReceiptsParameters
Returns
Promise<GetEpochReceiptsReturnType>
- GetEpochReceiptsReturnType
getFeeBurnt()
getFeeBurnt: () =>
Promise<bigint>
Get the total burnt tx gas fee by 1559. Added in Conflux-Rust v2.4.0.
- JSON-RPC Method:
cfx_getFeeBurnt
Returns
Promise<bigint>
- GetFeeBurntReturnType
getFeeHistory()
getFeeHistory: (
args) =>Promise<GetFeeHistoryReturnType>
Returns transaction base fee per gas and effective priority fee per gas for the requested/supported epoch range.
- JSON-RPC Method:
cfx_feeHistory
Parameters
args
GetFeeHistoryParameters
Returns
Promise<GetFeeHistoryReturnType>
getFilterChanges()
getFilterChanges: (
args) =>Promise<GetFilterChangesReturnType>
Get filter changes since last retrieve. Return value depends on which type of filter id is provided. Filter id can be returned from current RPCs: cfx_newFilter: new logs generated from newly executed transactions matching the filter. Noting that from* fields will be ignored by this RPC. cfx_newBlockFilter: new executed blocks. cfx_newPendingTransactionFilter: new pending transactions which are ready to execute.
Parameters
args
GetFilterChangesParameters
GetFilterChangesParameters
Returns
Promise<GetFilterChangesReturnType>
- GetFilterChangesReturnType
getFilterLogs()
getFilterLogs: <
abi,eventName,strict>(args) =>Promise<GetFilterLogsReturnType<abi,eventName,strict>>
Returns all logs matching the log filter (Unlike cfx_getFilterChanges, from* fields still work).
- JSON-RPC Method:
cfx_getFilterLogs
Type Parameters
abi
abi extends Abi | readonly unknown[] | undefined
eventName
eventName extends string | undefined
strict
strict extends boolean | undefined = undefined
Parameters
args
GetFilterLogsParameters<abi, eventName, strict>
GetFilterLogsParameters
Returns
Promise<GetFilterLogsReturnType<abi, eventName, strict>>
- GetFilterLogsReturnType
getGasPrice()
getGasPrice: () =>
Promise<bigint>
Returns the current price per gas in Drip.
- JSON-RPC Method:
cfx_gasprice
Returns
Promise<bigint>
integer of the current gas price in Drip. GetGasPriceReturnType
getInterestRate()
getInterestRate: (
args) =>Promise<bigint>
Returns the interest rate at the given epoch.
-JSON-RPC Method: cfx_getInterestRate
Parameters
args
GetInterestRateParameters
GetInterestRateParameters
Returns
Promise<bigint>
the interest rate at the given epoch. GetInterestRateReturnType
getLogs()
getLogs: <
abiEvent,abiEvents,strict>(args?) =>Promise<GetLogsReturnType<abiEvent,abiEvents,strict>>
Returns logs matching the filter provided.
- JSON-RPC Method:
cfx_getLogs
Type Parameters
abiEvent
abiEvent extends AbiEvent | undefined = undefined
abiEvents
abiEvents extends readonly unknown[] | readonly AbiEvent[] | undefined = abiEvent extends AbiEvent ? [abiEvent] : undefined
strict
strict extends boolean | undefined = undefined
Parameters
args?
GetLogsParameters<abiEvent, abiEvents, strict>
GetLogsParameters
Returns
Promise<GetLogsReturnType<abiEvent, abiEvents, strict>>
- GetLogsReturnType
getNextNonce()
getNextNonce: (
args) =>Promise<number>
Returns the next nonce that should be used by the given account when sending a transaction.
- JSON-RPC Method:
cfx_getNextNonce
Parameters
args
GetNextNonceParameters
GetNextNonceParameters
Returns
Promise<number>
- integer of the next nonce that should be used by the given address.
getParamsFromVote()
getParamsFromVote: (
args?) =>Promise<GetParamsFormVoteReturnType>
Returns DAO vote params info
- JSON-RPC Method:
cfx_getParamsFromVote
Parameters
args?
GetParamsFormVoteParameters
GetParamsFormVoteParameters
Returns
Promise<GetParamsFormVoteReturnType>
- GetParamsFormVoteReturnType
getPoSAccount()
getPoSAccount: (
args) =>Promise<GetPoSAccountReturnType>
Get the PoS account information
- JSON-RPC Method:
pos_getAccount
Parameters
args
GetPoSAccountParameters
GetPoSAccountParameters
Returns
Promise<GetPoSAccountReturnType>
- GetPoSAccountReturnType
getPoSBlock()
getPoSBlock: (
args?) =>Promise<GetPosBlockReturnType>
Get block information by its hash value
- JSON-RPC Method:
pos_getBlockByHash - JSON-RPC Method:
pos_getBlockByNumber
Parameters
args?
GetPoSBlockParameters
GetPosBlockParameters
Returns
Promise<GetPosBlockReturnType>
- GetPosBlockReturnType
getPoSCommittee()
getPoSCommittee: (
args?) =>Promise<GetPoSCommitteeReturnType>
Get the current PoS committee information in default. It is also able to get the committee information for a block in history by specifying the blockNumber.Parameters
- JSON-RPC Method:
pos_getCommittee
Parameters
args?
GetPoSCommitteeParameters
GetPoSCommitteeParameters
Returns
Promise<GetPoSCommitteeReturnType>
- GetPoSCommitteeReturnType
getPoSEconomics()
getPoSEconomics: (
args?) =>Promise<GetPoSEconomicsReturnType>
Returns PoS economics summary info.
- JSON-RPC Method:
cfx_getPoSEconomics
Parameters
args?
GetPoSEconomicsParameters
GetPoSEconomicsParameters
Returns
Promise<GetPoSEconomicsReturnType>
- GetPoSEconomicsReturnType
getPoSRewardByEpoch()
getPoSRewardByEpoch: (
args) =>Promise<GetPoSRewardByEpochReturnType>
Get rewards information of a PoS epoch by it’s correspond PoW epoch number. Only PoW epoch happen’s at PoS epoch end will have rewards information. Others will return undefined.
- JSON-RPC Method:
cfx_getPoSRewardByEpoch
Parameters
args
GetPoSRewardByEpochParameters
GetPoSRewardByEpochParameters
Returns
Promise<GetPoSRewardByEpochReturnType>
- GetPoSRewardByEpochReturnType
getPoSRewards()
getPoSRewards: (
args) =>Promise<GetPoSRewardsReturnType>
returns the rewards information of a PoS epoch
- JSON-RPC Method:
pos_getRewardsByEpoch
Parameters
args
GetPoSRewardsParameters
GetPoSRewardsParameters
Returns
Promise<GetPoSRewardsReturnType>
- GetPoSRewardsReturnType
getPoSStatus()
getPoSStatus: () =>
Promise<GetPoSStatusReturnType>
Returns the current status of the PoS chain
- JSON-RPC Method:
pos_getStatus
Returns
Promise<GetPoSStatusReturnType>
- GetPoSStatusReturnType
getPoSTransactionByNumber()
getPoSTransactionByNumber: (
args) =>Promise<GetPoSTransactionReturnType>
Get the transaction information by transaction number
- JSON-RPC Method:
pos_getTransactionByNumber
Parameters
args
GetPoSTransactionParameters
GetPoSTransactionParameters
Returns
Promise<GetPoSTransactionReturnType>
- GetPoSTransactionReturnType
getSkippedBlocksByEpoch()
getSkippedBlocksByEpoch: (
args?) =>Promise<GetSkippedBlocksByEpochReturnType>
Returns the list of non-executed blocks in an epoch. By default, Conflux only executes the last 200 blocks in each epoch (note that under normal circumstances, epochs should be much smaller).
- JSON-RPC Method:
cfx_getSkippedBlocksByEpoch
Parameters
args?
GetSkippedBlocksByEpochParameters
GetSkippedBlocksByEpochParameters
Returns
Promise<GetSkippedBlocksByEpochReturnType>
Array of block hashes GetSkippedBlocksByEpochReturnType
getSponsorInfo()
getSponsorInfo: (
args) =>Promise<GetSponsorInfoReturnType>
Returns the sponsor info of a given contract.
- JSON-RPC Method:
cfx_getSponsorInfo
Parameters
args
GetSponsorInfoParameters
GetSponsorInfoParameters
Returns
Promise<GetSponsorInfoReturnType>
-A sponsor info object. If the contract doesn’t have a sponsor, then all fields in the object returned will be 0 GetSponsorInfoReturnType
getStakingBalance()
getStakingBalance: (
args) =>Promise<bigint>
Returns the stacking balance of the given account, identified by its address.
-JSON-RPC Methods: cfx_getStakingBalance
Parameters
args
GetStakingBalanceParameters
GetStakingBalanceParameters
Returns
Promise<bigint>
Returns the stacking balance of the given account, identified by its address. GetStakingBalanceReturnType
getStatus()
getStatus: () =>
Promise<GetStatusReturnType>
Returns the node status.
- JSON-RPC Method:
cfx_getStatus
Returns
Promise<GetStatusReturnType>
- GetStatusReturnType
getStorageAt()
getStorageAt: (
args) =>Promise<GetStorageAtReturnType>
Returns storage entries from a given contract.
- JSON-RPC Methods:
cfx_getStorageAt
Parameters
args
GetStorageAtParameters
GetStorageAtParameters
Returns
Promise<GetStorageAtReturnType>
the contents of the storage position, or null if the contract does not exist. GetStorageAtReturnType
getStorageRoot()
getStorageRoot: (
args) =>Promise<GetStorageRootReturnType>
Returns the storage root of a given contract.
- JSON-RPC Methods:
cfx_getStorageRoot
Parameters
args
GetStorageRootParameters
GetStorageRootParameters
Returns
Promise<GetStorageRootReturnType>
- GetStorageRootReturnType
getSupplyInfo()
getSupplyInfo: () =>
Promise<GetSupplyInfoReturnType>
Returns summary supply info of the entire chain.
- JSON-RPC Method:
cfx_getSupplyInfo
Returns
Promise<GetSupplyInfoReturnType>
- GetSupplyInfoReturnType
getTransaction()
getTransaction: (
args) =>Promise<{accessList?:undefined;blockHash:`0x${string}`;chainId?:number;contractCreated:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;data:`0x${string}`;epochHeight:bigint|null;from:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;gas:bigint;gasPrice:bigint;hash:`0x${string}`;maxFeePerGas?:undefined;maxPriorityFeePerGas?:undefined;nonce:number;r:`0x${string}`;s:`0x${string}`;status:bigint|null;storageLimit:bigint;to:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;transactionIndex:number|null;type:"legacy";v:bigint;value:bigint;yParity?:undefined; } | {accessList:AccessList;blockHash:`0x${string}`;chainId:number;contractCreated:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;data:`0x${string}`;epochHeight:bigint|null;from:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;gas:bigint;gasPrice:bigint;hash:`0x${string}`;maxFeePerGas?:undefined;maxPriorityFeePerGas?:undefined;nonce:number;r:`0x${string}`;s:`0x${string}`;status:bigint|null;storageLimit:bigint;to:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;transactionIndex:number|null;type:"eip2930";v:bigint;value:bigint;yParity?:undefined; } | {accessList:AccessList;blockHash:`0x${string}`;chainId:number;contractCreated:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;data:`0x${string}`;epochHeight:bigint|null;from:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`;gas:bigint;gasPrice?:undefined;hash:`0x${string}`;maxFeePerGas:bigint;maxPriorityFeePerGas:bigint;nonce:number;r:`0x${string}`;s:`0x${string}`;status:bigint|null;storageLimit:bigint;to:`CFX:TYPE.USER:${string}`|`CFX:TYPE.CONTRACT:${string}`|`CFX:TYPE.BUILTIN:${string}`|`CFX:TYPE.NULL:${string}`|`CFXTEST:TYPE.USER:${string}`|`CFXTEST:TYPE.CONTRACT:${string}`|`CFXTEST:TYPE.BUILTIN:${string}`|`CFXTEST:TYPE.NULL:${string}`|`NET${string}:TYPE.USER:${string}`|`NET${string}:TYPE.CONTRACT:${string}`|`NET${string}:TYPE.BUILTIN:${string}`|`NET${string}:TYPE.NULL:${string}`|`cfx:${string}`|`cfxtest:${string}`|`net${string}:${string}`|null;transactionIndex:number|null;type:"eip1559";v:bigint;value:bigint;yParity?:undefined; }>
Returns information about a transaction, identified by its hash.
- Docs: https://doc.confluxnetwork.org/docs/core/build/json-rpc/cfx-namespace#cfx_gettransactionbyhash
Parameters
args
GetTransactionParameters
GetTransactionParameters
Returns
Promise<{ accessList?: undefined; blockHash: `0x${string}`; chainId?: number; contractCreated: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; data: `0x${string}`; epochHeight: bigint | null; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas: bigint; gasPrice: bigint; hash: `0x${string}`; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; status: bigint | null; storageLimit: bigint; to: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; transactionIndex: number | null; type: "legacy"; v: bigint; value: bigint; yParity?: undefined; } | { accessList: AccessList; blockHash: `0x${string}`; chainId: number; contractCreated: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; data: `0x${string}`; epochHeight: bigint | null; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas: bigint; gasPrice: bigint; hash: `0x${string}`; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce: number; r: `0x${string}`; s: `0x${string}`; status: bigint | null; storageLimit: bigint; to: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; transactionIndex: number | null; type: "eip2930"; v: bigint; value: bigint; yParity?: undefined; } | { accessList: AccessList; blockHash: `0x${string}`; chainId: number; contractCreated: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; data: `0x${string}`; epochHeight: bigint | null; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas: bigint; gasPrice?: undefined; hash: `0x${string}`; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; nonce: number; r: `0x${string}`; s: `0x${string}`; status: bigint | null; storageLimit: bigint; to: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; transactionIndex: number | null; type: "eip1559"; v: bigint; value: bigint; yParity?: undefined; }>
GetTransactionReturnType
getTransactionReceipt()
getTransactionReceipt: (
args) =>Promise<TransactionReceipt>
Returns a transaction receipt, identified by the corresponding transaction hash.
- JSON-RPC Method:
cfx_getTransactionReceipt
Parameters
args
GetTransactionReceiptParameters
GetTransactionReceiptParameters
Returns
Promise<TransactionReceipt>
a transaction receipt object, or null when no transaction was found or the transaction was not executed yet: GetTransactionReceiptReturnType
getTxPoolNextNonce()
getTxPoolNextNonce: (
args) =>Promise<number>
These RPC methods require node’s public_rpc_apis config set to safe or all, or the namespace include txpool Return one address’s next usable nonce in transaction pool.
- JSON-RPC Method:
txpool_nextNonce
Parameters
args
GetTxPoolNextNonceParameters
GetTxPoolNextNonceParameters
Returns
Promise<number>
- GetTxPoolNextNonceReturnType
getVoteList()
getVoteList: (
args) =>Promise<GetVoteListReturnType>
Returns the vote list of the given account, identified by its address.
- JSON-RPC Method:
cfx_getVoteList
Parameters
args
GetVoteListParameters
GetDepositListParameters
Returns
Promise<GetVoteListReturnType>
-array of vote info object GetDepositListReturnType
key
key:
string
A key for the client.
multicall()
multicall: <
contracts,allowFailure>(args) =>Promise<MulticallReturnType<contracts,allowFailure>>
Similar to [readContract] but batches up multiple functions on a contract in a single RPC call via the multicall3 contract.
Type Parameters
contracts
contracts extends readonly unknown[]
allowFailure
allowFailure extends boolean = true
Parameters
args
MulticallParameters<contracts, allowFailure>
MulticallParameters
Returns
Promise<MulticallReturnType<contracts, allowFailure>>
- MulticallReturnType
name
name:
string
A name for the client.
pollingInterval
pollingInterval:
number
Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds.
readContract()
readContract: <
abi,functionName,args>(args) =>Promise<ReadContractReturnType<abi,functionName,args>>
Type Parameters
abi
abi extends Abi | readonly unknown[]
functionName
functionName extends string
args
args extends unknown
Parameters
args
ReadContractParameters<abi, functionName, args>
ReadContractParameters
Returns
Promise<ReadContractReturnType<abi, functionName, args>>
The response from the contract. Type is inferred. ReadContractReturnType
request
request:
EIP1193RequestFn<PublicRpcSchema>
Request function wrapped with friendly error handling
sendRawTransaction()
sendRawTransaction: (
args) =>Promise<`0x${string}`>
Sends a signed transaction into the network for processing.
- JSON-RPC Method:
cfx_sendRawTransaction
Parameters
args
SendRawTransactionParameters
SendRawTransactionParameters
Returns
Promise<`0x${string}`>
- SendRawTransactionReturnType
simulateContract()
simulateContract: <
abi,functionName,args,chainOverride,accountOverride>(args) =>Promise<SimulateContractReturnType<abi,functionName,args,Chain|undefined,Account|undefined,chainOverride,accountOverride>>
Type Parameters
abi
abi extends Abi | readonly unknown[]
functionName
functionName extends string
args
args extends unknown
chainOverride
chainOverride extends Chain | undefined
accountOverride
accountOverride extends `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | Account | undefined = undefined
Parameters
args
SimulateContractParameters<abi, functionName, args, Chain | undefined, chainOverride, accountOverride>
SimulateContractParameters
Returns
Promise<SimulateContractReturnType<abi, functionName, args, Chain | undefined, Account | undefined, chainOverride, accountOverride>>
- SimulateContractReturnType
traceBlock()
traceBlock: (
args) =>Promise<TraceBlockReturnType>
Get block traces by block hash
-JSON-RPC Method: trace_block
Parameters
args
TraceBlockParameters
Returns
Promise<TraceBlockReturnType>
traceTransaction()
traceTransaction: (
args) =>Promise<TraceTransactionReturnType>
Get transaction’s trace by it’s hash
- JSON-RPC Method:
trace_transaction
Parameters
args
TraceTransactionParameters
TraceTransactionParameters
Returns
Promise<TraceTransactionReturnType>
- TraceTransactionReturnType
transport
transport:
TransportConfig<string,EIP1193RequestFn> &Record<string,any>
The RPC transport
type
type:
string
The type of client.
uid
uid:
string
A unique ID for the client.
uninstallFilter()
uninstallFilter: (
args) =>Promise<boolean>
Uninstall the specified filter. Returns a bool whether the uninstallation succeeds.
- JSON-RPC Method:
cfx_uninstallFilter
Parameters
args
UninstallFilterParameters
UninstallFilterParameters
Returns
Promise<boolean>
- UninstallFilterReturnType
verifyMessage()
verifyMessage: (
args) =>Promise<boolean>
Verify that a message was signed by the provided address.
Parameters
args
VerifyMessageParameters
VerifyMessageParameters
Returns
Promise<boolean>
- VerifyMessageReturnType
verifyTypedData()
verifyTypedData: (
args) =>Promise<boolean>
Verify that typed data was signed by the provided address.
Parameters
args
VerifyTypedDataParameters
Returns
Promise<boolean>
Whether or not the signature is valid. VerifyTypedDataReturnType
waitForTransactionReceipt()
waitForTransactionReceipt: (
args) =>Promise<TransactionReceipt>
Parameters
args
WaitForTransactionReceiptParameters
WaitForTransactionReceiptParameters
Returns
Promise<TransactionReceipt>
- WaitForTransactionReceiptReturnType
watchEpochNumber()
watchEpochNumber: (
args) =>WatchEpochNumberReturnType
Parameters
args
WatchEpochNumberParameters
WatchEpochNumberParameters
Returns
WatchEpochNumberReturnType
- WatchEpochNumberReturnType
civeWalletClient
Get Signature
get civeWalletClient():
object
Defined in: packages/core/src/clients/core.ts:878
Access the underlying cive WalletClient for advanced operations.
Returns
account
account:
Account|undefined
The Account of the Client.
addChain()
addChain: (
args) =>Promise<void>
Parameters
args
AddChainParameters
Returns
Promise<void>
batch?
optionalbatch:object
Flags for batch settings.
batch.multicall?
optionalmulticall:boolean| {batchSize?:number;wait?:number; }
Toggle to enable eth_call multicall aggregation.
Type Declaration
boolean
{ batchSize?: number; wait?: number; }
cacheTime
cacheTime:
number
Time (in ms) that cached data will remain in memory.
ccipRead?
optionalccipRead:false| {request?: (parameters) =>Promise<`0x${string}`>; }
CCIP Read configuration.
Type Declaration
false
{ request?: (parameters) => Promise<`0x${string}`>; }
chain
chain:
Chain|undefined
Chain for the client.
deployContract()
deployContract: <
abi,chainOverride>(args) =>Promise<`0x${string}`>
Type Parameters
abi
abi extends Abi | readonly unknown[]
chainOverride
chainOverride extends Chain | undefined
Parameters
args
DeployContractParameters<abi, Chain | undefined, Account | undefined, chainOverride>
Returns
Promise<`0x${string}`>
extend()
extend: <
client>(fn) =>Client<Transport,Chain|undefined,Account|undefined,WalletRpcSchema, { [K in string | number | symbol]: client[K] } &WalletActions<Chain|undefined,Account|undefined>>
Type Parameters
client
client extends object & ExactPartial<ExtendableProtectedActions<Transport, Chain | undefined, Account | undefined>>
Parameters
fn
(client) => client
Returns
Client<Transport, Chain | undefined, Account | undefined, WalletRpcSchema, { [K in string | number | symbol]: client[K] } & WalletActions<Chain | undefined, Account | undefined>>
getAddresses()
getAddresses: () =>
Promise<GetAddressesReturnType>
Returns
Promise<GetAddressesReturnType>
getChainId()
getChainId: () =>
Promise<number>
Returns
Promise<number>
getPermissions()
getPermissions: () =>
Promise<GetPermissionsReturnType>
Returns
Promise<GetPermissionsReturnType>
key
key:
string
A key for the client.
name
name:
string
A name for the client.
pollingInterval
pollingInterval:
number
Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds.
prepareTransactionRequest()
prepareTransactionRequest: <
TRequest,TChainOverride,TAccountOverride>(args) =>Promise<{ [K in string | number | symbol]: UnionRequiredBy<Extract<UnionOmit<ExtractChainFormatterParameters<(…), (…), (…)>, “from”> & (DeriveChain<(…), (…)> extends Chain ? { chain: … } : { chain?: … }) & (DeriveAccount<(…), (…)> extends Account ? { account: …; from: … } : { account?: …; from?: … }), IsNever<(…) | (…) | (…)> extends true ? unknown : ExactPartial<(…) | (…) | (…)>> & { chainId?: number }, ParameterTypeToParameters<TRequest[“parameters”] extends readonly PrepareTransactionRequestParameterType[] ? any[any][number] : “type” | “gas” | “nonce” | “storageLimit” | “epochHeight” | “chainId” | “fees”>>[K] }>
Type Parameters
TRequest
TRequest extends Omit<{ accessList?: undefined; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "legacy"; value?: bigint; }, "from"> | Omit<{ accessList?: AccessList; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "eip2930"; value?: bigint; }, "from"> | Omit<{ accessList?: AccessList; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: undefined; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "eip1559"; value?: bigint; }, "from"> & object & object
TChainOverride
TChainOverride extends Chain | undefined = undefined
TAccountOverride
TAccountOverride extends `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | Account | undefined = undefined
Parameters
args
PrepareTransactionRequestParameters<Chain | undefined, Account | undefined, TChainOverride, TAccountOverride, TRequest>
Returns
Promise<{ [K in string | number | symbol]: UnionRequiredBy<Extract<UnionOmit<ExtractChainFormatterParameters<(…), (…), (…)>, “from”> & (DeriveChain<(…), (…)> extends Chain ? { chain: … } : { chain?: … }) & (DeriveAccount<(…), (…)> extends Account ? { account: …; from: … } : { account?: …; from?: … }), IsNever<(…) | (…) | (…)> extends true ? unknown : ExactPartial<(…) | (…) | (…)>> & { chainId?: number }, ParameterTypeToParameters<TRequest[“parameters”] extends readonly PrepareTransactionRequestParameterType[] ? any[any][number] : “type” | “gas” | “nonce” | “storageLimit” | “epochHeight” | “chainId” | “fees”>>[K] }>
request
request:
EIP1193RequestFn<WalletRpcSchema>
Request function wrapped with friendly error handling
requestAddresses()
requestAddresses: () =>
Promise<RequestAddressesReturnType>
Returns
Promise<RequestAddressesReturnType>
requestPermissions()
requestPermissions: (
args) =>Promise<RequestPermissionsReturnType>
Parameters
args
cfx_accounts
Record<string, any>
Returns
Promise<RequestPermissionsReturnType>
sendRawTransaction()
sendRawTransaction: (
args) =>Promise<`0x${string}`>
Parameters
args
SendRawTransactionParameters
Returns
Promise<`0x${string}`>
sendTransaction()
sendTransaction: (
args) =>Promise<`0x${string}`>
Parameters
args
SendTransactionParameters<Chain | undefined, Account | undefined>
Returns
Promise<`0x${string}`>
signMessage()
signMessage: (
args) =>Promise<`0x${string}`>
Parameters
args
SignMessageParameters<Account | undefined>
Returns
Promise<`0x${string}`>
signTransaction()
signTransaction: <
request>(args) =>Promise<TransactionSerialized<GetTransactionType<request,requestextendsLegacyProperties|MatchKeys<TransactionSerializableLegacy,request> |MatchKeys<TransactionRequestLegacy,request> ?"legacy":never|requestextendsEIP1559Properties|MatchKeys<TransactionSerializableEIP1559,request> |MatchKeys<TransactionRequestEIP1559,request> ?"eip1559":never|requestextendsEIP2930Properties|MatchKeys<TransactionSerializableEIP2930,request> |MatchKeys<TransactionRequestEIP2930,request> ?"eip2930":never|request["type"] extendsstring|undefined?Extract<any[any],string> :never>,GetTransactionType<request,requestextendsLegacyProperties|MatchKeys<…, …> |MatchKeys<…, …> ?"legacy":never|requestextendsEIP1559Properties|MatchKeys<…, …> |MatchKeys<…, …> ?"eip1559":never|requestextendsEIP2930Properties|MatchKeys<…, …> |MatchKeys<…, …> ?"eip2930":never|request["type"] extendsstring|undefined?Extract<any[any],string> :never> extends"eip1559"?`0x02${string}`:never|GetTransactionType<request,requestextendsLegacyProperties|MatchKeys<…, …> |MatchKeys<…, …> ?"legacy":never|requestextendsEIP1559Properties|MatchKeys<…, …> |MatchKeys<…, …> ?"eip1559":never|requestextendsEIP2930Properties|MatchKeys<…, …> |MatchKeys<…, …> ?"eip2930":never|request["type"] extendsstring|undefined?Extract<any[any],string> :never> extends"eip2930"?`0x01${string}`:never|GetTransactionType<request,requestextendsLegacyProperties|MatchKeys<…, …> |MatchKeys<…, …> ?"legacy":never|requestextendsEIP1559Properties|MatchKeys<…, …> |MatchKeys<…, …> ?"eip1559":never|requestextendsEIP2930Properties|MatchKeys<…, …> |MatchKeys<…, …> ?"eip2930":never|request["type"] extendsstring|undefined?Extract<any[any],string> :never> extends"legacy"?TransactionSerializedLegacy:never>>
Type Parameters
request
request extends Omit<{ accessList?: undefined; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "legacy"; value?: bigint; }, "from"> | Omit<{ accessList?: AccessList; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "eip2930"; value?: bigint; }, "from"> | Omit<{ accessList?: AccessList; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: undefined; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "eip1559"; value?: bigint; }, "from"> = Omit<{ accessList?: undefined; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "legacy"; value?: bigint; }, "from"> | Omit<{ accessList?: AccessList; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: bigint; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "eip2930"; value?: bigint; }, "from"> | Omit<{ accessList?: AccessList; data?: `0x${string}`; epochHeight?: bigint; from: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}`; gas?: bigint; gasPrice?: undefined; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; storageLimit?: bigint; to?: `CFX:TYPE.USER:${string}` | `CFX:TYPE.CONTRACT:${string}` | `CFX:TYPE.BUILTIN:${string}` | `CFX:TYPE.NULL:${string}` | `CFXTEST:TYPE.USER:${string}` | `CFXTEST:TYPE.CONTRACT:${string}` | `CFXTEST:TYPE.BUILTIN:${string}` | `CFXTEST:TYPE.NULL:${string}` | `NET${string}:TYPE.USER:${string}` | `NET${string}:TYPE.CONTRACT:${string}` | `NET${string}:TYPE.BUILTIN:${string}` | `NET${string}:TYPE.NULL:${string}` | `cfx:${string}` | `cfxtest:${string}` | `net${string}:${string}` | null; type?: "eip1559"; value?: bigint; }, "from">
Parameters
args
SignTransactionParameters<Chain | undefined, Account | undefined, request>
Returns
Promise<TransactionSerialized<GetTransactionType<request, request extends LegacyProperties | MatchKeys<TransactionSerializableLegacy, request> | MatchKeys<TransactionRequestLegacy, request> ? "legacy" : never | request extends EIP1559Properties | MatchKeys<TransactionSerializableEIP1559, request> | MatchKeys<TransactionRequestEIP1559, request> ? "eip1559" : never | request extends EIP2930Properties | MatchKeys<TransactionSerializableEIP2930, request> | MatchKeys<TransactionRequestEIP2930, request> ? "eip2930" : never | request["type"] extends string | undefined ? Extract<any[any], string> : never>, GetTransactionType<request, request extends LegacyProperties | MatchKeys<…, …> | MatchKeys<…, …> ? "legacy" : never | request extends EIP1559Properties | MatchKeys<…, …> | MatchKeys<…, …> ? "eip1559" : never | request extends EIP2930Properties | MatchKeys<…, …> | MatchKeys<…, …> ? "eip2930" : never | request["type"] extends string | undefined ? Extract<any[any], string> : never> extends "eip1559" ? `0x02${string}` : never | GetTransactionType<request, request extends LegacyProperties | MatchKeys<…, …> | MatchKeys<…, …> ? "legacy" : never | request extends EIP1559Properties | MatchKeys<…, …> | MatchKeys<…, …> ? "eip1559" : never | request extends EIP2930Properties | MatchKeys<…, …> | MatchKeys<…, …> ? "eip2930" : never | request["type"] extends string | undefined ? Extract<any[any], string> : never> extends "eip2930" ? `0x01${string}` : never | GetTransactionType<request, request extends LegacyProperties | MatchKeys<…, …> | MatchKeys<…, …> ? "legacy" : never | request extends EIP1559Properties | MatchKeys<…, …> | MatchKeys<…, …> ? "eip1559" : never | request extends EIP2930Properties | MatchKeys<…, …> | MatchKeys<…, …> ? "eip2930" : never | request["type"] extends string | undefined ? Extract<any[any], string> : never> extends "legacy" ? TransactionSerializedLegacy : never>>
signTypedData()
signTypedData: <
TTypedData,TPrimaryType>(args) =>Promise<`0x${string}`>
Type Parameters
TTypedData
TTypedData extends {[key: string]: readonly TypedDataParameter[];
[key: `string[${string}]`]: undefined;
[key: `function[${string}]`]: undefined;
[key: `address[${string}]`]: undefined;
[key: `bool[${string}]`]: undefined;
[key: `bytes[${string}]`]: undefined;
[key: `bytes1[${string}]`]: undefined;
[key: `bytes32[${string}]`]: undefined;
[key: `bytes31[${string}]`]: undefined;
[key: `bytes30[${string}]`]: undefined;
[key: `bytes29[${string}]`]: undefined;
[key: `bytes28[${string}]`]: undefined;
[key: `bytes27[${string}]`]: undefined;
[key: `bytes26[${string}]`]: undefined;
[key: `bytes25[${string}]`]: undefined;
[key: `bytes24[${string}]`]: undefined;
[key: `bytes23[${string}]`]: undefined;
[key: `bytes22[${string}]`]: undefined;
[key: `bytes21[${string}]`]: undefined;
[key: `bytes20[${string}]`]: undefined;
[key: `bytes19[${string}]`]: undefined;
[key: `bytes18[${string}]`]: undefined;
[key: `bytes17[${string}]`]: undefined;
[key: `bytes16[${string}]`]: undefined;
[key: `bytes15[${string}]`]: undefined;
[key: `bytes2[${string}]`]: undefined;
[key: `bytes14[${string}]`]: undefined;
[key: `bytes3[${string}]`]: undefined;
[key: `bytes13[${string}]`]: undefined;
[key: `bytes12[${string}]`]: undefined;
[key: `bytes11[${string}]`]: undefined;
[key: `bytes10[${string}]`]: undefined;
[key: `bytes9[${string}]`]: undefined;
[key: `bytes8[${string}]`]: undefined;
[key: `bytes7[${string}]`]: undefined;
[key: `bytes6[${string}]`]: undefined;
[key: `bytes5[${string}]`]: undefined;
[key: `bytes4[${string}]`]: undefined;
[key: `int[${string}]`]: undefined;
[key: `int56[${string}]`]: undefined;
[key: `int48[${string}]`]: undefined;
[key: `int40[${string}]`]: undefined;
[key: `int32[${string}]`]: undefined;
[key: `int24[${string}]`]: undefined;
[key: `int16[${string}]`]: undefined;
[key: `int8[${string}]`]: undefined;
[key: `int64[${string}]`]: undefined;
[key: `int72[${string}]`]: undefined;
[key: `int80[${string}]`]: undefined;
[key: `int88[${string}]`]: undefined;
[key: `int96[${string}]`]: undefined;
[key: `int104[${string}]`]: undefined;
[key: `int112[${string}]`]: undefined;
[key: `int120[${string}]`]: undefined;
[key: `int128[${string}]`]: undefined;
[key: `int136[${string}]`]: undefined;
[key: `int144[${string}]`]: undefined;
[key: `int152[${string}]`]: undefined;
[key: `int160[${string}]`]: undefined;
[key: `int168[${string}]`]: undefined;
[key: `int176[${string}]`]: undefined;
[key: `int184[${string}]`]: undefined;
[key: `int192[${string}]`]: undefined;
[key: `int200[${string}]`]: undefined;
[key: `int208[${string}]`]: undefined;
[key: `int216[${string}]`]: undefined;
[key: `int224[${string}]`]: undefined;
[key: `int232[${string}]`]: undefined;
[key: `int240[${string}]`]: undefined;
[key: `int248[${string}]`]: undefined;
[key: `int256[${string}]`]: undefined;
[key: `uint[${string}]`]: undefined;
[key: `uint56[${string}]`]: undefined;
[key: `uint48[${string}]`]: undefined;
[key: `uint40[${string}]`]: undefined;
[key: `uint32[${string}]`]: undefined;
[key: `uint24[${string}]`]: undefined;
[key: `uint16[${string}]`]: undefined;
[key: `uint8[${string}]`]: undefined;
[key: `uint64[${string}]`]: undefined;
[key: `uint72[${string}]`]: undefined;
[key: `uint80[${string}]`]: undefined;
[key: `uint88[${string}]`]: undefined;
[key: `uint96[${string}]`]: undefined;
[key: `uint104[${string}]`]: undefined;
[key: `uint112[${string}]`]: undefined;
[key: `uint120[${string}]`]: undefined;
[key: `uint128[${string}]`]: undefined;
[key: `uint136[${string}]`]: undefined;
[key: `uint144[${string}]`]: undefined;
[key: `uint152[${string}]`]: undefined;
[key: `uint160[${string}]`]: undefined;
[key: `uint168[${string}]`]: undefined;
[key: `uint176[${string}]`]: undefined;
[key: `uint184[${string}]`]: undefined;
[key: `uint192[${string}]`]: undefined;
[key: `uint200[${string}]`]: undefined;
[key: `uint208[${string}]`]: undefined;
[key: `uint216[${string}]`]: undefined;
[key: `uint224[${string}]`]: undefined;
[key: `uint232[${string}]`]: undefined;
[key: `uint240[${string}]`]: undefined;
[key: `uint248[${string}]`]: undefined;
[key: `uint256[${string}]`]: undefined; address?: undefined; bool?: undefined; bytes?: undefined; bytes1?: undefined; bytes10?: undefined; bytes11?: undefined; bytes12?: undefined; bytes13?: undefined; bytes14?: undefined; bytes15?: undefined; bytes16?: undefined; bytes17?: undefined; bytes18?: undefined; bytes19?: undefined; bytes2?: undefined; bytes20?: undefined; bytes21?: undefined; bytes22?: undefined; bytes23?: undefined; bytes24?: undefined; bytes25?: undefined; bytes26?: undefined; bytes27?: undefined; bytes28?: undefined; bytes29?: undefined; bytes3?: undefined; bytes30?: undefined; bytes31?: undefined; bytes32?: undefined; bytes4?: undefined; bytes5?: undefined; bytes6?: undefined; bytes7?: undefined; bytes8?: undefined; bytes9?: undefined; int104?: undefined; int112?: undefined; int120?: undefined; int128?: undefined; int136?: undefined; int144?: undefined; int152?: undefined; int16?: undefined; int160?: undefined; int168?: undefined; int176?: undefined; int184?: undefined; int192?: undefined; int200?: undefined; int208?: undefined; int216?: undefined; int224?: undefined; int232?: undefined; int24?: undefined; int240?: undefined; int248?: undefined; int256?: undefined; int32?: undefined; int40?: undefined; int48?: undefined; int56?: undefined; int64?: undefined; int72?: undefined; int8?: undefined; int80?: undefined; int88?: undefined; int96?: undefined; string?: undefined; uint104?: undefined; uint112?: undefined; uint120?: undefined; uint128?: undefined; uint136?: undefined; uint144?: undefined; uint152?: undefined; uint16?: undefined; uint160?: undefined; uint168?: undefined; uint176?: undefined; uint184?: undefined; uint192?: undefined; uint200?: undefined; uint208?: undefined; uint216?: undefined; uint224?: undefined; uint232?: undefined; uint24?: undefined; uint240?: undefined; uint248?: undefined; uint256?: undefined; uint32?: undefined; uint40?: undefined; uint48?: undefined; uint56?: undefined; uint64?: undefined; uint72?: undefined; uint8?: undefined; uint80?: undefined; uint88?: undefined; uint96?: undefined; } | {[key: string]: unknown; }
TPrimaryType
TPrimaryType extends string
Parameters
args
SignTypedDataParameters<TTypedData, TPrimaryType, Account | undefined>
Returns
Promise<`0x${string}`>
switchChain()
switchChain: (
args) =>Promise<void>
Parameters
args
SwitchChainParameters
Returns
Promise<void>
transport
transport:
TransportConfig<string,EIP1193RequestFn> &Record<string,any>
The RPC transport
type
type:
string
The type of client.
uid
uid:
string
A unique ID for the client.
watchAsset()
watchAsset: (
args) =>Promise<boolean>
Parameters
args
WatchAssetParams
Returns
Promise<boolean>
writeContract()
writeContract: <
abi,functionName,args,chainOverride>(args) =>Promise<`0x${string}`>
Type Parameters
abi
abi extends Abi | readonly unknown[]
functionName
functionName extends string
args
args extends unknown
chainOverride
chainOverride extends Chain | undefined = undefined
Parameters
args
WriteContractParameters<abi, functionName, args, Chain | undefined, Account | undefined, chainOverride>
Returns
Promise<`0x${string}`>
Methods
callContract()
callContract<
T>(address,abi,functionName,args?):Promise<T>
Defined in: packages/core/src/clients/core.ts:794
Call a contract method (read-only)
Type Parameters
T
T = unknown
Parameters
address
string
abi
unknown[]
functionName
string
args?
unknown[] = []
Returns
Promise<T>
deployContract()
deployContract(
abi,bytecode,constructorArgs?,options?):Promise<string>
Defined in: packages/core/src/clients/core.ts:754
Deploy a contract to Core Space
Parameters
abi
unknown[]
bytecode
string
constructorArgs?
unknown[] = []
options?
Returns
Promise<string>
faucet()
faucet(
address,amount):Promise<string>
Defined in: packages/core/src/clients/core.ts:645
Unified faucet functionality Automatically detects address type and sends CFX accordingly:
- Core address: Direct transfer
- eSpace address: Cross-chain transfer via internal contract
Parameters
address
string
amount
string
Returns
Promise<string>
faucetToEspace()
faucetToEspace(
espaceAddress,amount):Promise<string>
Defined in: packages/core/src/clients/core.ts:708
Cross-chain faucet functionality (Core → eSpace) Sends CFX from Core space to eSpace address via internal contract
Parameters
espaceAddress
string
amount
string
Returns
Promise<string>
Deprecated
Use faucet() instead which auto-detects address type
sendTransaction()
sendTransaction(
tx):Promise<string>
Defined in: packages/core/src/clients/core.ts:558
Parameters
tx
Returns
Promise<string>
Implementation of
signMessage()
signMessage(
message):Promise<string>
Defined in: packages/core/src/clients/core.ts:580
Parameters
message
string
Returns
Promise<string>
Implementation of
waitForTransaction()
waitForTransaction(
hash,timeout?):Promise<TransactionReceipt>
Defined in: packages/core/src/clients/core.ts:601
Wait for a transaction to be confirmed.
Parameters
hash
string
Transaction hash.
timeout?
number
Timeout in milliseconds (default: 30 000).
Returns
Promise<TransactionReceipt>
writeAndWait()
writeAndWait(
address,abi,functionName,args?,value?,options?):Promise<TransactionReceipt>
Defined in: packages/core/src/clients/core.ts:854
Write to a contract and wait for the transaction to be confirmed.
Convenience wrapper around writeContract + waitForTransaction.
Parameters
address
string
abi
unknown[]
functionName
string
args?
unknown[] = []
value?
bigint
options?
Returns
Promise<TransactionReceipt>
writeContract()
writeContract(
address,abi,functionName,args?,value?):Promise<string>
Defined in: packages/core/src/clients/core.ts:822
Write to a contract (transaction)
Parameters
address
string
abi
unknown[]
functionName
string
args?
unknown[] = []
value?
bigint
Returns
Promise<string>