PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@near-js/providers/lib/commonjs
Просмотр файла: json-rpc-provider.d.ts
import { AccessKeyWithPublicKey, BlockId, BlockReference, BlockResult, BlockChangeResult, ChangeResult, ChunkId, ChunkResult, EpochValidatorInfo, FinalExecutionOutcome, GasPrice, LightClientProof, LightClientProofRequest, NextLightClientBlockRequest, NextLightClientBlockResponse, NearProtocolConfig, NodeStatusResult, QueryResponseKind } from '@near-js/types';
import { SignedTransaction } from '@near-js/transactions';
import { Provider } from './provider';
import { ConnectionInfo } from './fetch_json';
import { TxExecutionStatus } from '@near-js/types';
type RequestOptions = {
/**
* Number of retries before giving up on a request
*/
retries: number;
/**
* Wait until next retry in milliseconds
*/
wait: number;
/**
* Exponential back off for waiting to retry again
*/
backoff: number;
};
/**
* Client class to interact with the [NEAR RPC API](https://docs.near.org/api/rpc/introduction).
* @see [https://github.com/near/nearcore/tree/master/chain/jsonrpc](https://github.com/near/nearcore/tree/master/chain/jsonrpc)
*/
export declare class JsonRpcProvider extends Provider {
/** @hidden */
readonly connection: ConnectionInfo;
/** @hidden */
readonly options: RequestOptions;
/**
* @param connectionInfo Connection info
*/
constructor(connectionInfo: ConnectionInfo, options?: Partial<RequestOptions>);
/**
* Gets the RPC's status
* @see [https://docs.near.org/docs/develop/front-end/rpc#general-validator-status](https://docs.near.org/docs/develop/front-end/rpc#general-validator-status)
*/
status(): Promise<NodeStatusResult>;
/**
* Sends a signed transaction to the RPC
*
* @param signedTransaction The signed transaction being sent
* @param waitUntil
*/
sendTransactionUntil(signedTransaction: SignedTransaction, waitUntil: TxExecutionStatus): Promise<FinalExecutionOutcome>;
/**
* Sends a signed transaction to the RPC and waits until transaction is fully complete
* @see [https://docs.near.org/docs/develop/front-end/rpc#send-transaction-await](https://docs.near.org/docs/develop/front-end/rpc#general-validator-status)
*
* @param signedTransaction The signed transaction being sent
*/
sendTransaction(signedTransaction: SignedTransaction): Promise<FinalExecutionOutcome>;
/**
* Sends a signed transaction to the RPC and immediately returns transaction hash
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#send-transaction-async)
* @param signedTransaction The signed transaction being sent
* @returns {Promise<FinalExecutionOutcome>}
*/
sendTransactionAsync(signedTransaction: SignedTransaction): Promise<FinalExecutionOutcome>;
/**
* Gets a transaction's status from the RPC
* @see [https://docs.near.org/docs/develop/front-end/rpc#transaction-status](https://docs.near.org/docs/develop/front-end/rpc#general-validator-status)
*
* @param txHash A transaction hash as either a Uint8Array or a base58 encoded string
* @param accountId The NEAR account that signed the transaction
* @param waitUntil
*/
txStatus(txHash: Uint8Array | string, accountId: string, waitUntil?: TxExecutionStatus): Promise<FinalExecutionOutcome>;
private txStatusUint8Array;
private txStatusString;
/**
* Gets a transaction's status from the RPC with receipts
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#transaction-status-with-receipts)
* @param txHash The hash of the transaction
* @param accountId The NEAR account that signed the transaction
* @param waitUntil
* @returns {Promise<FinalExecutionOutcome>}
*/
txStatusReceipts(txHash: Uint8Array | string, accountId: string, waitUntil?: TxExecutionStatus): Promise<FinalExecutionOutcome>;
/**
* Query the RPC by passing an {@link "@near-js/types".provider/request.RpcQueryRequest | RpcQueryRequest }
* @see [https://docs.near.org/api/rpc/contracts](https://docs.near.org/api/rpc/contracts)
*
* @typeParam T the shape of the returned query response
*/
query<T extends QueryResponseKind>(...args: any[]): Promise<T>;
/**
* Query for block info from the RPC
* pass block_id OR finality as blockQuery, not both
* @see [https://docs.near.org/api/rpc/block-chunk](https://docs.near.org/api/rpc/block-chunk)
*
* @param blockQuery {@link BlockReference} (passing a {@link BlockId} is deprecated)
*/
block(blockQuery: BlockId | BlockReference): Promise<BlockResult>;
/**
* Query changes in block from the RPC
* pass block_id OR finality as blockQuery, not both
* @see [https://docs.near.org/api/rpc/block-chunk](https://docs.near.org/api/rpc/block-chunk)
*/
blockChanges(blockQuery: BlockReference): Promise<BlockChangeResult>;
/**
* Queries for details about a specific chunk appending details of receipts and transactions to the same chunk data provided by a block
* @see [https://docs.near.org/api/rpc/block-chunk](https://docs.near.org/api/rpc/block-chunk)
*
* @param chunkId Hash of a chunk ID or shard ID
*/
chunk(chunkId: ChunkId): Promise<ChunkResult>;
/**
* Query validators of the epoch defined by the given block id.
* @see [https://docs.near.org/api/rpc/network#validation-status](https://docs.near.org/api/rpc/network#validation-status)
*
* @param blockId Block hash or height, or null for latest.
*/
validators(blockId: BlockId | null): Promise<EpochValidatorInfo>;
/**
* Gets the protocol config at a block from RPC
*
* @param blockReference specifies the block to get the protocol config for
*/
experimental_protocolConfig(blockReference: BlockReference | {
sync_checkpoint: 'genesis';
}): Promise<NearProtocolConfig>;
/**
* Gets a light client execution proof for verifying execution outcomes
* @see [https://github.com/nearprotocol/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-proof](https://github.com/nearprotocol/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-proof)
*/
lightClientProof(request: LightClientProofRequest): Promise<LightClientProof>;
/**
* Returns the next light client block as far in the future as possible from the last known hash
* to still be able to validate from that hash. This will either return the last block of the
* next epoch, or the last final known block.
*
* @see [https://github.com/near/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-block](https://github.com/near/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-block)
*/
nextLightClientBlock(request: NextLightClientBlockRequest): Promise<NextLightClientBlockResponse>;
/**
* Gets access key changes for a given array of accountIds
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-access-key-changes-all)
* @returns {Promise<ChangeResult>}
*/
accessKeyChanges(accountIdArray: string[], blockQuery: BlockReference): Promise<ChangeResult>;
/**
* Gets single access key changes for a given array of access keys
* pass block_id OR finality as blockQuery, not both
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-access-key-changes-single)
* @returns {Promise<ChangeResult>}
*/
singleAccessKeyChanges(accessKeyArray: AccessKeyWithPublicKey[], blockQuery: BlockReference): Promise<ChangeResult>;
/**
* Gets account changes for a given array of accountIds
* pass block_id OR finality as blockQuery, not both
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-account-changes)
* @returns {Promise<ChangeResult>}
*/
accountChanges(accountIdArray: string[], blockQuery: BlockReference): Promise<ChangeResult>;
/**
* Gets contract state changes for a given array of accountIds
* pass block_id OR finality as blockQuery, not both
* Note: If you pass a keyPrefix it must be base64 encoded
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-contract-state-changes)
* @returns {Promise<ChangeResult>}
*/
contractStateChanges(accountIdArray: string[], blockQuery: BlockReference, keyPrefix?: string): Promise<ChangeResult>;
/**
* Gets contract code changes for a given array of accountIds
* pass block_id OR finality as blockQuery, not both
* Note: Change is returned in a base64 encoded WASM file
* See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-contract-code-changes)
* @returns {Promise<ChangeResult>}
*/
contractCodeChanges(accountIdArray: string[], blockQuery: BlockReference): Promise<ChangeResult>;
/**
* Returns gas price for a specific block_height or block_hash.
* @see [https://docs.near.org/api/rpc/gas](https://docs.near.org/api/rpc/gas)
*
* @param blockId Block hash or height, or null for latest.
*/
gasPrice(blockId: BlockId | null): Promise<GasPrice>;
/**
* Directly call the RPC specifying the method and params
*
* @param method RPC method
* @param params Parameters to the method
*/
sendJsonRpc<T>(method: string, params: object): Promise<T>;
}
export {};
//# sourceMappingURL=json-rpc-provider.d.ts.mapВыполнить команду
Для локальной разработки. Не используйте в интернете!