parseJsonRpcAccount
Call Signature
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
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 | null |
Returns
MaybeAccount<TData, TAddress>