diff --git a/package.json b/package.json index aaad2b964b..d6cc39e7c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tatumio/tatum", - "version": "1.21.5", + "version": "1.21.6", "description": "Tatum API client allows browsers and Node.js clients to interact with Tatum API.", "main": "dist/src/index.js", "repository": "https://github.com/tatumio/tatum-js", diff --git a/src/model/request/egld/EsdtToken.ts b/src/model/request/egld/EsdtToken.ts index f33c8c486b..50cbdb803d 100644 --- a/src/model/request/egld/EsdtToken.ts +++ b/src/model/request/egld/EsdtToken.ts @@ -22,6 +22,7 @@ export enum EgldServiceType { ESDTNFTAddQuantity = 'ESDTNFTAddQuantity', ESDTNFTBurn = 'ESDTNFTBurn', freezeSingleNFT = 'freezeSingleNFT', + wipeSingleNFT = 'wipeSingleNFT', unFreezeSingleNFT = 'unFreezeSingleNFT', ESDTNFTTransfer = 'ESDTNFTTransfer', } diff --git a/src/transaction/egld.ts b/src/transaction/egld.ts index df43b16b0c..4612efb7c5 100644 --- a/src/transaction/egld.ts +++ b/src/transaction/egld.ts @@ -852,6 +852,39 @@ export const prepareEgldFreezeNftSignedTransaction = async (body: EgldEsdtTransa return await prepareSignedTransactionAbstraction(client, tx, signatureId, fromPrivateKey, { gasLimit, gasPrice: fee?.gasPrice as string } as Fee) } +/** + * Sign ESDT freeze NFT transaction with private keys locally. Nothing is broadcast to the blockchain. + * @param body content of the transaction to broadcast + * @param provider url of the EGLD Server to connect to. If not set, default public server will be used. + * @returns transaction data to be broadcast to blockchain. + */ + export const prepareEgldWipeNftSignedTransaction = async (body: EgldEsdtTransaction, provider?: string) => { + await validateBody(body, EgldEsdtTransaction) + const { + fromPrivateKey, + amount, + fee, + data, + nonce, + signatureId, + } = body + + const client = getEgldClient(provider) + + const value = amount ? new BigNumber(amount).toNumber() : 0 + const gasLimit = fee?.gasLimit ? fee.gasLimit : '60000000' + + const tx: TransactionConfig = { + from: 0, + to: ESDT_SYSTEM_SMART_CONTRACT_ADDRESS, + value, + nonce, + data: await prepareEgldFreezeOrWipeNftData(data), + } + + return await prepareSignedTransactionAbstraction(client, tx, signatureId, fromPrivateKey, { gasLimit, gasPrice: fee?.gasPrice as string } as Fee) +} + /** * Sign ESDT transfer NFT transaction with private keys locally. Nothing is broadcast to the blockchain. * @param body content of the transaction to broadcast