diff --git a/Account.html b/Account.html index 3aa137489..7daf931ec 100644 --- a/Account.html +++ b/Account.html @@ -24,7 +24,7 @@
@@ -573,7 +573,7 @@
Returns:

diff --git a/AccountCallBuilder.html b/AccountCallBuilder.html index df9a7db52..c9dda8727 100644 --- a/AccountCallBuilder.html +++ b/AccountCallBuilder.html @@ -24,7 +24,7 @@
@@ -2383,7 +2383,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/AccountRequiresMemoError.html b/AccountRequiresMemoError.html index 1fd971c97..18d2b2017 100644 --- a/AccountRequiresMemoError.html +++ b/AccountRequiresMemoError.html @@ -24,7 +24,7 @@
@@ -269,7 +269,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/AccountResponse.html b/AccountResponse.html index f75101f56..f6dc7ad1d 100644 --- a/AccountResponse.html +++ b/AccountResponse.html @@ -24,7 +24,7 @@
@@ -576,7 +576,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Address.html b/Address.html index e7041a67a..c5f7808db 100644 --- a/Address.html +++ b/Address.html @@ -24,7 +24,7 @@
@@ -1428,7 +1428,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Api.html b/Api.html index 249e3b8f5..9b4a127f0 100644 --- a/Api.html +++ b/Api.html @@ -24,7 +24,7 @@
@@ -130,7 +130,7 @@


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/AssembledTransaction.html b/AssembledTransaction.html new file mode 100644 index 000000000..d2fa7aa5b --- /dev/null +++ b/AssembledTransaction.html @@ -0,0 +1,847 @@ + + + + + + AssembledTransaction - Documentation + + + + + + + + + + + + + + + + + +
+ +

AssembledTransaction

+ + + + + + + +
+ +
+ +

+ AssembledTransaction +

+ +

The main workhorse of ContractClient. This class is used to wrap a +transaction-under-construction and provide high-level interfaces to the most +common workflows, while still providing access to low-level stellar-sdk +transaction manipulation.

+

Most of the time, you will not construct an AssembledTransaction directly, +but instead receive one as the return value of a ContractClient method. If +you're familiar with the libraries generated by soroban-cli's contract bindings typescript command, these also wraps ContractClient and return +AssembledTransaction instances.

+

Let's look at examples of how to use AssembledTransaction for a variety of +use-cases:

+

1. Simple read call

+

Since these only require simulation, you can get the result of the call +right after constructing your AssembledTransaction:

+
const { result } = await AssembledTransaction.build({
+  method: 'myReadMethod',
+  args: spec.funcArgsToScVals('myReadMethod', { args: 'for', my: 'method', ... }),
+  contractId: 'C123…',
+  networkPassphrase: '…',
+  rpcUrl: 'https://…',
+  publicKey: Keypair.random().publicKey(), // keypairs are irrelevant, for simulation-only read calls
+  parseResultXdr: (result: xdr.ScVal) => spec.funcResToNative('myReadMethod', result),
+})
+
+

While that looks pretty complicated, most of the time you will use this in +conjunction with ContractClient, which simplifies it to:

+
const { result }  = await client.myReadMethod({ args: 'for', my: 'method', ... })
+
+

2. Simple write call

+

For write calls that will be simulated and then sent to the network without +further manipulation, only one more step is needed:

+
const assembledTx = await client.myWriteMethod({ args: 'for', my: 'method', ... })
+const sentTx = await assembledTx.signAndSend()
+
+

Here we're assuming that you're using a ContractClient, rather than +constructing AssembledTransaction's directly.

+

Note that sentTx, the return value of signAndSend, is a +SentTransaction. SentTransaction is similar to +AssembledTransaction, but is missing many of the methods and fields that +are only relevant while assembling a transaction. It also has a few extra +methods and fields that are only relevant after the transaction has been +sent to the network.

+

Like AssembledTransaction, SentTransaction also has a result getter, +which contains the parsed final return value of the contract call. Most of +the time, you may only be interested in this, so rather than getting the +whole sentTx you may just want to:

+
const tx = await client.myWriteMethod({ args: 'for', my: 'method', ... })
+const { result } = await tx.signAndSend()
+
+

3. More fine-grained control over transaction construction

+

If you need more control over the transaction before simulating it, you can +set various MethodOptions when constructing your +AssembledTransaction. With a ContractClient, this is passed as a +second object after the arguments (or the only object, if the method takes +no arguments):

+
const tx = await client.myWriteMethod(
+  {
+    args: 'for',
+    my: 'method',
+    ...
+  }, {
+    fee: '10000', // default: BASE_FEE
+    simulate: false,
+    timeoutInSeconds: 20, // default: DEFAULT_TIMEOUT
+  }
+)
+
+

Since we've skipped simulation, we can now edit the raw transaction and +then manually call simulate:

+
tx.raw.addMemo(Memo.text('Nice memo, friend!'))
+await tx.simulate()
+
+

If you need to inspect the simulation later, you can access it with tx.simulation.

+

4. Multi-auth workflows

+

Soroban, and Stellar in general, allows multiple parties to sign a +transaction.

+

Let's consider an Atomic Swap contract. Alice wants to give 10 of her Token +A tokens to Bob for 5 of his Token B tokens.

+
const ALICE = 'G123...'
+const BOB = 'G456...'
+const TOKEN_A = 'C123…'
+const TOKEN_B = 'C456…'
+const AMOUNT_A = 10n
+const AMOUNT_B = 5n
+
+

Let's say Alice is also going to be the one signing the final transaction +envelope, meaning she is the invoker. So your app, from Alice's browser, +simulates the swap call:

+
const tx = await swapClient.swap({
+  a: ALICE,
+  b: BOB,
+  token_a: TOKEN_A,
+  token_b: TOKEN_B,
+  amount_a: AMOUNT_A,
+  amount_b: AMOUNT_B,
+})
+
+

But your app can't signAndSend this right away, because Bob needs to sign +it first. You can check this:

+
const whoElseNeedsToSign = tx.needsNonInvokerSigningBy()
+
+

You can verify that whoElseNeedsToSign is an array of length 1, +containing only Bob's public key.

+

Then, still on Alice's machine, you can serialize the +transaction-under-assembly:

+
const json = tx.toJSON()
+
+

And now you need to send it to Bob's browser. How you do this depends on +your app. Maybe you send it to a server first, maybe you use WebSockets, or +maybe you have Alice text the JSON blob to Bob and have him paste it into +your app in his browser (note: this option might be error-prone 😄).

+

Once you get the JSON blob into your app on Bob's machine, you can +deserialize it:

+
const tx = swapClient.txFromJSON(json)
+
+

Or, if you're using a client generated with soroban contract bindings typescript, this deserialization will look like:

+
const tx = swapClient.fromJSON.swap(json)
+
+

Then you can have Bob sign it. What Bob will actually need to sign is some +auth entries within the transaction, not the transaction itself or the +transaction envelope. Your app can verify that Bob has the correct wallet +selected, then:

+
await tx.signAuthEntries()
+
+

Under the hood, this uses signAuthEntry, which you either need to inject +during initial construction of the ContractClient/AssembledTransaction, +or which you can pass directly to signAuthEntries.

+

Now Bob can again serialize the transaction and send back to Alice, where +she can finally call signAndSend().

+

To see an even more complicated example, where Alice swaps with Bob but the +transaction is invoked by yet another party, check out +test-swap.js.

+ + +
+ +
+
+ + +
+ + +

Constructor

+ + +

new AssembledTransaction()

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + +

Members

+ + + +
+

Errors

+ + + + +
+

A list of the most important errors that various AssembledTransaction +methods can throw. Feel free to catch specific errors in your application +logic.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + +
+

isReadCall

+ + + + +
+

Whether this transaction is a read call. This is determined by the +simulation result and the transaction data. If the transaction is a read +call, it will not need to be signed and sent to the network. If this +returns false, then you need to call signAndSend on this transaction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + +
+

needsNonInvokerSigningBy

+ + + + +
+

Get a list of accounts, other than the invoker of the simulation, that +need to sign auth entries in this transaction.

+

Soroban allows multiple people to sign a transaction. Someone needs to +sign the final transaction envelope; this person/account is called the +invoker, or source. Other accounts might need to sign individual auth +entries in the transaction, if they're not also the invoker.

+

This function returns a list of accounts that need to sign auth entries, +assuming that the same invoker/source account will sign the final +transaction envelope as signed the initial simulation.

+

One at a time, for each public key in this array, you will need to +serialize this transaction with toJSON, send to the owner of that key, +deserialize the transaction with txFromJson, and call +signAuthEntries. Then re-serialize and send to the next account +in this list.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + +
+

signAndSend

+ + + + +
+

Sign the transaction with the wallet, included previously. If you did +not previously include one, you need to include one now that at least +includes the signTransaction method. After signing, this method will +send the transaction to the network and return a SentTransaction that +keeps track of all the attempts to fetch the transaction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + +
+

signAuthEntries

+ + + + +
+

If needsNonInvokerSigningBy returns a non-empty list, you can serialize +the transaction with toJSON, send it to the owner of one of the public keys +in the map, deserialize with txFromJSON, and call this method on their +machine. Internally, this will use signAuthEntry function from connected +wallet for each.

+

Then, re-serialize the transaction and either send to the next +needsNonInvokerSigningBy owner, or send it back to the original account +who simulated the transaction so they can sign the transaction +envelope and send it to the network.

+

Sending to all needsNonInvokerSigningBy owners in parallel is not currently +supported!

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + + + +

Methods

+ + + +
+ + + +

toJSON()

+ + + + + +
+

Serialize the AssembledTransaction to a JSON string. This is useful for +saving the transaction to a database or sending it over the wire for +multi-auth workflows. fromJSON can be used to deserialize the +transaction. This only works with transactions that have been simulated.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

(async, static) build()

+ + + + + +
+

Construct a new AssembledTransaction. This is the only way to create a new +AssembledTransaction; the main constructor is private.

+

This is an asynchronous constructor for two reasons:

+
    +
  1. It needs to fetch the account from the network to get the current +sequence number.
  2. +
  3. It needs to simulate the transaction to get the expected fee.
  4. +
+

If you don't want to simulate the transaction, you can set simulate to +false in the options.

+
const tx = await AssembledTransaction.build({
+  ...,
+  simulate: false,
+})
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ +
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + \ No newline at end of file diff --git a/Asset.html b/Asset.html index e97a4ac5b..063bb9dd4 100644 --- a/Asset.html +++ b/Asset.html @@ -24,7 +24,7 @@
@@ -2053,7 +2053,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/AssetsCallBuilder.html b/AssetsCallBuilder.html index e6a070d6f..b659ba24a 100644 --- a/AssetsCallBuilder.html +++ b/AssetsCallBuilder.html @@ -24,7 +24,7 @@
@@ -1865,7 +1865,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/CallBuilder.html b/CallBuilder.html index 09b771098..c13221bc9 100644 --- a/CallBuilder.html +++ b/CallBuilder.html @@ -24,7 +24,7 @@
@@ -1500,7 +1500,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/ClaimableBalanceCallBuilder.html b/ClaimableBalanceCallBuilder.html index 4d17607e4..281e9bbf4 100644 --- a/ClaimableBalanceCallBuilder.html +++ b/ClaimableBalanceCallBuilder.html @@ -24,7 +24,7 @@
@@ -2220,7 +2220,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Claimant.html b/Claimant.html index b15eafe21..e329eea45 100644 --- a/Claimant.html +++ b/Claimant.html @@ -24,7 +24,7 @@
@@ -1625,7 +1625,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Config.html b/Config.html index 7904ac32d..1087fe527 100644 --- a/Config.html +++ b/Config.html @@ -24,7 +24,7 @@
@@ -804,7 +804,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Contract.html b/Contract.html index 08ac0fa20..948cb0725 100644 --- a/Contract.html +++ b/Contract.html @@ -24,7 +24,7 @@
@@ -878,7 +878,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/ContractClient.html b/ContractClient.html new file mode 100644 index 000000000..e0b12eebf --- /dev/null +++ b/ContractClient.html @@ -0,0 +1,178 @@ + + + + + + ContractClient - Documentation + + + + + + + + + + + + + + + + + +
+ +

ContractClient

+ + + + + + + +
+ +
+ +

+ ContractClient +

+ + +
+ +
+
+ + +
+ + + +

new ContractClient()

+ + + + + +
+

Generate a class from the contract spec that where each contract method +gets included with an identical name.

+

Each method returns an AssembledTransaction that can be used to +modify, simulate, decode results, and possibly sign, & submit the +transaction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + \ No newline at end of file diff --git a/ContractSpec.html b/ContractSpec.html index 8945060e2..2f99626df 100644 --- a/ContractSpec.html +++ b/ContractSpec.html @@ -24,7 +24,7 @@
@@ -104,7 +104,7 @@

new Contr
Source:
@@ -270,6 +270,114 @@

Methods

+
+ + + +

errorCases() → {Array.<xdr.ScSpecFunctionV0>}

+ + + + + +
+

Gets the XDR error cases from the spec.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Array.<xdr.ScSpecFunctionV0> + + +
+
+ + +
+

all contract functions

+
+ + +
+ + + +
+ +
@@ -317,7 +425,7 @@

findEntrySource:
@@ -509,7 +617,7 @@

funcA
Source:
@@ -740,7 +848,7 @@

funcRe
Source:
@@ -971,7 +1079,7 @@

funcsSource:
@@ -1079,7 +1187,7 @@

getFuncSource:
@@ -1272,7 +1380,7 @@

jsonSchema<
Source:
@@ -1476,7 +1584,7 @@

nativeTo
Source:
@@ -1714,7 +1822,7 @@

scVal
Source:
@@ -1932,7 +2040,7 @@

scValToN
Source:
@@ -2119,7 +2227,7 @@

Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/EffectCallBuilder.html b/EffectCallBuilder.html index 8a93bcb99..74c28afcf 100644 --- a/EffectCallBuilder.html +++ b/EffectCallBuilder.html @@ -24,7 +24,7 @@
@@ -2384,7 +2384,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/FederationServer.html b/FederationServer.html index c1c7883aa..8fb1abf79 100644 --- a/FederationServer.html +++ b/FederationServer.html @@ -24,7 +24,7 @@
@@ -1586,7 +1586,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/FeeBumpTransaction.html b/FeeBumpTransaction.html index 1ec9635d9..a989e8ca1 100644 --- a/FeeBumpTransaction.html +++ b/FeeBumpTransaction.html @@ -24,7 +24,7 @@
@@ -2040,7 +2040,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Int128_Int128.html b/Int128_Int128.html index 8881a238b..f55ca994c 100644 --- a/Int128_Int128.html +++ b/Int128_Int128.html @@ -24,7 +24,7 @@
@@ -230,7 +230,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Int256_Int256.html b/Int256_Int256.html index 5557e54dd..27427a7c2 100644 --- a/Int256_Int256.html +++ b/Int256_Int256.html @@ -24,7 +24,7 @@
@@ -230,7 +230,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Keypair.html b/Keypair.html index 3fc9b25d2..164577904 100644 --- a/Keypair.html +++ b/Keypair.html @@ -24,7 +24,7 @@
@@ -2462,7 +2462,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/LedgerCallBuilder.html b/LedgerCallBuilder.html index 1529b731c..7425194f8 100644 --- a/LedgerCallBuilder.html +++ b/LedgerCallBuilder.html @@ -24,7 +24,7 @@
@@ -1715,7 +1715,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/LiquidityPoolAsset.html b/LiquidityPoolAsset.html index 97be04720..a24e7a957 100644 --- a/LiquidityPoolAsset.html +++ b/LiquidityPoolAsset.html @@ -24,7 +24,7 @@
@@ -919,7 +919,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/LiquidityPoolCallBuilder.html b/LiquidityPoolCallBuilder.html index 84481d764..c3277cb8b 100644 --- a/LiquidityPoolCallBuilder.html +++ b/LiquidityPoolCallBuilder.html @@ -24,7 +24,7 @@
@@ -2044,7 +2044,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/LiquidityPoolId.html b/LiquidityPoolId.html index cdcc31b7a..65b5c5aa6 100644 --- a/LiquidityPoolId.html +++ b/LiquidityPoolId.html @@ -24,7 +24,7 @@
@@ -867,7 +867,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Memo.html b/Memo.html index 8a28b15cf..0c15d05fa 100644 --- a/Memo.html +++ b/Memo.html @@ -24,7 +24,7 @@
@@ -1386,7 +1386,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/MuxedAccount.html b/MuxedAccount.html index 7b9421852..a8ead40c0 100644 --- a/MuxedAccount.html +++ b/MuxedAccount.html @@ -24,7 +24,7 @@
@@ -985,7 +985,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/OfferCallBuilder.html b/OfferCallBuilder.html index bf4be9e8d..6bf96b14a 100644 --- a/OfferCallBuilder.html +++ b/OfferCallBuilder.html @@ -24,7 +24,7 @@
@@ -2559,7 +2559,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Operation.html b/Operation.html index ea986dc27..f80dda4ee 100644 --- a/Operation.html +++ b/Operation.html @@ -24,7 +24,7 @@
@@ -13515,7 +13515,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/OperationCallBuilder.html b/OperationCallBuilder.html index b78353344..cbf15f85e 100644 --- a/OperationCallBuilder.html +++ b/OperationCallBuilder.html @@ -24,7 +24,7 @@
@@ -2712,7 +2712,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/OrderbookCallBuilder.html b/OrderbookCallBuilder.html index 65e51b13a..e756a7664 100644 --- a/OrderbookCallBuilder.html +++ b/OrderbookCallBuilder.html @@ -24,7 +24,7 @@
@@ -277,7 +277,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/PathCallBuilder.html b/PathCallBuilder.html index a323d9612..8bd71de00 100644 --- a/PathCallBuilder.html +++ b/PathCallBuilder.html @@ -24,7 +24,7 @@
@@ -1668,7 +1668,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/PaymentCallBuilder.html b/PaymentCallBuilder.html index dffe7daa1..5b35c1219 100644 --- a/PaymentCallBuilder.html +++ b/PaymentCallBuilder.html @@ -24,7 +24,7 @@
@@ -2057,7 +2057,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Resolver.html b/Resolver.html index 60012afe2..ee18a1cdb 100644 --- a/Resolver.html +++ b/Resolver.html @@ -24,7 +24,7 @@
@@ -489,7 +489,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/ScInt.html b/ScInt.html index 7d4a10a38..075ed7b85 100644 --- a/ScInt.html +++ b/ScInt.html @@ -24,7 +24,7 @@
@@ -486,7 +486,7 @@

Classes


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/SentTransaction.html b/SentTransaction.html new file mode 100644 index 000000000..3986e3edc --- /dev/null +++ b/SentTransaction.html @@ -0,0 +1,321 @@ + + + + + + SentTransaction - Documentation + + + + + + + + + + + + + + + + + +
+ +

SentTransaction

+ + + + + + + +
+ +
+ +

+ SentTransaction +

+ +

A transaction that has been sent to the Soroban network. This happens in two steps:

+
    +
  1. sendTransaction: initial submission of the transaction to the network. +If this step runs into problems, the attempt to sign and send will be +aborted. You can see the result of this call in the +sendTransactionResponse getter.
  2. +
  3. getTransaction: once the transaction has been submitted to the network +successfully, you need to wait for it to finalize to get the result of the +transaction. This will be retried with exponential backoff for +MethodOptions.timeoutInSeconds seconds. See all attempts in +getTransactionResponseAll and the most recent attempt in +getTransactionResponse.
  4. +
+ + +
+ +
+
+ + +
+ + +

Constructor

+ + +

new SentTransaction()

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + +

Members

+ + + +
+

Errors

+ + + + +
+

The most recent result of calling getTransaction, from the +getTransactionResponseAll array.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + +
+

init

+ + + + +
+

Initialize a SentTransaction from an existing AssembledTransaction and +a signTransaction function. This will also send the transaction to the +network.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + \ No newline at end of file diff --git a/Server.html b/Server.html index d5f79d4f7..8c113be14 100644 --- a/Server.html +++ b/Server.html @@ -24,7 +24,7 @@
@@ -2028,7 +2028,7 @@

(async) getE
Source:
@@ -2350,7 +2350,7 @@

(async) Source:
@@ -2684,7 +2684,7 @@

(async) get
Source:
@@ -2813,7 +2813,7 @@

(async) Source:
@@ -3883,7 +3883,7 @@

(async) Source:
@@ -4140,7 +4140,7 @@

(async) Source:
@@ -4397,7 +4397,7 @@

(async) Source:
@@ -4604,7 +4604,7 @@

(async) <
Source:
@@ -8029,7 +8029,7 @@

(async) getE
Source:
@@ -8351,7 +8351,7 @@

(async) Source:
@@ -8685,7 +8685,7 @@

(async) get
Source:
@@ -8814,7 +8814,7 @@

(async) Source:
@@ -9884,7 +9884,7 @@

(async) Source:
@@ -10141,7 +10141,7 @@

(async) Source:
@@ -10398,7 +10398,7 @@

(async) Source:
@@ -10605,7 +10605,7 @@

(async) <
Source:
@@ -12104,7 +12104,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/SignerKey.html b/SignerKey.html index 0b8c88494..90607eb6a 100644 --- a/SignerKey.html +++ b/SignerKey.html @@ -24,7 +24,7 @@
@@ -497,7 +497,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/SorobanDataBuilder.html b/SorobanDataBuilder.html index 965e32fb3..83e31caac 100644 --- a/SorobanDataBuilder.html +++ b/SorobanDataBuilder.html @@ -24,7 +24,7 @@
@@ -1931,7 +1931,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/StrKey.html b/StrKey.html index 18f8873f3..7eefdfab9 100644 --- a/StrKey.html +++ b/StrKey.html @@ -24,7 +24,7 @@
@@ -3145,7 +3145,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/StrictReceivePathCallBuilder.html b/StrictReceivePathCallBuilder.html index 971cab3f7..76477ae40 100644 --- a/StrictReceivePathCallBuilder.html +++ b/StrictReceivePathCallBuilder.html @@ -24,7 +24,7 @@
@@ -1648,7 +1648,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/StrictSendPathCallBuilder.html b/StrictSendPathCallBuilder.html index 1facd2ece..b61a8cda4 100644 --- a/StrictSendPathCallBuilder.html +++ b/StrictSendPathCallBuilder.html @@ -24,7 +24,7 @@
@@ -1646,7 +1646,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/TradeAggregationCallBuilder.html b/TradeAggregationCallBuilder.html index 8a5a103e0..6181d149c 100644 --- a/TradeAggregationCallBuilder.html +++ b/TradeAggregationCallBuilder.html @@ -24,7 +24,7 @@
@@ -1701,7 +1701,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/TradesCallBuilder.html b/TradesCallBuilder.html index 993ca1a37..fcd60c769 100644 --- a/TradesCallBuilder.html +++ b/TradesCallBuilder.html @@ -24,7 +24,7 @@
@@ -2392,7 +2392,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Transaction.html b/Transaction.html index a8431c6e6..5669238cd 100644 --- a/Transaction.html +++ b/Transaction.html @@ -24,7 +24,7 @@
@@ -2960,7 +2960,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/TransactionBuilder.html b/TransactionBuilder.html index 4396e8a93..ae627b3bb 100644 --- a/TransactionBuilder.html +++ b/TransactionBuilder.html @@ -24,7 +24,7 @@
@@ -3658,7 +3658,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/TransactionCallBuilder.html b/TransactionCallBuilder.html index fac216129..3f1494b03 100644 --- a/TransactionCallBuilder.html +++ b/TransactionCallBuilder.html @@ -24,7 +24,7 @@
@@ -2544,7 +2544,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Uint128_Uint128.html b/Uint128_Uint128.html index de699f9dc..e369c4b61 100644 --- a/Uint128_Uint128.html +++ b/Uint128_Uint128.html @@ -24,7 +24,7 @@
@@ -230,7 +230,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/Uint256_Uint256.html b/Uint256_Uint256.html index beec3ae84..015385e36 100644 --- a/Uint256_Uint256.html +++ b/Uint256_Uint256.html @@ -24,7 +24,7 @@
@@ -230,7 +230,7 @@
Parameters:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/XdrLargeInt.html b/XdrLargeInt.html index 34f50f5d1..6dde28411 100644 --- a/XdrLargeInt.html +++ b/XdrLargeInt.html @@ -24,7 +24,7 @@
@@ -1598,7 +1598,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/global.html b/global.html index 1be790298..679518cf9 100644 --- a/global.html +++ b/global.html @@ -24,7 +24,7 @@
@@ -543,6 +543,70 @@

BadRe +

+ + + +
+

(constant) DEFAULT_TIMEOUT

+ + + + +
+

The default timeout for waiting for a transaction to be included in a block.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + +
@@ -1073,6 +1137,72 @@
Type:
+
+ + + +
+

Ok

+ + + + +
+

Part of implementing Result, a minimal implementation of Rust's +Result type. Used for contract methods that return Results, to maintain +their distinction from methods that simply either return a value or throw.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + +
@@ -1278,6 +1408,73 @@

(constant) + + + +
+

(constant) contractErrorPattern

+ + + + +
+

If contracts are implemented using the #[contracterror] macro, then the +errors get included in the on-chain XDR that also describes your contract's +methods. Each error will have a specific number. This Regular Expression +matches these "expected error types" that a contract may throw, and helps

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + +
@@ -2340,6 +2537,93 @@
Returns:

+ + + +
+ + +
+ + + +

basicNodeSigner()

+ + + + + +
+

For use with ContractClient and AssembledTransaction. +Implements signTransaction and signAuthEntry with signatures expected by +those classes. This is useful for testing and maybe some simple Node +applications. Feel free to use this as a starting point for your own +Wallet/TransactionSigner implementation.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -3955,6 +4239,89 @@
Returns:
+ + + +
+ + +
+ + + +

implementsToString()

+ + + + + +
+

A TypeScript type guard that checks if an object has a toString method.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -4887,89 +5254,6 @@
Returns:
- - - -
- - -
- - - -

(async) post()

- - - - - -
-

Sends the jsonrpc 'params' as an array.

-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -4987,7 +5271,7 @@

(async) pos
-

Sends the jsonrpc 'params' as the single 'param' obj, no array wrapper is applied.

+

Sends the jsonrpc 'params' as a single 'param' object (no array support).

@@ -5023,7 +5307,7 @@

(async) pos
Source:
@@ -5485,7 +5769,7 @@

typeRefSource:
@@ -5772,6 +6056,90 @@
Returns:

+ + + +
+ + +
+ + + +

(async) withExponentialBackoff()

+ + + + + +
+

Keep calling a fn for timeoutInSeconds seconds, if keepWaitingIf is true. +Returns an array of all attempts to call the function.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -6833,7 +7201,7 @@
Returns:

- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/global.html#Ok b/global.html#Ok new file mode 100644 index 000000000..df8436d79 --- /dev/null +++ b/global.html#Ok @@ -0,0 +1,176 @@ + + + + + + Ok - Documentation + + + + + + + + + + + + + + + + + +
+ +

Ok

+ + + + + + + +
+ +
+ +

+ Ok +

+ +

Part of implementing Result, a minimal implementation of Rust's +Result type. Used for contract methods that return Results, to maintain +their distinction from methods that simply either return a value or throw.

+ + +
+ +
+
+ + +
+ + +

Constructor

+ + +

new Ok()

+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + \ No newline at end of file diff --git a/index.html b/index.html index 24de9eb15..20b414b90 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@
@@ -297,7 +297,7 @@

License


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:40 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_account.js.html b/js-stellar-base_src_account.js.html index a8c597dc4..fd4cac846 100644 --- a/js-stellar-base_src_account.js.html +++ b/js-stellar-base_src_account.js.html @@ -24,7 +24,7 @@
@@ -113,7 +113,7 @@

js-stellar-base/src/account.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_address.js.html b/js-stellar-base_src_address.js.html index 80759ef9b..b3ed35d7a 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_asset.js.html b/js-stellar-base_src_asset.js.html index 4d27cbd89..341272bad 100644 --- a/js-stellar-base_src_asset.js.html +++ b/js-stellar-base_src_asset.js.html @@ -24,7 +24,7 @@
@@ -345,7 +345,7 @@

js-stellar-base/src/asset.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_auth.js.html b/js-stellar-base_src_auth.js.html index f34b1db18..67aad0f76 100644 --- a/js-stellar-base_src_auth.js.html +++ b/js-stellar-base_src_auth.js.html @@ -24,7 +24,7 @@
@@ -290,7 +290,7 @@

js-stellar-base/src/auth.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_claimant.js.html b/js-stellar-base_src_claimant.js.html index 1411c5e2c..36f2b529d 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_contract.js.html b/js-stellar-base_src_contract.js.html index 2c39d5b94..28bff5326 100644 --- a/js-stellar-base_src_contract.js.html +++ b/js-stellar-base_src_contract.js.html @@ -24,7 +24,7 @@
@@ -138,7 +138,7 @@

js-stellar-base/src/contract.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_events.js.html b/js-stellar-base_src_events.js.html index 0e8747b37..649e9acf9 100644 --- a/js-stellar-base_src_events.js.html +++ b/js-stellar-base_src_events.js.html @@ -24,7 +24,7 @@
@@ -94,7 +94,7 @@

js-stellar-base/src/events.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 ddd0075f0..3c014cab6 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 f4286c16f..7746b4ebe 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_invocation.js.html b/js-stellar-base_src_invocation.js.html index bf47856fa..6c76a7b5c 100644 --- a/js-stellar-base_src_invocation.js.html +++ b/js-stellar-base_src_invocation.js.html @@ -24,7 +24,7 @@
@@ -249,7 +249,7 @@

js-stellar-base/src/invocation.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_keypair.js.html b/js-stellar-base_src_keypair.js.html index eb29e677c..e6ef1657f 100644 --- a/js-stellar-base_src_keypair.js.html +++ b/js-stellar-base_src_keypair.js.html @@ -24,7 +24,7 @@
@@ -327,7 +327,7 @@

js-stellar-base/src/keypair.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 0c250de9e..d01198234 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 e95096b76..36e1f5569 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 @@
@@ -128,7 +128,7 @@

js-stellar-base/src/liquidity_pool_id.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_memo.js.html b/js-stellar-base_src_memo.js.html index c31a3269a..91fd587c0 100644 --- a/js-stellar-base_src_memo.js.html +++ b/js-stellar-base_src_memo.js.html @@ -24,7 +24,7 @@
@@ -296,7 +296,7 @@

js-stellar-base/src/memo.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 fc79885ff..f5e8f5497 100644 --- a/js-stellar-base_src_muxed_account.js.html +++ b/js-stellar-base_src_muxed_account.js.html @@ -24,7 +24,7 @@
@@ -188,7 +188,7 @@

js-stellar-base/src/muxed_account.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_network.js.html b/js-stellar-base_src_network.js.html index 8f862da91..aff65136a 100644 --- a/js-stellar-base_src_network.js.html +++ b/js-stellar-base_src_network.js.html @@ -24,7 +24,7 @@
@@ -67,7 +67,7 @@

js-stellar-base/src/network.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_index.js.html b/js-stellar-base_src_numbers_index.js.html index 2c89b035f..b661e93a4 100644 --- a/js-stellar-base_src_numbers_index.js.html +++ b/js-stellar-base_src_numbers_index.js.html @@ -24,7 +24,7 @@
@@ -110,7 +110,7 @@

js-stellar-base/src/numbers/index.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_int128.js.html b/js-stellar-base_src_numbers_int128.js.html index 4c583eb53..46876047c 100644 --- a/js-stellar-base_src_numbers_int128.js.html +++ b/js-stellar-base_src_numbers_int128.js.html @@ -24,7 +24,7 @@
@@ -74,7 +74,7 @@

js-stellar-base/src/numbers/int128.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_int256.js.html b/js-stellar-base_src_numbers_int256.js.html index 2fbf52e4e..407dde1df 100644 --- a/js-stellar-base_src_numbers_int256.js.html +++ b/js-stellar-base_src_numbers_int256.js.html @@ -24,7 +24,7 @@
@@ -74,7 +74,7 @@

js-stellar-base/src/numbers/int256.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_sc_int.js.html b/js-stellar-base_src_numbers_sc_int.js.html index 81d5b9955..153154eb9 100644 --- a/js-stellar-base_src_numbers_sc_int.js.html +++ b/js-stellar-base_src_numbers_sc_int.js.html @@ -24,7 +24,7 @@
@@ -163,7 +163,7 @@

js-stellar-base/src/numbers/sc_int.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_uint128.js.html b/js-stellar-base_src_numbers_uint128.js.html index f83e08c40..6aae29c0e 100644 --- a/js-stellar-base_src_numbers_uint128.js.html +++ b/js-stellar-base_src_numbers_uint128.js.html @@ -24,7 +24,7 @@
@@ -74,7 +74,7 @@

js-stellar-base/src/numbers/uint128.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_uint256.js.html b/js-stellar-base_src_numbers_uint256.js.html index cf6de1666..86ade896b 100644 --- a/js-stellar-base_src_numbers_uint256.js.html +++ b/js-stellar-base_src_numbers_uint256.js.html @@ -24,7 +24,7 @@
@@ -74,7 +74,7 @@

js-stellar-base/src/numbers/uint256.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_numbers_xdr_large_int.js.html b/js-stellar-base_src_numbers_xdr_large_int.js.html index 46fbcb5e3..af75d8d5d 100644 --- a/js-stellar-base_src_numbers_xdr_large_int.js.html +++ b/js-stellar-base_src_numbers_xdr_large_int.js.html @@ -24,7 +24,7 @@
@@ -301,7 +301,7 @@

js-stellar-base/src/numbers/xdr_large_int.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_operation.js.html b/js-stellar-base_src_operation.js.html index c1b84384d..c65cc627c 100644 --- a/js-stellar-base_src_operation.js.html +++ b/js-stellar-base_src_operation.js.html @@ -24,7 +24,7 @@
@@ -734,7 +734,7 @@

js-stellar-base/src/operation.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 73b2ec318..35fdd3c32 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 53bf1fe52..f45fa7d1f 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 @@
@@ -106,7 +106,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 190814051..5ccdb2a63 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 acca547dc..0441b8d9f 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 @@
@@ -88,7 +88,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 03fb6af57..0f5054a23 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 @@
@@ -103,7 +103,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 c7b24c139..4f61858de 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 30aa7c5d3..4fdec21f3 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 0aeaccdce..b29ab4b09 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 f2a4bf6a5..1de50ba84 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 1921a2715..82b4db443 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 @@
@@ -120,7 +120,7 @@

js-stellar-base/src/operations/create_claimable_balance.j
- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 a45d35dd5..01fa663f3 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 @@
@@ -93,7 +93,7 @@

js-stellar-base/src/operations/create_passive_sell_offer.
- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 0ef3efb7f..fc795acfa 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_extend_footprint_ttl.js.html b/js-stellar-base_src_operations_extend_footprint_ttl.js.html index b90d1b8a7..d028e5bee 100644 --- a/js-stellar-base_src_operations_extend_footprint_ttl.js.html +++ b/js-stellar-base_src_operations_extend_footprint_ttl.js.html @@ -24,7 +24,7 @@
@@ -91,7 +91,7 @@

js-stellar-base/src/operations/extend_footprint_ttl.js
- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 69a155365..9a4768970 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 9d5b99dca..594914efd 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 @@
@@ -280,7 +280,7 @@

js-stellar-base/src/operations/invoke_host_function.js
- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 841fdba3b..46f1e9684 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 @@
@@ -111,7 +111,7 @@

js-stellar-base/src/operations/liquidity_pool_deposit.js<
- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 6d117ce62..7f009c86f 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 f0e21c119..78815e565 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 @@
@@ -98,7 +98,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 212c78f33..76a3e3dea 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 @@
@@ -97,7 +97,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 7cf3c8f29..6645024f5 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 @@
@@ -98,7 +98,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 828d9899e..dd0f99f8e 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 46dab6e9c..cff467716 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 59b5537c4..0a1e7c1ba 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_operations_restore_footprint.js.html b/js-stellar-base_src_operations_restore_footprint.js.html index 6937cf682..c4d3fc6df 100644 --- a/js-stellar-base_src_operations_restore_footprint.js.html +++ b/js-stellar-base_src_operations_restore_footprint.js.html @@ -24,7 +24,7 @@
@@ -80,7 +80,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 0b4a0daac..19967ad3b 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 @@
@@ -367,7 +367,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 8a87f5ee3..e2967448b 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 @@
@@ -235,7 +235,7 @@

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


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 9ca3097c9..5f96d13d7 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_scval.js.html b/js-stellar-base_src_scval.js.html index ed8ac11c8..d1d9832b0 100644 --- a/js-stellar-base_src_scval.js.html +++ b/js-stellar-base_src_scval.js.html @@ -24,7 +24,7 @@
@@ -426,7 +426,7 @@

js-stellar-base/src/scval.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_signerkey.js.html b/js-stellar-base_src_signerkey.js.html index 1a8e52fc6..acc22f085 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_signing.js.html b/js-stellar-base_src_signing.js.html index 2d271dad5..852c37e00 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 Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_soroban.js.html b/js-stellar-base_src_soroban.js.html index a8ad0c178..7b4122ebe 100644 --- a/js-stellar-base_src_soroban.js.html +++ b/js-stellar-base_src_soroban.js.html @@ -24,7 +24,7 @@
@@ -125,7 +125,7 @@

js-stellar-base/src/soroban.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_sorobandata_builder.js.html b/js-stellar-base_src_sorobandata_builder.js.html index db986e8e1..b48028151 100644 --- a/js-stellar-base_src_sorobandata_builder.js.html +++ b/js-stellar-base_src_sorobandata_builder.js.html @@ -24,7 +24,7 @@
@@ -247,7 +247,7 @@

js-stellar-base/src/sorobandata_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_strkey.js.html b/js-stellar-base_src_strkey.js.html index 6591e5fb1..ea7875ec5 100644 --- a/js-stellar-base_src_strkey.js.html +++ b/js-stellar-base_src_strkey.js.html @@ -24,7 +24,7 @@
@@ -449,7 +449,7 @@

js-stellar-base/src/strkey.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/js-stellar-base_src_transaction.js.html b/js-stellar-base_src_transaction.js.html index d41525c33..22b21f173 100644 --- a/js-stellar-base_src_transaction.js.html +++ b/js-stellar-base_src_transaction.js.html @@ -24,7 +24,7 @@
@@ -419,7 +419,7 @@

js-stellar-base/src/transaction.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 b1b773e36..09908a68f 100644 --- a/js-stellar-base_src_transaction_base.js.html +++ b/js-stellar-base_src_transaction_base.js.html @@ -24,7 +24,7 @@
@@ -268,7 +268,7 @@

js-stellar-base/src/transaction_base.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 823bd082c..3cfca8909 100644 --- a/js-stellar-base_src_transaction_builder.js.html +++ b/js-stellar-base_src_transaction_builder.js.html @@ -24,7 +24,7 @@
@@ -851,7 +851,7 @@

js-stellar-base/src/transaction_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal 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 f6f151db0..833ca7072 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 @@
@@ -175,7 +175,7 @@

js-stellar-base/src/util/decode_encode_muxed_account.js
- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_config.js.html b/lib_config.js.html index 0795c0a70..8e022f110 100644 --- a/lib_config.js.html +++ b/lib_config.js.html @@ -24,7 +24,7 @@
@@ -128,7 +128,7 @@

lib/config.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_contract_client_assembled_transaction.js.html b/lib_contract_client_assembled_transaction.js.html new file mode 100644 index 000000000..24ebaa045 --- /dev/null +++ b/lib_contract_client_assembled_transaction.js.html @@ -0,0 +1,588 @@ + + + + + + lib/contract_client/assembled_transaction.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

lib/contract_client/assembled_transaction.js

+ + + + + + + +
+
+
"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.AssembledTransaction = void 0;
+var _ = require("..");
+var _rust_types = require("../rust_types");
+var _utils = require("./utils");
+var _sent_transaction = require("./sent_transaction");
+/**
+ * The main workhorse of {@link ContractClient}. This class is used to wrap a
+ * transaction-under-construction and provide high-level interfaces to the most
+ * common workflows, while still providing access to low-level stellar-sdk
+ * transaction manipulation.
+ *
+ * Most of the time, you will not construct an `AssembledTransaction` directly,
+ * but instead receive one as the return value of a `ContractClient` method. If
+ * you're familiar with the libraries generated by soroban-cli's `contract
+ * bindings typescript` command, these also wraps `ContractClient` and return
+ * `AssembledTransaction` instances.
+ *
+ * Let's look at examples of how to use `AssembledTransaction` for a variety of
+ * use-cases:
+ *
+ * # 1. Simple read call
+ *
+ * Since these only require simulation, you can get the `result` of the call
+ * right after constructing your `AssembledTransaction`:
+ *
+ * ```ts
+ * const { result } = await AssembledTransaction.build({
+ *   method: 'myReadMethod',
+ *   args: spec.funcArgsToScVals('myReadMethod', { args: 'for', my: 'method', ... }),
+ *   contractId: 'C123…',
+ *   networkPassphrase: '…',
+ *   rpcUrl: 'https://…',
+ *   publicKey: Keypair.random().publicKey(), // keypairs are irrelevant, for simulation-only read calls
+ *   parseResultXdr: (result: xdr.ScVal) => spec.funcResToNative('myReadMethod', result),
+ * })
+ * ```
+ *
+ * While that looks pretty complicated, most of the time you will use this in
+ * conjunction with {@link ContractClient}, which simplifies it to:
+ *
+ * ```ts
+ * const { result }  = await client.myReadMethod({ args: 'for', my: 'method', ... })
+ * ```
+ *
+ * # 2. Simple write call
+ *
+ * For write calls that will be simulated and then sent to the network without
+ * further manipulation, only one more step is needed:
+ *
+ * ```ts
+ * const assembledTx = await client.myWriteMethod({ args: 'for', my: 'method', ... })
+ * const sentTx = await assembledTx.signAndSend()
+ * ```
+ *
+ * Here we're assuming that you're using a {@link ContractClient}, rather than
+ * constructing `AssembledTransaction`'s directly.
+ *
+ * Note that `sentTx`, the return value of `signAndSend`, is a
+ * {@link SentTransaction}. `SentTransaction` is similar to
+ * `AssembledTransaction`, but is missing many of the methods and fields that
+ * are only relevant while assembling a transaction. It also has a few extra
+ * methods and fields that are only relevant after the transaction has been
+ * sent to the network.
+ *
+ * Like `AssembledTransaction`, `SentTransaction` also has a `result` getter,
+ * which contains the parsed final return value of the contract call. Most of
+ * the time, you may only be interested in this, so rather than getting the
+ * whole `sentTx` you may just want to:
+ *
+ * ```ts
+ * const tx = await client.myWriteMethod({ args: 'for', my: 'method', ... })
+ * const { result } = await tx.signAndSend()
+ * ```
+ *
+ * # 3. More fine-grained control over transaction construction
+ *
+ * If you need more control over the transaction before simulating it, you can
+ * set various {@link MethodOptions} when constructing your
+ * `AssembledTransaction`. With a {@link ContractClient}, this is passed as a
+ * second object after the arguments (or the only object, if the method takes
+ * no arguments):
+ *
+ * ```ts
+ * const tx = await client.myWriteMethod(
+ *   {
+ *     args: 'for',
+ *     my: 'method',
+ *     ...
+ *   }, {
+ *     fee: '10000', // default: {@link BASE_FEE}
+ *     simulate: false,
+ *     timeoutInSeconds: 20, // default: {@link DEFAULT_TIMEOUT}
+ *   }
+ * )
+ * ```
+ *
+ * Since we've skipped simulation, we can now edit the `raw` transaction and
+ * then manually call `simulate`:
+ *
+ * ```ts
+ * tx.raw.addMemo(Memo.text('Nice memo, friend!'))
+ * await tx.simulate()
+ * ```
+ *
+ * If you need to inspect the simulation later, you can access it with `tx.simulation`.
+ *
+ * # 4. Multi-auth workflows
+ *
+ * Soroban, and Stellar in general, allows multiple parties to sign a
+ * transaction.
+ *
+ * Let's consider an Atomic Swap contract. Alice wants to give 10 of her Token
+ * A tokens to Bob for 5 of his Token B tokens.
+ *
+ * ```ts
+ * const ALICE = 'G123...'
+ * const BOB = 'G456...'
+ * const TOKEN_A = 'C123…'
+ * const TOKEN_B = 'C456…'
+ * const AMOUNT_A = 10n
+ * const AMOUNT_B = 5n
+ * ```
+ *
+ * Let's say Alice is also going to be the one signing the final transaction
+ * envelope, meaning she is the invoker. So your app, from Alice's browser,
+ * simulates the `swap` call:
+ *
+ * ```ts
+ * const tx = await swapClient.swap({
+ *   a: ALICE,
+ *   b: BOB,
+ *   token_a: TOKEN_A,
+ *   token_b: TOKEN_B,
+ *   amount_a: AMOUNT_A,
+ *   amount_b: AMOUNT_B,
+ * })
+ * ```
+ *
+ * But your app can't `signAndSend` this right away, because Bob needs to sign
+ * it first. You can check this:
+ *
+ * ```ts
+ * const whoElseNeedsToSign = tx.needsNonInvokerSigningBy()
+ * ```
+ *
+ * You can verify that `whoElseNeedsToSign` is an array of length `1`,
+ * containing only Bob's public key.
+ *
+ * Then, still on Alice's machine, you can serialize the
+ * transaction-under-assembly:
+ *
+ * ```ts
+ * const json = tx.toJSON()
+ * ```
+ *
+ * And now you need to send it to Bob's browser. How you do this depends on
+ * your app. Maybe you send it to a server first, maybe you use WebSockets, or
+ * maybe you have Alice text the JSON blob to Bob and have him paste it into
+ * your app in his browser (note: this option might be error-prone 😄).
+ *
+ * Once you get the JSON blob into your app on Bob's machine, you can
+ * deserialize it:
+ *
+ * ```ts
+ * const tx = swapClient.txFromJSON(json)
+ * ```
+ *
+ * Or, if you're using a client generated with `soroban contract bindings
+ * typescript`, this deserialization will look like:
+ *
+ * ```ts
+ * const tx = swapClient.fromJSON.swap(json)
+ * ```
+ *
+ * Then you can have Bob sign it. What Bob will actually need to sign is some
+ * _auth entries_ within the transaction, not the transaction itself or the
+ * transaction envelope. Your app can verify that Bob has the correct wallet
+ * selected, then:
+ *
+ * ```ts
+ * await tx.signAuthEntries()
+ * ```
+ *
+ * Under the hood, this uses `signAuthEntry`, which you either need to inject
+ * during initial construction of the `ContractClient`/`AssembledTransaction`,
+ * or which you can pass directly to `signAuthEntries`.
+ *
+ * Now Bob can again serialize the transaction and send back to Alice, where
+ * she can finally call `signAndSend()`.
+ *
+ * To see an even more complicated example, where Alice swaps with Bob but the
+ * transaction is invoked by yet another party, check out
+ * [test-swap.js](../../test/e2e/src/test-swap.js).
+ */
+class AssembledTransaction {
+  /**
+   * The TransactionBuilder as constructed in `{@link
+   * AssembledTransaction}.build`. Feel free set `simulate: false` to modify
+   * this object before calling `tx.simulate()` manually. Example:
+   *
+   * ```ts
+   * const tx = await myContract.myMethod(
+   *   { args: 'for', my: 'method', ... },
+   *   { simulate: false }
+   * );
+   * tx.raw.addMemo(Memo.text('Nice memo, friend!'))
+   * await tx.simulate();
+   * ```
+   */
+
+  /**
+   * The Transaction as it was built with `raw.build()` right before
+   * simulation. Once this is set, modifying `raw` will have no effect unless
+   * you call `tx.simulate()` again.
+   */
+
+  /**
+   * The result of the transaction simulation. This is set after the first call
+   * to `simulate`. It is difficult to serialize and deserialize, so it is not
+   * included in the `toJSON` and `fromJSON` methods. See `simulationData`
+   * cached, serializable access to the data needed by AssembledTransaction
+   * logic.
+   */
+
+  /**
+   * Cached simulation result. This is set after the first call to
+   * {@link simulationData}, and is used to facilitate serialization and
+   * deserialization of the AssembledTransaction.
+   *
+   * Most of the time, if you need this data, you can call `tx.simulation.result`.
+   *
+   * If you need access to this data after a transaction has been serialized
+   * and then deserialized, you can call `simulationData.result`.
+   */
+
+  /**
+   * Cached simulation transaction data. This is set after the first call to
+   * {@link simulationData}, and is used to facilitate serialization and
+   * deserialization of the AssembledTransaction.
+   *
+   * Most of the time, if you need this data, you can call `simulation.transactionData`.
+   *
+   * If you need access to this data after a transaction has been serialized
+   * and then deserialized, you can call `simulationData.transactionData`.
+   */
+
+  /**
+   * The Soroban server to use for all RPC calls. This is constructed from the
+   * `rpcUrl` in the options.
+   */
+
+  /**
+   * A list of the most important errors that various AssembledTransaction
+   * methods can throw. Feel free to catch specific errors in your application
+   * logic.
+   */
+  static Errors = {
+    ExpiredState: class ExpiredStateError extends Error {},
+    NeedsMoreSignatures: class NeedsMoreSignaturesError extends Error {},
+    NoSignatureNeeded: class NoSignatureNeededError extends Error {},
+    NoUnsignedNonInvokerAuthEntries: class NoUnsignedNonInvokerAuthEntriesError extends Error {},
+    NoSigner: class NoSignerError extends Error {},
+    NotYetSimulated: class NotYetSimulatedError extends Error {},
+    FakeAccount: class FakeAccountError extends Error {}
+  };
+
+  /**
+   * Serialize the AssembledTransaction to a JSON string. This is useful for
+   * saving the transaction to a database or sending it over the wire for
+   * multi-auth workflows. `fromJSON` can be used to deserialize the
+   * transaction. This only works with transactions that have been simulated.
+   */
+  toJSON() {
+    return JSON.stringify({
+      method: this.options.method,
+      tx: this.built?.toXDR(),
+      simulationResult: {
+        auth: this.simulationData.result.auth.map(a => a.toXDR("base64")),
+        retval: this.simulationData.result.retval.toXDR("base64")
+      },
+      simulationTransactionData: this.simulationData.transactionData.toXDR("base64")
+    });
+  }
+  static fromJSON(options, {
+    tx,
+    simulationResult,
+    simulationTransactionData
+  }) {
+    const txn = new AssembledTransaction(options);
+    txn.built = _.TransactionBuilder.fromXDR(tx, options.networkPassphrase);
+    txn.simulationResult = {
+      auth: simulationResult.auth.map(a => _.xdr.SorobanAuthorizationEntry.fromXDR(a, "base64")),
+      retval: _.xdr.ScVal.fromXDR(simulationResult.retval, "base64")
+    };
+    txn.simulationTransactionData = _.xdr.SorobanTransactionData.fromXDR(simulationTransactionData, "base64");
+    return txn;
+  }
+  constructor(options) {
+    this.options = options;
+    this.options.simulate = this.options.simulate ?? true;
+    this.server = new _.SorobanRpc.Server(this.options.rpcUrl, {
+      allowHttp: this.options.allowHttp ?? false
+    });
+  }
+
+  /**
+   * Construct a new AssembledTransaction. This is the only way to create a new
+   * AssembledTransaction; the main constructor is private.
+   *
+   * This is an asynchronous constructor for two reasons:
+   *
+   * 1. It needs to fetch the account from the network to get the current
+   *   sequence number.
+   * 2. It needs to simulate the transaction to get the expected fee.
+   *
+   * If you don't want to simulate the transaction, you can set `simulate` to
+   * `false` in the options.
+   *
+   *     const tx = await AssembledTransaction.build({
+   *       ...,
+   *       simulate: false,
+   *     })
+   */
+  static async build(options) {
+    const tx = new AssembledTransaction(options);
+    const contract = new _.Contract(options.contractId);
+    const account = await tx.server.getAccount(options.publicKey);
+    tx.raw = new _.TransactionBuilder(account, {
+      fee: options.fee ?? _.BASE_FEE,
+      networkPassphrase: options.networkPassphrase
+    }).addOperation(contract.call(options.method, ...(options.args ?? []))).setTimeout(options.timeoutInSeconds ?? _utils.DEFAULT_TIMEOUT);
+    if (options.simulate) await tx.simulate();
+    return tx;
+  }
+  simulate = async () => {
+    if (!this.raw) {
+      throw new Error('Transaction has not yet been assembled; ' + 'call `AssembledTransaction.build` first.');
+    }
+    this.built = this.raw.build();
+    this.simulation = await this.server.simulateTransaction(this.built);
+    if (_.SorobanRpc.Api.isSimulationSuccess(this.simulation)) {
+      this.built = _.SorobanRpc.assembleTransaction(this.built, this.simulation).build();
+    }
+    return this;
+  };
+  get simulationData() {
+    if (this.simulationResult && this.simulationTransactionData) {
+      return {
+        result: this.simulationResult,
+        transactionData: this.simulationTransactionData
+      };
+    }
+    const simulation = this.simulation;
+    if (!simulation) {
+      throw new AssembledTransaction.Errors.NotYetSimulated("Transaction has not yet been simulated");
+    }
+    if (_.SorobanRpc.Api.isSimulationError(simulation)) {
+      throw new Error(`Transaction simulation failed: "${simulation.error}"`);
+    }
+    if (_.SorobanRpc.Api.isSimulationRestore(simulation)) {
+      throw new AssembledTransaction.Errors.ExpiredState(`You need to restore some contract state before you can invoke this method. ${JSON.stringify(simulation, null, 2)}`);
+    }
+    if (!simulation.result) {
+      throw new Error(`Expected an invocation simulation, but got no 'result' field. Simulation: ${JSON.stringify(simulation, null, 2)}`);
+    }
+
+    // add to object for serialization & deserialization
+    this.simulationResult = simulation.result;
+    this.simulationTransactionData = simulation.transactionData.build();
+    return {
+      result: this.simulationResult,
+      transactionData: this.simulationTransactionData
+    };
+  }
+  get result() {
+    try {
+      return this.options.parseResultXdr(this.simulationData.result.retval);
+    } catch (e) {
+      if (!(0, _utils.implementsToString)(e)) throw e;
+      let err = this.parseError(e.toString());
+      if (err) return err;
+      throw e;
+    }
+  }
+  parseError(errorMessage) {
+    if (!this.options.errorTypes) return undefined;
+    const match = errorMessage.match(_utils.contractErrorPattern);
+    if (!match) return undefined;
+    let i = parseInt(match[1], 10);
+    let err = this.options.errorTypes[i];
+    if (!err) return undefined;
+    return new _rust_types.Err(err);
+  }
+
+  /**
+   * Sign the transaction with the `wallet`, included previously. If you did
+   * not previously include one, you need to include one now that at least
+   * includes the `signTransaction` method. After signing, this method will
+   * send the transaction to the network and return a `SentTransaction` that
+   * keeps track of all the attempts to fetch the transaction.
+   */
+  signAndSend = async ({
+    force = false,
+    signTransaction = this.options.signTransaction
+  } = {}) => {
+    if (!this.built) {
+      throw new Error("Transaction has not yet been simulated");
+    }
+    if (!force && this.isReadCall) {
+      throw new AssembledTransaction.Errors.NoSignatureNeeded("This is a read call. It requires no signature or sending. " + "Use `force: true` to sign and send anyway.");
+    }
+    if (!signTransaction) {
+      throw new AssembledTransaction.Errors.NoSigner("You must provide a signTransaction function, either when calling " + "`signAndSend` or when initializing your ContractClient");
+    }
+    if ((await this.needsNonInvokerSigningBy()).length) {
+      throw new AssembledTransaction.Errors.NeedsMoreSignatures("Transaction requires more signatures. " + "See `needsNonInvokerSigningBy` for details.");
+    }
+    const typeChecked = this;
+    return await _sent_transaction.SentTransaction.init(signTransaction, typeChecked);
+  };
+  getStorageExpiration = async () => {
+    const entryRes = await this.server.getLedgerEntries(new _.Contract(this.options.contractId).getFootprint());
+    if (!entryRes.entries || !entryRes.entries.length || !entryRes.entries[0].liveUntilLedgerSeq) throw new Error("failed to get ledger entry");
+    return entryRes.entries[0].liveUntilLedgerSeq;
+  };
+
+  /**
+   * Get a list of accounts, other than the invoker of the simulation, that
+   * need to sign auth entries in this transaction.
+   *
+   * Soroban allows multiple people to sign a transaction. Someone needs to
+   * sign the final transaction envelope; this person/account is called the
+   * _invoker_, or _source_. Other accounts might need to sign individual auth
+   * entries in the transaction, if they're not also the invoker.
+   *
+   * This function returns a list of accounts that need to sign auth entries,
+   * assuming that the same invoker/source account will sign the final
+   * transaction envelope as signed the initial simulation.
+   *
+   * One at a time, for each public key in this array, you will need to
+   * serialize this transaction with `toJSON`, send to the owner of that key,
+   * deserialize the transaction with `txFromJson`, and call
+   * {@link signAuthEntries}. Then re-serialize and send to the next account
+   * in this list.
+   */
+  needsNonInvokerSigningBy = async ({
+    includeAlreadySigned = false
+  } = {}) => {
+    if (!this.built) {
+      throw new Error("Transaction has not yet been simulated");
+    }
+
+    // We expect that any transaction constructed by these libraries has a
+    // single operation, which is an InvokeHostFunction operation. The host
+    // function being invoked is the contract method call.
+    if (!("operations" in this.built)) {
+      throw new Error(`Unexpected Transaction type; no operations: ${JSON.stringify(this.built)}`);
+    }
+    const rawInvokeHostFunctionOp = this.built.operations[0];
+    return [...new Set((rawInvokeHostFunctionOp.auth ?? []).filter(entry => entry.credentials().switch() === _.xdr.SorobanCredentialsType.sorobanCredentialsAddress() && (includeAlreadySigned || entry.credentials().address().signature().switch().name === "scvVoid")).map(entry => _.StrKey.encodeEd25519PublicKey(entry.credentials().address().address().accountId().ed25519())))];
+  };
+
+  /**
+   * If {@link needsNonInvokerSigningBy} returns a non-empty list, you can serialize
+   * the transaction with `toJSON`, send it to the owner of one of the public keys
+   * in the map, deserialize with `txFromJSON`, and call this method on their
+   * machine. Internally, this will use `signAuthEntry` function from connected
+   * `wallet` for each.
+   *
+   * Then, re-serialize the transaction and either send to the next
+   * `needsNonInvokerSigningBy` owner, or send it back to the original account
+   * who simulated the transaction so they can {@link sign} the transaction
+   * envelope and {@link send} it to the network.
+   *
+   * Sending to all `needsNonInvokerSigningBy` owners in parallel is not currently
+   * supported!
+   */
+  signAuthEntries = async ({
+    expiration = this.getStorageExpiration(),
+    signAuthEntry = this.options.signAuthEntry,
+    publicKey = this.options.publicKey
+  } = {}) => {
+    if (!this.built) throw new Error("Transaction has not yet been assembled or simulated");
+    const needsNonInvokerSigningBy = await this.needsNonInvokerSigningBy();
+    if (!needsNonInvokerSigningBy) {
+      throw new AssembledTransaction.Errors.NoUnsignedNonInvokerAuthEntries("No unsigned non-invoker auth entries; maybe you already signed?");
+    }
+    if (needsNonInvokerSigningBy.indexOf(publicKey ?? '') === -1) {
+      throw new AssembledTransaction.Errors.NoSignatureNeeded(`No auth entries for public key "${publicKey}"`);
+    }
+    if (!signAuthEntry) {
+      throw new AssembledTransaction.Errors.NoSigner('You must provide `signAuthEntry` when calling `signAuthEntries`, ' + 'or when constructing the `ContractClient` or `AssembledTransaction`');
+    }
+    const rawInvokeHostFunctionOp = this.built.operations[0];
+    const authEntries = rawInvokeHostFunctionOp.auth ?? [];
+    for (const [i, entry] of authEntries.entries()) {
+      if (entry.credentials().switch() !== _.xdr.SorobanCredentialsType.sorobanCredentialsAddress()) {
+        // if the invoker/source account, then the entry doesn't need explicit
+        // signature, since the tx envelope is already signed by the source
+        // account, so only check for sorobanCredentialsAddress
+        continue;
+      }
+      const pk = _.StrKey.encodeEd25519PublicKey(entry.credentials().address().address().accountId().ed25519());
+
+      // this auth entry needs to be signed by a different account
+      // (or maybe already was!)
+      if (pk !== publicKey) continue;
+      authEntries[i] = await (0, _.authorizeEntry)(entry, async preimage => Buffer.from(await signAuthEntry(preimage.toXDR("base64")), "base64"), await expiration, this.options.networkPassphrase);
+    }
+  };
+
+  /**
+   * Whether this transaction is a read call. This is determined by the
+   * simulation result and the transaction data. If the transaction is a read
+   * call, it will not need to be signed and sent to the network. If this
+   * returns `false`, then you need to call `signAndSend` on this transaction.
+   */
+  get isReadCall() {
+    const authsCount = this.simulationData.result.auth.length;
+    const writeLength = this.simulationData.transactionData.resources().footprint().readWrite().length;
+    return authsCount === 0 && writeLength === 0;
+  }
+}
+exports.AssembledTransaction = AssembledTransaction;
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + diff --git a/lib_contract_client_basic_node_signer.js.html b/lib_contract_client_basic_node_signer.js.html new file mode 100644 index 000000000..0ce298dd7 --- /dev/null +++ b/lib_contract_client_basic_node_signer.js.html @@ -0,0 +1,84 @@ + + + + + + lib/contract_client/basic_node_signer.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

lib/contract_client/basic_node_signer.js

+ + + + + + + +
+
+
"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.basicNodeSigner = void 0;
+var _ = require("..");
+/**
+ * For use with {@link ContractClient} and {@link AssembledTransaction}.
+ * Implements `signTransaction` and `signAuthEntry` with signatures expected by
+ * those classes. This is useful for testing and maybe some simple Node
+ * applications. Feel free to use this as a starting point for your own
+ * Wallet/TransactionSigner implementation.
+ */
+const basicNodeSigner = (keypair, networkPassphrase) => ({
+  signTransaction: async tx => {
+    const t = _.TransactionBuilder.fromXDR(tx, networkPassphrase);
+    t.sign(keypair);
+    return t.toXDR();
+  },
+  signAuthEntry: async entryXdr => {
+    return keypair.sign((0, _.hash)(Buffer.from(entryXdr, "base64"))).toString('base64');
+  }
+});
+exports.basicNodeSigner = basicNodeSigner;
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + diff --git a/lib_contract_client_client.js.html b/lib_contract_client_client.js.html new file mode 100644 index 000000000..39767e0ba --- /dev/null +++ b/lib_contract_client_client.js.html @@ -0,0 +1,112 @@ + + + + + + lib/contract_client/client.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

lib/contract_client/client.js

+ + + + + + + +
+
+
"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.ContractClient = void 0;
+var _assembled_transaction = require("./assembled_transaction");
+class ContractClient {
+  /**
+   * Generate a class from the contract spec that where each contract method
+   * gets included with an identical name.
+   *
+   * Each method returns an {@link AssembledTransaction} that can be used to
+   * modify, simulate, decode results, and possibly sign, & submit the
+   * transaction.
+   */
+  constructor(spec, options) {
+    this.spec = spec;
+    this.options = options;
+    let methods = this.spec.funcs();
+    for (let method of methods) {
+      let name = method.name().toString();
+      // @ts-ignore
+      this[name] = async (args, options) => {
+        return await _assembled_transaction.AssembledTransaction.build({
+          method: name,
+          args: spec.funcArgsToScVals(name, args),
+          ...options,
+          ...this.options,
+          errorTypes: spec.errorCases().reduce((acc, curr) => ({
+            ...acc,
+            [curr.value()]: {
+              message: curr.doc().toString()
+            }
+          }), {}),
+          parseResultXdr: result => spec.funcResToNative(name, result)
+        });
+      };
+    }
+  }
+  txFromJSON = json => {
+    const {
+      method,
+      ...tx
+    } = JSON.parse(json);
+    return _assembled_transaction.AssembledTransaction.fromJSON({
+      ...this.options,
+      method,
+      parseResultXdr: result => this.spec.funcResToNative(method, result)
+    }, tx);
+  };
+}
+exports.ContractClient = ContractClient;
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + diff --git a/lib_contract_client_sent_transaction.js.html b/lib_contract_client_sent_transaction.js.html new file mode 100644 index 000000000..b9382de02 --- /dev/null +++ b/lib_contract_client_sent_transaction.js.html @@ -0,0 +1,171 @@ + + + + + + lib/contract_client/sent_transaction.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

lib/contract_client/sent_transaction.js

+ + + + + + + +
+
+
"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.SentTransaction = void 0;
+var _ = require("..");
+var _utils = require("./utils");
+/**
+ * A transaction that has been sent to the Soroban network. This happens in two steps:
+ *
+ * 1. `sendTransaction`: initial submission of the transaction to the network.
+ *    If this step runs into problems, the attempt to sign and send will be
+ *    aborted. You can see the result of this call in the
+ *    `sendTransactionResponse` getter.
+ * 2. `getTransaction`: once the transaction has been submitted to the network
+ *    successfully, you need to wait for it to finalize to get the result of the
+ *    transaction. This will be retried with exponential backoff for
+ *    {@link MethodOptions.timeoutInSeconds} seconds. See all attempts in
+ *    `getTransactionResponseAll` and the most recent attempt in
+ *    `getTransactionResponse`.
+ */
+class SentTransaction {
+  /**
+   * The result of calling `sendTransaction` to broadcast the transaction to the
+   * network.
+   */
+
+  /**
+   * If `sendTransaction` completes successfully (which means it has `status: 'PENDING'`),
+   * then `getTransaction` will be called in a loop for
+   * {@link MethodOptions.timeoutInSeconds} seconds. This array contains all
+   * the results of those calls.
+   */
+
+  /**
+   * The most recent result of calling `getTransaction`, from the
+   * `getTransactionResponseAll` array.
+   */
+
+  static Errors = {
+    SendFailed: class SendFailedError extends Error {},
+    SendResultOnly: class SendResultOnlyError extends Error {}
+  };
+  constructor(signTransaction, assembled) {
+    this.signTransaction = signTransaction;
+    this.assembled = assembled;
+    if (!signTransaction) {
+      throw new Error("You must provide a `signTransaction` function to send a transaction");
+    }
+    this.server = new _.SorobanRpc.Server(this.assembled.options.rpcUrl, {
+      allowHttp: this.assembled.options.rpcUrl.startsWith("http://")
+    });
+  }
+
+  /**
+   * Initialize a `SentTransaction` from an existing `AssembledTransaction` and
+   * a `signTransaction` function. This will also send the transaction to the
+   * network.
+   */
+  static init = async (signTransaction, assembled) => {
+    const tx = new SentTransaction(signTransaction, assembled);
+    return await tx.send();
+  };
+  send = async () => {
+    const timeoutInSeconds = this.assembled.options.timeoutInSeconds ?? _utils.DEFAULT_TIMEOUT;
+    const signature = await this.signTransaction(
+    // `signAndSend` checks for `this.built` before calling `SentTransaction.init`
+    this.assembled.built.toXDR(), {
+      networkPassphrase: this.assembled.options.networkPassphrase
+    });
+    this.signed = _.TransactionBuilder.fromXDR(signature, this.assembled.options.networkPassphrase);
+    this.sendTransactionResponse = await this.server.sendTransaction(this.signed);
+    if (this.sendTransactionResponse.status !== "PENDING") {
+      throw new SentTransaction.Errors.SendFailed('Sending the transaction to the network failed!\n' + JSON.stringify(this.sendTransactionResponse, null, 2));
+    }
+    const {
+      hash
+    } = this.sendTransactionResponse;
+    this.getTransactionResponseAll = await (0, _utils.withExponentialBackoff)(() => this.server.getTransaction(hash), resp => resp.status === _.SorobanRpc.Api.GetTransactionStatus.NOT_FOUND, timeoutInSeconds);
+    this.getTransactionResponse = this.getTransactionResponseAll[this.getTransactionResponseAll.length - 1];
+    if (this.getTransactionResponse.status === _.SorobanRpc.Api.GetTransactionStatus.NOT_FOUND) {
+      console.error(`Waited ${timeoutInSeconds} seconds for transaction to complete, but it did not. ` + `Returning anyway. Check the transaction status manually. ` + `Sent transaction: ${JSON.stringify(this.sendTransactionResponse, null, 2)}\n` + `All attempts to get the result: ${JSON.stringify(this.getTransactionResponseAll, null, 2)}`);
+    }
+    return this;
+  };
+  get result() {
+    // 1. check if transaction was submitted and awaited with `getTransaction`
+    if ("getTransactionResponse" in this && this.getTransactionResponse) {
+      // getTransactionResponse has a `returnValue` field unless it failed
+      if ("returnValue" in this.getTransactionResponse) {
+        return this.assembled.options.parseResultXdr(this.getTransactionResponse.returnValue);
+      }
+
+      // if "returnValue" not present, the transaction failed; return without parsing the result
+      throw new Error("Transaction failed! Cannot parse result.");
+    }
+
+    // 2. otherwise, maybe it was merely sent with `sendTransaction`
+    if (this.sendTransactionResponse) {
+      const errorResult = this.sendTransactionResponse.errorResult?.result();
+      if (errorResult) {
+        throw new SentTransaction.Errors.SendFailed(`Transaction simulation looked correct, but attempting to send the transaction failed. Check \`simulation\` and \`sendTransactionResponseAll\` to troubleshoot. Decoded \`sendTransactionResponse.errorResultXdr\`: ${errorResult}`);
+      }
+      throw new SentTransaction.Errors.SendResultOnly(`Transaction was sent to the network, but not yet awaited. No result to show. Await transaction completion with \`getTransaction(sendTransactionResponse.hash)\``);
+    }
+
+    // 3. finally, if neither of those are present, throw an error
+    throw new Error(`Sending transaction failed: ${JSON.stringify(this.assembled)}`);
+  }
+}
+exports.SentTransaction = SentTransaction;
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + diff --git a/lib_contract_client_utils.js.html b/lib_contract_client_utils.js.html new file mode 100644 index 000000000..bbc0ddeca --- /dev/null +++ b/lib_contract_client_utils.js.html @@ -0,0 +1,124 @@ + + + + + + lib/contract_client/utils.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

lib/contract_client/utils.js

+ + + + + + + +
+
+
"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.contractErrorPattern = exports.DEFAULT_TIMEOUT = void 0;
+exports.implementsToString = implementsToString;
+exports.withExponentialBackoff = withExponentialBackoff;
+/**
+ * The default timeout for waiting for a transaction to be included in a block.
+ */
+const DEFAULT_TIMEOUT = exports.DEFAULT_TIMEOUT = 10;
+
+/**
+ * Keep calling a `fn` for `timeoutInSeconds` seconds, if `keepWaitingIf` is true.
+ * Returns an array of all attempts to call the function.
+ */
+async function withExponentialBackoff(fn, keepWaitingIf, timeoutInSeconds, exponentialFactor = 1.5, verbose = false) {
+  const attempts = [];
+  let count = 0;
+  attempts.push(await fn());
+  if (!keepWaitingIf(attempts[attempts.length - 1])) return attempts;
+  const waitUntil = new Date(Date.now() + timeoutInSeconds * 1000).valueOf();
+  let waitTime = 1000;
+  let totalWaitTime = waitTime;
+  while (Date.now() < waitUntil && keepWaitingIf(attempts[attempts.length - 1])) {
+    count++;
+    // Wait a beat
+    if (verbose) {
+      console.info(`Waiting ${waitTime}ms before trying again (bringing the total wait time to ${totalWaitTime}ms so far, of total ${timeoutInSeconds * 1000}ms)`);
+    }
+    await new Promise(res => setTimeout(res, waitTime));
+    // Exponential backoff
+    waitTime = waitTime * exponentialFactor;
+    if (new Date(Date.now() + waitTime).valueOf() > waitUntil) {
+      waitTime = waitUntil - Date.now();
+      if (verbose) {
+        console.info(`was gonna wait too long; new waitTime: ${waitTime}ms`);
+      }
+    }
+    totalWaitTime = waitTime + totalWaitTime;
+    // Try again
+    attempts.push(await fn(attempts[attempts.length - 1]));
+    if (verbose && keepWaitingIf(attempts[attempts.length - 1])) {
+      console.info(`${count}. Called ${fn}; ${attempts.length} prev attempts. Most recent: ${JSON.stringify(attempts[attempts.length - 1], null, 2)}`);
+    }
+  }
+  return attempts;
+}
+
+/**
+ * If contracts are implemented using the `#[contracterror]` macro, then the
+ * errors get included in the on-chain XDR that also describes your contract's
+ * methods. Each error will have a specific number. This Regular Expression
+ * matches these "expected error types" that a contract may throw, and helps
+ * @{link AssembledTransaction} parse these errors.
+ */
+const contractErrorPattern = exports.contractErrorPattern = /Error\(Contract, #(\d+)\)/;
+
+/**
+ * A TypeScript type guard that checks if an object has a `toString` method.
+ */
+function implementsToString(obj) {
+  return typeof obj === "object" && obj !== null && "toString" in obj;
+}
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + diff --git a/lib_contract_spec.js.html b/lib_contract_spec.js.html index fdd994d55..9f64e42bc 100644 --- a/lib_contract_spec.js.html +++ b/lib_contract_spec.js.html @@ -24,7 +24,7 @@
@@ -46,6 +46,7 @@

lib/contract_spec.js

}); exports.ContractSpec = void 0; var _2 = require("."); +var _rust_types = require("./rust_types"); function readObj(args, input) { let inputName = input.name().toString(); let entry = Object.entries(args).find(([name, _]) => name === inputName); @@ -181,7 +182,7 @@

lib/contract_spec.js

} let output = outputs[0]; if (output.switch().value === _2.xdr.ScSpecType.scSpecTypeResult().value) { - return this.scValToNative(val, output.result().okType()); + return new _rust_types.Ok(this.scValToNative(val, output.result().okType())); } return this.scValToNative(val, output); } @@ -612,6 +613,16 @@

lib/contract_spec.js

return num; } + /** + * Gets the XDR error cases from the spec. + * + * @returns {xdr.ScSpecFunctionV0[]} all contract functions + * + */ + errorCases() { + return this.entries.filter(entry => entry.switch().value === _2.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value).flatMap(entry => entry.value().cases()); + } + /** * Converts the contract spec to a JSON schema. * @@ -1120,7 +1131,7 @@

lib/contract_spec.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_errors.js.html b/lib_errors.js.html index 7abe7d21e..9325a0b1b 100644 --- a/lib_errors.js.html +++ b/lib_errors.js.html @@ -24,7 +24,7 @@
@@ -144,7 +144,7 @@

lib/errors.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_federation_server.js.html b/lib_federation_server.js.html index a8488144f..7ed6e91e6 100644 --- a/lib_federation_server.js.html +++ b/lib_federation_server.js.html @@ -24,7 +24,7 @@
@@ -266,7 +266,7 @@

lib/federation/server.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_account_call_builder.js.html b/lib_horizon_account_call_builder.js.html index 7b1776881..9efd01a36 100644 --- a/lib_horizon_account_call_builder.js.html +++ b/lib_horizon_account_call_builder.js.html @@ -24,7 +24,7 @@
@@ -133,7 +133,7 @@

lib/horizon/account_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_account_response.js.html b/lib_horizon_account_response.js.html index 157f5ee4e..586ddc828 100644 --- a/lib_horizon_account_response.js.html +++ b/lib_horizon_account_response.js.html @@ -24,7 +24,7 @@
@@ -106,7 +106,7 @@

lib/horizon/account_response.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_assets_call_builder.js.html b/lib_horizon_assets_call_builder.js.html index 5ee824682..ec3785656 100644 --- a/lib_horizon_assets_call_builder.js.html +++ b/lib_horizon_assets_call_builder.js.html @@ -24,7 +24,7 @@
@@ -93,7 +93,7 @@

lib/horizon/assets_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_call_builder.js.html b/lib_horizon_call_builder.js.html index 9d866da1c..a46d88d41 100644 --- a/lib_horizon_call_builder.js.html +++ b/lib_horizon_call_builder.js.html @@ -24,7 +24,7 @@
@@ -409,7 +409,7 @@

lib/horizon/call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_claimable_balances_call_builder.js.html b/lib_horizon_claimable_balances_call_builder.js.html index 6d80ced4f..069a70923 100644 --- a/lib_horizon_claimable_balances_call_builder.js.html +++ b/lib_horizon_claimable_balances_call_builder.js.html @@ -24,7 +24,7 @@
@@ -123,7 +123,7 @@

lib/horizon/claimable_balances_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_effect_call_builder.js.html b/lib_horizon_effect_call_builder.js.html index d66c92d54..d1c57b906 100644 --- a/lib_horizon_effect_call_builder.js.html +++ b/lib_horizon_effect_call_builder.js.html @@ -24,7 +24,7 @@
@@ -126,7 +126,7 @@

lib/horizon/effect_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_horizon_axios_client.js.html b/lib_horizon_horizon_axios_client.js.html index 1cbe6bf7b..631f8dc19 100644 --- a/lib_horizon_horizon_axios_client.js.html +++ b/lib_horizon_horizon_axios_client.js.html @@ -24,7 +24,7 @@
@@ -124,7 +124,7 @@

lib/horizon/horizon_axios_client.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_ledger_call_builder.js.html b/lib_horizon_ledger_call_builder.js.html index f88d21b29..c82b9d483 100644 --- a/lib_horizon_ledger_call_builder.js.html +++ b/lib_horizon_ledger_call_builder.js.html @@ -24,7 +24,7 @@
@@ -84,7 +84,7 @@

lib/horizon/ledger_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_liquidity_pool_call_builder.js.html b/lib_horizon_liquidity_pool_call_builder.js.html index 8f52b0db2..5df044089 100644 --- a/lib_horizon_liquidity_pool_call_builder.js.html +++ b/lib_horizon_liquidity_pool_call_builder.js.html @@ -24,7 +24,7 @@
@@ -112,7 +112,7 @@

lib/horizon/liquidity_pool_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_offer_call_builder.js.html b/lib_horizon_offer_call_builder.js.html index 3a49c732e..9d338b258 100644 --- a/lib_horizon_offer_call_builder.js.html +++ b/lib_horizon_offer_call_builder.js.html @@ -24,7 +24,7 @@
@@ -157,7 +157,7 @@

lib/horizon/offer_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_operation_call_builder.js.html b/lib_horizon_operation_call_builder.js.html index 9ffac3244..7d54eddd0 100644 --- a/lib_horizon_operation_call_builder.js.html +++ b/lib_horizon_operation_call_builder.js.html @@ -24,7 +24,7 @@
@@ -150,7 +150,7 @@

lib/horizon/operation_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_orderbook_call_builder.js.html b/lib_horizon_orderbook_call_builder.js.html index 55b8d2e4a..04e87780b 100644 --- a/lib_horizon_orderbook_call_builder.js.html +++ b/lib_horizon_orderbook_call_builder.js.html @@ -24,7 +24,7 @@
@@ -87,7 +87,7 @@

lib/horizon/orderbook_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_path_call_builder.js.html b/lib_horizon_path_call_builder.js.html index f1bdfee10..5c581189e 100644 --- a/lib_horizon_path_call_builder.js.html +++ b/lib_horizon_path_call_builder.js.html @@ -24,7 +24,7 @@
@@ -98,7 +98,7 @@

lib/horizon/path_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_payment_call_builder.js.html b/lib_horizon_payment_call_builder.js.html index b0be41fa2..4ee00c1b3 100644 --- a/lib_horizon_payment_call_builder.js.html +++ b/lib_horizon_payment_call_builder.js.html @@ -24,7 +24,7 @@
@@ -103,7 +103,7 @@

lib/horizon/payment_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_server.js.html b/lib_horizon_server.js.html index b48283b82..dc749084a 100644 --- a/lib_horizon_server.js.html +++ b/lib_horizon_server.js.html @@ -24,7 +24,7 @@
@@ -70,7 +70,7 @@

lib/horizon/server.js

var _transaction_call_builder = require("./transaction_call_builder"); var _horizon_axios_client = _interopRequireWildcard(require("./horizon_axios_client")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* tslint:disable:variable-name no-namespace */ @@ -718,7 +718,7 @@

lib/horizon/server.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_strict_receive_path_call_builder.js.html b/lib_horizon_strict_receive_path_call_builder.js.html index 936b02048..f674108bb 100644 --- a/lib_horizon_strict_receive_path_call_builder.js.html +++ b/lib_horizon_strict_receive_path_call_builder.js.html @@ -24,7 +24,7 @@
@@ -110,7 +110,7 @@

lib/horizon/strict_receive_path_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_strict_send_path_call_builder.js.html b/lib_horizon_strict_send_path_call_builder.js.html index 846fd4236..8c2074480 100644 --- a/lib_horizon_strict_send_path_call_builder.js.html +++ b/lib_horizon_strict_send_path_call_builder.js.html @@ -24,7 +24,7 @@
@@ -110,7 +110,7 @@

lib/horizon/strict_send_path_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_trade_aggregation_call_builder.js.html b/lib_horizon_trade_aggregation_call_builder.js.html index 23d563262..2d624103e 100644 --- a/lib_horizon_trade_aggregation_call_builder.js.html +++ b/lib_horizon_trade_aggregation_call_builder.js.html @@ -24,7 +24,7 @@
@@ -139,7 +139,7 @@

lib/horizon/trade_aggregation_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_trades_call_builder.js.html b/lib_horizon_trades_call_builder.js.html index 60613cd6c..20ea64815 100644 --- a/lib_horizon_trades_call_builder.js.html +++ b/lib_horizon_trades_call_builder.js.html @@ -24,7 +24,7 @@
@@ -138,7 +138,7 @@

lib/horizon/trades_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_horizon_transaction_call_builder.js.html b/lib_horizon_transaction_call_builder.js.html index 92058a5df..c2d2582f0 100644 --- a/lib_horizon_transaction_call_builder.js.html +++ b/lib_horizon_transaction_call_builder.js.html @@ -24,7 +24,7 @@
@@ -137,7 +137,7 @@

lib/horizon/transaction_call_builder.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_rust_types_result.js.html b/lib_rust_types_result.js.html new file mode 100644 index 000000000..68aac6536 --- /dev/null +++ b/lib_rust_types_result.js.html @@ -0,0 +1,150 @@ + + + + + + lib/rust_types/result.js - Documentation + + + + + + + + + + + + + + + + + +
+ +

lib/rust_types/result.js

+ + + + + + + +
+
+
"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.Ok = exports.Err = void 0;
+/**
+ * A minimal implementation of Rust's `Result` type. Used for contract
+ * methods that return Results, to maintain their distinction from methods
+ * that simply either return a value or throw.
+ *
+ * **Why is this needed?**
+ *
+ * This is used by `ContractSpec` and `AssembledTransaction` when parsing
+ * values return by contracts.
+ *
+ * Contract methods can be implemented to return simple values, in which case
+ * they can also throw errors. This matches JavaScript's most idiomatic
+ * workflow, using `try...catch` blocks.
+ *
+ * But Rust also gives the flexibility of returning `Result` types. And Soroban
+ * contracts further support this with the `#[contracterror]` macro. Should
+ * JavaScript calls to such methods ignore all of that, and just flatten this
+ * extra info down to the same `try...catch` flow as other methods? We're not
+ * sure.
+ *
+ * For now, we've added this minimal implementation of Rust's `Result` logic,
+ * which exports the `Result` interface and its associated implementations,
+ * `Ok` and `Err`. This allows `ContractSpec` and `AssembledTransaction` to
+ * work together to duplicate the contract's Rust logic, always returning
+ * `Result` types for contract methods that are implemented to do so.
+ *
+ * In the future, if this feels too un-idiomatic for JavaScript, we can always
+ * remove this and flatten all JS calls to `try...catch`. Easier to remove this
+ * logic later than it would be to add it.
+ */
+
+/**
+ * Error interface containing the error message. Matches Rust's implementation.
+ * Part of implementing {@link Result}, a minimal implementation of Rust's
+ * `Result` type. Used for contract methods that return Results, to maintain
+ * their distinction from methods that simply either return a value or throw.
+ */
+
+/**
+ * Part of implementing {@link Result}, a minimal implementation of Rust's
+ * `Result` type. Used for contract methods that return Results, to maintain
+ * their distinction from methods that simply either return a value or throw.
+ */
+class Ok {
+  constructor(value) {
+    this.value = value;
+  }
+  unwrapErr() {
+    throw new Error("No error");
+  }
+  unwrap() {
+    return this.value;
+  }
+  isOk() {
+    return true;
+  }
+  isErr() {
+    return false;
+  }
+}
+
+/**
+ * Part of implementing {@link Result}, a minimal implementation of Rust's
+ * `Result` type. Used for contract methods that return Results, to maintain
+ * their distinction from methods that simply either return a value or throw.
+ */
+exports.Ok = Ok;
+class Err {
+  constructor(error) {
+    this.error = error;
+  }
+  unwrapErr() {
+    return this.error;
+  }
+  unwrap() {
+    throw new Error(this.error.message);
+  }
+  isOk() {
+    return false;
+  }
+  isErr() {
+    return true;
+  }
+}
+exports.Err = Err;
+
+
+ + + + +
+ +
+ +
+ Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme. +
+ + + + + diff --git a/lib_soroban_api.js.html b/lib_soroban_api.js.html index dc6281d49..8aecb2f42 100644 --- a/lib_soroban_api.js.html +++ b/lib_soroban_api.js.html @@ -24,7 +24,7 @@
@@ -104,7 +104,7 @@

lib/soroban/api.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_soroban_jsonrpc.js.html b/lib_soroban_jsonrpc.js.html index ef39c72cc..e35d0acf8 100644 --- a/lib_soroban_jsonrpc.js.html +++ b/lib_soroban_jsonrpc.js.html @@ -24,7 +24,7 @@
@@ -44,35 +44,11 @@

lib/soroban/jsonrpc.js

Object.defineProperty(exports, "__esModule", { value: true }); -exports.post = post; exports.postObject = postObject; var _axios = _interopRequireDefault(require("./axios")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Sends the jsonrpc 'params' as an array. - */ -async function post(url, method, ...params) { - 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 (hasOwnProperty(response.data, "error")) { - throw response.data.error; - } else { - return response.data?.result; - } -} - -/** - * Sends the jsonrpc 'params' as the single 'param' obj, no array wrapper is applied. - */ -async function postObject(url, method, param) { +/** Sends the jsonrpc 'params' as a single 'param' object (no array support). */ +async function postObject(url, method, param = null) { const response = await _axios.default.post(url, { jsonrpc: "2.0", // TODO: Generate a unique request id @@ -103,7 +79,7 @@

lib/soroban/jsonrpc.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_soroban_parsers.js.html b/lib_soroban_parsers.js.html index 7bd360809..fa8922b95 100644 --- a/lib_soroban_parsers.js.html +++ b/lib_soroban_parsers.js.html @@ -24,7 +24,7 @@
@@ -190,7 +190,7 @@

lib/soroban/parsers.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_soroban_server.js.html b/lib_soroban_server.js.html index 7dc3e9249..b02e932e2 100644 --- a/lib_soroban_server.js.html +++ b/lib_soroban_server.js.html @@ -24,7 +24,7 @@
@@ -53,7 +53,7 @@

lib/soroban/server.js

var _transaction = require("./transaction"); var _parsers = require("./parsers"); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } -function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* tslint:disable:variable-name no-namespace */ @@ -145,7 +145,7 @@

lib/soroban/server.js

* }); */ async getHealth() { - return jsonrpc.post(this.serverURL.toString(), 'getHealth'); + return jsonrpc.postObject(this.serverURL.toString(), 'getHealth'); } /** @@ -255,7 +255,9 @@

lib/soroban/server.js

return this._getLedgerEntries(...keys).then(_parsers.parseRawLedgerEntries); } async _getLedgerEntries(...keys) { - return jsonrpc.post(this.serverURL.toString(), 'getLedgerEntries', keys.map(k => k.toXDR('base64'))); + return jsonrpc.postObject(this.serverURL.toString(), 'getLedgerEntries', { + keys: keys.map(k => k.toXDR('base64')) + }); } /** @@ -309,7 +311,9 @@

lib/soroban/server.js

}); } async _getTransaction(hash) { - return jsonrpc.post(this.serverURL.toString(), 'getTransaction', hash); + return jsonrpc.postObject(this.serverURL.toString(), 'getTransaction', { + hash + }); } /** @@ -386,7 +390,7 @@

lib/soroban/server.js

* }); */ async getNetwork() { - return await jsonrpc.post(this.serverURL.toString(), 'getNetwork'); + return await jsonrpc.postObject(this.serverURL.toString(), 'getNetwork'); } /** @@ -405,7 +409,7 @@

lib/soroban/server.js

* }); */ async getLatestLedger() { - return jsonrpc.post(this.serverURL.toString(), 'getLatestLedger'); + return jsonrpc.postObject(this.serverURL.toString(), 'getLatestLedger'); } /** @@ -588,7 +592,9 @@

lib/soroban/server.js

return this._sendTransaction(transaction).then(_parsers.parseRawSendTransaction); } async _sendTransaction(transaction) { - return jsonrpc.post(this.serverURL.toString(), 'sendTransaction', transaction.toXDR()); + return jsonrpc.postObject(this.serverURL.toString(), 'sendTransaction', { + transaction: transaction.toXDR() + }); } /** @@ -683,7 +689,7 @@

lib/soroban/server.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_soroban_transaction.js.html b/lib_soroban_transaction.js.html index 235e60fbd..c7de39b62 100644 --- a/lib_soroban_transaction.js.html +++ b/lib_soroban_transaction.js.html @@ -24,7 +24,7 @@
@@ -137,7 +137,7 @@

lib/soroban/transaction.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_stellartoml_index.js.html b/lib_stellartoml_index.js.html index 84249413c..3eb2d0343 100644 --- a/lib_stellartoml_index.js.html +++ b/lib_stellartoml_index.js.html @@ -24,7 +24,7 @@
@@ -115,7 +115,7 @@

lib/stellartoml/index.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_utils.js.html b/lib_utils.js.html index 8b90aa21b..35be80068 100644 --- a/lib_utils.js.html +++ b/lib_utils.js.html @@ -24,7 +24,7 @@
@@ -78,7 +78,7 @@

lib/utils.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.
diff --git a/lib_webauth_utils.js.html b/lib_webauth_utils.js.html index 67be93612..a68cdbbf9 100644 --- a/lib_webauth_utils.js.html +++ b/lib_webauth_utils.js.html @@ -24,7 +24,7 @@
@@ -654,7 +654,7 @@

lib/webauth/utils.js


- Generated by JSDoc 4.0.2 on Mon Feb 12 2024 20:39:39 GMT+0000 (Coordinated Universal Time) using the Minami theme. + Generated by JSDoc 4.0.2 on Wed Mar 20 2024 22:11:08 GMT+0000 (Coordinated Universal Time) using the Minami theme.