File tree Expand file tree Collapse file tree 2 files changed +15
-19
lines changed Expand file tree Collapse file tree 2 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,12 @@ test("AssetTransferTransaction fromJSON", async () => {
5454 . createMintTransaction ( { recipient : addressA } ) ;
5555 await sendTransactions ( { transactions : [ mintTx ] } ) ;
5656 const firstAsset = await sdk . rpc . chain . getAsset ( mintTx . hash ( ) , 0 ) ;
57-
58- const transferTx = await firstAsset . createTransferTransaction ( {
59- recipients : [
60- {
61- address : addressB ,
62- amount : 100
63- }
64- ]
57+ const transferTx = await sdk . core . createAssetTransferTransaction ( ) ;
58+ transferTx . addInputs ( firstAsset ) ;
59+ transferTx . addOutputs ( {
60+ assetType : firstAsset . assetType ,
61+ recipient : addressB ,
62+ amount : 100
6563 } ) ;
6664 sdk . key . signTransactionInput ( transferTx , 0 ) ;
6765 const { parcelHash } = await sendTransactions ( {
Original file line number Diff line number Diff line change @@ -96,18 +96,16 @@ export class Asset {
9696 } ) ;
9797 }
9898
99- public createTransferTransaction (
100- params : {
101- recipients : Array < {
102- address : AssetTransferAddress | string ;
103- amount : number ;
104- } > ;
105- nonce ?: number ;
106- networkId ?: NetworkId ;
107- } = { recipients : [ ] }
108- ) : AssetTransferTransaction {
99+ public createTransferTransaction ( params : {
100+ recipients ?: Array < {
101+ address : AssetTransferAddress | string ;
102+ amount : number ;
103+ } > ;
104+ nonce ?: number ;
105+ networkId : NetworkId ;
106+ } ) : AssetTransferTransaction {
109107 const { outPoint, assetType } = this ;
110- const { recipients, nonce = 0 , networkId = "tc" } = params ;
108+ const { recipients = [ ] , nonce = 0 , networkId } = params ;
111109
112110 return new AssetTransferTransaction ( {
113111 burns : [ ] ,
You can’t perform that action at this time.
0 commit comments