From 820bc2e2e26a1cd1909b063b46d3779580a88455 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 18 Nov 2024 16:31:31 +0100 Subject: [PATCH] feat: update ckETH minter Signed-off-by: David Dal Busco --- packages/cketh/candid/minter.certified.idl.js | 4 ++++ packages/cketh/candid/minter.d.ts | 4 ++++ packages/cketh/candid/minter.did | 22 +++++++++++++++++-- packages/cketh/candid/minter.idl.js | 4 ++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/cketh/candid/minter.certified.idl.js b/packages/cketh/candid/minter.certified.idl.js index f905b330a..09ce19adc 100644 --- a/packages/cketh/candid/minter.certified.idl.js +++ b/packages/cketh/candid/minter.certified.idl.js @@ -264,6 +264,7 @@ export const idlFactory = ({ IDL }) => { ) ), 'minter_address' : IDL.Opt(IDL.Text), + 'last_deposit_with_subaccount_scraped_block_number' : IDL.Opt(IDL.Nat), 'ethereum_block_height' : IDL.Opt(BlockTag), }); const EthTransaction = IDL.Record({ 'transaction_hash' : IDL.Text }); @@ -289,6 +290,8 @@ export const idlFactory = ({ IDL }) => { const WithdrawErc20Arg = IDL.Record({ 'ckerc20_ledger_id' : IDL.Principal, 'recipient' : IDL.Text, + 'from_cketh_subaccount' : IDL.Opt(Subaccount), + 'from_ckerc20_subaccount' : IDL.Opt(Subaccount), 'amount' : IDL.Nat, }); const RetrieveErc20Request = IDL.Record({ @@ -330,6 +333,7 @@ export const idlFactory = ({ IDL }) => { }); const WithdrawalArg = IDL.Record({ 'recipient' : IDL.Text, + 'from_subaccount' : IDL.Opt(Subaccount), 'amount' : IDL.Nat, }); const RetrieveEthRequest = IDL.Record({ 'block_index' : IDL.Nat }); diff --git a/packages/cketh/candid/minter.d.ts b/packages/cketh/candid/minter.d.ts index 77b6c25bc..40be61dbd 100644 --- a/packages/cketh/candid/minter.d.ts +++ b/packages/cketh/candid/minter.d.ts @@ -256,6 +256,7 @@ export interface MinterInfo { | [] | [Array<{ balance: bigint; erc20_contract_address: string }>]; minter_address: [] | [string]; + last_deposit_with_subaccount_scraped_block_number: [] | [bigint]; ethereum_block_height: [] | [BlockTag]; } export interface QueryStats { @@ -339,6 +340,8 @@ export interface UpgradeArg { export interface WithdrawErc20Arg { ckerc20_ledger_id: Principal; recipient: string; + from_cketh_subaccount: [] | [Subaccount]; + from_ckerc20_subaccount: [] | [Subaccount]; amount: bigint; } export type WithdrawErc20Error = @@ -356,6 +359,7 @@ export type WithdrawErc20Error = | { RecipientAddressBlocked: { address: string } }; export interface WithdrawalArg { recipient: string; + from_subaccount: [] | [Subaccount]; amount: bigint; } export interface WithdrawalDetail { diff --git a/packages/cketh/candid/minter.did b/packages/cketh/candid/minter.did index a0705c80c..7af94a899 100644 --- a/packages/cketh/candid/minter.did +++ b/packages/cketh/candid/minter.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit c47e172 (2024-10-25 tags: release-2024-11-07_03-07-6.11-kernel) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid +// Generated from IC repo commit cb3cb61 (2024-11-14 tags: release-2024-11-14_03-07-base) 'rs/ethereum/cketh/minter/cketh_minter.did' by import-candid type EthereumNetwork = variant { // The public Ethereum mainnet. Mainnet; @@ -202,6 +202,9 @@ type MinterInfo = record { // Last scraped block number for logs of the ERC20 helper contract. last_erc20_scraped_block_number: opt nat; + // Last scraped block number for logs of the deposit with subaccount helper contract. + last_deposit_with_subaccount_scraped_block_number: opt nat; + // Canister ID of the ckETH ledger. cketh_ledger_id: opt principal; @@ -263,7 +266,16 @@ type RetrieveEthStatus = variant { TxFinalized : TxFinalizedStatus; }; -type WithdrawalArg = record { recipient : text; amount : nat }; +type WithdrawalArg = record { + // The address to which the minter should deposit ETH. + recipient : text; + + // The amount of ckETH in Wei that the client wants to withdraw. + amount : nat; + + // The subaccount to burn ckETH from. + from_subaccount : opt Subaccount; +}; // Details of a withdrawal request and its status. type WithdrawalDetail = record { @@ -351,6 +363,12 @@ type WithdrawErc20Arg = record { // Ethereum address to withdraw to. recipient : text; + + // The subaccount to burn ckETH from to pay for the transaction fee. + from_cketh_subaccount : opt Subaccount; + + // The subaccount to burn ckERC20 from. + from_ckerc20_subaccount : opt Subaccount; }; type RetrieveErc20Request = record { diff --git a/packages/cketh/candid/minter.idl.js b/packages/cketh/candid/minter.idl.js index 48ff9024b..335ddb194 100644 --- a/packages/cketh/candid/minter.idl.js +++ b/packages/cketh/candid/minter.idl.js @@ -264,6 +264,7 @@ export const idlFactory = ({ IDL }) => { ) ), 'minter_address' : IDL.Opt(IDL.Text), + 'last_deposit_with_subaccount_scraped_block_number' : IDL.Opt(IDL.Nat), 'ethereum_block_height' : IDL.Opt(BlockTag), }); const EthTransaction = IDL.Record({ 'transaction_hash' : IDL.Text }); @@ -289,6 +290,8 @@ export const idlFactory = ({ IDL }) => { const WithdrawErc20Arg = IDL.Record({ 'ckerc20_ledger_id' : IDL.Principal, 'recipient' : IDL.Text, + 'from_cketh_subaccount' : IDL.Opt(Subaccount), + 'from_ckerc20_subaccount' : IDL.Opt(Subaccount), 'amount' : IDL.Nat, }); const RetrieveErc20Request = IDL.Record({ @@ -330,6 +333,7 @@ export const idlFactory = ({ IDL }) => { }); const WithdrawalArg = IDL.Record({ 'recipient' : IDL.Text, + 'from_subaccount' : IDL.Opt(Subaccount), 'amount' : IDL.Nat, }); const RetrieveEthRequest = IDL.Record({ 'block_index' : IDL.Nat });