UNPKG

@newfound8ion/newcoin.farm-js

Version:

JS Library to interact with newcoin.farm smart contract.

42 lines (41 loc) 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ActionGenerator = void 0; /* tslint:disable:variable-name */ class ActionGenerator { constructor(contract, pools_contract) { this.contract = contract; this.pools_contract = pools_contract; } async open(authorization, owner, symbol, payer) { return this._pack(this.contract, authorization, "open", { owner, symbol, payer, }); } async close(authorization, owner, symbol) { return this._pack(this.contract, authorization, "close", { owner, symbol, }); } async unlock(authorization, from, id) { return this._pack(this.contract, authorization, "unlock", { from, id, }); } async lockTokens(authorization, from, quantity) { return this._pack(this.pools_contract, authorization, "transfer", { from: from, to: this.contract, quantity: quantity, memo: "lock", }); } _pack(account, authorization, name, data) { return [{ account, name, authorization, data }]; } } exports.ActionGenerator = ActionGenerator;