UNPKG

@hashgraph/sdk

Version:
3 lines (2 loc) 1.09 kB
import r from"long";import o from"../account/AccountId.js";import e from"./TokenId.js";class t{constructor(t){this.tokenId=t.tokenId instanceof e?t.tokenId:e.fromString(t.tokenId),this.senderAccountId=t.senderAccountId instanceof o?t.senderAccountId:o.fromString(t.senderAccountId),this.receiverAccountId=t.receiverAccountId instanceof o?t.receiverAccountId:o.fromString(t.receiverAccountId),this.serialNumber=r.fromValue(t.serialNumber),this.isApproved=t.isApproved}static _fromProtobuf(n){const c=[];for(const s of n){const n=e._fromProtobuf(s.token);for(const e of null!=s.nftTransfers?s.nftTransfers:[])c.push(new t({tokenId:n,senderAccountId:o._fromProtobuf(e.senderAccountID),receiverAccountId:o._fromProtobuf(e.receiverAccountID),serialNumber:null!=e.serialNumber?e.serialNumber:r.ZERO,isApproved:1==e.isApproval}))}return c}_toProtobuf(){return{senderAccountID:this.senderAccountId._toProtobuf(),receiverAccountID:this.receiverAccountId._toProtobuf(),serialNumber:this.serialNumber,isApproval:this.isApproved}}}export{t as default}; //# sourceMappingURL=TokenNftTransfer.js.map