Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fcl = require("@onflow/fcl");
- const misc = require('./utils/misc');
- const templates = require('./utils/flow_templates');
- const t = require("@onflow/types");
- import { promises as fsPromises } from 'fs';
- misc.configFcl('emulator');
- export default async function main() {
- const accounts = JSON.parse(
- await fsPromises.readFile('accounts.json', 'utf8'),
- );
- await fcl.config().put('system.contracts.BBCollectables', accounts.admin.address)
- const admin = {
- address: accounts.admin.address,
- publicKey: accounts.admin.keys.public,
- privateKey: accounts.admin.keys.private,
- keyIndex: 0,
- };
- const user = {
- address: accounts.userAccount1.address,
- publicKey: accounts.userAccount1.keys.public,
- privateKey: accounts.userAccount1.keys.private,
- keyIndex: 0,
- };
- const args: any = [
- fcl.arg("1", t.UInt32),
- fcl.arg("1", t.UInt32),
- ];
- const txId = await templates.simpleTransactionBuilder(admin, [admin, user], admin, 'mint_card', args);
- const viralatTransaction = await fcl.tx(txId).onceExecuted();
- // console.log(viralatTransaction)
- };
- main()
- .then((text) => console.log(text))
- .catch((error) => console.log(error));
Advertisement
Add Comment
Please, Sign In to add comment