From 92e93380f0477dbe96e9ffc58001428c97c3ddeb Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Wed, 13 Sep 2023 10:56:34 +0200 Subject: [PATCH] feat: use types --- packages/ledger/src/ledger.canister.ts | 2 +- packages/ledger/src/types/ledger.params.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ledger/src/ledger.canister.ts b/packages/ledger/src/ledger.canister.ts index 57152f318..3e27f094c 100644 --- a/packages/ledger/src/ledger.canister.ts +++ b/packages/ledger/src/ledger.canister.ts @@ -120,7 +120,7 @@ export class IcrcLedgerCanister extends Canister { * * @throws {IcrcTransferError} If the approval fails. */ - approve = async (params: ApproveParams): Promise => { + approve = async (params: ApproveParams): Promise => { const response = await this.caller({ certified: true }).icrc2_approve( toApproveArgs(params), ); diff --git a/packages/ledger/src/types/ledger.params.ts b/packages/ledger/src/types/ledger.params.ts index 5db9c76ea..095624a83 100644 --- a/packages/ledger/src/types/ledger.params.ts +++ b/packages/ledger/src/types/ledger.params.ts @@ -59,12 +59,12 @@ export type TransferFromParams = Omit & { * @param {Uint8Array?} memo Transfer memo. * @param {Timestamp?} created_at_time nanoseconds since unix epoc to trigger deduplication and avoid other issues * @param {Tokens?} fee The fee of the transfer when it's not the default fee. - * @param {bigint?} expected_allowance The optional allowance expected. If the expected_allowance field is set, the ledger MUST ensure that the current allowance for the spender from the caller's account is equal to the given value and return the AllowanceChanged error otherwise. - * @param {bigint?} expires_at When the approval expires. If the field is set, it's greater than the current ledger time. + * @param {Tokens?} expected_allowance The optional allowance expected. If the expected_allowance field is set, the ledger MUST ensure that the current allowance for the spender from the caller's account is equal to the given value and return the AllowanceChanged error otherwise. + * @param {Timestamp?} expires_at When the approval expires. If the field is set, it's greater than the current ledger time. */ export type ApproveParams = Omit & { - expected_allowance?: bigint; - expires_at?: bigint; + expected_allowance?: Tokens; + expires_at?: Timestamp; spender: Account; };