Created
August 11, 2022 23:59
-
-
Save mxjxn/4c7e831766d470be8bb513ef46839ec7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Charged from '@charged-particles/sdk' | |
const charged = new Charged({providers: window.ethereum}); | |
const contractAddress = '0x...'; | |
const tokenId = '123'; | |
const nft = charged.NFT(contractAddress, tokenId); | |
// This energizes our nft with 47 DAI tokens. | |
const txReceipt = await nft.energize( | |
'aave.B', | |
daiContractAddress, | |
ethers.utils.parseEther('47') | |
); | |
// Get the energized mass | |
const massBN = await nft.getMass('aave.B', '0xDAI'); | |
// Discharges all of the interest accrued by the DAI tokens to my wallet. | |
const txReceipt2 = await nft.discharge(myAddress, 'aave.B', daiContractAddress); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment