UNPKG

@xcapit/shelter-sdk

Version:

SDK for Shelter smart contracts on Stellar

26 lines (25 loc) 670 B
import { FeeBumpTransaction, rpc, Transaction, TransactionBuilder, } from "shelter-sdk"; export class Rpc { _server; _rpc; _cachedNetwork = ""; constructor(_server, _rpc = rpc) { this._server = _server; this._rpc = _rpc; } url() { return this._server.serverURL; } server() { return this._server; } assembleTransaction(raw, simulation) { return this._rpc.assembleTransaction(raw, simulation); } async network() { if (!this._cachedNetwork) { this._cachedNetwork = (await this._server.getNetwork()).passphrase; } return this._cachedNetwork; } }