Skip to content

Commit

Permalink
build: update ledger-icrc did files (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Oct 14, 2023
1 parent 5273278 commit 540e342
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 77 deletions.
2 changes: 1 addition & 1 deletion packages/ckbtc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Parameters:
- `params`: The Bitcoin address and network to parse
- `params.network`: Optional. Default BtcNetwork is Mainnet

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/utils/btc.utils.ts#L194)
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/utils/btc.utils.ts#L195)

### :factory: CkBTCMinterCanister

Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/candid/icrc_index.certified.idl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger/candid/icrc1_index.did */
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index.did */
export const idlFactory = ({ IDL }) => {
const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });
const TxId = IDL.Nat;
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 d2331ec4b3c60f408b876427d7238ec15fb16ad5 'rs/rosetta-api/icrc1/index/index.did' by import-candid
// Generated from IC repo commit 695f05aacf69371fc5743fa6d1619f7d9993ea87 '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_index.idl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger/candid/icrc1_index.did */
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_index.did */
export const idlFactory = ({ IDL }) => {
const InitArgs = IDL.Record({ 'ledger_id' : IDL.Principal });
const TxId = IDL.Nat;
Expand Down
37 changes: 20 additions & 17 deletions packages/ledger-icrc/candid/icrc_ledger.certified.idl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger/candid/icrc1_ledger.did */
/* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ledger-icrc/candid/icrc_ledger.did */
export const idlFactory = ({ IDL }) => {
const Value = IDL.Rec();
const MetadataValue = IDL.Variant({
Expand Down Expand Up @@ -97,35 +97,36 @@ export const idlFactory = ({ IDL }) => {
'start' : TxIndex,
'length' : IDL.Nat,
});
const Timestamp = IDL.Nat64;
const Burn = IDL.Record({
'from' : Account,
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'created_at_time' : IDL.Opt(IDL.Nat64),
'created_at_time' : IDL.Opt(Timestamp),
'amount' : IDL.Nat,
'spender' : IDL.Opt(Account),
});
const Mint = IDL.Record({
'to' : Account,
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'created_at_time' : IDL.Opt(IDL.Nat64),
'created_at_time' : IDL.Opt(Timestamp),
'amount' : IDL.Nat,
});
const Approve = IDL.Record({
'fee' : IDL.Opt(IDL.Nat),
'from' : Account,
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'created_at_time' : IDL.Opt(IDL.Nat64),
'created_at_time' : IDL.Opt(Timestamp),
'amount' : IDL.Nat,
'expected_allowance' : IDL.Opt(IDL.Nat),
'expires_at' : IDL.Opt(IDL.Nat64),
'expires_at' : IDL.Opt(Timestamp),
'spender' : Account,
});
const Transfer = IDL.Record({
'to' : Account,
'fee' : IDL.Opt(IDL.Nat),
'from' : Account,
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'created_at_time' : IDL.Opt(IDL.Nat64),
'created_at_time' : IDL.Opt(Timestamp),
'amount' : IDL.Nat,
'spender' : IDL.Opt(Account),
});
Expand All @@ -134,7 +135,7 @@ export const idlFactory = ({ IDL }) => {
'kind' : IDL.Text,
'mint' : IDL.Opt(Mint),
'approve' : IDL.Opt(Approve),
'timestamp' : IDL.Nat64,
'timestamp' : Timestamp,
'transfer' : IDL.Opt(Transfer),
});
const TransactionRange = IDL.Record({
Expand All @@ -159,7 +160,6 @@ export const idlFactory = ({ IDL }) => {
});
const Tokens = IDL.Nat;
const StandardRecord = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });
const Timestamp = IDL.Nat64;
const TransferArg = IDL.Record({
'to' : Account,
'fee' : IDL.Opt(Tokens),
Expand All @@ -177,7 +177,7 @@ export const idlFactory = ({ IDL }) => {
'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),
'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),
'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),
'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),
'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),
'TooOld' : IDL.Null,
'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),
});
Expand All @@ -191,16 +191,16 @@ export const idlFactory = ({ IDL }) => {
});
const Allowance = IDL.Record({
'allowance' : IDL.Nat,
'expires_at' : IDL.Opt(IDL.Nat64),
'expires_at' : IDL.Opt(Timestamp),
});
const ApproveArgs = IDL.Record({
'fee' : IDL.Opt(IDL.Nat),
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'created_at_time' : IDL.Opt(IDL.Nat64),
'created_at_time' : IDL.Opt(Timestamp),
'amount' : IDL.Nat,
'expected_allowance' : IDL.Opt(IDL.Nat),
'expires_at' : IDL.Opt(IDL.Nat64),
'expires_at' : IDL.Opt(Timestamp),
'spender' : Account,
});
const ApproveError = IDL.Variant({
Expand All @@ -209,15 +209,18 @@ export const idlFactory = ({ IDL }) => {
'error_code' : IDL.Nat,
}),
'TemporarilyUnavailable' : IDL.Null,
'Duplicate' : IDL.Record({ 'duplicate_of' : IDL.Nat }),
'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),
'BadFee' : IDL.Record({ 'expected_fee' : IDL.Nat }),
'AllowanceChanged' : IDL.Record({ 'current_allowance' : IDL.Nat }),
'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),
'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),
'TooOld' : IDL.Null,
'Expired' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),
'Expired' : IDL.Record({ 'ledger_time' : Timestamp }),
'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),
});
const ApproveResult = IDL.Variant({ 'Ok' : IDL.Nat, 'Err' : ApproveError });
const ApproveResult = IDL.Variant({
'Ok' : BlockIndex,
'Err' : ApproveError,
});
const TransferFromArgs = IDL.Record({
'to' : Account,
'fee' : IDL.Opt(Tokens),
Expand All @@ -237,7 +240,7 @@ export const idlFactory = ({ IDL }) => {
'BadBurn' : IDL.Record({ 'min_burn_amount' : Tokens }),
'Duplicate' : IDL.Record({ 'duplicate_of' : BlockIndex }),
'BadFee' : IDL.Record({ 'expected_fee' : Tokens }),
'CreatedInFuture' : IDL.Record({ 'ledger_time' : IDL.Nat64 }),
'CreatedInFuture' : IDL.Record({ 'ledger_time' : Timestamp }),
'TooOld' : IDL.Null,
'InsufficientFunds' : IDL.Record({ 'balance' : Tokens }),
});
Expand Down
30 changes: 15 additions & 15 deletions packages/ledger-icrc/candid/icrc_ledger.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface Account {
}
export interface Allowance {
allowance: bigint;
expires_at: [] | [bigint];
expires_at: [] | [Timestamp];
}
export interface AllowanceArgs {
account: Account;
Expand All @@ -17,35 +17,35 @@ export interface Approve {
fee: [] | [bigint];
from: Account;
memo: [] | [Uint8Array];
created_at_time: [] | [bigint];
created_at_time: [] | [Timestamp];
amount: bigint;
expected_allowance: [] | [bigint];
expires_at: [] | [bigint];
expires_at: [] | [Timestamp];
spender: Account;
}
export interface ApproveArgs {
fee: [] | [bigint];
memo: [] | [Uint8Array];
from_subaccount: [] | [Uint8Array];
created_at_time: [] | [bigint];
created_at_time: [] | [Timestamp];
amount: bigint;
expected_allowance: [] | [bigint];
expires_at: [] | [bigint];
expires_at: [] | [Timestamp];
spender: Account;
}
export type ApproveError =
| {
GenericError: { message: string; error_code: bigint };
}
| { TemporarilyUnavailable: null }
| { Duplicate: { duplicate_of: bigint } }
| { Duplicate: { duplicate_of: BlockIndex } }
| { BadFee: { expected_fee: bigint } }
| { AllowanceChanged: { current_allowance: bigint } }
| { CreatedInFuture: { ledger_time: bigint } }
| { CreatedInFuture: { ledger_time: Timestamp } }
| { TooOld: null }
| { Expired: { ledger_time: bigint } }
| { Expired: { ledger_time: Timestamp } }
| { InsufficientFunds: { balance: bigint } };
export type ApproveResult = { Ok: bigint } | { Err: ApproveError };
export type ApproveResult = { Ok: BlockIndex } | { Err: ApproveError };
export type Block = Value;
export type BlockIndex = bigint;
export interface BlockRange {
Expand All @@ -54,7 +54,7 @@ export interface BlockRange {
export interface Burn {
from: Account;
memo: [] | [Uint8Array];
created_at_time: [] | [bigint];
created_at_time: [] | [Timestamp];
amount: bigint;
spender: [] | [Account];
}
Expand Down Expand Up @@ -140,7 +140,7 @@ export type MetadataValue =
export interface Mint {
to: Account;
memo: [] | [Uint8Array];
created_at_time: [] | [bigint];
created_at_time: [] | [Timestamp];
amount: bigint;
}
export type QueryArchiveFn = ActorMethod<
Expand All @@ -160,7 +160,7 @@ export interface Transaction {
kind: string;
mint: [] | [Mint];
approve: [] | [Approve];
timestamp: bigint;
timestamp: Timestamp;
transfer: [] | [Transfer];
}
export interface TransactionRange {
Expand All @@ -171,7 +171,7 @@ export interface Transfer {
fee: [] | [bigint];
from: Account;
memo: [] | [Uint8Array];
created_at_time: [] | [bigint];
created_at_time: [] | [Timestamp];
amount: bigint;
spender: [] | [Account];
}
Expand All @@ -191,7 +191,7 @@ export type TransferError =
| { BadBurn: { min_burn_amount: Tokens } }
| { Duplicate: { duplicate_of: BlockIndex } }
| { BadFee: { expected_fee: Tokens } }
| { CreatedInFuture: { ledger_time: bigint } }
| { CreatedInFuture: { ledger_time: Timestamp } }
| { TooOld: null }
| { InsufficientFunds: { balance: Tokens } };
export interface TransferFromArgs {
Expand All @@ -212,7 +212,7 @@ export type TransferFromError =
| { BadBurn: { min_burn_amount: Tokens } }
| { Duplicate: { duplicate_of: BlockIndex } }
| { BadFee: { expected_fee: Tokens } }
| { CreatedInFuture: { ledger_time: bigint } }
| { CreatedInFuture: { ledger_time: Timestamp } }
| { TooOld: null }
| { InsufficientFunds: { balance: Tokens } };
export type TransferFromResult =
Expand Down
48 changes: 24 additions & 24 deletions 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 d2331ec4b3c60f408b876427d7238ec15fb16ad5 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
// Generated from IC repo commit 695f05aacf69371fc5743fa6d1619f7d9993ea87 '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 All @@ -7,49 +7,49 @@ type Timestamp = nat64;
type Duration = nat64;
type Tokens = nat;
type TxIndex = nat;
type Allowance = record { allowance : nat; expires_at : opt nat64 };
type Allowance = record { allowance : nat; expires_at : opt Timestamp };
type AllowanceArgs = record { account : Account; spender : Account };
type Approve = record {
fee : opt nat;
from : Account;
memo : opt vec nat8;
created_at_time : opt nat64;
memo : opt blob;
created_at_time : opt Timestamp;
amount : nat;
expected_allowance : opt nat;
expires_at : opt nat64;
expires_at : opt Timestamp;
spender : Account;
};
type ApproveArgs = record {
fee : opt nat;
memo : opt vec nat8;
from_subaccount : opt vec nat8;
created_at_time : opt nat64;
memo : opt blob;
from_subaccount : opt blob;
created_at_time : opt Timestamp;
amount : nat;
expected_allowance : opt nat;
expires_at : opt nat64;
expires_at : opt Timestamp;
spender : Account;
};
type ApproveError = variant {
GenericError : record { message : text; error_code : nat };
TemporarilyUnavailable;
Duplicate : record { duplicate_of : nat };
Duplicate : record { duplicate_of : BlockIndex };
BadFee : record { expected_fee : nat };
AllowanceChanged : record { current_allowance : nat };
CreatedInFuture : record { ledger_time : nat64 };
CreatedInFuture : record { ledger_time : Timestamp };
TooOld;
Expired : record { ledger_time : nat64 };
Expired : record { ledger_time : Timestamp };
InsufficientFunds : record { balance : nat };
};
type ApproveResult = variant { Ok : nat; Err : ApproveError };
type ApproveResult = variant { Ok : BlockIndex; Err : ApproveError };

type HttpRequest = record {
url : text;
method : text;
body : vec nat8;
body : blob;
headers : vec record { text; text };
};
type HttpResponse = record {
body : vec nat8;
body : blob;
headers : vec record { text; text };
status_code : nat16;
};
Expand All @@ -73,7 +73,7 @@ type TransferError = variant {
BadBurn : record { min_burn_amount : Tokens };
InsufficientFunds : record { balance : Tokens };
TooOld;
CreatedInFuture : record { ledger_time : nat64 };
CreatedInFuture : record { ledger_time : Timestamp };
TemporarilyUnavailable;
Duplicate : record { duplicate_of : BlockIndex };
GenericError : record { error_code : nat; message : text };
Expand Down Expand Up @@ -214,31 +214,31 @@ type Transaction = record {
kind : text;
mint : opt Mint;
approve : opt Approve;
timestamp : nat64;
timestamp : Timestamp;
transfer : opt Transfer;
};

type Burn = record {
from : Account;
memo : opt vec nat8;
created_at_time : opt nat64;
memo : opt blob;
created_at_time : opt Timestamp;
amount : nat;
spender : opt Account;
};

type Mint = record {
to : Account;
memo : opt vec nat8;
created_at_time : opt nat64;
memo : opt blob;
created_at_time : opt Timestamp;
amount : nat;
};

type Transfer = record {
to : Account;
fee : opt nat;
from : Account;
memo : opt vec nat8;
created_at_time : opt nat64;
memo : opt blob;
created_at_time : opt Timestamp;
amount : nat;
spender : opt Account;
};
Expand Down Expand Up @@ -352,7 +352,7 @@ type TransferFromError = variant {
InsufficientFunds : record { balance : Tokens };
InsufficientAllowance : record { allowance : Tokens };
TooOld;
CreatedInFuture : record { ledger_time : nat64 };
CreatedInFuture : record { ledger_time : Timestamp };
Duplicate : record { duplicate_of : BlockIndex };
TemporarilyUnavailable;
GenericError : record { error_code : nat; message : text };
Expand Down
Loading

0 comments on commit 540e342

Please sign in to comment.