Skip to content

Commit

Permalink
feat: use types
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Sep 13, 2023
1 parent 93818ac commit 92e9338
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ledger/src/ledger.canister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class IcrcLedgerCanister extends Canister<IcrcLedgerService> {
*
* @throws {IcrcTransferError} If the approval fails.
*/
approve = async (params: ApproveParams): Promise<bigint> => {
approve = async (params: ApproveParams): Promise<BlockIndex> => {
const response = await this.caller({ certified: true }).icrc2_approve(
toApproveArgs(params),
);
Expand Down
8 changes: 4 additions & 4 deletions packages/ledger/src/types/ledger.params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ export type TransferFromParams = Omit<TransferParams, "from_subaccount"> & {
* @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<TransferParams, "to"> & {
expected_allowance?: bigint;
expires_at?: bigint;
expected_allowance?: Tokens;
expires_at?: Timestamp;
spender: Account;
};

Expand Down

0 comments on commit 92e9338

Please sign in to comment.