Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update candid in ledger-icp package #592

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2024.xx.yy-hhmmZ

## Features

- ICP transactions, as provided by the Index canister, have been extended to include their block timestamp information.

# 2024.03.25-1415Z

## Overview
Expand Down
1 change: 1 addition & 0 deletions packages/ledger-icp/candid/index.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const idlFactory = ({ IDL }) => {
'memo' : IDL.Nat64,
'icrc1_memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'operation' : Operation,
'timestamp' : IDL.Opt(TimeStamp),
'created_at_time' : IDL.Opt(TimeStamp),
});
const TransactionWithId = IDL.Record({
Expand Down
1 change: 1 addition & 0 deletions packages/ledger-icp/candid/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface Transaction {
memo: bigint;
icrc1_memo: [] | [Uint8Array | number[]];
operation: Operation;
timestamp: [] | [TimeStamp];
created_at_time: [] | [TimeStamp];
}
export interface TransactionWithId {
Expand Down
3 changes: 2 additions & 1 deletion packages/ledger-icp/candid/index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit fff2052 (2024-03-07 tags: release-2024-03-06_23-01+p2p) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
// Generated from IC repo commit c0dc8b76c4 (2024-03-25) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
type Account = record { owner : principal; subaccount : opt vec nat8 };
type GetAccountIdentifierTransactionsArgs = record {
max_results : nat64;
Expand Down Expand Up @@ -59,6 +59,7 @@ type Transaction = record {
icrc1_memo : opt vec nat8;
operation : Operation;
created_at_time : opt TimeStamp;
timestamp : opt TimeStamp;
};
type TransactionWithId = record { id : nat64; transaction : Transaction };
service : (InitArg) -> {
Expand Down
1 change: 1 addition & 0 deletions packages/ledger-icp/candid/index.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const idlFactory = ({ IDL }) => {
'memo' : IDL.Nat64,
'icrc1_memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'operation' : Operation,
'timestamp' : IDL.Opt(TimeStamp),
'created_at_time' : IDL.Opt(TimeStamp),
});
const TransactionWithId = IDL.Record({
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/candid/ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit fff2052 (2024-03-07 tags: release-2024-03-06_23-01+p2p) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// Generated from IC repo commit c0dc8b76c4 (2024-03-25) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// This is the official Ledger interface that is guaranteed to be backward compatible.

// Amount of tokens, measured in 10^-8 of a token.
Expand Down
37 changes: 36 additions & 1 deletion packages/ledger-icp/src/index.canister.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,42 @@ describe("IndexCanister", () => {
const transactionsMock = {
Ok: {
balance: 1234n,
transactions: [{ id: 1n }, { id: 2n }],
transactions: [
{
id: 1n,
transaction: {
memo: 123n,
icrc1_memo: [],
operation: {
Mint: {
to: "test",
amount: {
e8s: 1000000n,
},
},
},
created_at_time: [{ timestamp_nanos: 100000123n }],
timestamp: [],
},
},
{
id: 2n,
transaction: {
memo: 123n,
icrc1_memo: [],
operation: {
Mint: {
to: "test",
amount: {
e8s: 1000000n,
},
},
},
created_at_time: [],
timestamp: [{ timestamp_nanos: 100000456n }],
},
},
],
oldest_tx_id: [],
} as GetAccountIdentifierTransactionsResponse,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index-ng.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit c3c5dc8 (2024-03-15 tags: release-2024-03-14_23-01-p2p) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
// Generated from IC repo commit c0dc8b76c4 (2024-03-25) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
type Tokens = nat;

type InitArg = record {
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit c3c5dc8 (2024-03-15 tags: release-2024-03-14_23-01-p2p) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
// Generated from IC repo commit c0dc8b76c4 (2024-03-25) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
type TxId = nat;

type Account = record { owner : principal; subaccount : opt blob };
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_ledger.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit c3c5dc8 (2024-03-15 tags: release-2024-03-14_23-01-p2p) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
// Generated from IC repo commit c0dc8b76c4 (2024-03-25) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
type BlockIndex = nat;
type Subaccount = blob;
// Number of nanoseconds since the UNIX epoch in UTC timezone.
Expand Down
Loading