Created
February 25, 2023 00:06
Revisions
-
SuddenlyHazel created this gist
Feb 25, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,69 @@ type BlockIndex = nat64; type Memo = nat64; type AccountIdentifier = blob; type Tokens = record { e8s : nat64 }; type Timestamp = record { timestamp_nanos : nat64 }; type Operation = variant { Mint : record { to : AccountIdentifier; amount : Tokens; }; Burn : record { from : AccountIdentifier; amount : Tokens; }; Transfer : record { from : AccountIdentifier; to : AccountIdentifier; amount : Tokens; fee : Tokens; }; }; type Transaction = record { memo : Memo; // Optional to support potential future variant extensions. operation : Operation; created_at_time : Timestamp; }; type Block = record { parent_hash : opt blob; transaction : Transaction; timestamp : Timestamp; }; type GetBlocksArgs = record { start : BlockIndex; length : nat64; }; type BlockRange = record { blocks : vec Block; }; type GetBlocksError = variant { /// The [GetBlocksArgs.start] is below the first block that /// archive node stores. BadFirstBlockIndex : record { requested_index : BlockIndex; first_valid_index : BlockIndex; }; /// Reserved for future use. Other : record { error_code : nat64; error_message : text; }; }; type GetBlocksResult = variant { Ok : BlockRange; Err : GetBlocksError; }; service : { get_blocks : (GetBlocksArgs) -> (GetBlocksResult) query; }