Cancel a request
Recover tokens from a stale, still-pending request after its TTL has elapsed.
function cancelSubscription(uint256 id) external; // returns escrowed assets to the investor
function cancelRedemption(uint256 id) external; // returns escrowed shares to the investorimport { createWalletClient, http, parseAbi } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { mainnet } from "viem/chains";
const SHARES = "0x...";
const abi = parseAbi([
"function cancelSubscription(uint256 id)",
"function cancelRedemption(uint256 id)",
]);
const account = privateKeyToAccount("0x...");
const wallet = createWalletClient({ account, chain: mainnet, transport: http() });
await wallet.writeContract({ address: SHARES, abi, functionName: "cancelSubscription", args: [42n] });import { ethers } from "ethers";
const SHARES = "0x...";
const abi = ["function cancelSubscription(uint256 id)", "function cancelRedemption(uint256 id)"];
const provider = new ethers.JsonRpcProvider("https://eth.llamarpc.com");
const signer = new ethers.Wallet("0x...", provider);
const shares = new ethers.Contract(SHARES, abi, signer);
await (await shares.cancelSubscription(42n)).wait();

Last updated