Appearance
Check Attachments of TradeToken
To check the attachments associated with a specific trade token, you can use the getAttachments
method provided by the TradeTokenContract
class. Here is an example of how to do this:
- Import the
TradeTokenContract
from theskc-sdk
. - Initialize the
TradeTokenContract
with the contract address, a signer or provider, and the RPC URL. - Call the
getAttachments
method to retrieve and parse allAttachmentAdded
events from the contract.
Here is a sample code snippet:
typescript
import { TradeTokenContract } from "skc-sdk";
const provider = new ethers.JsonRpcProvider("http://localhost:8545");
const signer = provider.getSigner();
const tradeToken = new TradeTokenContract("0xYourTradeTokenContractAddress", signer, "http://localhost:8545");
const attachments = await tradeToken.getAttachments();
This code will fetch the attachments associated with the specified trade token contract address.