Skip to content

Commit

Permalink
feat: update ckETH minter
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Nov 18, 2024
1 parent aed8e3b commit 820bc2e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/cketh/candid/minter.certified.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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({
Expand Down Expand Up @@ -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 });
Expand Down
4 changes: 4 additions & 0 deletions packages/cketh/candid/minter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 =
Expand All @@ -356,6 +359,7 @@ export type WithdrawErc20Error =
| { RecipientAddressBlocked: { address: string } };
export interface WithdrawalArg {
recipient: string;
from_subaccount: [] | [Subaccount];
amount: bigint;
}
export interface WithdrawalDetail {
Expand Down
22 changes: 20 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 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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions packages/cketh/candid/minter.idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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({
Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 820bc2e

Please sign in to comment.