jton-contracts
Version:
Free TON contracts wrapped in jTON
77 lines (76 loc) • 2.68 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RootTokenContract = exports.RootTokenContractContract = void 0;
const jton_1 = require("jton");
const RootTokenContract_1 = __importDefault(require("./source/build/RootTokenContract"));
exports.RootTokenContractContract = RootTokenContract_1.default;
class RootTokenContract extends jton_1.Contract {
constructor(client, keys, initialData, timeout) {
super(client, {
abi: RootTokenContract_1.default.abi,
tvc: RootTokenContract_1.default.tvc,
initialData: initialData,
keys: keys
}, timeout);
}
/**********
* DEPLOY *
**********/
async deploy(input, timeout) {
return await super.deploy(input, timeout);
}
/**********
* PUBLIC *
**********/
async deployWallet(input, keys) {
return await this.call('deployWallet', input, keys);
}
async mint(input, keys) {
return await this.call('mint', input, keys);
}
async setPaused(input, keys) {
return await this.call('setPaused', input, keys);
}
async transferOwner(input, keys) {
return await this.call('transferOwner', input, keys);
}
/***********
* GETTERS *
***********/
async getVersion() {
return (await this.run('getVersion', jton_1.ZERO_ANSWER_ID)).value.value0;
}
async getDetails() {
return (await this.run('getDetails', jton_1.ZERO_ANSWER_ID)).value.value0;
}
async getTotalSupply() {
return (await this.run('getTotalSupply', jton_1.ZERO_ANSWER_ID)).value.value0;
}
async getWalletCode() {
return (await this.run('getWalletCode', jton_1.ZERO_ANSWER_ID)).value.value0;
}
async getWalletAddress(input) {
return (await this.run('getWalletAddress', { ...input, ...jton_1.ZERO_ANSWER_ID })).value.value0;
}
}
exports.RootTokenContract = RootTokenContract;
RootTokenContract.EXTERNAL = {
getVersion: 'getVersion',
getDetails: 'getDetails',
getTotalSupply: 'getTotalSupply',
getWalletCode: 'getWalletCode',
getWalletAddress: 'getWalletAddress',
sendExpectedWalletAddress: 'sendExpectedWalletAddress',
deployWallet: 'deployWallet',
deployEmptyWallet: 'deployEmptyWallet',
mint: 'mint',
proxyBurn: 'proxyBurn',
tokensBurned: 'tokensBurned',
sendSurplusGas: 'sendSurplusGas',
setPaused: 'setPaused',
sendPausedCallbackTo: 'sendPausedCallbackTo',
transferOwner: 'transferOwner'
};