Skip to content

Commit 754d7be

Browse files
Merge pull request #860 from dfinity/fix/token-transfer-from
Fix/token transfer from
2 parents 60b6fa9 + e5365e9 commit 754d7be

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

motoko/token_transfer_from/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,13 @@ Replace the contents of the `src/token_transfer_from_backend/main.mo` file with
178178
import Icrc1Ledger "canister:icrc1_ledger_canister";
179179
import Debug "mo:base/Debug";
180180
import Result "mo:base/Result";
181-
import Option "mo:base/Option";
182-
import Blob "mo:base/Blob";
183181
import Error "mo:base/Error";
184182

185183
actor {
186184

187-
type Account = {
188-
owner : Principal;
189-
subaccount : ?[Nat8];
190-
};
191-
192185
type TransferArgs = {
193186
amount : Nat;
194-
toAccount : Account;
187+
toAccount : Icrc1Ledger.Account;
195188
};
196189

197190
public shared ({ caller }) func transfer(args : TransferArgs) : async Result.Result<Icrc1Ledger.BlockIndex, Text> {

motoko/token_transfer_from/src/token_transfer_from_backend/main.mo

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
import Icrc1Ledger "canister:icrc1_ledger_canister";
22
import Debug "mo:base/Debug";
33
import Result "mo:base/Result";
4-
import Option "mo:base/Option";
5-
import Blob "mo:base/Blob";
64
import Error "mo:base/Error";
75

86
actor {
97

10-
type Account = {
11-
owner : Principal;
12-
subaccount : ?[Nat8];
13-
};
14-
158
type TransferArgs = {
169
amount : Nat;
17-
toAccount : Account;
10+
toAccount : Icrc1Ledger.Account;
1811
};
1912

2013
public shared ({ caller }) func transfer(args : TransferArgs) : async Result.Result<Icrc1Ledger.BlockIndex, Text> {

0 commit comments

Comments
 (0)