Receipt
Structure
Definition
Receipt is an internal transaction in NEAR Protocol.
ReceiptView
- Rust
- TypeScript
pub struct ReceiptView {
pub predecessor_id: AccountId,
pub receiver_id: AccountId,
pub receipt_id: CryptoHash,
pub receipt: ReceiptEnumView,
}
export type Receipt = {
predecessorId: string;
receipt: ReceiptEnum;
receiptId: string;
receiverId: string;
}
ReceiptEnumView
- Rust
- TypeScript
pub enum ReceiptEnumView {
Action {
signer_id: AccountId,
signer_public_key: PublicKey,
#[serde(with = "u128_dec_format")]
gas_price: Balance,
output_data_receivers: Vec<DataReceiverView>,
input_data_ids: Vec<CryptoHash>,
actions: Vec<ActionView>,
},
Data {
data_id: CryptoHash,
#[serde(with = "option_base64_format")]
data: Option<Vec<u8>>,
},
}
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 by Promise
during the cross-contract calls.