UNPKG

@protonsale/sdk

Version:
49 lines 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const aptos_1 = require("aptos"); const proton_sale_client_1 = require("./proton_sale_client"); async function start() { // eslint-disable-next-line import/no-extraneous-dependencies, global-require await require("dotenv").config(); const clientMain = new proton_sale_client_1.ProtonSaleClient("MAINNET"); // const clientTest = new ProtonSaleClient("TESTNET"); const privateKey = process.env.KEY; // const vault = process.env.VAULT; const privateKeyUint8 = Uint8Array.from((privateKey .match(/.{1,2}/g) ?? [""]) .map((byte) => parseInt(byte, 16))); const account = new aptos_1.AptosAccount(privateKeyUint8); console.log(account.address()); // const txn1 = await clientMain.protonInitialize( // account, // "https://api.protonsale.io/nft/", // 25, // 3000000000, // 40, // vault, // 50, // 50, // undefined, // ); // console.log(txn1) // const txn2 = await clientTest.protonInitialize( // account, // "https://dev2-api.protonsale.io/nft/", // 25, // 10000000, // 40, // vault, // 50, // 50, // undefined, // ); // console.log(txn2) const saleName = "genesis"; const txnCreatePresale = await clientMain.createPresale(account, "0x1::aptos_coin::AptosCoin", "0x1::aptos_coin::AptosCoin", saleName, "10", (Math.floor(Date.now() / 1000) + 5).toString(), (1).toString(), (1).toString(), "10000000", 60, "86400", 1, "20000", undefined); console.log(txnCreatePresale); } start().catch((e) => { console.error(e); process.exit(1); }); //# sourceMappingURL=deploy.js.map