Skip to content

Commit

Permalink
Update Candid Files (#640)
Browse files Browse the repository at this point in the history
# Motivation
The canisters APIs have been updated.

# Changes
* Updated the candid interface files for the canisters used in this
library.
* Updated the javascript bindings for the latest candid interfaces.

# Tests
- [ ] Please check the API updates for any breaking changes that affect
our code.

Co-authored-by: gix-bot <[email protected]>
  • Loading branch information
sa-github-api and gix-bot authored May 27, 2024
1 parent fbda59a commit 0e762d9
Show file tree
Hide file tree
Showing 20 changed files with 232 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/ckbtc/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// Represents an account on the ckBTC ledger.
type Account = record { owner : principal; subaccount : opt blob };

Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
type EthereumNetwork = variant {
// The public Ethereum mainnet.
Mainnet;
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/candid/orchestrator.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 8776fd1c1c (2024-05-20) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/ethereum/ledger-suite-orchestrator/ledger_suite_orchestrator.did' by import-candid
type OrchestratorArg = variant {
UpgradeArg : UpgradeArg;
InitArg : InitArg;
Expand Down
2 changes: 1 addition & 1 deletion packages/cmc/candid/cmc.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/nns/cmc/cmc.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/cmc/cmc.did' by import-candid
type Cycles = nat;
type BlockIndex = nat64;
type log_visibility = variant {
Expand Down
2 changes: 1 addition & 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 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) '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
52 changes: 52 additions & 0 deletions packages/ledger-icp/candid/ledger.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,48 @@ export const idlFactory = ({ IDL }) => {
'Ok' : Icrc1BlockIndex,
'Err' : Icrc1TransferError,
});
const icrc21_consent_message_metadata = IDL.Record({ 'language' : IDL.Text });
const icrc21_consent_message_spec = IDL.Record({
'metadata' : icrc21_consent_message_metadata,
'device_spec' : IDL.Opt(
IDL.Variant({
'GenericDisplay' : IDL.Null,
'LineDisplay' : IDL.Record({
'characters_per_line' : IDL.Nat16,
'lines_per_page' : IDL.Nat16,
}),
})
),
});
const icrc21_consent_message_request = IDL.Record({
'arg' : IDL.Vec(IDL.Nat8),
'method' : IDL.Text,
'user_preferences' : icrc21_consent_message_spec,
});
const icrc21_consent_message = IDL.Variant({
'LineDisplayMessage' : IDL.Record({
'pages' : IDL.Vec(IDL.Record({ 'lines' : IDL.Vec(IDL.Text) })),
}),
'GenericDisplayMessage' : IDL.Text,
});
const icrc21_consent_info = IDL.Record({
'metadata' : icrc21_consent_message_metadata,
'consent_message' : icrc21_consent_message,
});
const icrc21_error_info = IDL.Record({ 'description' : IDL.Text });
const icrc21_error = IDL.Variant({
'GenericError' : IDL.Record({
'description' : IDL.Text,
'error_code' : IDL.Nat,
}),
'InsufficientPayment' : icrc21_error_info,
'UnsupportedCanisterCall' : icrc21_error_info,
'ConsentMessageUnavailable' : icrc21_error_info,
});
const icrc21_consent_message_response = IDL.Variant({
'Ok' : icrc21_consent_info,
'Err' : icrc21_error,
});
const AllowanceArgs = IDL.Record({
'account' : Account,
'spender' : Account,
Expand Down Expand Up @@ -273,6 +315,11 @@ export const idlFactory = ({ IDL }) => {
'account_identifier' : IDL.Func([Account], [AccountIdentifier], []),
'archives' : IDL.Func([], [Archives], []),
'decimals' : IDL.Func([], [IDL.Record({ 'decimals' : IDL.Nat32 })], []),
'icrc10_supported_standards' : IDL.Func(
[],
[IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],
[],
),
'icrc1_balance_of' : IDL.Func([Account], [Icrc1Tokens], []),
'icrc1_decimals' : IDL.Func([], [IDL.Nat8], []),
'icrc1_fee' : IDL.Func([], [Icrc1Tokens], []),
Expand All @@ -287,6 +334,11 @@ export const idlFactory = ({ IDL }) => {
'icrc1_symbol' : IDL.Func([], [IDL.Text], []),
'icrc1_total_supply' : IDL.Func([], [Icrc1Tokens], []),
'icrc1_transfer' : IDL.Func([TransferArg], [Icrc1TransferResult], []),
'icrc21_canister_call_consent_message' : IDL.Func(
[icrc21_consent_message_request],
[icrc21_consent_message_response],
[],
),
'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], []),
'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []),
'icrc2_transfer_from' : IDL.Func(
Expand Down
52 changes: 52 additions & 0 deletions packages/ledger-icp/candid/ledger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,60 @@ export type Value =
| { Nat: bigint }
| { Blob: Uint8Array | number[] }
| { Text: string };
export interface icrc21_consent_info {
metadata: icrc21_consent_message_metadata;
consent_message: icrc21_consent_message;
}
export type icrc21_consent_message =
| {
LineDisplayMessage: { pages: Array<{ lines: Array<string> }> };
}
| { GenericDisplayMessage: string };
export interface icrc21_consent_message_metadata {
language: string;
}
export interface icrc21_consent_message_request {
arg: Uint8Array | number[];
method: string;
user_preferences: icrc21_consent_message_spec;
}
export type icrc21_consent_message_response =
| { Ok: icrc21_consent_info }
| { Err: icrc21_error };
export interface icrc21_consent_message_spec {
metadata: icrc21_consent_message_metadata;
device_spec:
| []
| [
| { GenericDisplay: null }
| {
LineDisplay: {
characters_per_line: number;
lines_per_page: number;
};
},
];
}
export type icrc21_error =
| {
GenericError: { description: string; error_code: bigint };
}
| { InsufficientPayment: icrc21_error_info }
| { UnsupportedCanisterCall: icrc21_error_info }
| { ConsentMessageUnavailable: icrc21_error_info };
export interface icrc21_error_info {
description: string;
}
export interface _SERVICE {
account_balance: ActorMethod<[AccountBalanceArgs], Tokens>;
account_balance_dfx: ActorMethod<[AccountBalanceArgsDfx], Tokens>;
account_identifier: ActorMethod<[Account], AccountIdentifier>;
archives: ActorMethod<[], Archives>;
decimals: ActorMethod<[], { decimals: number }>;
icrc10_supported_standards: ActorMethod<
[],
Array<{ url: string; name: string }>
>;
icrc1_balance_of: ActorMethod<[Account], Icrc1Tokens>;
icrc1_decimals: ActorMethod<[], number>;
icrc1_fee: ActorMethod<[], Icrc1Tokens>;
Expand All @@ -285,6 +333,10 @@ export interface _SERVICE {
icrc1_symbol: ActorMethod<[], string>;
icrc1_total_supply: ActorMethod<[], Icrc1Tokens>;
icrc1_transfer: ActorMethod<[TransferArg], Icrc1TransferResult>;
icrc21_canister_call_consent_message: ActorMethod<
[icrc21_consent_message_request],
icrc21_consent_message_response
>;
icrc2_allowance: ActorMethod<[AllowanceArgs], Allowance>;
icrc2_approve: ActorMethod<[ApproveArgs], ApproveResult>;
icrc2_transfer_from: ActorMethod<[TransferFromArgs], TransferFromResult>;
Expand Down
61 changes: 60 additions & 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 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) '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 Expand Up @@ -426,6 +426,62 @@ type TransferFromError = variant {
GenericError : record { error_code : nat; message : text };
};

type icrc21_consent_message_metadata = record {
language: text;
};

type icrc21_consent_message_spec = record {
metadata: icrc21_consent_message_metadata;
device_spec: opt variant {
GenericDisplay;
LineDisplay: record {
characters_per_line: nat16;
lines_per_page: nat16;
};
};
};

type icrc21_consent_message_request = record {
method: text;
arg: blob;
user_preferences: icrc21_consent_message_spec;
};

type icrc21_consent_message = variant {
GenericDisplayMessage: text;
LineDisplayMessage: record {
pages: vec record {
lines: vec text;
};
};
};

type icrc21_consent_info = record {
consent_message: icrc21_consent_message;
metadata: icrc21_consent_message_metadata;
};

type icrc21_error_info = record {
description: text;
};

type icrc21_error = variant {
UnsupportedCanisterCall: icrc21_error_info;
ConsentMessageUnavailable: icrc21_error_info;
InsufficientPayment: icrc21_error_info;

// Any error not covered by the above variants.
GenericError: record {
error_code: nat;
description: text;
};
};

type icrc21_consent_message_response = variant {
Ok: icrc21_consent_info;
Err: icrc21_error;
};

service: (LedgerCanisterPayload) -> {
// Transfers tokens from a subaccount of the caller to the destination address.
// The source address is computed from the principal of the caller and the specified subaccount.
Expand Down Expand Up @@ -477,4 +533,7 @@ service: (LedgerCanisterPayload) -> {
icrc2_approve : (ApproveArgs) -> (ApproveResult);
icrc2_allowance : (AllowanceArgs) -> (Allowance) query;
icrc2_transfer_from : (TransferFromArgs) -> (TransferFromResult);

icrc21_canister_call_consent_message: (icrc21_consent_message_request) -> (icrc21_consent_message_response);
icrc10_supported_standards : () -> (vec record { name : text; url : text }) query;
}
52 changes: 52 additions & 0 deletions packages/ledger-icp/candid/ledger.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,48 @@ export const idlFactory = ({ IDL }) => {
'Ok' : Icrc1BlockIndex,
'Err' : Icrc1TransferError,
});
const icrc21_consent_message_metadata = IDL.Record({ 'language' : IDL.Text });
const icrc21_consent_message_spec = IDL.Record({
'metadata' : icrc21_consent_message_metadata,
'device_spec' : IDL.Opt(
IDL.Variant({
'GenericDisplay' : IDL.Null,
'LineDisplay' : IDL.Record({
'characters_per_line' : IDL.Nat16,
'lines_per_page' : IDL.Nat16,
}),
})
),
});
const icrc21_consent_message_request = IDL.Record({
'arg' : IDL.Vec(IDL.Nat8),
'method' : IDL.Text,
'user_preferences' : icrc21_consent_message_spec,
});
const icrc21_consent_message = IDL.Variant({
'LineDisplayMessage' : IDL.Record({
'pages' : IDL.Vec(IDL.Record({ 'lines' : IDL.Vec(IDL.Text) })),
}),
'GenericDisplayMessage' : IDL.Text,
});
const icrc21_consent_info = IDL.Record({
'metadata' : icrc21_consent_message_metadata,
'consent_message' : icrc21_consent_message,
});
const icrc21_error_info = IDL.Record({ 'description' : IDL.Text });
const icrc21_error = IDL.Variant({
'GenericError' : IDL.Record({
'description' : IDL.Text,
'error_code' : IDL.Nat,
}),
'InsufficientPayment' : icrc21_error_info,
'UnsupportedCanisterCall' : icrc21_error_info,
'ConsentMessageUnavailable' : icrc21_error_info,
});
const icrc21_consent_message_response = IDL.Variant({
'Ok' : icrc21_consent_info,
'Err' : icrc21_error,
});
const AllowanceArgs = IDL.Record({
'account' : Account,
'spender' : Account,
Expand Down Expand Up @@ -285,6 +327,11 @@ export const idlFactory = ({ IDL }) => {
[IDL.Record({ 'decimals' : IDL.Nat32 })],
['query'],
),
'icrc10_supported_standards' : IDL.Func(
[],
[IDL.Vec(IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text }))],
['query'],
),
'icrc1_balance_of' : IDL.Func([Account], [Icrc1Tokens], ['query']),
'icrc1_decimals' : IDL.Func([], [IDL.Nat8], ['query']),
'icrc1_fee' : IDL.Func([], [Icrc1Tokens], ['query']),
Expand All @@ -303,6 +350,11 @@ export const idlFactory = ({ IDL }) => {
'icrc1_symbol' : IDL.Func([], [IDL.Text], ['query']),
'icrc1_total_supply' : IDL.Func([], [Icrc1Tokens], ['query']),
'icrc1_transfer' : IDL.Func([TransferArg], [Icrc1TransferResult], []),
'icrc21_canister_call_consent_message' : IDL.Func(
[icrc21_consent_message_request],
[icrc21_consent_message_response],
[],
),
'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], ['query']),
'icrc2_approve' : IDL.Func([ApproveArgs], [ApproveResult], []),
'icrc2_transfer_from' : IDL.Func(
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 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) '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 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) '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 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) '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
2 changes: 1 addition & 1 deletion packages/nns/candid/genesis_token.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/nns/gtc/canister/gtc.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
type AccountState = record {
authenticated_principal_id : opt principal;
successfully_transferred_neurons : vec TransferredNeuron;
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/governance.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/nns/governance/canister/governance.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/governance/canister/governance.did' by import-candid
type AccountIdentifier = record { hash : blob };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/governance_test.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/nns/governance/canister/governance_test.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/governance/canister/governance_test.did' by import-candid
type AccountIdentifier = record { hash : blob };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down
2 changes: 1 addition & 1 deletion packages/nns/candid/sns_wasm.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
type AddWasmRequest = record { hash : blob; wasm : opt SnsWasm };
type AddWasmResponse = record { result : opt Result };
type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution };
Expand Down
2 changes: 1 addition & 1 deletion packages/sns/candid/sns_governance.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/sns/governance/canister/governance.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/sns/governance/canister/governance.did' by import-candid
type Account = record { owner : opt principal; subaccount : opt Subaccount };
type Action = variant {
ManageNervousSystemParameters : NervousSystemParameters;
Expand Down
2 changes: 1 addition & 1 deletion packages/sns/candid/sns_governance_test.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/sns/governance/canister/governance_test.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/sns/governance/canister/governance_test.did' by import-candid
type Account = record { owner : opt principal; subaccount : opt Subaccount };
type Action = variant {
ManageNervousSystemParameters : NervousSystemParameters;
Expand Down
2 changes: 1 addition & 1 deletion packages/sns/candid/sns_root.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/sns/root/canister/root.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/sns/root/canister/root.did' by import-candid
type CanisterCallError = record { code : opt int32; description : text };
type CanisterIdRecord = record { canister_id : principal };
type CanisterInstallMode = variant { reinstall; upgrade; install };
Expand Down
2 changes: 1 addition & 1 deletion packages/sns/candid/sns_swap.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit 9866a6f (2024-04-24 tags: release-2024-05-09_23-02-storage-layer) 'rs/sns/swap/canister/swap.did' by import-candid
// Generated from IC repo commit ec35ebd (2024-05-22 tags: release-2024-05-22_23-01-base) 'rs/sns/swap/canister/swap.did' by import-candid
type BuyerState = record {
icp : opt TransferableAmount;
has_created_neuron_recipes : opt bool;
Expand Down

0 comments on commit 0e762d9

Please sign in to comment.