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.

45 lines
1.4 KiB

2 years ago
import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano, Cell} from "ton";
import {mnemonicToPrivateKey} from "ton-crypto";
import {buildOnchainMetadata} from "./utils/helpers";
import {client, wallet_data, workchain, owner, jettonParams, default_content} from "./utils/config";
import { PseudoStaking } from "./output/jetton_PseudoStaking";
(async () => {
let {my_wallet, secretKey} = await wallet_data(1);
// Get deployment wallet balance
let balance: bigint = await my_wallet.getBalance();
// Compute init data for deployment
let init = await PseudoStaking.init();
let destination_address = contractAddress(workchain, init);
let deployAmount = toNano('7');
// send a message on new address contract to deploy it
let seqno: number = await my_wallet.getSeqno();
console.log('🛠Preparing new outgoing massage from deployment wallet. Seqno = ', seqno);
console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON');
await my_wallet.sendTransfer({
seqno,
secretKey,
messages: [internal({
value: deployAmount,
to: destination_address,
init: {
code : init.code,
data : init.data
},
body:
})]
});
console.log('======deployment message sent to ', destination_address, ' ======');
})();