-
Notifications
You must be signed in to change notification settings - Fork 286
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
feat(sdk-core, sdk-coin-eth): add function to transfer nfts #4150
Conversation
Transferred NFT with method here: https://goerli.etherscan.io/tx/0xba821690529fd637d368e7fbeff165dc7af60c177ca5a46fc7a984e0320c3304 |
* Build the data to transfer an ERC-721 or ERC-1155 token to another address | ||
* @param params | ||
*/ | ||
buildNftTransferData(params: NFTTransferOptions & { fromAddress: string }): string { |
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.
I see that this is only implemented for abstractEthLikeNewCoins
and not abstractEthLike
. That's intentional right? I'm not super familiar on the ETH set up, just wanna make sure that we're only expecting it to be for these new coins
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.
I believe so, both eth
& polygon
extend from abstractEthLikeNewCoins
which are the only chains we need to implement nfts for atm.
recipients: [ | ||
{ | ||
address: sendNftOptions.tokenContractAddress, | ||
amount: '0', |
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.
Is there a case where we'd have any fees and it doesnt make sense for amount
to be 0?
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.
Don't think so, the documentation https://developers.bitgo.com/guides/transact/nfts says to always set the amount to 0.
- Add a new sendNftMethod to make transferring ERC-721/1155 tokens easier. - Expose function to construct call data for an ERC-721/1155 transfers TICKET: WP-1094
a8c6047
to
b77b386
Compare
const data = this.baseCoin.buildNftTransferData({ ...sendNftOptions, fromAddress: baseAddress }); | ||
return this.sendMany({ | ||
...sendOptions, | ||
recipients: [ | ||
{ | ||
address: sendNftOptions.tokenContractAddress, | ||
amount: '0', | ||
data: data, | ||
}, | ||
], | ||
}); |
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.
seems duplicated, a nit for another pr
Ticket: WP-1094
TICKET: WP-1094