From 1ab24463bb690ad4d9b374ffb8e07f2848456f29 Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Wed, 27 Sep 2023 09:38:05 +0200 Subject: [PATCH] Revert ledger --- packages/ledger/src/converters/ledger.converters.ts | 12 ++++++------ packages/ledger/src/types/ledger.params.ts | 8 ++++---- packages/sns/src/sns.wrapper.ts | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/ledger/src/converters/ledger.converters.ts b/packages/ledger/src/converters/ledger.converters.ts index b9b16e32..1d5282ed 100644 --- a/packages/ledger/src/converters/ledger.converters.ts +++ b/packages/ledger/src/converters/ledger.converters.ts @@ -19,12 +19,12 @@ export const toTransferArg = ({ from_subaccount, fee, created_at_time, - icrc1Memo, + memo, ...rest }: TransferParams): TransferArg => ({ ...rest, fee: toNullable(fee), - memo: toNullable(icrc1Memo), + memo: toNullable(memo), from_subaccount: toNullable(from_subaccount), created_at_time: toNullable(created_at_time), }); @@ -33,12 +33,12 @@ export const toTransferFromArgs = ({ spender_subaccount, fee, created_at_time, - icrc1Memo, + memo, ...rest }: TransferFromParams): TransferFromArgs => ({ ...rest, fee: toNullable(fee), - memo: toNullable(icrc1Memo), + memo: toNullable(memo), spender_subaccount: toNullable(spender_subaccount), created_at_time: toNullable(created_at_time), }); @@ -46,7 +46,7 @@ export const toTransferFromArgs = ({ export const toApproveArgs = ({ fee, created_at_time, - icrc1Memo, + memo, from_subaccount, expected_allowance, expires_at, @@ -54,7 +54,7 @@ export const toApproveArgs = ({ }: ApproveParams): ApproveArgs => ({ ...rest, fee: toNullable(fee), - memo: toNullable(icrc1Memo), + memo: toNullable(memo), from_subaccount: toNullable(from_subaccount), created_at_time: toNullable(created_at_time), expected_allowance: toNullable(expected_allowance), diff --git a/packages/ledger/src/types/ledger.params.ts b/packages/ledger/src/types/ledger.params.ts index 38b09dd1..7f4e4566 100644 --- a/packages/ledger/src/types/ledger.params.ts +++ b/packages/ledger/src/types/ledger.params.ts @@ -24,7 +24,7 @@ export type BalanceParams = IcrcAccount & QueryParams; * @param {Account} to The account to transfer tokens to. * @param {Tokens} amount The Amount of tokens to transfer. * @param {Subaccount?} from_subaccount The subaccount to transfer tokens to. - * @param {Uint8Array?} icrc1Memo Transfer memo. + * @param {Uint8Array?} memo Transfer memo. * @param {Timestamp?} created_at_time nanoseconds since unix epoc to trigger deduplication and avoid other issues * See the link for more details on deduplication * https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/README.md#transaction_deduplication @@ -33,7 +33,7 @@ export type BalanceParams = IcrcAccount & QueryParams; export interface TransferParams { to: Account; fee?: Tokens; - icrc1Memo?: Uint8Array; + memo?: Uint8Array; from_subaccount?: Subaccount; created_at_time?: Timestamp; amount: Tokens; @@ -46,7 +46,7 @@ export interface TransferParams { * @param {Account} from The account to transfer tokens from. * @param {Subaccount?} spender_subaccount A spender subaccount. * @param {Tokens} amount The Amount of tokens to transfer. - * @param {Uint8Array?} icrc1Memo Transfer memo. + * @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. */ @@ -61,7 +61,7 @@ export type TransferFromParams = Omit & { * @param {Account} spender The account of the spender. * @param {Tokens} amount The Amount of tokens to approve. * @param {Subaccount?} from_subaccount The subaccount to transfer tokens from. - * @param {Uint8Array?} icrc1Memo Transfer memo. + * @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 {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. diff --git a/packages/sns/src/sns.wrapper.ts b/packages/sns/src/sns.wrapper.ts index e0024cc1..d471fe45 100644 --- a/packages/sns/src/sns.wrapper.ts +++ b/packages/sns/src/sns.wrapper.ts @@ -276,7 +276,7 @@ export class SnsWrapper { subaccount: toNullable(neuronAccount.subaccount), }, from_subaccount: source.subaccount, - icrc1Memo: bigIntToUint8Array(index), + memo: bigIntToUint8Array(index), created_at_time: createdAt, fee, });