Skip to content

Commit

Permalink
Merge pull request #419 from Cryptonomic/as-tokentransfer
Browse files Browse the repository at this point in the history
FA2 token transfer conseiljs update
  • Loading branch information
anonymoussprocket authored Oct 14, 2021
2 parents 4bfd9bb + 988c3d3 commit 9a94894
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/contracts/NFT/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,16 @@ export async function transferNFT(
freight?: number
): Promise<string> {
try {
return await MultiAssetTokenHelper.transfer(server, address, signer, keystore, fee, source, transfers, gas, freight);
const transferPairs = [
{
source,
txs: transfers.map((t) => {
return { destination: t.address, token_id: t.tokenid, amount: t.amount };
}),
},
];

return await MultiAssetTokenHelper.transfer(server, address, signer, keystore, fee, transferPairs, gas, freight);
} catch (err) {
throw new TransferNFTError('components.messageBar.messages.nft_send_transaction_failed', transfers);
}
Expand Down
3 changes: 1 addition & 2 deletions src/contracts/Token2Contract/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export function transferThunk(destination: string, amount: number, fee: number,
isLedger ? signer : await cloneDecryptedSigner(signer, password),
keyStore,
fee,
selectedParentHash,
[{ address: destination, tokenid: token.tokenIndex, amount }],
[{ source: selectedParentHash, txs: [{ destination, token_id: token.tokenIndex, amount }] }],
0,
0
).catch((err) => {
Expand Down

0 comments on commit 9a94894

Please sign in to comment.