TON contracts for Agorata
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.7 KiB

import * as main from "../contracts/main";
import { Address, toNano, TupleSlice, WalletContract } from "ton";
// import { sendInternalMessageWithWallet } from "../test/helpers";
import { hex } from "../build/nft-item.compiled.json";
import { Builder, Cell, Slice } from "ton";
// return the init Cell of the contract storage (according to load_data() contract method)
export function initData() {
return main.collectionData({
ownerAddress: Address.parseFriendly("kQBw4_jZTQVbOSDbUjAMibTHWbstrCqjOnzvUTCphGpTFDrK").address,
code: Cell.fromBoc(hex)[0],
ownerKey: 0 // 63181357919630091755807889549433422416741950993093777020964723182484811889834
});
}
// return the op that should be sent to the contract on deployment, can be "null" to send an empty message
export function initMessage() {
return null;
}
// optional end-to-end sanity test for the actual on-chain contract to see it is actually working on-chain
// export async function postDeployTest(walletContract: WalletContract, secretKey: Buffer, contractAddress: Address) {
// const call = await walletContract.client.callGetMethod(contractAddress, "counter");
// const counter = new TupleSlice(call.stack).readBigNumber();
// console.log(` # Getter 'counter' = ${counter.toString()}`);
//
// const message = main.increment();
// await sendInternalMessageWithWallet({ walletContract, secretKey, to: contractAddress, value: toNano(0.02), body: message });
// console.log(` # Sent 'increment' op message`);
//
// const call2 = await walletContract.client.callGetMethod(contractAddress, "counter");
// const counter2 = new TupleSlice(call2.stack).readBigNumber();
// console.log(` # Getter 'counter' = ${counter2.toString()}`);
// }