Skip to main content

CallContext

@midnight-ntwrk/onchain-runtime v2.0.1


@midnight-ntwrk/onchain-runtime / CallContext

Type Alias: CallContext

type CallContext: {
balance: Map<TokenType, bigint>;
caller: PublicAddress;
comIndices: Map<CoinCommitment, number>;
ownAddress: ContractAddress;
parentBlockHash: string;
secondsSinceEpoch: bigint;
secondsSinceEpochErr: number;
};

The context information of a call provided to the VM.

Type declaration

balance

balance: Map<TokenType, bigint>;

The balances held by the called contract at the time it was called.

caller?

optional caller: PublicAddress;

A public address identifying an entity.

comIndices

comIndices: Map<CoinCommitment, number>;

The commitment indices map accessible to the contract.

ownAddress

ownAddress: ContractAddress;

parentBlockHash

parentBlockHash: string;

The hash of the block prior to this transaction, as a hex-encoded string

secondsSinceEpoch

secondsSinceEpoch: bigint;

The seconds since the UNIX epoch that have elapsed

secondsSinceEpochErr

secondsSinceEpochErr: number;

The maximum error on secondsSinceEpoch that should occur, as a positive seconds value