Functions
parseJsonRpcAccount
Call Signature
parseJsonRpcAccount<
TData
,TAddress
>(address
,rpcAccount
):Account
<TData
,TAddress
>
Parses an arbitrary jsonParsed
account provided by the RPC client into an Account type
or a MaybeAccount type if the raw data can be set to null
.
The expected data type should be explicitly provided as the first type parameter.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
TData extends object | - | The expected type of this account's data. |
TAddress extends string | string | Supply a string literal to define an account having a particular address. |
Parameters
Parameter | Type |
---|---|
address | Address <TAddress > |
rpcAccount | JsonParsedRpcAccount |
Returns
Account
<TData
, TAddress
>
Example
Call Signature
parseJsonRpcAccount<
TData
,TAddress
>(address
,rpcAccount
):MaybeAccount
<TData
,TAddress
>
Parses an arbitrary jsonParsed
account provided by the RPC client into an Account type
or a MaybeAccount type if the raw data can be set to null
.
The expected data type should be explicitly provided as the first type parameter.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
TData extends object | - | The expected type of this account's data. |
TAddress extends string | string | Supply a string literal to define an account having a particular address. |
Parameters
Parameter | Type |
---|---|
address | Address <TAddress > |
rpcAccount | null | JsonParsedRpcAccount |
Returns
MaybeAccount
<TData
, TAddress
>