Skip to main content

Buy Fan Tokens On Behalf Of Others

Pre-requisites

Install the ethers package into your project:

npm install ethers

Step 1: Add Contract Call To Your Code

index.ts
import { ethers } from "ethers";
import { abi } from "./MoxieBondingCurve.json";

try {
const contract = new ethers.Contract(
"0x373065e66B32a1C428aa14698dFa99BA7199B55E",
abi,
signer
);

const tx = await contract.buySharesFor();
await tx.wait();
} catch (e) {
console.error(e);
}

Step 2: Execute The Contract Call

Once you have your code ready, you can execute it by running the following command:

ts-node index.ts

Developer Support

If you have any questions or need help with other use cases, feel free to join the /airstack Warpcast channel and ask your questions there.

Our team is always ready to help you with any questions you may have.