add withdrawStartWithMetaData in erc721 pos
MODIFY
src/pos/erc721.ts
src/pos/erc721.ts
@@ -205,6 +205,19 @@ export class ERC721 extends POSToken {
});
}
+ withdrawStartWithMetaData(tokenId: TYPE_AMOUNT, option?: ITransactionOption) {
+ this.checkForChild("withdrawStartWithMetaData");
+
+
+ return this.getContract().then(contract => {
+ const method = contract.method(
+ "withdrawWithMetadata",
+ Converter.toHex(tokenId)
+ );
+ return this.processWrite(method, option);
+ });
+ }
+
withdrawStartMany(tokenIds: TYPE_AMOUNT[], option?: ITransactionOption) {
this.checkForChild("withdrawStartMany");

MODIFY
test/specs/erc721.spec.ts
test/specs/erc721.spec.ts
@@ -101,6 +101,14 @@ describe('ERC721', () => {
expect(result['to'].toLowerCase()).equal(erc721.child.toLowerCase());
})
+ it('withdrawStartWithMetaData return tx', async () => {
+ const allTokens = await erc721Child.getAllTokens(from);
+ const result = await erc721Child.withdrawStartWithMetaData(allTokens[0], {
+ returnTransaction: true
+ });
+ expect(result['to'].toLowerCase()).equal(erc721.child.toLowerCase());
+ })
+
it('transfer write', async () => {
const allTokensFrom = await erc721Child.getAllTokens(from);
// console.log('allTokensFrom', allTokensFrom);

add withdrawStartWithMetaData in erc721 pos