mirror of
https://github.com/alexgo-io/stacks-subnets.git
synced 2026-04-30 04:35:25 +08:00
24 lines
628 B
JavaScript
24 lines
628 B
JavaScript
import { uintCV, callReadOnlyFunction, cvToString } from "@stacks/transactions";
|
|
import { StacksTestnet, HIRO_MOCKNET_DEFAULT } from "@stacks/network";
|
|
|
|
async function main() {
|
|
const network = new StacksTestnet({ url: HIRO_MOCKNET_DEFAULT });
|
|
const senderAddress = process.env.ALT_USER_ADDR;
|
|
const addr = process.env.USER_ADDR;
|
|
|
|
const txOptions = {
|
|
contractAddress: addr,
|
|
contractName: "simple-nft-l1",
|
|
functionName: "get-owner",
|
|
functionArgs: [uintCV(5)],
|
|
network,
|
|
senderAddress,
|
|
};
|
|
|
|
const result = await callReadOnlyFunction(txOptions);
|
|
|
|
console.log(cvToString(result.value));
|
|
}
|
|
|
|
main();
|