Skip to content

Commit

Permalink
Update IC commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gix-bot authored May 13, 2024
1 parent f32c162 commit 5870af2
Show file tree
Hide file tree
Showing 22 changed files with 201 additions and 21 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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
// 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
// Represents an account on the ckBTC ledger.
type Account = record { owner : principal; subaccount : opt blob };

Expand Down
37 changes: 36 additions & 1 deletion packages/cketh/candid/minter.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ export const idlFactory = ({ IDL }) => {
'eth_helper_contract_address' : IDL.Opt(IDL.Text),
'last_observed_block_number' : IDL.Opt(IDL.Nat),
'erc20_helper_contract_address' : IDL.Opt(IDL.Text),
'last_erc20_scraped_block_number' : IDL.Opt(IDL.Nat),
'supported_ckerc20_tokens' : IDL.Opt(IDL.Vec(CkErc20Token)),
'last_gas_fee_estimate' : IDL.Opt(GasFeeEstimate),
'smart_contract_address' : IDL.Opt(IDL.Text),
'last_eth_scraped_block_number' : IDL.Opt(IDL.Nat),
'minimum_withdrawal_amount' : IDL.Opt(IDL.Nat),
'erc20_balances' : IDL.Opt(
IDL.Vec(
Expand All @@ -243,7 +245,10 @@ export const idlFactory = ({ IDL }) => {
});
const EthTransaction = IDL.Record({ 'transaction_hash' : IDL.Text });
const TxFinalizedStatus = IDL.Variant({
'Success' : EthTransaction,
'Success' : IDL.Record({
'transaction_hash' : IDL.Text,
'effective_transaction_fee' : IDL.Opt(IDL.Nat),
}),
'Reimbursed' : IDL.Record({
'transaction_hash' : IDL.Text,
'reimbursed_amount' : IDL.Nat,
Expand Down Expand Up @@ -312,6 +317,31 @@ export const idlFactory = ({ IDL }) => {
'RecipientAddressBlocked' : IDL.Record({ 'address' : IDL.Text }),
'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),
});
const Account = IDL.Record({
'owner' : IDL.Principal,
'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
});
const WithdrawalSearchParameter = IDL.Variant({
'ByRecipient' : IDL.Text,
'BySenderAccount' : Account,
'ByWithdrawalId' : IDL.Nat64,
});
const WithdrawalStatus = IDL.Variant({
'TxFinalized' : TxFinalizedStatus,
'TxSent' : EthTransaction,
'TxCreated' : IDL.Null,
'Pending' : IDL.Null,
});
const WithdrawalDetail = IDL.Record({
'status' : WithdrawalStatus,
'token_symbol' : IDL.Text,
'withdrawal_amount' : IDL.Nat,
'withdrawal_id' : IDL.Nat64,
'from' : IDL.Principal,
'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'max_transaction_fee' : IDL.Opt(IDL.Nat),
'recipient_address' : IDL.Text,
});
return IDL.Service({
'add_ckerc20_token' : IDL.Func([AddCkErc20Token], [], []),
'eip_1559_transaction_price' : IDL.Func([], [Eip1559TransactionPrice], []),
Expand Down Expand Up @@ -346,6 +376,11 @@ export const idlFactory = ({ IDL }) => {
[IDL.Variant({ 'Ok' : RetrieveEthRequest, 'Err' : WithdrawalError })],
[],
),
'withdrawal_status' : IDL.Func(
[WithdrawalSearchParameter],
[IDL.Vec(WithdrawalDetail)],
[],
),
});
};
export const init = ({ IDL }) => {
Expand Down
36 changes: 35 additions & 1 deletion packages/cketh/candid/minter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import type { ActorMethod } from "@dfinity/agent";
import type { IDL } from "@dfinity/candid";
import type { Principal } from "@dfinity/principal";

export interface Account {
owner: Principal;
subaccount: [] | [Uint8Array | number[]];
}
export interface AddCkErc20Token {
ckerc20_ledger_id: Principal;
chain_id: bigint;
Expand Down Expand Up @@ -226,9 +230,11 @@ export interface MinterInfo {
eth_helper_contract_address: [] | [string];
last_observed_block_number: [] | [bigint];
erc20_helper_contract_address: [] | [string];
last_erc20_scraped_block_number: [] | [bigint];
supported_ckerc20_tokens: [] | [Array<CkErc20Token>];
last_gas_fee_estimate: [] | [GasFeeEstimate];
smart_contract_address: [] | [string];
last_eth_scraped_block_number: [] | [bigint];
minimum_withdrawal_amount: [] | [bigint];
erc20_balances:
| []
Expand Down Expand Up @@ -273,7 +279,12 @@ export interface TransactionReceipt {
gas_used: bigint;
}
export type TxFinalizedStatus =
| { Success: EthTransaction }
| {
Success: {
transaction_hash: string;
effective_transaction_fee: [] | [bigint];
};
}
| {
Reimbursed: {
transaction_hash: string;
Expand Down Expand Up @@ -327,12 +338,31 @@ export interface WithdrawalArg {
recipient: string;
amount: bigint;
}
export interface WithdrawalDetail {
status: WithdrawalStatus;
token_symbol: string;
withdrawal_amount: bigint;
withdrawal_id: bigint;
from: Principal;
from_subaccount: [] | [Uint8Array | number[]];
max_transaction_fee: [] | [bigint];
recipient_address: string;
}
export type WithdrawalError =
| { TemporarilyUnavailable: string }
| { InsufficientAllowance: { allowance: bigint } }
| { AmountTooLow: { min_withdrawal_amount: bigint } }
| { RecipientAddressBlocked: { address: string } }
| { InsufficientFunds: { balance: bigint } };
export type WithdrawalSearchParameter =
| { ByRecipient: string }
| { BySenderAccount: Account }
| { ByWithdrawalId: bigint };
export type WithdrawalStatus =
| { TxFinalized: TxFinalizedStatus }
| { TxSent: EthTransaction }
| { TxCreated: null }
| { Pending: null };
export interface _SERVICE {
add_ckerc20_token: ActorMethod<[AddCkErc20Token], undefined>;
eip_1559_transaction_price: ActorMethod<[], Eip1559TransactionPrice>;
Expand All @@ -354,6 +384,10 @@ export interface _SERVICE {
[WithdrawalArg],
{ Ok: RetrieveEthRequest } | { Err: WithdrawalError }
>;
withdrawal_status: ActorMethod<
[WithdrawalSearchParameter],
Array<WithdrawalDetail>
>;
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
73 changes: 71 additions & 2 deletions packages/cketh/candid/minter.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from IC repo commit f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid
// 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
type EthereumNetwork = variant {
// The public Ethereum mainnet.
Mainnet;
Expand Down Expand Up @@ -167,6 +167,12 @@ type MinterInfo = record {
// Amount of ETH in Wei controlled by the minter.
// This might be less that the actual amount available on the `minter_address()`.
erc20_balances : opt vec record { erc20_contract_address: text; balance: nat};

// Last scraped block number for logs of the ETH helper contract.
last_eth_scraped_block_number: opt nat;

// Last scraped block number for logs of the ERC20 helper contract.
last_erc20_scraped_block_number: opt nat;
};


Expand All @@ -189,7 +195,10 @@ type EthTransaction = record { transaction_hash : text };
// Status of a finalized transaction.
type TxFinalizedStatus = variant {
// Transaction was successful.
Success : EthTransaction;
Success : record {
transaction_hash : text;
effective_transaction_fee: opt nat;
};
// Transaction failed, user got reimbursed.
Reimbursed : record {
transaction_hash : text;
Expand Down Expand Up @@ -221,6 +230,63 @@ type RetrieveEthStatus = variant {

type WithdrawalArg = record { recipient : text; amount : nat };

// Details of a withdrawal request and its status.
type WithdrawalDetail = record {
// Symbol of the withdrawal token (either ckETH or ckERC20 token symbol).
token_symbol : text;

// Amount of tokens in base unit that was withdrawn.
withdrawal_amount : nat;

// Max transaction fee in Wei (transaction fee paid by the sender).
max_transaction_fee : opt nat;

// Withdrawal id (i.e. burn index on the ckETH ledger).
withdrawal_id : nat64;

// Sender's principal.
from : principal;

// Sender's subaccount (if given).
from_subaccount : opt blob;

// Address to send tokens to.
recipient_address : text;

// Withdrawal status
status : WithdrawalStatus;
};

// Status of a withdrawal request.
type WithdrawalStatus = variant {
// Request is pending, i.e. transaction is not yet created.
Pending;

// Transaction created byt not yet sent.
TxCreated;

// Transaction sent but not yet finalized.
TxSent : EthTransaction;

// Transaction already finalized.
TxFinalized : TxFinalizedStatus;
};

// ICRC-1 account type.
type Account = record { owner : principal; subaccount : opt blob };

// Search parameter for withdrawals.
type WithdrawalSearchParameter = variant {
// Search by recipient's ETH address.
ByRecipient : text;

// Search by sender's token account.
BySenderAccount : Account;

// Search by ckETH burn index (which is also used to index ckERC20 withdrawals).
ByWithdrawalId : nat64;
};

type RetrieveEthRequest = record { block_index : nat };

type WithdrawalError = variant {
Expand Down Expand Up @@ -489,6 +555,9 @@ service : (MinterArg) -> {
// Retrieve the status of a Eth withdrawal request.
retrieve_eth_status : (nat64) -> (RetrieveEthStatus);

// Return details of all withdrawals matching the given search parameter.
withdrawal_status : (WithdrawalSearchParameter) -> (vec WithdrawalDetail) query;

// Check if an address is blocked by the minter.
is_address_blocked : (text) -> (bool) query;

Expand Down
37 changes: 36 additions & 1 deletion packages/cketh/candid/minter.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ export const idlFactory = ({ IDL }) => {
'eth_helper_contract_address' : IDL.Opt(IDL.Text),
'last_observed_block_number' : IDL.Opt(IDL.Nat),
'erc20_helper_contract_address' : IDL.Opt(IDL.Text),
'last_erc20_scraped_block_number' : IDL.Opt(IDL.Nat),
'supported_ckerc20_tokens' : IDL.Opt(IDL.Vec(CkErc20Token)),
'last_gas_fee_estimate' : IDL.Opt(GasFeeEstimate),
'smart_contract_address' : IDL.Opt(IDL.Text),
'last_eth_scraped_block_number' : IDL.Opt(IDL.Nat),
'minimum_withdrawal_amount' : IDL.Opt(IDL.Nat),
'erc20_balances' : IDL.Opt(
IDL.Vec(
Expand All @@ -243,7 +245,10 @@ export const idlFactory = ({ IDL }) => {
});
const EthTransaction = IDL.Record({ 'transaction_hash' : IDL.Text });
const TxFinalizedStatus = IDL.Variant({
'Success' : EthTransaction,
'Success' : IDL.Record({
'transaction_hash' : IDL.Text,
'effective_transaction_fee' : IDL.Opt(IDL.Nat),
}),
'Reimbursed' : IDL.Record({
'transaction_hash' : IDL.Text,
'reimbursed_amount' : IDL.Nat,
Expand Down Expand Up @@ -312,6 +317,31 @@ export const idlFactory = ({ IDL }) => {
'RecipientAddressBlocked' : IDL.Record({ 'address' : IDL.Text }),
'InsufficientFunds' : IDL.Record({ 'balance' : IDL.Nat }),
});
const Account = IDL.Record({
'owner' : IDL.Principal,
'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
});
const WithdrawalSearchParameter = IDL.Variant({
'ByRecipient' : IDL.Text,
'BySenderAccount' : Account,
'ByWithdrawalId' : IDL.Nat64,
});
const WithdrawalStatus = IDL.Variant({
'TxFinalized' : TxFinalizedStatus,
'TxSent' : EthTransaction,
'TxCreated' : IDL.Null,
'Pending' : IDL.Null,
});
const WithdrawalDetail = IDL.Record({
'status' : WithdrawalStatus,
'token_symbol' : IDL.Text,
'withdrawal_amount' : IDL.Nat,
'withdrawal_id' : IDL.Nat64,
'from' : IDL.Principal,
'from_subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'max_transaction_fee' : IDL.Opt(IDL.Nat),
'recipient_address' : IDL.Text,
});
return IDL.Service({
'add_ckerc20_token' : IDL.Func([AddCkErc20Token], [], []),
'eip_1559_transaction_price' : IDL.Func(
Expand Down Expand Up @@ -350,6 +380,11 @@ export const idlFactory = ({ IDL }) => {
[IDL.Variant({ 'Ok' : RetrieveEthRequest, 'Err' : WithdrawalError })],
[],
),
'withdrawal_status' : IDL.Func(
[WithdrawalSearchParameter],
[IDL.Vec(WithdrawalDetail)],
['query'],
),
});
};
export const init = ({ IDL }) => {
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/nns/cmc/cmc.did' by import-candid
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/rosetta-api/icp_ledger/index/index.did' by import-candid
// 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
type Account = record { owner : principal; subaccount : opt vec nat8 };
type GetAccountIdentifierTransactionsArgs = record {
max_results : nat64;
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/rosetta-api/icp_ledger/ledger.did' by import-candid
// 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
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/rosetta-api/icrc1/index-ng/index-ng.did' by import-candid
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/rosetta-api/icrc1/index/index.did' by import-candid
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/rosetta-api/icrc1/ledger/ledger.did' by import-candid
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/nns/gtc/canister/gtc.did' by import-candid
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/nns/governance/canister/governance.did' by import-candid
// 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
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 f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) 'rs/nns/governance/canister/governance_test.did' by import-candid
// 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
type AccountIdentifier = record { hash : blob };
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
Expand Down
1 change: 1 addition & 0 deletions packages/nns/candid/sns_wasm.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const idlFactory = ({ IDL }) => {
});
const SnsWasm = IDL.Record({
'wasm' : IDL.Vec(IDL.Nat8),
'proposal_id' : IDL.Opt(IDL.Nat64),
'canister_type' : IDL.Int32,
});
const AddWasmRequest = IDL.Record({
Expand Down
1 change: 1 addition & 0 deletions packages/nns/candid/sns_wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export interface SnsVersion {
}
export interface SnsWasm {
wasm: Uint8Array | number[];
proposal_id: [] | [bigint];
canister_type: number;
}
export interface SnsWasmCanisterInitPayload {
Expand Down
Loading

0 comments on commit 5870af2

Please sign in to comment.