UNPKG

@xcapit/shelter-sdk

Version:

SDK for Shelter smart contracts on Stellar

25 lines (24 loc) 755 B
import { Client, Keypair } from "shelter-sdk"; import { Transaction } from "../transaction/transaction"; export class Gate { _aClient; _aSteward; _aRpc; constructor(_aClient, _aSteward, _aRpc) { this._aClient = _aClient; this._aSteward = _aSteward; this._aRpc = _aRpc; } async guard() { await this._txOf(await this._aClient.guard(), 'Guard Gate Error').result(); } async open() { await this._txOf(await this._aClient.open(), 'Open Gate Error').result(); } async seal() { await this._txOf(await this._aClient.seal(), 'Seal Gate Error').result(); } _txOf(aRawTx, errorMsg) { return new Transaction(aRawTx, this._aSteward, this._aRpc, errorMsg); } }