NearRpc
Defined in: wallet-near/src/rpc.ts:110
The NEAR JSON-RPC calls a wallet uses, with parsed results.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NearRpc(
fetch):NearRpc
Defined in: wallet-near/src/rpc.ts:111
Parameters
Section titled “Parameters”Returns
Section titled “Returns”NearRpc
Properties
Section titled “Properties”
readonlyfetch:NearFetch
Defined in: wallet-near/src/rpc.ts:111
Methods
Section titled “Methods”callFunction()
Section titled “callFunction()”callFunction<
T>(contract,method,args?):Promise<T>
Defined in: wallet-near/src/rpc.ts:134
View call; the JSON-decoded return value (null for an empty result).
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”contract
Section titled “contract”string
method
Section titled “method”string
Record<string, unknown> = {}
Returns
Section titled “Returns”Promise<T>
gasPrice()
Section titled “gasPrice()”gasPrice():
Promise<bigint>
Defined in: wallet-near/src/rpc.ts:150
Returns
Section titled “Returns”Promise<bigint>
latestBlockHash()
Section titled “latestBlockHash()”latestBlockHash():
Promise<string>
Defined in: wallet-near/src/rpc.ts:144
Returns
Section titled “Returns”Promise<string>
sendTx()
Section titled “sendTx()”sendTx(
signedTxBase64,waitUntil?):Promise<RawFinalOutcome>
Defined in: wallet-near/src/rpc.ts:156
Parameters
Section titled “Parameters”signedTxBase64
Section titled “signedTxBase64”string
waitUntil?
Section titled “waitUntil?”"NONE" | "INCLUDED" | "EXECUTED_OPTIMISTIC" | "INCLUDED_FINAL" | "EXECUTED" | "FINAL"
Returns
Section titled “Returns”Promise<RawFinalOutcome>
txStatus()
Section titled “txStatus()”txStatus(
hash,senderId):Promise<RawFinalOutcome|undefined>
Defined in: wallet-near/src/rpc.ts:161
undefined when the node does not know the transaction.
Parameters
Section titled “Parameters”string
senderId
Section titled “senderId”string
Returns
Section titled “Returns”Promise<RawFinalOutcome | undefined>
viewAccessKey()
Section titled “viewAccessKey()”viewAccessKey(
accountId,publicKey):Promise<RawAccessKeyView|undefined>
Defined in: wallet-near/src/rpc.ts:124
undefined when the key is not on the account.
Parameters
Section titled “Parameters”accountId
Section titled “accountId”string
publicKey
Section titled “publicKey”string
Returns
Section titled “Returns”Promise<RawAccessKeyView | undefined>
viewAccount()
Section titled “viewAccount()”viewAccount(
accountId):Promise<RawAccountView|undefined>
Defined in: wallet-near/src/rpc.ts:114
undefined when the account does not exist.
Parameters
Section titled “Parameters”accountId
Section titled “accountId”string
Returns
Section titled “Returns”Promise<RawAccountView | undefined>