From 189836fc461e47c110d930e0a38580f67b3fac5f Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Tue, 23 May 2023 14:15:54 -0700 Subject: [PATCH] Add generated docs as of v0.7.0 --- Account.html | 2 +- Address.html | 2 +- Asset.html | 2 +- Claimant.html | 2 +- Contract.html | 2 +- FeeBumpTransaction.html | 2 +- Keypair.html | 2 +- LiquidityPoolAsset.html | 2 +- LiquidityPoolId.html | 2 +- Memo.html | 2 +- MuxedAccount.html | 2 +- Operation.html | 2 +- Server.html | 2164 ++++++++++++++++- SignerKey.html | 2 +- StrKey.html | 2 +- Transaction.html | 2 +- TransactionBuilder.html | 2 +- account.js.html | 2 +- address.js.html | 2 +- asset.js.html | 2 +- claimant.js.html | 2 +- contract.js.html | 2 +- fee_bump_transaction.js.html | 2 +- get_liquidity_pool_id.js.html | 2 +- global.html | 2 +- index.html | 2 +- js-stellar-base_src_account.js.html | 4 +- js-stellar-base_src_address.js.html | 4 +- js-stellar-base_src_asset.js.html | 4 +- js-stellar-base_src_claimant.js.html | 4 +- js-stellar-base_src_contract.js.html | 4 +- ...llar-base_src_fee_bump_transaction.js.html | 4 +- ...lar-base_src_get_liquidity_pool_id.js.html | 4 +- js-stellar-base_src_keypair.js.html | 4 +- ...llar-base_src_liquidity_pool_asset.js.html | 4 +- js-stellar-base_src_liquidity_pool_id.js.html | 4 +- js-stellar-base_src_memo.js.html | 4 +- js-stellar-base_src_muxed_account.js.html | 4 +- js-stellar-base_src_network.js.html | 4 +- js-stellar-base_src_operation.js.html | 4 +- ...-base_src_operations_account_merge.js.html | 4 +- ...ar-base_src_operations_allow_trust.js.html | 4 +- ...s_begin_sponsoring_future_reserves.js.html | 4 +- ...-base_src_operations_bump_sequence.js.html | 4 +- ...r-base_src_operations_change_trust.js.html | 4 +- ...operations_claim_claimable_balance.js.html | 4 +- ...ellar-base_src_operations_clawback.js.html | 4 +- ...rations_clawback_claimable_balance.js.html | 4 +- ...base_src_operations_create_account.js.html | 4 +- ...perations_create_claimable_balance.js.html | 4 +- ...erations_create_passive_sell_offer.js.html | 4 +- ...ons_end_sponsoring_future_reserves.js.html | 4 +- ...llar-base_src_operations_inflation.js.html | 4 +- ...rc_operations_invoke_host_function.js.html | 4 +- ..._operations_liquidity_pool_deposit.js.html | 4 +- ...operations_liquidity_pool_withdraw.js.html | 4 +- ...se_src_operations_manage_buy_offer.js.html | 4 +- ...ar-base_src_operations_manage_data.js.html | 4 +- ...e_src_operations_manage_sell_offer.js.html | 4 +- ...ations_path_payment_strict_receive.js.html | 4 +- ...perations_path_payment_strict_send.js.html | 4 +- ...tellar-base_src_operations_payment.js.html | 4 +- ..._src_operations_revoke_sponsorship.js.html | 4 +- ...ar-base_src_operations_set_options.js.html | 4 +- ...src_operations_set_trustline_flags.js.html | 4 +- js-stellar-base_src_signerkey.js.html | 4 +- js-stellar-base_src_signing.js.html | 4 +- js-stellar-base_src_strkey.js.html | 4 +- js-stellar-base_src_transaction.js.html | 4 +- js-stellar-base_src_transaction_base.js.html | 4 +- ...ellar-base_src_transaction_builder.js.html | 4 +- ...c_util_decode_encode_muxed_account.js.html | 4 +- keypair.js.html | 2 +- lib_axios.js.html | 30 +- lib_jsonrpc.js.html | 120 +- lib_server.js.html | 1207 ++++----- liquidity_pool_asset.js.html | 2 +- liquidity_pool_id.js.html | 2 +- memo.js.html | 2 +- muxed_account.js.html | 2 +- network.js.html | 2 +- operation.js.html | 2 +- operations_account_merge.js.html | 2 +- operations_allow_trust.js.html | 2 +- ...s_begin_sponsoring_future_reserves.js.html | 2 +- operations_bump_sequence.js.html | 2 +- operations_change_trust.js.html | 2 +- operations_claim_claimable_balance.js.html | 2 +- operations_clawback.js.html | 2 +- operations_clawback_claimable_balance.js.html | 2 +- operations_create_account.js.html | 2 +- operations_create_claimable_balance.js.html | 2 +- operations_create_passive_sell_offer.js.html | 2 +- ...ons_end_sponsoring_future_reserves.js.html | 2 +- operations_inflation.js.html | 2 +- operations_invoke_host_function.js.html | 2 +- operations_liquidity_pool_deposit.js.html | 2 +- operations_liquidity_pool_withdraw.js.html | 2 +- operations_manage_buy_offer.js.html | 2 +- operations_manage_data.js.html | 2 +- operations_manage_sell_offer.js.html | 2 +- ...ations_path_payment_strict_receive.js.html | 2 +- operations_path_payment_strict_send.js.html | 2 +- operations_payment.js.html | 2 +- operations_revoke_sponsorship.js.html | 2 +- operations_set_options.js.html | 2 +- operations_set_trustline_flags.js.html | 2 +- signerkey.js.html | 2 +- signing.js.html | 2 +- strkey.js.html | 2 +- transaction.js.html | 2 +- transaction_base.js.html | 2 +- transaction_builder.js.html | 2 +- util_decode_encode_muxed_account.js.html | 2 +- 114 files changed, 2847 insertions(+), 986 deletions(-) diff --git a/Account.html b/Account.html index 25236b07..65f33a3e 100644 --- a/Account.html +++ b/Account.html @@ -573,7 +573,7 @@
Returns:

diff --git a/Address.html b/Address.html index 0e504886..a0727dab 100644 --- a/Address.html +++ b/Address.html @@ -1428,7 +1428,7 @@
Returns:

diff --git a/Asset.html b/Asset.html index 8e5fa9ef..c4d98171 100644 --- a/Asset.html +++ b/Asset.html @@ -1890,7 +1890,7 @@
Returns:

diff --git a/Claimant.html b/Claimant.html index 6b79facc..9625e90e 100644 --- a/Claimant.html +++ b/Claimant.html @@ -1625,7 +1625,7 @@
Returns:

diff --git a/Contract.html b/Contract.html index 0c17b9eb..1de3b21c 100644 --- a/Contract.html +++ b/Contract.html @@ -676,7 +676,7 @@
Returns:

diff --git a/FeeBumpTransaction.html b/FeeBumpTransaction.html index 29bf2dcf..536652c0 100644 --- a/FeeBumpTransaction.html +++ b/FeeBumpTransaction.html @@ -2040,7 +2040,7 @@
Returns:

diff --git a/Keypair.html b/Keypair.html index 221001b8..dcb2b917 100644 --- a/Keypair.html +++ b/Keypair.html @@ -2462,7 +2462,7 @@
Returns:

diff --git a/LiquidityPoolAsset.html b/LiquidityPoolAsset.html index 117b6621..988a7add 100644 --- a/LiquidityPoolAsset.html +++ b/LiquidityPoolAsset.html @@ -919,7 +919,7 @@
Returns:

diff --git a/LiquidityPoolId.html b/LiquidityPoolId.html index e99c8861..ef3b8154 100644 --- a/LiquidityPoolId.html +++ b/LiquidityPoolId.html @@ -867,7 +867,7 @@
Returns:

diff --git a/Memo.html b/Memo.html index 10437c30..7ed41157 100644 --- a/Memo.html +++ b/Memo.html @@ -1386,7 +1386,7 @@
Returns:

diff --git a/MuxedAccount.html b/MuxedAccount.html index 20d5ea16..daa84ea7 100644 --- a/MuxedAccount.html +++ b/MuxedAccount.html @@ -985,7 +985,7 @@
Returns:

diff --git a/Operation.html b/Operation.html index 0eb35f02..5bea338a 100644 --- a/Operation.html +++ b/Operation.html @@ -11675,7 +11675,7 @@
Returns:

diff --git a/Server.html b/Server.html index 92f1ac12..15585c7f 100644 --- a/Server.html +++ b/Server.html @@ -24,7 +24,7 @@
@@ -45,6 +45,9 @@

Server

+

Server handles the network connection to a Soroban-RPC +instance and exposes an interface for requests to that instance.

+ @@ -55,6 +58,8 @@

+

Constructor

+

new Server(serverURL, optsopt)

@@ -63,8 +68,7 @@

new Server -

Server handles the network connection to a Soroban-RPC -instance and exposes an interface for requests to that instance.

+

serverURL Soroban-RPC Server URL (ex. http://localhost:8000/soroban/rpc).

@@ -100,7 +104,7 @@

new ServerSource:
@@ -383,6 +387,2156 @@
Parameters:
+

Methods

+ + + +
+ + + +

(async) getAccount(address) → {Promise.<Account>}

+ + + + + +
+

Fetch a minimal set of current info about a Stellar account.

+

Needed to get the current sequence number for the account so you can build +a successful transaction with TransactionBuilder.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
address + + +string + + + + +

The public address of the account to load.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Account> + + +
+
+ + +
+

Returns a promise to the Account object with populated sequence number.

+
+ + +
+ + + +
+
Example
+ +
server.getAccount("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4").then(account => {
+  console.log("sequence:", account.sequence);
+});
+ +
+ +
+ + +
+ + + +

(async) getContractData(contractId, key) → {Promise.<SorobanRpc.LedgerEntryResult>}

+ + + + + +
+

Reads the current value of contract data ledger entries directly.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
contractId + + +string + + + + +

The contract ID containing the data to load. Encoded as a hex string.

+ +
key + + +xdr.ScVal + + + + +

The key of the contract data to load.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.LedgerEntryResult> + + +
+
+ + +
+

Returns a promise to the SorobanRpc.LedgerEntryResult object with the current value.

+
+ + +
+ + + +
+
Example
+ +
const contractId = "0000000000000000000000000000000000000000000000000000000000000001";
+const key = xdr.ScVal.scvSymbol("counter");
+server.getContractData(contractId, key).then(data => {
+  console.log("value:", data.xdr);
+  console.log("lastModified:", data.lastModifiedLedgerSeq);
+  console.log("latestLedger:", data.latestLedger);
+});
+
+Allows you to directly inspect the current state of a contract. This is a backup way to access your contract data which may not be available via events or simulateTransaction.
+ +
+ +
+ + +
+ + + +

(async) getEvents() → {Promise.<SorobanRpc.GetEventsResponse>}

+ + + + + +
+

Fetches all events that match a given set of filters.

+

The given filters (see SorobanRpc.EventFilter for detailed fields) +are combined only in a logical OR fashion, and all of the fields in each +filter are optional.

+

To page through events, use the pagingToken field on the relevant +SorobanRpc.EventResponse object to set the cursor parameter.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.GetEventsResponse> + + +
+
+ + +
+

a promise to the +SorobanRpc.GetEventsResponse object containing a paginatable set +of the events matching the given event filters.

+
+ + +
+ + + +
+
Example
+ +
server.getEvents({
+   startLedger: "1000",
+   filters: [
+    {
+     type: "contract",
+     contractIds: [ "deadb33f..." ],
+     topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc=", "*" ]]
+    }, {
+     type: "system",
+     contractIds: [ "...c4f3b4b3..." ],
+     topics: [[ "*" ], [ "*", "AAAAAQB6Mcc=" ]]
+    }, {
+     contractIds: [ "...c4f3b4b3..." ],
+     topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==" ]]
+    }, {
+     type: "diagnostic",
+     topics: [[ "AAAAAQB6Mcc=" ]]
+    }
+   ],
+   limit: 10,
+});
+ +
+ +
+ + +
+ + + +

(async) getHealth() → {Promise.<SorobanRpc.GetHealthResponse>}

+ + + + + +
+

General node health check.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.GetHealthResponse> + + +
+
+ + +
+

Returns a promise to the SorobanRpc.GetHealthResponse object with the status of the server ("healthy").

+
+ + +
+ + + +
+
Example
+ +
server.getHealth().then(health => {
+  console.log("status:", health.status);
+});
+ +
+ +
+ + +
+ + + +

(async) getLatestLedger() → {Promise.<SorobanRpc.GetLatestLedgerResponse>}

+ + + + + +
+

Fetches the latest ledger meta info from network which Soroban-RPC is connected to.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.GetLatestLedgerResponse> + + +
+
+ + +
+

a promise to the +SorobanRpc.GetLatestLedgerResponse object containing metadata +about the latest ledger from network soroban-rpc server is connected to.

+
+ + +
+ + + +
+
Example
+ +
server.getLatestLedger().then(response => {
+  console.log("hash:", response.id);
+  console.log("sequence:", response.sequence);
+  console.log("protocolVersion:", response.protocolVersion);
+});
+ +
+ +
+ + +
+ + + +

(async) getLedgerEntries(key) → {Promise.<SorobanRpc.GetLedgerEntriesResponse>}

+ + + + + +
+

Reads the current value of ledger entries directly.

+

Allows you to directly inspect the current state of contracts, +contract's code, or any other ledger entries. This is a backup way to access +your contract data which may not be available via events or +simulateTransaction.

+

To fetch contract wasm byte-code, use the ContractCode ledger entry key.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +xdr.ScVal + + + + +

The key of the contract data to load.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.GetLedgerEntriesResponse> + + +
+
+ + +
+

Returns a promise to the SorobanRpc.GetLedgerEntriesResponse object with the current value.

+
+ + +
+ + + +
+
Example
+ +
const contractId = "0000000000000000000000000000000000000000000000000000000000000001";
+const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({
+  contractId: Buffer.from(contractId, "hex"),
+  key: xdr.ScVal.scvSymbol("counter"),
+}));
+server.getLedgerEntries([key]).then(response => {
+  const ledgerData = response.entries[0];
+  console.log("key:", ledgerData.key);
+  console.log("value:", ledgerData.xdr);
+  console.log("lastModified:", ledgerData.lastModifiedLedgerSeq);
+  console.log("latestLedger:", response.latestLedger);
+});
+ +
+ +
+ + +
+ + + +

(async) getNetwork() → {Promise.<SorobanRpc.GetNetworkResponse>}

+ + + + + +
+

Fetches metadata about the network which Soroban-RPC is connected to.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.GetNetworkResponse> + + +
+
+ + +
+

a promise to the +SorobanRpc.GetNetworkResponse object containing metadata +about the current network this soroban-rpc server is connected to.

+
+ + +
+ + + +
+
Example
+ +
server.getNetwork().then(network => {
+  console.log("friendbotUrl:", network.friendbotUrl);
+  console.log("passphrase:", network.passphrase);
+  console.log("protocolVersion:", network.protocolVersion);
+});
+ +
+ +
+ + +
+ + + +

(async) getTransaction(hash) → {Promise.<SorobanRpc.GetTransactionResponse>}

+ + + + + +
+

Fetch the details of a submitted transaction.

+

When submitting a transaction, clients should poll this to tell when the +transaction has completed.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hash + + +string + + + + +

The hash of the transaction to check. Encoded as a +hex string.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.GetTransactionResponse> + + +
+
+ + +
+

Returns a +promise to the SorobanRpc.GetTransactionResponse object +with the status, result, and other details about the transaction.

+
+ + +
+ + + +
+
Example
+ +
const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a";
+server.getTransaction(transactionHash).then(transaction => {
+  console.log("status:", transaction.status);
+  console.log("envelopeXdr:", transaction.envelopeXdr);
+  console.log("resultMetaXdr:", transaction.resultMetaXdr);
+  console.log("resultXdr:", transaction.resultXdr);
+});
+ +
+ +
+ + +
+ + + +

(async) prepareTransaction(transaction, networkPassphraseopt) → {Promise.<(Transaction|FeeBumpTransaction)>}

+ + + + + +
+

Submit a trial contract invocation, first run a simulation of the contract +invocation as defined on the incoming transaction, and apply the results +to a new copy of the transaction which is then returned. Setting the ledger +footprint and authorization, so the resulting transaction is ready for signing & sending.

+

The returned transaction will also have an updated fee that is the sum of fee set +on incoming transaction with the contract resource fees estimated from simulation. It is +adviseable to check the fee on returned transaction and validate or take appropriate +measures for interaction with user to confirm it is acceptable.

+

You can call the {simulateTransaction(transaction)} method directly first if you +want to inspect estimated fees for a given transaction in detail first if that is +of importance.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
transaction + + +Transaction +| + +FeeBumpTransaction + + + + + + + + + + +

The transaction to +prepare. It should include exactly one operation, which must be a +InvokeHostFunctionOp. Any provided footprint will be overwritten.

+ +
networkPassphrase + + +string + + + + + + <optional>
+ + + + + +
+

Explicitly provide a network +passphrase. If not passed, the current network passphrase will be requested +from the server via getNetwork.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<(Transaction|FeeBumpTransaction)> + + +
+
+ + +
+

Returns a copy of the +transaction, with the expected ledger footprint and authorizations added +and the transaction fee will automatically be adjusted to the sum of +the incoming transaction fee and the contract minimum resource fees +discovered from the simulation,

+
+ + +
+ + + +
+
Example
+ +
const contractId = '0000000000000000000000000000000000000000000000000000000000000001';
+const contract = new SorobanClient.Contract(contractId);
+
+// Right now, this is just the default fee for this example.
+const fee = 100;
+
+const transaction = new SorobanClient.TransactionBuilder(account, {
+    fee,
+    // Uncomment the following line to build transactions for the live network. Be
+    // sure to also change the horizon hostname.
+    // networkPassphrase: SorobanClient.Networks.PUBLIC,
+    networkPassphrase: SorobanClient.Networks.TESTNET
+  })
+  // Add a contract.increment soroban contract invocation operation
+  .addOperation(contract.call("increment"))
+  // Make this transaction valid for the next 30 seconds only
+  .setTimeout(30)
+  // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/)
+  // .addMemo(SorobanClient.Memo.text('Hello world!'))
+  .build();
+
+preparedTransaction = await server.prepareTransaction(transaction);
+
+// Sign this transaction with the secret key
+// NOTE: signing is transaction is network specific. Test network transactions
+// won't work in the public network. To switch networks, use the Network object
+// as explained above (look for SorobanClient.Network).
+const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey);
+preparedTransaction.sign(sourceKeypair);
+
+server.sendTransaction(transaction).then(result => {
+  console.log("hash:", result.hash);
+  console.log("status:", result.status);
+  console.log("errorResultXdr:", result.errorResultXdr);
+});
+ +
+ +
+ + +
+ + + +

(async) requestAirdrop(address, friendbotUrlopt) → {Promise.<Account>}

+ + + + + +
+

Use the friendbot faucet to create and fund a new account. The method will +return an Account object for the created account, or if the account already +existed. If friendbot is not configured on this network, this method will +throw an error. If the request fails, this method will throw an error.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
address + + +string +| + +Account + + + + + + + + + + +

The address or account we want to create and fund.

+ +
friendbotUrl + + +string + + + + + + <optional>
+ + + + + +
+

The optional explicit address for +friendbot. If not provided, the client will call the Soroban-RPC getNetwork +method to attempt to find this network's friendbot url.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<Account> + + +
+
+ + +
+

Returns a promise to the Account object with populated sequence number.

+
+ + +
+ + + +
+
Example
+ +
server.requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4").then(accountCreated => {
+  console.log("accountCreated:", accountCreated);
+}).catch(error => {
+  console.error("error:", error);
+});
+ +
+ +
+ + +
+ + + +

(async) sendTransaction(transaction) → {Promise.<SorobanRpc.SendTransactionResponse>}

+ + + + + +
+

Submit a real transaction to the Stellar network. This is the only way to +make changes "on-chain". Unlike Horizon, Soroban-RPC does not wait for +transaction completion. It simply validates the transaction and enqueues +it. Clients should call Server#getTransactionStatus to learn about +transaction success/failure.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transaction + + +Transaction +| + +FeeBumpTransaction + + + + +

The transaction to +submit.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.SendTransactionResponse> + + +
+
+ + +
+

Returns a promise to +the SorobanRpc.SendTransactionResponse object with the +transaction id, status, and any error if available.

+
+ + +
+ + + +
+
Example
+ +
const contractId = '0000000000000000000000000000000000000000000000000000000000000001';
+const contract = new SorobanClient.Contract(contractId);
+
+// Right now, this is just the default fee for this example.
+const fee = 100;
+
+const transaction = new SorobanClient.TransactionBuilder(account, {
+    fee,
+    // Uncomment the following line to build transactions for the live network. Be
+    // sure to also change the horizon hostname.
+    // networkPassphrase: SorobanClient.Networks.PUBLIC,
+    networkPassphrase: SorobanClient.Networks.STANDALONE
+  })
+  // Add a contract.increment soroban contract invocation operation
+  // Note: For real transactions you will need to include the footprint
+  // and auth in the operation, as returned from simulateTransaction.
+  .addOperation(contract.call("increment"))
+  // Make this transaction valid for the next 30 seconds only
+  .setTimeout(30)
+  // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/)
+  // .addMemo(SorobanClient.Memo.text('Hello world!'))
+  .build();
+
+// Sign this transaction with the secret key
+// NOTE: signing is transaction is network specific. Test network transactions
+// won't work in the public network. To switch networks, use the Network object
+// as explained above (look for SorobanClient.Network).
+const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey);
+transaction.sign(sourceKeypair);
+
+server.sendTransaction(transaction).then(result => {
+  console.log("hash:", result.hash);
+  console.log("status:", result.status);
+  console.log("errorResultXdr:", result.errorResultXdr);
+});
+ +
+ +
+ + +
+ + + +

(async) simulateTransaction(transaction) → {Promise.<SorobanRpc.SimulateTransactionResponse>}

+ + + + + +
+

Submit a trial contract invocation to get back return values, expected +ledger footprint, expected authorizations, and expected costs.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
transaction + + +Transaction +| + +FeeBumpTransaction + + + + +

The transaction to +simulate. It should include exactly one operation, which must be a +InvokeHostFunctionOp. Any provided footprint will be ignored.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Promise.<SorobanRpc.SimulateTransactionResponse> + + +
+
+ + +
+

Returns a +promise to the SorobanRpc.SimulateTransactionResponse object +with the cost, result, footprint, auth, and error of the transaction.

+
+ + +
+ + + +
+
Example
+ +
const contractId = '0000000000000000000000000000000000000000000000000000000000000001';
+const contract = new SorobanClient.Contract(contractId);
+
+// Right now, this is just the default fee for this example.
+const fee = 100;
+
+const transaction = new SorobanClient.TransactionBuilder(account, {
+    fee,
+    // Uncomment the following line to build transactions for the live network. Be
+    // sure to also change the horizon hostname.
+    // networkPassphrase: SorobanClient.Networks.PUBLIC,
+    networkPassphrase: SorobanClient.Networks.STANDALONE
+  })
+  // Add a contract.increment soroban contract invocation operation
+  .addOperation(contract.call("increment"))
+  // Make this transaction valid for the next 30 seconds only
+  .setTimeout(30)
+  // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/)
+  // .addMemo(SorobanClient.Memo.text('Hello world!'))
+  .build();
+
+// Sign this transaction with the secret key
+// NOTE: signing is transaction is network specific. Test network transactions
+// won't work in the public network. To switch networks, use the Network object
+// as explained above (look for SorobanClient.Network).
+const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey);
+transaction.sign(sourceKeypair);
+
+server.simulateTransaction(transaction).then(sim => {
+  console.log("cost:", sim.cost);
+  console.log("results:", sim.results);
+  console.log("error:", sim.error);
+  console.log("latestLedger:", sim.latestLedger);
+});
+ +
+ +
+ + @@ -399,7 +2553,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/SignerKey.html b/SignerKey.html index 53caa70f..756cdf24 100644 --- a/SignerKey.html +++ b/SignerKey.html @@ -497,7 +497,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/StrKey.html b/StrKey.html index 0b3dc928..13dd3f58 100644 --- a/StrKey.html +++ b/StrKey.html @@ -3145,7 +3145,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/Transaction.html b/Transaction.html index c0e122e9..05d00d65 100644 --- a/Transaction.html +++ b/Transaction.html @@ -2960,7 +2960,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/TransactionBuilder.html b/TransactionBuilder.html index 00da0d6d..75d2ef9f 100644 --- a/TransactionBuilder.html +++ b/TransactionBuilder.html @@ -3313,7 +3313,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/account.js.html b/account.js.html index eaf0fac8..0f661605 100644 --- a/account.js.html +++ b/account.js.html @@ -114,7 +114,7 @@

account.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/address.js.html b/address.js.html index 58893283..8d926b64 100644 --- a/address.js.html +++ b/address.js.html @@ -189,7 +189,7 @@

address.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/asset.js.html b/asset.js.html index bbeef510..c67bdcab 100644 --- a/asset.js.html +++ b/asset.js.html @@ -316,7 +316,7 @@

asset.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/claimant.js.html b/claimant.js.html index ab867267..52c61634 100644 --- a/claimant.js.html +++ b/claimant.js.html @@ -223,7 +223,7 @@

claimant.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/contract.js.html b/contract.js.html index 24a9b377..08033bf9 100644 --- a/contract.js.html +++ b/contract.js.html @@ -139,7 +139,7 @@

contract.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/fee_bump_transaction.js.html b/fee_bump_transaction.js.html index 0621cf8e..4a93bd0f 100644 --- a/fee_bump_transaction.js.html +++ b/fee_bump_transaction.js.html @@ -166,7 +166,7 @@

fee_bump_transaction.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/get_liquidity_pool_id.js.html b/get_liquidity_pool_id.js.html index 3510168b..f245bc81 100644 --- a/get_liquidity_pool_id.js.html +++ b/get_liquidity_pool_id.js.html @@ -105,7 +105,7 @@

get_liquidity_pool_id.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/global.html b/global.html index b2810dab..231c58f7 100644 --- a/global.html +++ b/global.html @@ -2704,7 +2704,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/index.html b/index.html index 01e8989c..66b82af7 100644 --- a/index.html +++ b/index.html @@ -222,7 +222,7 @@

License


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_account.js.html b/js-stellar-base_src_account.js.html index d5b222b7..c0f48365 100644 --- a/js-stellar-base_src_account.js.html +++ b/js-stellar-base_src_account.js.html @@ -24,7 +24,7 @@
@@ -114,7 +114,7 @@

js-stellar-base/src/account.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_address.js.html b/js-stellar-base_src_address.js.html index bc09e199..667146e9 100644 --- a/js-stellar-base_src_address.js.html +++ b/js-stellar-base_src_address.js.html @@ -24,7 +24,7 @@
@@ -189,7 +189,7 @@

js-stellar-base/src/address.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_asset.js.html b/js-stellar-base_src_asset.js.html index f173ae54..3363c6e9 100644 --- a/js-stellar-base_src_asset.js.html +++ b/js-stellar-base_src_asset.js.html @@ -24,7 +24,7 @@
@@ -316,7 +316,7 @@

js-stellar-base/src/asset.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_claimant.js.html b/js-stellar-base_src_claimant.js.html index ccf7ec99..2051ba73 100644 --- a/js-stellar-base_src_claimant.js.html +++ b/js-stellar-base_src_claimant.js.html @@ -24,7 +24,7 @@
@@ -223,7 +223,7 @@

js-stellar-base/src/claimant.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_contract.js.html b/js-stellar-base_src_contract.js.html index fae2bf6e..ba735057 100644 --- a/js-stellar-base_src_contract.js.html +++ b/js-stellar-base_src_contract.js.html @@ -24,7 +24,7 @@
@@ -139,7 +139,7 @@

js-stellar-base/src/contract.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_fee_bump_transaction.js.html b/js-stellar-base_src_fee_bump_transaction.js.html index 74a0a6bd..9dc037f9 100644 --- a/js-stellar-base_src_fee_bump_transaction.js.html +++ b/js-stellar-base_src_fee_bump_transaction.js.html @@ -24,7 +24,7 @@
@@ -166,7 +166,7 @@

js-stellar-base/src/fee_bump_transaction.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_get_liquidity_pool_id.js.html b/js-stellar-base_src_get_liquidity_pool_id.js.html index 2f1c53ab..00ecd430 100644 --- a/js-stellar-base_src_get_liquidity_pool_id.js.html +++ b/js-stellar-base_src_get_liquidity_pool_id.js.html @@ -24,7 +24,7 @@
@@ -105,7 +105,7 @@

js-stellar-base/src/get_liquidity_pool_id.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_keypair.js.html b/js-stellar-base_src_keypair.js.html index b61998c7..43c1b82f 100644 --- a/js-stellar-base_src_keypair.js.html +++ b/js-stellar-base_src_keypair.js.html @@ -24,7 +24,7 @@
@@ -329,7 +329,7 @@

js-stellar-base/src/keypair.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_liquidity_pool_asset.js.html b/js-stellar-base_src_liquidity_pool_asset.js.html index ae8c0e67..34e49ef6 100644 --- a/js-stellar-base_src_liquidity_pool_asset.js.html +++ b/js-stellar-base_src_liquidity_pool_asset.js.html @@ -24,7 +24,7 @@
@@ -171,7 +171,7 @@

js-stellar-base/src/liquidity_pool_asset.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_liquidity_pool_id.js.html b/js-stellar-base_src_liquidity_pool_id.js.html index ff951570..1a42b313 100644 --- a/js-stellar-base_src_liquidity_pool_id.js.html +++ b/js-stellar-base_src_liquidity_pool_id.js.html @@ -24,7 +24,7 @@
@@ -129,7 +129,7 @@

js-stellar-base/src/liquidity_pool_id.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_memo.js.html b/js-stellar-base_src_memo.js.html index 91af5898..12d6b001 100644 --- a/js-stellar-base_src_memo.js.html +++ b/js-stellar-base_src_memo.js.html @@ -24,7 +24,7 @@
@@ -299,7 +299,7 @@

js-stellar-base/src/memo.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_muxed_account.js.html b/js-stellar-base_src_muxed_account.js.html index 8f05aca8..8c87972d 100644 --- a/js-stellar-base_src_muxed_account.js.html +++ b/js-stellar-base_src_muxed_account.js.html @@ -24,7 +24,7 @@
@@ -190,7 +190,7 @@

js-stellar-base/src/muxed_account.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_network.js.html b/js-stellar-base_src_network.js.html index 281853f0..d5fc560b 100644 --- a/js-stellar-base_src_network.js.html +++ b/js-stellar-base_src_network.js.html @@ -24,7 +24,7 @@
@@ -64,7 +64,7 @@

js-stellar-base/src/network.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operation.js.html b/js-stellar-base_src_operation.js.html index df43fd09..36f8bfd3 100644 --- a/js-stellar-base_src_operation.js.html +++ b/js-stellar-base_src_operation.js.html @@ -24,7 +24,7 @@
@@ -704,7 +704,7 @@

js-stellar-base/src/operation.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_account_merge.js.html b/js-stellar-base_src_operations_account_merge.js.html index 8f04950a..aeb11339 100644 --- a/js-stellar-base_src_operations_account_merge.js.html +++ b/js-stellar-base_src_operations_account_merge.js.html @@ -24,7 +24,7 @@
@@ -80,7 +80,7 @@

js-stellar-base/src/operations/account_merge.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_allow_trust.js.html b/js-stellar-base_src_operations_allow_trust.js.html index 77faa4d4..8a4dfd97 100644 --- a/js-stellar-base_src_operations_allow_trust.js.html +++ b/js-stellar-base_src_operations_allow_trust.js.html @@ -24,7 +24,7 @@
@@ -107,7 +107,7 @@

js-stellar-base/src/operations/allow_trust.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html b/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html index 400dfb0e..f34cbf73 100644 --- a/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html +++ b/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html @@ -24,7 +24,7 @@
@@ -84,7 +84,7 @@

js-stellar-base/src/operations/begin_sponsoring_future_re
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_bump_sequence.js.html b/js-stellar-base_src_operations_bump_sequence.js.html index 9cfaa8a1..60a7f26b 100644 --- a/js-stellar-base_src_operations_bump_sequence.js.html +++ b/js-stellar-base_src_operations_bump_sequence.js.html @@ -24,7 +24,7 @@
@@ -89,7 +89,7 @@

js-stellar-base/src/operations/bump_sequence.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_change_trust.js.html b/js-stellar-base_src_operations_change_trust.js.html index 47f831d5..2c0e875c 100644 --- a/js-stellar-base_src_operations_change_trust.js.html +++ b/js-stellar-base_src_operations_change_trust.js.html @@ -24,7 +24,7 @@
@@ -104,7 +104,7 @@

js-stellar-base/src/operations/change_trust.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_claim_claimable_balance.js.html b/js-stellar-base_src_operations_claim_claimable_balance.js.html index 914dee28..426a0f14 100644 --- a/js-stellar-base_src_operations_claim_claimable_balance.js.html +++ b/js-stellar-base_src_operations_claim_claimable_balance.js.html @@ -24,7 +24,7 @@
@@ -92,7 +92,7 @@

js-stellar-base/src/operations/claim_claimable_balance.js
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_clawback.js.html b/js-stellar-base_src_operations_clawback.js.html index 502434c5..a8586919 100644 --- a/js-stellar-base_src_operations_clawback.js.html +++ b/js-stellar-base_src_operations_clawback.js.html @@ -24,7 +24,7 @@
@@ -93,7 +93,7 @@

js-stellar-base/src/operations/clawback.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_clawback_claimable_balance.js.html b/js-stellar-base_src_operations_clawback_claimable_balance.js.html index 7fcb9dc5..d87ce553 100644 --- a/js-stellar-base_src_operations_clawback_claimable_balance.js.html +++ b/js-stellar-base_src_operations_clawback_claimable_balance.js.html @@ -24,7 +24,7 @@
@@ -88,7 +88,7 @@

js-stellar-base/src/operations/clawback_claimable_balance
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_create_account.js.html b/js-stellar-base_src_operations_create_account.js.html index 77578b50..73916e2d 100644 --- a/js-stellar-base_src_operations_create_account.js.html +++ b/js-stellar-base_src_operations_create_account.js.html @@ -24,7 +24,7 @@
@@ -88,7 +88,7 @@

js-stellar-base/src/operations/create_account.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_create_claimable_balance.js.html b/js-stellar-base_src_operations_create_claimable_balance.js.html index 26267175..aed15a85 100644 --- a/js-stellar-base_src_operations_create_claimable_balance.js.html +++ b/js-stellar-base_src_operations_create_claimable_balance.js.html @@ -24,7 +24,7 @@
@@ -118,7 +118,7 @@

js-stellar-base/src/operations/create_claimable_balance.j
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_create_passive_sell_offer.js.html b/js-stellar-base_src_operations_create_passive_sell_offer.js.html index 7e842f18..ab6580e5 100644 --- a/js-stellar-base_src_operations_create_passive_sell_offer.js.html +++ b/js-stellar-base_src_operations_create_passive_sell_offer.js.html @@ -24,7 +24,7 @@
@@ -94,7 +94,7 @@

js-stellar-base/src/operations/create_passive_sell_offer.
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html b/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html index 6eed10ce..1c22b313 100644 --- a/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html +++ b/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html @@ -24,7 +24,7 @@
@@ -72,7 +72,7 @@

js-stellar-base/src/operations/end_sponsoring_future_rese
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_inflation.js.html b/js-stellar-base_src_operations_inflation.js.html index 9fbb057e..4e78b8d0 100644 --- a/js-stellar-base_src_operations_inflation.js.html +++ b/js-stellar-base_src_operations_inflation.js.html @@ -24,7 +24,7 @@
@@ -67,7 +67,7 @@

js-stellar-base/src/operations/inflation.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_invoke_host_function.js.html b/js-stellar-base_src_operations_invoke_host_function.js.html index 2a9ef348..5290e649 100644 --- a/js-stellar-base_src_operations_invoke_host_function.js.html +++ b/js-stellar-base_src_operations_invoke_host_function.js.html @@ -24,7 +24,7 @@
@@ -105,7 +105,7 @@

js-stellar-base/src/operations/invoke_host_function.js
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_liquidity_pool_deposit.js.html b/js-stellar-base_src_operations_liquidity_pool_deposit.js.html index a60f55b1..c3f45add 100644 --- a/js-stellar-base_src_operations_liquidity_pool_deposit.js.html +++ b/js-stellar-base_src_operations_liquidity_pool_deposit.js.html @@ -24,7 +24,7 @@
@@ -112,7 +112,7 @@

js-stellar-base/src/operations/liquidity_pool_deposit.js<
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html b/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html index cdd91538..c580be57 100644 --- a/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html +++ b/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html @@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@

js-stellar-base/src/operations/liquidity_pool_withdraw.js
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_manage_buy_offer.js.html b/js-stellar-base_src_operations_manage_buy_offer.js.html index 8905a1ef..598567ce 100644 --- a/js-stellar-base_src_operations_manage_buy_offer.js.html +++ b/js-stellar-base_src_operations_manage_buy_offer.js.html @@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@

js-stellar-base/src/operations/manage_buy_offer.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_manage_data.js.html b/js-stellar-base_src_operations_manage_data.js.html index bb542030..0d3bdc58 100644 --- a/js-stellar-base_src_operations_manage_data.js.html +++ b/js-stellar-base_src_operations_manage_data.js.html @@ -24,7 +24,7 @@
@@ -98,7 +98,7 @@

js-stellar-base/src/operations/manage_data.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_manage_sell_offer.js.html b/js-stellar-base_src_operations_manage_sell_offer.js.html index 029dcbb7..5928b49c 100644 --- a/js-stellar-base_src_operations_manage_sell_offer.js.html +++ b/js-stellar-base_src_operations_manage_sell_offer.js.html @@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@

js-stellar-base/src/operations/manage_sell_offer.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_path_payment_strict_receive.js.html b/js-stellar-base_src_operations_path_payment_strict_receive.js.html index 10ba13aa..0bc5f7e7 100644 --- a/js-stellar-base_src_operations_path_payment_strict_receive.js.html +++ b/js-stellar-base_src_operations_path_payment_strict_receive.js.html @@ -24,7 +24,7 @@
@@ -117,7 +117,7 @@

js-stellar-base/src/operations/path_payment_strict_receiv
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_path_payment_strict_send.js.html b/js-stellar-base_src_operations_path_payment_strict_send.js.html index 32b3e30e..dba188ff 100644 --- a/js-stellar-base_src_operations_path_payment_strict_send.js.html +++ b/js-stellar-base_src_operations_path_payment_strict_send.js.html @@ -24,7 +24,7 @@
@@ -116,7 +116,7 @@

js-stellar-base/src/operations/path_payment_strict_send.j
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_payment.js.html b/js-stellar-base_src_operations_payment.js.html index b10ff5fc..5b85e29c 100644 --- a/js-stellar-base_src_operations_payment.js.html +++ b/js-stellar-base_src_operations_payment.js.html @@ -24,7 +24,7 @@
@@ -96,7 +96,7 @@

js-stellar-base/src/operations/payment.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_revoke_sponsorship.js.html b/js-stellar-base_src_operations_revoke_sponsorship.js.html index 62d4a5b0..b4b2c382 100644 --- a/js-stellar-base_src_operations_revoke_sponsorship.js.html +++ b/js-stellar-base_src_operations_revoke_sponsorship.js.html @@ -24,7 +24,7 @@
@@ -368,7 +368,7 @@

js-stellar-base/src/operations/revoke_sponsorship.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_set_options.js.html b/js-stellar-base_src_operations_set_options.js.html index a404e661..0e5fde2a 100644 --- a/js-stellar-base_src_operations_set_options.js.html +++ b/js-stellar-base_src_operations_set_options.js.html @@ -24,7 +24,7 @@
@@ -238,7 +238,7 @@

js-stellar-base/src/operations/set_options.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_set_trustline_flags.js.html b/js-stellar-base_src_operations_set_trustline_flags.js.html index a223889c..e51e10ce 100644 --- a/js-stellar-base_src_operations_set_trustline_flags.js.html +++ b/js-stellar-base_src_operations_set_trustline_flags.js.html @@ -24,7 +24,7 @@
@@ -137,7 +137,7 @@

js-stellar-base/src/operations/set_trustline_flags.js

- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_signerkey.js.html b/js-stellar-base_src_signerkey.js.html index 5e6fe9e3..dd798326 100644 --- a/js-stellar-base_src_signerkey.js.html +++ b/js-stellar-base_src_signerkey.js.html @@ -24,7 +24,7 @@
@@ -143,7 +143,7 @@

js-stellar-base/src/signerkey.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_signing.js.html b/js-stellar-base_src_signing.js.html index 096fba72..5d38e121 100644 --- a/js-stellar-base_src_signing.js.html +++ b/js-stellar-base_src_signing.js.html @@ -24,7 +24,7 @@
@@ -158,7 +158,7 @@

js-stellar-base/src/signing.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_strkey.js.html b/js-stellar-base_src_strkey.js.html index 8cf5e29e..25aa11d1 100644 --- a/js-stellar-base_src_strkey.js.html +++ b/js-stellar-base_src_strkey.js.html @@ -24,7 +24,7 @@
@@ -412,7 +412,7 @@

js-stellar-base/src/strkey.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_transaction.js.html b/js-stellar-base_src_transaction.js.html index 1c5b0efc..1ca95d25 100644 --- a/js-stellar-base_src_transaction.js.html +++ b/js-stellar-base_src_transaction.js.html @@ -24,7 +24,7 @@
@@ -421,7 +421,7 @@

js-stellar-base/src/transaction.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_transaction_base.js.html b/js-stellar-base_src_transaction_base.js.html index 7df5f37d..9ca5098c 100644 --- a/js-stellar-base_src_transaction_base.js.html +++ b/js-stellar-base_src_transaction_base.js.html @@ -24,7 +24,7 @@
@@ -279,7 +279,7 @@

js-stellar-base/src/transaction_base.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_transaction_builder.js.html b/js-stellar-base_src_transaction_builder.js.html index 0ab62587..e6ae9694 100644 --- a/js-stellar-base_src_transaction_builder.js.html +++ b/js-stellar-base_src_transaction_builder.js.html @@ -24,7 +24,7 @@
@@ -778,7 +778,7 @@

js-stellar-base/src/transaction_builder.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/js-stellar-base_src_util_decode_encode_muxed_account.js.html b/js-stellar-base_src_util_decode_encode_muxed_account.js.html index e33ef8be..e02cfd70 100644 --- a/js-stellar-base_src_util_decode_encode_muxed_account.js.html +++ b/js-stellar-base_src_util_decode_encode_muxed_account.js.html @@ -24,7 +24,7 @@
@@ -177,7 +177,7 @@

js-stellar-base/src/util/decode_encode_muxed_account.js
- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/keypair.js.html b/keypair.js.html index a345767f..d9b08122 100644 --- a/keypair.js.html +++ b/keypair.js.html @@ -329,7 +329,7 @@

keypair.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/lib_axios.js.html b/lib_axios.js.html index a5bcc5eb..6915cab2 100644 --- a/lib_axios.js.html +++ b/lib_axios.js.html @@ -24,7 +24,7 @@
@@ -50,7 +50,7 @@

lib/axios.js

var _urijs = _interopRequireDefault(require("urijs")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* tslint:disable-next-line:no-var-requires */ -var version = require("../package.json").version; +const version = require("../package.json").version; /** * keep a local map of server times * (export this purely for testing purposes) @@ -63,9 +63,9 @@

lib/axios.js

* localTimeRecorded: 1552513052 * } */ -var SERVER_TIME_MAP = {}; +const SERVER_TIME_MAP = {}; exports.SERVER_TIME_MAP = SERVER_TIME_MAP; -var AxiosClient = _axios.default.create({ +const AxiosClient = _axios.default.create({ headers: { "X-Client-Name": "js-soroban-client", "X-Client-Version": version @@ -75,13 +75,13 @@

lib/axios.js

return Math.floor(ms / 1000); } AxiosClient.interceptors.response.use(function interceptorHorizonResponse(response) { - var hostname = (0, _urijs.default)(response.config.url).hostname(); - var serverTime = _toSeconds(Date.parse(response.headers.date)); - var localTimeRecorded = _toSeconds(new Date().getTime()); + const hostname = (0, _urijs.default)(response.config.url).hostname(); + const serverTime = _toSeconds(Date.parse(response.headers.date)); + const localTimeRecorded = _toSeconds(new Date().getTime()); if (!isNaN(serverTime)) { SERVER_TIME_MAP[hostname] = { - serverTime: serverTime, - localTimeRecorded: localTimeRecorded + serverTime, + localTimeRecorded }; } return response; @@ -98,13 +98,15 @@

lib/axios.js

*/ exports.default = _default; function getCurrentServerTime(hostname) { - var entry = SERVER_TIME_MAP[hostname]; + const entry = SERVER_TIME_MAP[hostname]; if (!entry || !entry.localTimeRecorded || !entry.serverTime) { return null; } - var serverTime = entry.serverTime, - localTimeRecorded = entry.localTimeRecorded; - var currentTime = _toSeconds(new Date().getTime()); + const { + serverTime, + localTimeRecorded + } = entry; + const currentTime = _toSeconds(new Date().getTime()); // if it's been more than 5 minutes from the last time, then null it out if (currentTime - localTimeRecorded > 60 * 5) { @@ -123,7 +125,7 @@

lib/axios.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/lib_jsonrpc.js.html b/lib_jsonrpc.js.html index ca298282..af3bdc1f 100644 --- a/lib_jsonrpc.js.html +++ b/lib_jsonrpc.js.html @@ -24,7 +24,7 @@
@@ -49,94 +49,48 @@

lib/jsonrpc.js

var _axios = _interopRequireDefault(require("./axios")); var _utils = require("./utils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /** * Sends the jsonrpc 'params' as an array. */ -function post(_x, _x2) { - return _post.apply(this, arguments); +async function post(url, method) { + for (var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + params[_key - 2] = arguments[_key]; + } + if (params && params.length < 1) { + params = null; + } + const response = await _axios.default.post(url, { + jsonrpc: "2.0", + // TODO: Generate a unique request id + id: 1, + method, + params + }); + if ((0, _utils.hasOwnProperty)(response.data, "error")) { + throw response.data.error; + } else { + var _response$data; + return (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.result; + } } + /** * Sends the jsonrpc 'params' as the single 'param' obj, no array wrapper is applied. */ -function _post() { - _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, method) { - var _len, - params, - _key, - response, - _response$data, - _args = arguments; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - for (_len = _args.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - params[_key - 2] = _args[_key]; - } - if (params && params.length < 1) { - params = null; - } - _context.next = 4; - return _axios.default.post(url, { - jsonrpc: "2.0", - // TODO: Generate a unique request id - id: 1, - method: method, - params: params - }); - case 4: - response = _context.sent; - if (!(0, _utils.hasOwnProperty)(response.data, "error")) { - _context.next = 9; - break; - } - throw response.data.error; - case 9: - return _context.abrupt("return", (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.result); - case 10: - case "end": - return _context.stop(); - } - }, _callee); - })); - return _post.apply(this, arguments); -} -function postObject(_x3, _x4, _x5) { - return _postObject.apply(this, arguments); -} -function _postObject() { - _postObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url, method, param) { - var response, _response$data2; - return _regeneratorRuntime().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return _axios.default.post(url, { - jsonrpc: "2.0", - // TODO: Generate a unique request id - id: 1, - method: method, - params: param - }); - case 2: - response = _context2.sent; - if (!(0, _utils.hasOwnProperty)(response.data, "error")) { - _context2.next = 7; - break; - } - throw response.data.error; - case 7: - return _context2.abrupt("return", (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.result); - case 8: - case "end": - return _context2.stop(); - } - }, _callee2); - })); - return _postObject.apply(this, arguments); +async function postObject(url, method, param) { + const response = await _axios.default.post(url, { + jsonrpc: "2.0", + // TODO: Generate a unique request id + id: 1, + method, + params: param + }); + if ((0, _utils.hasOwnProperty)(response.data, "error")) { + throw response.data.error; + } else { + var _response$data2; + return (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.result; + } } @@ -149,7 +103,7 @@

lib/jsonrpc.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/lib_server.js.html b/lib_server.js.html index 232b2762..459bfd84 100644 --- a/lib_server.js.html +++ b/lib_server.js.html @@ -24,7 +24,7 @@
@@ -52,29 +52,12 @@

lib/server.js

var _axios = _interopRequireDefault(require("./axios")); var jsonrpc = _interopRequireWildcard(require("./jsonrpc")); var _transaction = require("./transaction"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* tslint:disable:variable-name no-namespace */ -var SUBMIT_TRANSACTION_TIMEOUT = 60 * 1000; +/* tslint:disable:variable-name no-namespace */ + +const SUBMIT_TRANSACTION_TIMEOUT = 60 * 1000; exports.SUBMIT_TRANSACTION_TIMEOUT = SUBMIT_TRANSACTION_TIMEOUT; /** * Server handles the network connection to a [Soroban-RPC](https://soroban.stellar.org/docs) @@ -86,16 +69,15 @@

lib/server.js

* @param {string} [opts.appName] - Allow set custom header `X-App-Name`, default: `undefined`. * @param {string} [opts.appVersion] - Allow set custom header `X-App-Version`, default: `undefined`. */ -var Server = /*#__PURE__*/function () { +class Server { /** * serverURL Soroban-RPC Server URL (ex. `http://localhost:8000/soroban/rpc`). */ - function Server(serverURL) { - var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - _classCallCheck(this, Server); + constructor(serverURL) { + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.serverURL = (0, _urijs.default)(serverURL); - var customHeaders = {}; + const customHeaders = {}; if (opts.appName) { customHeaders["X-App-Name"] = opts.appName; } @@ -103,7 +85,7 @@

lib/server.js

customHeaders["X-App-Version"] = opts.appVersion; } if (!(0, _isEmpty.default)(customHeaders)) { - _axios.default.interceptors.request.use(function (config) { + _axios.default.interceptors.request.use(config => { // merge the custom headers with an existing headers config.headers = (0, _merge.default)(customHeaders, config.headers); return config; @@ -128,674 +110,462 @@

lib/server.js

* @param {string} address - The public address of the account to load. * @returns {Promise<Account>} Returns a promise to the {@link Account} object with populated sequence number. */ - _createClass(Server, [{ - key: "getAccount", - value: function () { - var _getAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(address) { - var _yield$jsonrpc$post, ledgerEntryData, accountEntry, _accountEntry$seqNum, high, low, sequence; - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getLedgerEntry", _stellarBase.xdr.LedgerKey.account(new _stellarBase.xdr.LedgerKeyAccount({ - accountId: _stellarBase.xdr.PublicKey.publicKeyTypeEd25519(_stellarBase.StrKey.decodeEd25519PublicKey(address)) - })).toXDR("base64")); - case 2: - _yield$jsonrpc$post = _context.sent; - ledgerEntryData = _yield$jsonrpc$post.xdr; - accountEntry = _stellarBase.xdr.LedgerEntryData.fromXDR(ledgerEntryData, "base64").account(); - _accountEntry$seqNum = accountEntry.seqNum(), high = _accountEntry$seqNum.high, low = _accountEntry$seqNum.low; - sequence = BigInt(high) * BigInt(4294967296) + BigInt(low); - return _context.abrupt("return", new _stellarBase.Account(address, sequence.toString())); - case 8: - case "end": - return _context.stop(); - } - }, _callee, this); - })); - function getAccount(_x) { - return _getAccount.apply(this, arguments); - } - return getAccount; - }() - /** - * General node health check. - * - * @example - * server.getHealth().then(health => { - * console.log("status:", health.status); - * }); - * - * @returns {Promise<SorobanRpc.GetHealthResponse>} Returns a promise to the {@link SorobanRpc.GetHealthResponse} object with the status of the server ("healthy"). - */ - }, { - key: "getHealth", - value: function () { - var _getHealth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { - return _regeneratorRuntime().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - _context2.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getHealth"); - case 2: - return _context2.abrupt("return", _context2.sent); - case 3: - case "end": - return _context2.stop(); - } - }, _callee2, this); - })); - function getHealth() { - return _getHealth.apply(this, arguments); - } - return getHealth; - }() - /** - * Reads the current value of contract data ledger entries directly. - * - * @example - * const contractId = "0000000000000000000000000000000000000000000000000000000000000001"; - * const key = xdr.ScVal.scvSymbol("counter"); - * server.getContractData(contractId, key).then(data => { - * console.log("value:", data.xdr); - * console.log("lastModified:", data.lastModifiedLedgerSeq); - * console.log("latestLedger:", data.latestLedger); - * }); - * - * Allows you to directly inspect the current state of a contract. This is a backup way to access your contract data which may not be available via events or simulateTransaction. - * - * @param {string} contractId - The contract ID containing the data to load. Encoded as a hex string. - * @param {xdr.ScVal} key - The key of the contract data to load. - * @returns {Promise<SorobanRpc.GetLedgerEntryResponse>} Returns a promise to the {@link SorobanRpc.GetLedgerEntryResponse} object with the current value. - */ - }, { - key: "getContractData", - value: function () { - var _getContractData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(contractId, key) { - return _regeneratorRuntime().wrap(function _callee3$(_context3) { - while (1) switch (_context3.prev = _context3.next) { - case 0: - _context3.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getLedgerEntry", _stellarBase.xdr.LedgerKey.contractData(new _stellarBase.xdr.LedgerKeyContractData({ - contractId: Buffer.from(contractId, "hex"), - key: key - })).toXDR("base64")); - case 2: - return _context3.abrupt("return", _context3.sent); - case 3: - case "end": - return _context3.stop(); - } - }, _callee3, this); - })); - function getContractData(_x2, _x3) { - return _getContractData.apply(this, arguments); - } - return getContractData; - }() - /** - * Reads the current value of ledger entries directly. - * - * Allows you to directly inspect the current state of a contract, - * contract's code, or any other ledger entry. This is a backup way to access - * your contract data which may not be available via events or - * simulateTransaction. - * - * To fetch contract wasm byte-code, use the ContractCode ledger entry key. - * - * @example - * const contractId = "0000000000000000000000000000000000000000000000000000000000000001"; - * const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({ - * contractId: Buffer.from(contractId, "hex"), - * key: xdr.ScVal.scvSymbol("counter"), - * })); - * server.getLedgerEntry(key).then(data => { - * console.log("value:", data.xdr); - * console.log("lastModified:", data.lastModifiedLedgerSeq); - * console.log("latestLedger:", data.latestLedger); - * }); - * - * @param {xdr.ScVal} key - The key of the contract data to load. - * @returns {Promise<SorobanRpc.GetLedgerEntryResponse>} Returns a promise to the {@link SorobanRpc.GetLedgerEntryResponse} object with the current value. - */ - }, { - key: "getLedgerEntry", - value: function () { - var _getLedgerEntry = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key) { - return _regeneratorRuntime().wrap(function _callee4$(_context4) { - while (1) switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getLedgerEntry", key.toXDR("base64")); - case 2: - return _context4.abrupt("return", _context4.sent); - case 3: - case "end": - return _context4.stop(); - } - }, _callee4, this); - })); - function getLedgerEntry(_x4) { - return _getLedgerEntry.apply(this, arguments); - } - return getLedgerEntry; - }() - /** - * Fetch the details of a submitted transaction. - * - * When submitting a transaction, clients should poll this to tell when the - * transaction has completed. - * - * @example - * const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a"; - * server.getTransaction(transactionHash).then(transaction => { - * console.log("status:", transaction.status); - * console.log("envelopeXdr:", transaction.envelopeXdr); - * console.log("resultMetaXdr:", transaction.resultMetaXdr); - * console.log("resultXdr:", transaction.resultXdr); - * }); - * - * @param {string} hash - The hash of the transaction to check. Encoded as a - * hex string. - * - * @returns {Promise<SorobanRpc.GetTransactionResponse>} Returns a - * promise to the {@link SorobanRpc.GetTransactionResponse} object - * with the status, result, and other details about the transaction. - */ - }, { - key: "getTransaction", - value: function () { - var _getTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(hash) { - return _regeneratorRuntime().wrap(function _callee5$(_context5) { - while (1) switch (_context5.prev = _context5.next) { - case 0: - _context5.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getTransaction", hash); - case 2: - return _context5.abrupt("return", _context5.sent); - case 3: - case "end": - return _context5.stop(); - } - }, _callee5, this); - })); - function getTransaction(_x5) { - return _getTransaction.apply(this, arguments); - } - return getTransaction; - }() - /** - * Fetches all events that match a given set of filters. - * - * The given filters (see {@link SorobanRpc.EventFilter} for detailed fields) - * are combined only in a logical OR fashion, and all of the fields in each - * filter are optional. - * - * To page through events, use the `pagingToken` field on the relevant - * {@link SorobanRpc.EventResponse} object to set the `cursor` parameter. - * - * @example - * server.getEvents({ - * startLedger: "1000", - * filters: [ - * { - * type: "contract", - * contractIds: [ "deadb33f..." ], - * topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc=", "*" ]] - * }, { - * type: "system", - * contractIds: [ "...c4f3b4b3..." ], - * topics: [[ "*" ], [ "*", "AAAAAQB6Mcc=" ]] - * }, { - * contractIds: [ "...c4f3b4b3..." ], - * topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==" ]] - * }, { - * type: "diagnostic", - * topics: [[ "AAAAAQB6Mcc=" ]] - * } - * ], - * limit: 10, - * }); - * - * @returns {Promise<SorobanRpc.GetEventsResponse>} a promise to the - * {@link SorobanRpc.GetEventsResponse} object containing a paginatable set - * of the events matching the given event filters. - */ - }, { - key: "getEvents", - value: function () { - var _getEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(request) { - var _request$filters; - return _regeneratorRuntime().wrap(function _callee6$(_context6) { - while (1) switch (_context6.prev = _context6.next) { - case 0: - _context6.next = 2; - return jsonrpc.postObject(this.serverURL.toString(), "getEvents", _objectSpread({ - filters: (_request$filters = request.filters) !== null && _request$filters !== void 0 ? _request$filters : [], - pagination: _objectSpread(_objectSpread({}, request.cursor && { - cursor: request.cursor - }), request.limit && { - limit: request.limit - }) - }, request.startLedger && { - startLedger: String(request.startLedger) - })); - case 2: - return _context6.abrupt("return", _context6.sent); - case 3: - case "end": - return _context6.stop(); - } - }, _callee6, this); - })); - function getEvents(_x6) { - return _getEvents.apply(this, arguments); - } - return getEvents; - }() - /** - * Fetches metadata about the network which Soroban-RPC is connected to. - * - * @example - * server.getNetwork().then(network => { - * console.log("friendbotUrl:", network.friendbotUrl); - * console.log("passphrase:", network.passphrase); - * console.log("protocolVersion:", network.protocolVersion); - * }); - * - * @returns {Promise<SorobanRpc.GetNetworkResponse>} a promise to the - * {@link SorobanRpc.GetNetworkResponse} object containing metadata - * about the current network this soroban-rpc server is connected to. - */ - }, { - key: "getNetwork", - value: function () { - var _getNetwork = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() { - return _regeneratorRuntime().wrap(function _callee7$(_context7) { - while (1) switch (_context7.prev = _context7.next) { - case 0: - _context7.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getNetwork"); - case 2: - return _context7.abrupt("return", _context7.sent); - case 3: - case "end": - return _context7.stop(); - } - }, _callee7, this); - })); - function getNetwork() { - return _getNetwork.apply(this, arguments); - } - return getNetwork; - }() - /** - * Fetches the latest ledger meta info from network which Soroban-RPC is connected to. - * - * @example - * server.getLatestLedger().then(response => { - * console.log("hash:", response.id); - * console.log("sequence:", response.sequence); - * console.log("protocolVersion:", response.protocolVersion); - * }); - * - * @returns {Promise<SorobanRpc.GetLatestLedgerResponse>} a promise to the - * {@link SorobanRpc.GetLatestLedgerResponse} object containing metadata - * about the latest ledger from network soroban-rpc server is connected to. - */ - }, { - key: "getLatestLedger", - value: function () { - var _getLatestLedger = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() { - return _regeneratorRuntime().wrap(function _callee8$(_context8) { - while (1) switch (_context8.prev = _context8.next) { - case 0: - _context8.next = 2; - return jsonrpc.post(this.serverURL.toString(), "getLatestLedger"); - case 2: - return _context8.abrupt("return", _context8.sent); - case 3: - case "end": - return _context8.stop(); - } - }, _callee8, this); - })); - function getLatestLedger() { - return _getLatestLedger.apply(this, arguments); - } - return getLatestLedger; - }() - /** - * Submit a trial contract invocation to get back return values, expected - * ledger footprint, expected authorizations, and expected costs. - * - * @example - * const contractId = '0000000000000000000000000000000000000000000000000000000000000001'; - * const contract = new SorobanClient.Contract(contractId); - * - * // Right now, this is just the default fee for this example. - * const fee = 100; - * - * const transaction = new SorobanClient.TransactionBuilder(account, { - * fee, - * // Uncomment the following line to build transactions for the live network. Be - * // sure to also change the horizon hostname. - * // networkPassphrase: SorobanClient.Networks.PUBLIC, - * networkPassphrase: SorobanClient.Networks.STANDALONE - * }) - * // Add a contract.increment soroban contract invocation operation - * .addOperation(contract.call("increment")) - * // Make this transaction valid for the next 30 seconds only - * .setTimeout(30) - * // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/) - * // .addMemo(SorobanClient.Memo.text('Hello world!')) - * .build(); - * - * // Sign this transaction with the secret key - * // NOTE: signing is transaction is network specific. Test network transactions - * // won't work in the public network. To switch networks, use the Network object - * // as explained above (look for SorobanClient.Network). - * const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey); - * transaction.sign(sourceKeypair); - * - * server.simulateTransaction(transaction).then(sim => { - * console.log("cost:", sim.cost); - * console.log("results:", sim.results); - * console.log("error:", sim.error); - * console.log("latestLedger:", sim.latestLedger); - * }); - * - * @param {Transaction | FeeBumpTransaction} transaction - The transaction to - * simulate. It should include exactly one operation, which must be a - * {@link InvokeHostFunctionOp}. Any provided footprint will be ignored. - * @returns {Promise<SorobanRpc.SimulateTransactionResponse>} Returns a - * promise to the {@link SorobanRpc.SimulateTransactionResponse} object - * with the cost, result, footprint, auth, and error of the transaction. - */ - }, { - key: "simulateTransaction", - value: function () { - var _simulateTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(transaction) { - return _regeneratorRuntime().wrap(function _callee9$(_context9) { - while (1) switch (_context9.prev = _context9.next) { - case 0: - _context9.next = 2; - return jsonrpc.post(this.serverURL.toString(), "simulateTransaction", transaction.toXDR()); - case 2: - return _context9.abrupt("return", _context9.sent); - case 3: - case "end": - return _context9.stop(); - } - }, _callee9, this); - })); - function simulateTransaction(_x7) { - return _simulateTransaction.apply(this, arguments); - } - return simulateTransaction; - }() - /** - * Submit a trial contract invocation, first run a simulation of the contract - * invocation as defined on the incoming transaction, and apply the results - * to a new copy of the transaction which is then returned. Setting the ledger - * footprint and authorization, so the resulting transaction is ready for signing & sending. - * - * The returned transaction will also have an updated fee that is the sum of fee set - * on incoming transaction with the contract resource fees estimated from simulation. It is - * adviseable to check the fee on returned transaction and validate or take appropriate - * measures for interaction with user to confirm it is acceptable. - * - * You can call the {simulateTransaction(transaction)} method directly first if you - * want to inspect estimated fees for a given transaction in detail first if that is - * of importance. - * - * @example - * const contractId = '0000000000000000000000000000000000000000000000000000000000000001'; - * const contract = new SorobanClient.Contract(contractId); - * - * // Right now, this is just the default fee for this example. - * const fee = 100; - * - * const transaction = new SorobanClient.TransactionBuilder(account, { - * fee, - * // Uncomment the following line to build transactions for the live network. Be - * // sure to also change the horizon hostname. - * // networkPassphrase: SorobanClient.Networks.PUBLIC, - * networkPassphrase: SorobanClient.Networks.TESTNET - * }) - * // Add a contract.increment soroban contract invocation operation - * .addOperation(contract.call("increment")) - * // Make this transaction valid for the next 30 seconds only - * .setTimeout(30) - * // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/) - * // .addMemo(SorobanClient.Memo.text('Hello world!')) - * .build(); - * - * preparedTransaction = await server.prepareTransaction(transaction); - * - * // Sign this transaction with the secret key - * // NOTE: signing is transaction is network specific. Test network transactions - * // won't work in the public network. To switch networks, use the Network object - * // as explained above (look for SorobanClient.Network). - * const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey); - * preparedTransaction.sign(sourceKeypair); - * - * server.sendTransaction(transaction).then(result => { - * console.log("hash:", result.hash); - * console.log("status:", result.status); - * console.log("errorResultXdr:", result.errorResultXdr); - * }); - * - * @param {Transaction | FeeBumpTransaction} transaction - The transaction to - * prepare. It should include exactly one operation, which must be a - * {@link InvokeHostFunctionOp}. Any provided footprint will be overwritten. - * @param {string} [networkPassphrase] - Explicitly provide a network - * passphrase. If not passed, the current network passphrase will be requested - * from the server via `getNetwork`. - * @returns {Promise<Transaction | FeeBumpTransaction>} Returns a copy of the - * transaction, with the expected ledger footprint and authorizations added - * and the transaction fee will automatically be adjusted to the sum of - * the incoming transaction fee and the contract minimum resource fees - * discovered from the simulation, - * - */ - }, { - key: "prepareTransaction", - value: function () { - var _prepareTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(transaction, networkPassphrase) { - var _yield$Promise$all, _yield$Promise$all2, passphrase, simResponse; - return _regeneratorRuntime().wrap(function _callee10$(_context10) { - while (1) switch (_context10.prev = _context10.next) { - case 0: - _context10.next = 2; - return Promise.all([networkPassphrase ? Promise.resolve({ - passphrase: networkPassphrase - }) : this.getNetwork(), this.simulateTransaction(transaction)]); - case 2: - _yield$Promise$all = _context10.sent; - _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2); - passphrase = _yield$Promise$all2[0].passphrase; - simResponse = _yield$Promise$all2[1]; - if (!simResponse.error) { - _context10.next = 8; - break; - } - throw simResponse.error; - case 8: - if (!(!simResponse.results || simResponse.results.length < 1)) { - _context10.next = 10; - break; - } - throw new Error("transaction simulation failed"); - case 10: - return _context10.abrupt("return", (0, _transaction.assembleTransaction)(transaction, passphrase, simResponse)); - case 11: - case "end": - return _context10.stop(); - } - }, _callee10, this); - })); - function prepareTransaction(_x8, _x9) { - return _prepareTransaction.apply(this, arguments); - } - return prepareTransaction; - }() - /** - * Submit a real transaction to the Stellar network. This is the only way to - * make changes "on-chain". Unlike Horizon, Soroban-RPC does not wait for - * transaction completion. It simply validates the transaction and enqueues - * it. Clients should call {@link Server#getTransactionStatus} to learn about - * transaction success/failure. - * - * @example - * const contractId = '0000000000000000000000000000000000000000000000000000000000000001'; - * const contract = new SorobanClient.Contract(contractId); - * - * // Right now, this is just the default fee for this example. - * const fee = 100; - * - * const transaction = new SorobanClient.TransactionBuilder(account, { - * fee, - * // Uncomment the following line to build transactions for the live network. Be - * // sure to also change the horizon hostname. - * // networkPassphrase: SorobanClient.Networks.PUBLIC, - * networkPassphrase: SorobanClient.Networks.STANDALONE - * }) - * // Add a contract.increment soroban contract invocation operation - * // Note: For real transactions you will need to include the footprint - * // and auth in the operation, as returned from simulateTransaction. - * .addOperation(contract.call("increment")) - * // Make this transaction valid for the next 30 seconds only - * .setTimeout(30) - * // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/) - * // .addMemo(SorobanClient.Memo.text('Hello world!')) - * .build(); - * - * // Sign this transaction with the secret key - * // NOTE: signing is transaction is network specific. Test network transactions - * // won't work in the public network. To switch networks, use the Network object - * // as explained above (look for SorobanClient.Network). - * const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey); - * transaction.sign(sourceKeypair); - * - * server.sendTransaction(transaction).then(result => { - * console.log("hash:", result.hash); - * console.log("status:", result.status); - * console.log("errorResultXdr:", result.errorResultXdr); - * }); - * - * @param {Transaction | FeeBumpTransaction} transaction - The transaction to - * submit. - * @returns {Promise<SorobanRpc.SendTransactionResponse>} Returns a promise to - * the {@link SorobanRpc.SendTransactionResponse} object with the - * transaction id, status, and any error if available. - */ - }, { - key: "sendTransaction", - value: function () { - var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(transaction) { - return _regeneratorRuntime().wrap(function _callee11$(_context11) { - while (1) switch (_context11.prev = _context11.next) { - case 0: - _context11.next = 2; - return jsonrpc.post(this.serverURL.toString(), "sendTransaction", transaction.toXDR()); - case 2: - return _context11.abrupt("return", _context11.sent); - case 3: - case "end": - return _context11.stop(); - } - }, _callee11, this); - })); - function sendTransaction(_x10) { - return _sendTransaction.apply(this, arguments); - } - return sendTransaction; - }() - /** - * Use the friendbot faucet to create and fund a new account. The method will - * return an Account object for the created account, or if the account already - * existed. If friendbot is not configured on this network, this method will - * throw an error. If the request fails, this method will throw an error. - * - * @example - * server.requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4").then(accountCreated => { - * console.log("accountCreated:", accountCreated); - * }).catch(error => { - * console.error("error:", error); - * }); - * - * @param {string | Account} address - The address or account we want to create and fund. - * @param {string} [friendbotUrl] - The optional explicit address for - * friendbot. If not provided, the client will call the Soroban-RPC `getNetwork` - * method to attempt to find this network's friendbot url. - * @returns {Promise<Account>} Returns a promise to the {@link Account} object with populated sequence number. - */ - }, { - key: "requestAirdrop", - value: function () { - var _requestAirdrop = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(address, friendbotUrl) { - var account, response, meta, sequence, _error$response, _error$response$detai; - return _regeneratorRuntime().wrap(function _callee12$(_context12) { - while (1) switch (_context12.prev = _context12.next) { - case 0: - account = typeof address === "string" ? address : address.accountId(); - _context12.t0 = friendbotUrl; - if (_context12.t0) { - _context12.next = 6; - break; - } - _context12.next = 5; - return this.getNetwork(); - case 5: - _context12.t0 = _context12.sent.friendbotUrl; - case 6: - friendbotUrl = _context12.t0; - if (friendbotUrl) { - _context12.next = 9; - break; - } - throw new Error("No friendbot URL configured for current network"); - case 9: - _context12.prev = 9; - _context12.next = 12; - return _axios.default.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account))); - case 12: - response = _context12.sent; - meta = _stellarBase.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, "base64"); - sequence = findCreatedAccountSequenceInTransactionMeta(meta); - return _context12.abrupt("return", new _stellarBase.Account(account, sequence)); - case 18: - _context12.prev = 18; - _context12.t1 = _context12["catch"](9); - if (!(((_error$response = _context12.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) { - _context12.next = 23; - break; - } - if (!((_error$response$detai = _context12.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes("createAccountAlreadyExist"))) { - _context12.next = 23; - break; - } - return _context12.abrupt("return", this.getAccount(account)); - case 23: - throw _context12.t1; - case 24: - case "end": - return _context12.stop(); - } - }, _callee12, this, [[9, 18]]); - })); - function requestAirdrop(_x11, _x12) { - return _requestAirdrop.apply(this, arguments); + async getAccount(address) { + const ledgerKey = _stellarBase.xdr.LedgerKey.account(new _stellarBase.xdr.LedgerKeyAccount({ + accountId: _stellarBase.xdr.PublicKey.publicKeyTypeEd25519(_stellarBase.StrKey.decodeEd25519PublicKey(address)) + })).toXDR("base64"); + const data = await jsonrpc.post(this.serverURL.toString(), "getLedgerEntries", [ledgerKey]); + const ledgerEntries = data.entries; + if (ledgerEntries.length === 0) { + return Promise.reject({ + code: 404, + message: "Ledger entry not found. Key: " + ledgerKey + }); + } + const ledgerEntryData = ledgerEntries[0].xdr; + const accountEntry = _stellarBase.xdr.LedgerEntryData.fromXDR(ledgerEntryData, "base64").account(); + const { + high, + low + } = accountEntry.seqNum(); + const sequence = BigInt(high) * BigInt(4294967296) + BigInt(low); + return new _stellarBase.Account(address, sequence.toString()); + } + + /** + * General node health check. + * + * @example + * server.getHealth().then(health => { + * console.log("status:", health.status); + * }); + * + * @returns {Promise<SorobanRpc.GetHealthResponse>} Returns a promise to the {@link SorobanRpc.GetHealthResponse} object with the status of the server ("healthy"). + */ + async getHealth() { + return await jsonrpc.post(this.serverURL.toString(), "getHealth"); + } + + /** + * Reads the current value of contract data ledger entries directly. + * + * @example + * const contractId = "0000000000000000000000000000000000000000000000000000000000000001"; + * const key = xdr.ScVal.scvSymbol("counter"); + * server.getContractData(contractId, key).then(data => { + * console.log("value:", data.xdr); + * console.log("lastModified:", data.lastModifiedLedgerSeq); + * console.log("latestLedger:", data.latestLedger); + * }); + * + * Allows you to directly inspect the current state of a contract. This is a backup way to access your contract data which may not be available via events or simulateTransaction. + * + * @param {string} contractId - The contract ID containing the data to load. Encoded as a hex string. + * @param {xdr.ScVal} key - The key of the contract data to load. + * @returns {Promise<SorobanRpc.LedgerEntryResult>} Returns a promise to the {@link SorobanRpc.LedgerEntryResult} object with the current value. + */ + async getContractData(contractId, key) { + const contractKey = _stellarBase.xdr.LedgerKey.contractData(new _stellarBase.xdr.LedgerKeyContractData({ + contractId: Buffer.from(contractId, "hex"), + key + })).toXDR("base64"); + const getLedgerEntriesResponse = await jsonrpc.post(this.serverURL.toString(), "getLedgerEntries", [contractKey]); + if (getLedgerEntriesResponse.entries.length === 0) { + return Promise.reject({ + code: 404, + message: "Ledger entry not found. Key: " + contractKey + }); + } + return getLedgerEntriesResponse.entries[0]; + } + + /** + * Reads the current value of ledger entries directly. + * + * Allows you to directly inspect the current state of contracts, + * contract's code, or any other ledger entries. This is a backup way to access + * your contract data which may not be available via events or + * simulateTransaction. + * + * To fetch contract wasm byte-code, use the ContractCode ledger entry key. + * + * @example + * const contractId = "0000000000000000000000000000000000000000000000000000000000000001"; + * const key = xdr.LedgerKey.contractData(new xdr.LedgerKeyContractData({ + * contractId: Buffer.from(contractId, "hex"), + * key: xdr.ScVal.scvSymbol("counter"), + * })); + * server.getLedgerEntries([key]).then(response => { + * const ledgerData = response.entries[0]; + * console.log("key:", ledgerData.key); + * console.log("value:", ledgerData.xdr); + * console.log("lastModified:", ledgerData.lastModifiedLedgerSeq); + * console.log("latestLedger:", response.latestLedger); + * }); + * + * @param {xdr.ScVal} key - The key of the contract data to load. + * @returns {Promise<SorobanRpc.GetLedgerEntriesResponse>} Returns a promise to the {@link SorobanRpc.GetLedgerEntriesResponse} object with the current value. + */ + async getLedgerEntries(keys) { + return await jsonrpc.post(this.serverURL.toString(), "getLedgerEntries", keys.map(k => k.toXDR("base64"))); + } + + /** + * Fetch the details of a submitted transaction. + * + * When submitting a transaction, clients should poll this to tell when the + * transaction has completed. + * + * @example + * const transactionHash = "c4515e3bdc0897f21cc5dbec8c82cf0a936d4741cb74a8e158eb51b9fb00411a"; + * server.getTransaction(transactionHash).then(transaction => { + * console.log("status:", transaction.status); + * console.log("envelopeXdr:", transaction.envelopeXdr); + * console.log("resultMetaXdr:", transaction.resultMetaXdr); + * console.log("resultXdr:", transaction.resultXdr); + * }); + * + * @param {string} hash - The hash of the transaction to check. Encoded as a + * hex string. + * + * @returns {Promise<SorobanRpc.GetTransactionResponse>} Returns a + * promise to the {@link SorobanRpc.GetTransactionResponse} object + * with the status, result, and other details about the transaction. + */ + async getTransaction(hash) { + return await jsonrpc.post(this.serverURL.toString(), "getTransaction", hash); + } + + /** + * Fetches all events that match a given set of filters. + * + * The given filters (see {@link SorobanRpc.EventFilter} for detailed fields) + * are combined only in a logical OR fashion, and all of the fields in each + * filter are optional. + * + * To page through events, use the `pagingToken` field on the relevant + * {@link SorobanRpc.EventResponse} object to set the `cursor` parameter. + * + * @example + * server.getEvents({ + * startLedger: "1000", + * filters: [ + * { + * type: "contract", + * contractIds: [ "deadb33f..." ], + * topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==", "AAAAAQB6Mcc=", "*" ]] + * }, { + * type: "system", + * contractIds: [ "...c4f3b4b3..." ], + * topics: [[ "*" ], [ "*", "AAAAAQB6Mcc=" ]] + * }, { + * contractIds: [ "...c4f3b4b3..." ], + * topics: [[ "AAAABQAAAAh0cmFuc2Zlcg==" ]] + * }, { + * type: "diagnostic", + * topics: [[ "AAAAAQB6Mcc=" ]] + * } + * ], + * limit: 10, + * }); + * + * @returns {Promise<SorobanRpc.GetEventsResponse>} a promise to the + * {@link SorobanRpc.GetEventsResponse} object containing a paginatable set + * of the events matching the given event filters. + */ + async getEvents(request) { + // TODO: It'd be nice if we could do something to infer the types of filter + // arguments a user wants, e.g. converting something like "transfer/*/42" + // into the base64-encoded `ScVal` equivalents by inferring that the first + // is an ScSymbol and the last is a U32. + // + // The difficulty comes in matching up the correct integer primitives. + // + // It also means this library will rely on the XDR definitions. + return await jsonrpc.postObject(this.serverURL.toString(), "getEvents", { + filters: request.filters ?? [], + pagination: { + ...(request.cursor && { + cursor: request.cursor + }), + // add fields only if defined + ...(request.limit && { + limit: request.limit + }) + }, + ...(request.startLedger && { + startLedger: String(request.startLedger) + }) + }); + } + + /** + * Fetches metadata about the network which Soroban-RPC is connected to. + * + * @example + * server.getNetwork().then(network => { + * console.log("friendbotUrl:", network.friendbotUrl); + * console.log("passphrase:", network.passphrase); + * console.log("protocolVersion:", network.protocolVersion); + * }); + * + * @returns {Promise<SorobanRpc.GetNetworkResponse>} a promise to the + * {@link SorobanRpc.GetNetworkResponse} object containing metadata + * about the current network this soroban-rpc server is connected to. + */ + async getNetwork() { + return await jsonrpc.post(this.serverURL.toString(), "getNetwork"); + } + + /** + * Fetches the latest ledger meta info from network which Soroban-RPC is connected to. + * + * @example + * server.getLatestLedger().then(response => { + * console.log("hash:", response.id); + * console.log("sequence:", response.sequence); + * console.log("protocolVersion:", response.protocolVersion); + * }); + * + * @returns {Promise<SorobanRpc.GetLatestLedgerResponse>} a promise to the + * {@link SorobanRpc.GetLatestLedgerResponse} object containing metadata + * about the latest ledger from network soroban-rpc server is connected to. + */ + async getLatestLedger() { + return await jsonrpc.post(this.serverURL.toString(), "getLatestLedger"); + } + + /** + * Submit a trial contract invocation to get back return values, expected + * ledger footprint, expected authorizations, and expected costs. + * + * @example + * const contractId = '0000000000000000000000000000000000000000000000000000000000000001'; + * const contract = new SorobanClient.Contract(contractId); + * + * // Right now, this is just the default fee for this example. + * const fee = 100; + * + * const transaction = new SorobanClient.TransactionBuilder(account, { + * fee, + * // Uncomment the following line to build transactions for the live network. Be + * // sure to also change the horizon hostname. + * // networkPassphrase: SorobanClient.Networks.PUBLIC, + * networkPassphrase: SorobanClient.Networks.STANDALONE + * }) + * // Add a contract.increment soroban contract invocation operation + * .addOperation(contract.call("increment")) + * // Make this transaction valid for the next 30 seconds only + * .setTimeout(30) + * // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/) + * // .addMemo(SorobanClient.Memo.text('Hello world!')) + * .build(); + * + * // Sign this transaction with the secret key + * // NOTE: signing is transaction is network specific. Test network transactions + * // won't work in the public network. To switch networks, use the Network object + * // as explained above (look for SorobanClient.Network). + * const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey); + * transaction.sign(sourceKeypair); + * + * server.simulateTransaction(transaction).then(sim => { + * console.log("cost:", sim.cost); + * console.log("results:", sim.results); + * console.log("error:", sim.error); + * console.log("latestLedger:", sim.latestLedger); + * }); + * + * @param {Transaction | FeeBumpTransaction} transaction - The transaction to + * simulate. It should include exactly one operation, which must be a + * {@link InvokeHostFunctionOp}. Any provided footprint will be ignored. + * @returns {Promise<SorobanRpc.SimulateTransactionResponse>} Returns a + * promise to the {@link SorobanRpc.SimulateTransactionResponse} object + * with the cost, result, footprint, auth, and error of the transaction. + */ + async simulateTransaction(transaction) { + return await jsonrpc.post(this.serverURL.toString(), "simulateTransaction", transaction.toXDR()); + } + + /** + * Submit a trial contract invocation, first run a simulation of the contract + * invocation as defined on the incoming transaction, and apply the results + * to a new copy of the transaction which is then returned. Setting the ledger + * footprint and authorization, so the resulting transaction is ready for signing & sending. + * + * The returned transaction will also have an updated fee that is the sum of fee set + * on incoming transaction with the contract resource fees estimated from simulation. It is + * adviseable to check the fee on returned transaction and validate or take appropriate + * measures for interaction with user to confirm it is acceptable. + * + * You can call the {simulateTransaction(transaction)} method directly first if you + * want to inspect estimated fees for a given transaction in detail first if that is + * of importance. + * + * @example + * const contractId = '0000000000000000000000000000000000000000000000000000000000000001'; + * const contract = new SorobanClient.Contract(contractId); + * + * // Right now, this is just the default fee for this example. + * const fee = 100; + * + * const transaction = new SorobanClient.TransactionBuilder(account, { + * fee, + * // Uncomment the following line to build transactions for the live network. Be + * // sure to also change the horizon hostname. + * // networkPassphrase: SorobanClient.Networks.PUBLIC, + * networkPassphrase: SorobanClient.Networks.TESTNET + * }) + * // Add a contract.increment soroban contract invocation operation + * .addOperation(contract.call("increment")) + * // Make this transaction valid for the next 30 seconds only + * .setTimeout(30) + * // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/) + * // .addMemo(SorobanClient.Memo.text('Hello world!')) + * .build(); + * + * preparedTransaction = await server.prepareTransaction(transaction); + * + * // Sign this transaction with the secret key + * // NOTE: signing is transaction is network specific. Test network transactions + * // won't work in the public network. To switch networks, use the Network object + * // as explained above (look for SorobanClient.Network). + * const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey); + * preparedTransaction.sign(sourceKeypair); + * + * server.sendTransaction(transaction).then(result => { + * console.log("hash:", result.hash); + * console.log("status:", result.status); + * console.log("errorResultXdr:", result.errorResultXdr); + * }); + * + * @param {Transaction | FeeBumpTransaction} transaction - The transaction to + * prepare. It should include exactly one operation, which must be a + * {@link InvokeHostFunctionOp}. Any provided footprint will be overwritten. + * @param {string} [networkPassphrase] - Explicitly provide a network + * passphrase. If not passed, the current network passphrase will be requested + * from the server via `getNetwork`. + * @returns {Promise<Transaction | FeeBumpTransaction>} Returns a copy of the + * transaction, with the expected ledger footprint and authorizations added + * and the transaction fee will automatically be adjusted to the sum of + * the incoming transaction fee and the contract minimum resource fees + * discovered from the simulation, + * + */ + async prepareTransaction(transaction, networkPassphrase) { + const [{ + passphrase + }, simResponse] = await Promise.all([networkPassphrase ? Promise.resolve({ + passphrase: networkPassphrase + }) : this.getNetwork(), this.simulateTransaction(transaction)]); + if (simResponse.error) { + throw simResponse.error; + } + if (!simResponse.results || simResponse.results.length < 1) { + throw new Error("transaction simulation failed"); + } + return (0, _transaction.assembleTransaction)(transaction, passphrase, simResponse); + } + + /** + * Submit a real transaction to the Stellar network. This is the only way to + * make changes "on-chain". Unlike Horizon, Soroban-RPC does not wait for + * transaction completion. It simply validates the transaction and enqueues + * it. Clients should call {@link Server#getTransactionStatus} to learn about + * transaction success/failure. + * + * @example + * const contractId = '0000000000000000000000000000000000000000000000000000000000000001'; + * const contract = new SorobanClient.Contract(contractId); + * + * // Right now, this is just the default fee for this example. + * const fee = 100; + * + * const transaction = new SorobanClient.TransactionBuilder(account, { + * fee, + * // Uncomment the following line to build transactions for the live network. Be + * // sure to also change the horizon hostname. + * // networkPassphrase: SorobanClient.Networks.PUBLIC, + * networkPassphrase: SorobanClient.Networks.STANDALONE + * }) + * // Add a contract.increment soroban contract invocation operation + * // Note: For real transactions you will need to include the footprint + * // and auth in the operation, as returned from simulateTransaction. + * .addOperation(contract.call("increment")) + * // Make this transaction valid for the next 30 seconds only + * .setTimeout(30) + * // Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/) + * // .addMemo(SorobanClient.Memo.text('Hello world!')) + * .build(); + * + * // Sign this transaction with the secret key + * // NOTE: signing is transaction is network specific. Test network transactions + * // won't work in the public network. To switch networks, use the Network object + * // as explained above (look for SorobanClient.Network). + * const sourceKeypair = SorobanClient.Keypair.fromSecret(sourceSecretKey); + * transaction.sign(sourceKeypair); + * + * server.sendTransaction(transaction).then(result => { + * console.log("hash:", result.hash); + * console.log("status:", result.status); + * console.log("errorResultXdr:", result.errorResultXdr); + * }); + * + * @param {Transaction | FeeBumpTransaction} transaction - The transaction to + * submit. + * @returns {Promise<SorobanRpc.SendTransactionResponse>} Returns a promise to + * the {@link SorobanRpc.SendTransactionResponse} object with the + * transaction id, status, and any error if available. + */ + async sendTransaction(transaction) { + return await jsonrpc.post(this.serverURL.toString(), "sendTransaction", transaction.toXDR()); + } + + /** + * Use the friendbot faucet to create and fund a new account. The method will + * return an Account object for the created account, or if the account already + * existed. If friendbot is not configured on this network, this method will + * throw an error. If the request fails, this method will throw an error. + * + * @example + * server.requestAirdrop("GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4").then(accountCreated => { + * console.log("accountCreated:", accountCreated); + * }).catch(error => { + * console.error("error:", error); + * }); + * + * @param {string | Account} address - The address or account we want to create and fund. + * @param {string} [friendbotUrl] - The optional explicit address for + * friendbot. If not provided, the client will call the Soroban-RPC `getNetwork` + * method to attempt to find this network's friendbot url. + * @returns {Promise<Account>} Returns a promise to the {@link Account} object with populated sequence number. + */ + async requestAirdrop(address, friendbotUrl) { + const account = typeof address === "string" ? address : address.accountId(); + friendbotUrl = friendbotUrl || (await this.getNetwork()).friendbotUrl; + if (!friendbotUrl) { + throw new Error("No friendbot URL configured for current network"); + } + try { + const response = await _axios.default.post(`${friendbotUrl}?addr=${encodeURIComponent(account)}`); + const meta = _stellarBase.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, "base64"); + const sequence = findCreatedAccountSequenceInTransactionMeta(meta); + return new _stellarBase.Account(account, sequence); + } catch (error) { + var _error$response; + if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400) { + var _error$response$detai; + if ((_error$response$detai = error.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes("createAccountAlreadyExist")) { + // Account already exists, load the sequence number + return this.getAccount(account); + } } - return requestAirdrop; - }() - }]); - return Server; -}(); + throw error; + } + } +} exports.Server = Server; function findCreatedAccountSequenceInTransactionMeta(meta) { - var operations = []; + let operations = []; switch (meta.switch()) { case 0: operations = meta.operations(); @@ -812,42 +582,24 @@

lib/server.js

default: throw new Error("Unexpected transaction meta switch value"); } - var _iterator = _createForOfIteratorHelper(operations), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var op = _step.value; - var _iterator2 = _createForOfIteratorHelper(op.changes()), - _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var c = _step2.value; - if (c.switch() !== _stellarBase.xdr.LedgerEntryChangeType.ledgerEntryCreated()) { - continue; - } - var data = c.created().data(); - if (data.switch() !== _stellarBase.xdr.LedgerEntryType.account()) { - continue; - } - var account = data.account(); - var seqNum = account.seqNum(); - return bigIntFromBytes(!seqNum.unsigned, seqNum.high, seqNum.low).toString(); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); + for (const op of operations) { + for (const c of op.changes()) { + if (c.switch() !== _stellarBase.xdr.LedgerEntryChangeType.ledgerEntryCreated()) { + continue; + } + const data = c.created().data(); + if (data.switch() !== _stellarBase.xdr.LedgerEntryType.account()) { + continue; } + const account = data.account(); + const seqNum = account.seqNum(); + return bigIntFromBytes(!seqNum.unsigned, seqNum.high, seqNum.low).toString(); } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); } throw new Error("No account created in transaction"); } function bigIntFromBytes(signed) { - var sign = BigInt(1); + let sign = BigInt(1); for (var _len = arguments.length, bytes = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { bytes[_key - 1] = arguments[_key]; } @@ -857,9 +609,8 @@

lib/server.js

// tslint:disable-next-line:no-bitwise bytes[0] &= 0x7f; } - var b = BigInt(0); - for (var _i2 = 0, _bytes = bytes; _i2 < _bytes.length; _i2++) { - var byte = _bytes[_i2]; + let b = BigInt(0); + for (const byte of bytes) { // tslint:disable-next-line:no-bitwise b <<= BigInt(8); // tslint:disable-next-line:no-bitwise @@ -879,7 +630,7 @@

lib/server.js


- Generated by JSDoc 4.0.2 on Thu May 18 2023 23:10:30 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:13:24 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/liquidity_pool_asset.js.html b/liquidity_pool_asset.js.html index 17893270..b1522c28 100644 --- a/liquidity_pool_asset.js.html +++ b/liquidity_pool_asset.js.html @@ -171,7 +171,7 @@

liquidity_pool_asset.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/liquidity_pool_id.js.html b/liquidity_pool_id.js.html index 798488d2..1d1ac5d7 100644 --- a/liquidity_pool_id.js.html +++ b/liquidity_pool_id.js.html @@ -129,7 +129,7 @@

liquidity_pool_id.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/memo.js.html b/memo.js.html index 446e33df..65c9fc55 100644 --- a/memo.js.html +++ b/memo.js.html @@ -299,7 +299,7 @@

memo.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/muxed_account.js.html b/muxed_account.js.html index a70d5706..7397590f 100644 --- a/muxed_account.js.html +++ b/muxed_account.js.html @@ -190,7 +190,7 @@

muxed_account.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/network.js.html b/network.js.html index a3c8ce4f..c1438a11 100644 --- a/network.js.html +++ b/network.js.html @@ -64,7 +64,7 @@

network.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operation.js.html b/operation.js.html index 1d45a6fd..85c0ccbe 100644 --- a/operation.js.html +++ b/operation.js.html @@ -704,7 +704,7 @@

operation.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_account_merge.js.html b/operations_account_merge.js.html index 5413a055..99692ca7 100644 --- a/operations_account_merge.js.html +++ b/operations_account_merge.js.html @@ -80,7 +80,7 @@

operations/account_merge.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_allow_trust.js.html b/operations_allow_trust.js.html index 2ad4122a..aad250fb 100644 --- a/operations_allow_trust.js.html +++ b/operations_allow_trust.js.html @@ -107,7 +107,7 @@

operations/allow_trust.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_begin_sponsoring_future_reserves.js.html b/operations_begin_sponsoring_future_reserves.js.html index 10699cf2..2e5b9ec3 100644 --- a/operations_begin_sponsoring_future_reserves.js.html +++ b/operations_begin_sponsoring_future_reserves.js.html @@ -84,7 +84,7 @@

operations/begin_sponsoring_future_reserves.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_bump_sequence.js.html b/operations_bump_sequence.js.html index 835b5dc0..eb3f1931 100644 --- a/operations_bump_sequence.js.html +++ b/operations_bump_sequence.js.html @@ -89,7 +89,7 @@

operations/bump_sequence.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_change_trust.js.html b/operations_change_trust.js.html index 2a1e18a5..d4867624 100644 --- a/operations_change_trust.js.html +++ b/operations_change_trust.js.html @@ -104,7 +104,7 @@

operations/change_trust.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_claim_claimable_balance.js.html b/operations_claim_claimable_balance.js.html index 7dfc6b66..3b0035d1 100644 --- a/operations_claim_claimable_balance.js.html +++ b/operations_claim_claimable_balance.js.html @@ -92,7 +92,7 @@

operations/claim_claimable_balance.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_clawback.js.html b/operations_clawback.js.html index 0c947c77..efa9c44f 100644 --- a/operations_clawback.js.html +++ b/operations_clawback.js.html @@ -93,7 +93,7 @@

operations/clawback.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_clawback_claimable_balance.js.html b/operations_clawback_claimable_balance.js.html index fefe13fb..7649df3e 100644 --- a/operations_clawback_claimable_balance.js.html +++ b/operations_clawback_claimable_balance.js.html @@ -88,7 +88,7 @@

operations/clawback_claimable_balance.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_create_account.js.html b/operations_create_account.js.html index 8789198a..7d21abd3 100644 --- a/operations_create_account.js.html +++ b/operations_create_account.js.html @@ -88,7 +88,7 @@

operations/create_account.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_create_claimable_balance.js.html b/operations_create_claimable_balance.js.html index e6e84c9f..908ac946 100644 --- a/operations_create_claimable_balance.js.html +++ b/operations_create_claimable_balance.js.html @@ -118,7 +118,7 @@

operations/create_claimable_balance.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_create_passive_sell_offer.js.html b/operations_create_passive_sell_offer.js.html index 7753e79e..bf5a1416 100644 --- a/operations_create_passive_sell_offer.js.html +++ b/operations_create_passive_sell_offer.js.html @@ -94,7 +94,7 @@

operations/create_passive_sell_offer.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_end_sponsoring_future_reserves.js.html b/operations_end_sponsoring_future_reserves.js.html index 912db9d9..81de24ef 100644 --- a/operations_end_sponsoring_future_reserves.js.html +++ b/operations_end_sponsoring_future_reserves.js.html @@ -72,7 +72,7 @@

operations/end_sponsoring_future_reserves.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_inflation.js.html b/operations_inflation.js.html index 561a934e..dab167c0 100644 --- a/operations_inflation.js.html +++ b/operations_inflation.js.html @@ -67,7 +67,7 @@

operations/inflation.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_invoke_host_function.js.html b/operations_invoke_host_function.js.html index ade4ceee..7d243aa9 100644 --- a/operations_invoke_host_function.js.html +++ b/operations_invoke_host_function.js.html @@ -105,7 +105,7 @@

operations/invoke_host_function.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_liquidity_pool_deposit.js.html b/operations_liquidity_pool_deposit.js.html index a63d00a3..f9eaad8f 100644 --- a/operations_liquidity_pool_deposit.js.html +++ b/operations_liquidity_pool_deposit.js.html @@ -112,7 +112,7 @@

operations/liquidity_pool_deposit.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_liquidity_pool_withdraw.js.html b/operations_liquidity_pool_withdraw.js.html index bc71f0c6..009e8c7d 100644 --- a/operations_liquidity_pool_withdraw.js.html +++ b/operations_liquidity_pool_withdraw.js.html @@ -99,7 +99,7 @@

operations/liquidity_pool_withdraw.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_manage_buy_offer.js.html b/operations_manage_buy_offer.js.html index 42545508..9806ef9a 100644 --- a/operations_manage_buy_offer.js.html +++ b/operations_manage_buy_offer.js.html @@ -99,7 +99,7 @@

operations/manage_buy_offer.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_manage_data.js.html b/operations_manage_data.js.html index edde2662..91ba8dea 100644 --- a/operations_manage_data.js.html +++ b/operations_manage_data.js.html @@ -98,7 +98,7 @@

operations/manage_data.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_manage_sell_offer.js.html b/operations_manage_sell_offer.js.html index 1554dcbb..a821849f 100644 --- a/operations_manage_sell_offer.js.html +++ b/operations_manage_sell_offer.js.html @@ -99,7 +99,7 @@

operations/manage_sell_offer.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_path_payment_strict_receive.js.html b/operations_path_payment_strict_receive.js.html index 669dbff2..d46837a7 100644 --- a/operations_path_payment_strict_receive.js.html +++ b/operations_path_payment_strict_receive.js.html @@ -117,7 +117,7 @@

operations/path_payment_strict_receive.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_path_payment_strict_send.js.html b/operations_path_payment_strict_send.js.html index 784df68d..f1d58796 100644 --- a/operations_path_payment_strict_send.js.html +++ b/operations_path_payment_strict_send.js.html @@ -116,7 +116,7 @@

operations/path_payment_strict_send.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_payment.js.html b/operations_payment.js.html index b58b1a47..808ea194 100644 --- a/operations_payment.js.html +++ b/operations_payment.js.html @@ -96,7 +96,7 @@

operations/payment.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_revoke_sponsorship.js.html b/operations_revoke_sponsorship.js.html index 7bef2b0c..5d942b30 100644 --- a/operations_revoke_sponsorship.js.html +++ b/operations_revoke_sponsorship.js.html @@ -368,7 +368,7 @@

operations/revoke_sponsorship.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_set_options.js.html b/operations_set_options.js.html index 23ab6d7e..9ce4b40b 100644 --- a/operations_set_options.js.html +++ b/operations_set_options.js.html @@ -238,7 +238,7 @@

operations/set_options.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/operations_set_trustline_flags.js.html b/operations_set_trustline_flags.js.html index 70c303a3..8f14a21d 100644 --- a/operations_set_trustline_flags.js.html +++ b/operations_set_trustline_flags.js.html @@ -137,7 +137,7 @@

operations/set_trustline_flags.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/signerkey.js.html b/signerkey.js.html index 10aa2d95..a7d6a282 100644 --- a/signerkey.js.html +++ b/signerkey.js.html @@ -143,7 +143,7 @@

signerkey.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/signing.js.html b/signing.js.html index 403b589b..df42c26f 100644 --- a/signing.js.html +++ b/signing.js.html @@ -158,7 +158,7 @@

signing.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/strkey.js.html b/strkey.js.html index 3e91fee4..4b0e9d26 100644 --- a/strkey.js.html +++ b/strkey.js.html @@ -412,7 +412,7 @@

strkey.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/transaction.js.html b/transaction.js.html index 6c3b1cac..660079fc 100644 --- a/transaction.js.html +++ b/transaction.js.html @@ -421,7 +421,7 @@

transaction.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/transaction_base.js.html b/transaction_base.js.html index 7f2832b9..75a1b727 100644 --- a/transaction_base.js.html +++ b/transaction_base.js.html @@ -279,7 +279,7 @@

transaction_base.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/transaction_builder.js.html b/transaction_builder.js.html index 4dd7e060..d2443722 100644 --- a/transaction_builder.js.html +++ b/transaction_builder.js.html @@ -778,7 +778,7 @@

transaction_builder.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.
diff --git a/util_decode_encode_muxed_account.js.html b/util_decode_encode_muxed_account.js.html index 981ddfb4..afccda50 100644 --- a/util_decode_encode_muxed_account.js.html +++ b/util_decode_encode_muxed_account.js.html @@ -177,7 +177,7 @@

util/decode_encode_muxed_account.js


- Generated by JSDoc 4.0.2 on Tue May 23 2023 21:08:44 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Tue May 23 2023 14:15:17 GMT-0700 (Pacific Daylight Time) using the Minami theme.