UNPKG

@near-lake/primitives

Version:

Near Protocol primitive datatypes utilized by near-lake-framework and QueryAPI

89 lines (88 loc) 2.25 kB
/// <reference types="node" /> import { Action, FunctionCall } from "./receipts"; import { Event } from "./events"; import { ExecutionStatus } from "./core/types"; /** * Represents a Function Call to a smart cotract * */ export declare class FunctionCallView { /** * The account ID of the contract that is called. */ readonly receiverId: string; /** * The method name of the contract that was invoked. */ readonly methodName: string; /** * Base64 encoded arguments to the method. */ readonly args: string; /** * gas amount. */ readonly gas: number; /** * deposit amount in yoctoNEAR. */ readonly deposit: string; private readonly action; constructor( /** * The account ID of the contract that is called. */ receiverId: string, /** * The method name of the contract that was invoked. */ methodName: string, /** * Base64 encoded arguments to the method. */ args: string, /** * gas amount. */ gas: number, /** * deposit amount in yoctoNEAR. */ deposit: string, action: Action); /** * receiptId in which this call was executed. */ get receiptId(): string; /** * whether the call was successful. */ get isSuccessful(): boolean; /** * Execution status object of the corresponding receipt. */ get receiptStatus(): ExecutionStatus; /** * predecessorId: the contract that invoked this call. */ get predecessorId(): string; /** * original signer of the transaction. */ get signerId(): string; /** * array of parsed events complying with NEP-297 emitted in this call. */ get events(): Event[]; /** * array of logs produced in this call. */ get logs(): string[]; /** * arguments, decoded from base64 and parsed to JSON * @param encoding encoding of the args, default is utf-8 * @returns JSON object of the arguments * @throws Error if failed to parse the args as JSON */ argsAsJSON(encoding?: BufferEncoding): JSON; static fromFunctionCall(functionCall: FunctionCall, action: Action): FunctionCallView; }