receipt

To Share and +4 nLEARNs

import Tabs from ‘@theme/Tabs’;
import TabItem from ‘@theme/TabItem’;

Receipt Structure

Definition

Receipt is an internal transaction in NEAR Protocol.

ReceiptView


“`rust links=1
pub struct ReceiptView {
pub predecessor_id: AccountId,
pub receiver_id: AccountId,
pub receipt_id: CryptoHash,

pub receipt: ReceiptEnumView,
}
“`


“`ts links=1
export type Receipt = {
predecessorId: string;
receipt: ReceiptEnum;
receiptId: string;
receiverId: string;
}
“`


ReceiptEnumView


“`rust links=1
pub enum ReceiptEnumView {
Action {
signer_id: AccountId,
signer_public_key: PublicKey,
#[serde(with = “u128_dec_format”)]
gas_price: Balance,
output_data_receivers: Vec,
input_data_ids: Vec,
actions: Vec,
},
Data {
data_id: CryptoHash,
#[serde(with = “option_base64_format”)]
data: Option>,
},
}
“`


“`ts links=1
export type ReceiptEnum =
| {
Action: {
actions: Action[];
gasPrice: string;
inputDataIds: string[];
outputDataReceivers: string[];
signerId: string;
signerPublicKey: string;
};
}
| {
Data: {
data: string;
dataId: string;
};
};
“`


ActionReceipt

ActionReceipts hold info about what actions to perform. In the cross-contract calls some actions might happen only when specific data is available, such data is in the DataReceipts.

DataReceipt

DataReceipts hold the data that is produced my Promise during the cross-contract calls.

Generate comment with AI 2 nL
Scroll to Top
Report a bug👀