-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send Native token in MultiESDTNFTTransfer #462
Conversation
|
||
if (nativeTransferAmount && numberOfTokens) { | ||
throw new ErrBadUsage("Can't send both native tokens and custom tokens(ESDT/NFT)"); | ||
const nativeTransfer = TokenTransfer.newFromEgldAmount(nativeTransferAmount); | ||
tokenTransfers.push(nativeTransfer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use array concatenation, similar to Python?
@@ -82,18 +82,10 @@ export class TransferTransactionsFactory { | |||
return this.gasEstimator !== undefined; | |||
} | |||
|
|||
private ensureMembersAreDefined() { | |||
private ensureConfigIsDefined() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the presence of this.config
indicates the presence of tokenComputer
and tokenTransfersDataBuilder
, as well. Also, we can set this.tokenComputer
and this.tokenTransfersDataBuilder
in constructor no matter what (irrespective to isGasEstimator()
).
In v14, this is the first legacy thing to be dropped :)
} | ||
|
||
const nativeTransfer = nativeAmount ? TokenTransfer.newFromEgldAmount(nativeAmount) : undefined; | ||
nativeTransfer ? tokenTransfers.push(nativeTransfer) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above, array concatenation can be used (optional).
Added support to send both native and esdt tokens using
MultiESDTNFTTransfer
.