From 728945dcdde62eb2f11e30e485b06f5bec40d26c Mon Sep 17 00:00:00 2001 From: Moritz Fuller Date: Mon, 6 May 2024 09:30:04 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A9=B9=E2=80=87use=20ledger=20types?= =?UTF-8?q?=20directly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- motoko/token_transfer_from/README.md | 7 +------ .../src/token_transfer_from_backend/main.mo | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/motoko/token_transfer_from/README.md b/motoko/token_transfer_from/README.md index 3afca6559..475cd5bf2 100644 --- a/motoko/token_transfer_from/README.md +++ b/motoko/token_transfer_from/README.md @@ -184,14 +184,9 @@ import Error "mo:base/Error"; actor { - type Account = { - owner : Principal; - subaccount : ?[Nat8]; - }; - type TransferArgs = { amount : Nat; - toAccount : Account; + toAccount : Icrc1Ledger.Account; }; public shared ({ caller }) func transfer(args : TransferArgs) : async Result.Result { diff --git a/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo b/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo index 568164978..fd37c8e35 100644 --- a/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo +++ b/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo @@ -7,14 +7,9 @@ import Error "mo:base/Error"; actor { - type Account = { - owner : Principal; - subaccount : ?[Nat8]; - }; - type TransferArgs = { amount : Nat; - toAccount : Account; + toAccount : Icrc1Ledger.Account; }; public shared ({ caller }) func transfer(args : TransferArgs) : async Result.Result { From e5365e96b8e082835824f5b72a45366a2f0f829f Mon Sep 17 00:00:00 2001 From: Moritz Fuller Date: Mon, 6 May 2024 09:30:26 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=A5=E2=80=87removed=20unnecessary?= =?UTF-8?q?=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- motoko/token_transfer_from/README.md | 2 -- .../token_transfer_from/src/token_transfer_from_backend/main.mo | 2 -- 2 files changed, 4 deletions(-) diff --git a/motoko/token_transfer_from/README.md b/motoko/token_transfer_from/README.md index 475cd5bf2..79bbbed2e 100644 --- a/motoko/token_transfer_from/README.md +++ b/motoko/token_transfer_from/README.md @@ -178,8 +178,6 @@ Replace the contents of the `src/token_transfer_from_backend/main.mo` file with import Icrc1Ledger "canister:icrc1_ledger_canister"; import Debug "mo:base/Debug"; import Result "mo:base/Result"; -import Option "mo:base/Option"; -import Blob "mo:base/Blob"; import Error "mo:base/Error"; actor { diff --git a/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo b/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo index fd37c8e35..ab2330bc2 100644 --- a/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo +++ b/motoko/token_transfer_from/src/token_transfer_from_backend/main.mo @@ -1,8 +1,6 @@ import Icrc1Ledger "canister:icrc1_ledger_canister"; import Debug "mo:base/Debug"; import Result "mo:base/Result"; -import Option "mo:base/Option"; -import Blob "mo:base/Blob"; import Error "mo:base/Error"; actor {