UNPKG

@newcoin-foundation/newcoin.pool-js

Version:

js module to fetch data from the newcoin.pool smart contract

54 lines (53 loc) 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ActionGenerator = void 0; /* tslint:disable:variable-name */ class ActionGenerator { constructor(contract, token_contract) { this.contract = contract; this.token_contract = token_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 instunstake(authorization, from, quantity) { return this._pack(this.contract, authorization, "instunstake", { from, quantity, }); } async dldunstake(authorization, from, quantity) { return this._pack(this.contract, authorization, "dldunstake", { from, quantity, }); } async redeem(authorization, from, id) { return this._pack(this.contract, authorization, "redeem", { from, id, }); } async stake(authorization, from, quantity) { return this._pack(this.token_contract, authorization, "transfer", { from: from, to: this.contract, quantity: quantity, memo: "stake", }); } _pack(account, authorization, name, data) { return [{ account, name, authorization, data }]; } } exports.ActionGenerator = ActionGenerator;