@stellar/stellar-sdk 14.3.2 → 14.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/dist/stellar-sdk-minimal.js +7222 -7108
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +3460 -3346
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +7213 -7099
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +8051 -7937
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/config.d.ts +2 -6
- package/lib/contract/assembled_transaction.d.ts +16 -132
- package/lib/contract/assembled_transaction.js +14 -114
- package/lib/contract/errors.d.ts +26 -0
- package/lib/contract/errors.js +126 -0
- package/lib/contract/sent_transaction.d.ts +1 -1
- package/lib/contract/spec.d.ts +2 -2
- package/lib/contract/spec.js +40 -28
- package/lib/contract/types.d.ts +35 -9
- package/lib/contract/utils.d.ts +1 -1
- package/lib/contract/utils.js +18 -53
- package/lib/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/contract/wasm_spec_parser.js +15 -0
- package/lib/errors/network.d.ts +1 -1
- package/lib/federation/server.d.ts +7 -7
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server.d.ts +1 -1
- package/lib/horizon/server.js +2 -2
- package/lib/index.d.ts +0 -3
- package/lib/minimal/config.d.ts +2 -6
- package/lib/minimal/contract/assembled_transaction.d.ts +16 -132
- package/lib/minimal/contract/assembled_transaction.js +14 -114
- package/lib/minimal/contract/errors.d.ts +26 -0
- package/lib/minimal/contract/errors.js +126 -0
- package/lib/minimal/contract/sent_transaction.d.ts +1 -1
- package/lib/minimal/contract/spec.d.ts +2 -2
- package/lib/minimal/contract/spec.js +40 -28
- package/lib/minimal/contract/types.d.ts +35 -9
- package/lib/minimal/contract/utils.d.ts +1 -1
- package/lib/minimal/contract/utils.js +18 -53
- package/lib/minimal/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/minimal/contract/wasm_spec_parser.js +15 -0
- package/lib/minimal/errors/network.d.ts +1 -1
- package/lib/minimal/federation/server.d.ts +7 -7
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server.d.ts +1 -1
- package/lib/minimal/horizon/server.js +2 -2
- package/lib/minimal/index.d.ts +0 -3
- package/lib/minimal/rpc/api.d.ts +27 -3
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/rpc/jsonrpc.d.ts +2 -1
- package/lib/minimal/rpc/jsonrpc.js +1 -1
- package/lib/minimal/rpc/parsers.js +8 -5
- package/lib/minimal/rpc/server.d.ts +46 -7
- package/lib/minimal/rpc/server.js +290 -211
- package/lib/minimal/rpc/utils.js +1 -1
- package/lib/minimal/webauth/challenge_transaction.d.ts +235 -0
- package/lib/minimal/webauth/challenge_transaction.js +307 -0
- package/lib/minimal/webauth/index.d.ts +1 -0
- package/lib/minimal/webauth/index.js +13 -1
- package/lib/minimal/webauth/utils.d.ts +28 -273
- package/lib/minimal/webauth/utils.js +12 -288
- package/lib/no-axios/config.d.ts +2 -6
- package/lib/no-axios/contract/assembled_transaction.d.ts +16 -132
- package/lib/no-axios/contract/assembled_transaction.js +14 -114
- package/lib/no-axios/contract/errors.d.ts +26 -0
- package/lib/no-axios/contract/errors.js +126 -0
- package/lib/no-axios/contract/sent_transaction.d.ts +1 -1
- package/lib/no-axios/contract/spec.d.ts +2 -2
- package/lib/no-axios/contract/spec.js +40 -28
- package/lib/no-axios/contract/types.d.ts +35 -9
- package/lib/no-axios/contract/utils.d.ts +1 -1
- package/lib/no-axios/contract/utils.js +18 -53
- package/lib/no-axios/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/no-axios/contract/wasm_spec_parser.js +15 -0
- package/lib/no-axios/errors/network.d.ts +1 -1
- package/lib/no-axios/federation/server.d.ts +7 -7
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server.d.ts +1 -1
- package/lib/no-axios/horizon/server.js +2 -2
- package/lib/no-axios/index.d.ts +0 -3
- package/lib/no-axios/rpc/api.d.ts +27 -3
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-axios/rpc/jsonrpc.js +1 -1
- package/lib/no-axios/rpc/parsers.js +8 -5
- package/lib/no-axios/rpc/server.d.ts +46 -7
- package/lib/no-axios/rpc/server.js +290 -211
- package/lib/no-axios/rpc/utils.js +1 -1
- package/lib/no-axios/webauth/challenge_transaction.d.ts +235 -0
- package/lib/no-axios/webauth/challenge_transaction.js +307 -0
- package/lib/no-axios/webauth/index.d.ts +1 -0
- package/lib/no-axios/webauth/index.js +13 -1
- package/lib/no-axios/webauth/utils.d.ts +28 -273
- package/lib/no-axios/webauth/utils.js +12 -288
- package/lib/no-eventsource/config.d.ts +2 -6
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +16 -132
- package/lib/no-eventsource/contract/assembled_transaction.js +14 -114
- package/lib/no-eventsource/contract/errors.d.ts +26 -0
- package/lib/no-eventsource/contract/errors.js +126 -0
- package/lib/no-eventsource/contract/sent_transaction.d.ts +1 -1
- package/lib/no-eventsource/contract/spec.d.ts +2 -2
- package/lib/no-eventsource/contract/spec.js +40 -28
- package/lib/no-eventsource/contract/types.d.ts +35 -9
- package/lib/no-eventsource/contract/utils.d.ts +1 -1
- package/lib/no-eventsource/contract/utils.js +18 -53
- package/lib/no-eventsource/contract/wasm_spec_parser.d.ts +7 -0
- package/lib/no-eventsource/contract/wasm_spec_parser.js +15 -0
- package/lib/no-eventsource/errors/network.d.ts +1 -1
- package/lib/no-eventsource/federation/server.d.ts +7 -7
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server.d.ts +1 -1
- package/lib/no-eventsource/horizon/server.js +2 -2
- package/lib/no-eventsource/index.d.ts +0 -3
- package/lib/no-eventsource/rpc/api.d.ts +27 -3
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/rpc/jsonrpc.d.ts +2 -1
- package/lib/no-eventsource/rpc/jsonrpc.js +1 -1
- package/lib/no-eventsource/rpc/parsers.js +8 -5
- package/lib/no-eventsource/rpc/server.d.ts +46 -7
- package/lib/no-eventsource/rpc/server.js +290 -211
- package/lib/no-eventsource/rpc/utils.js +1 -1
- package/lib/no-eventsource/webauth/challenge_transaction.d.ts +235 -0
- package/lib/no-eventsource/webauth/challenge_transaction.js +307 -0
- package/lib/no-eventsource/webauth/index.d.ts +1 -0
- package/lib/no-eventsource/webauth/index.js +13 -1
- package/lib/no-eventsource/webauth/utils.d.ts +28 -273
- package/lib/no-eventsource/webauth/utils.js +12 -288
- package/lib/rpc/api.d.ts +27 -3
- package/lib/rpc/axios.js +1 -1
- package/lib/rpc/jsonrpc.d.ts +2 -1
- package/lib/rpc/jsonrpc.js +1 -1
- package/lib/rpc/parsers.js +8 -5
- package/lib/rpc/server.d.ts +46 -7
- package/lib/rpc/server.js +290 -211
- package/lib/rpc/utils.js +1 -1
- package/lib/webauth/challenge_transaction.d.ts +235 -0
- package/lib/webauth/challenge_transaction.js +307 -0
- package/lib/webauth/index.d.ts +1 -0
- package/lib/webauth/index.js +13 -1
- package/lib/webauth/utils.d.ts +28 -273
- package/lib/webauth/utils.js +12 -288
- package/package.json +14 -14
- package/types/dom-monkeypatch.d.ts +1 -1
|
@@ -155,6 +155,7 @@ export declare class RpcServer {
|
|
|
155
155
|
* @see
|
|
156
156
|
* {@link https://developers.stellar.org/docs/data/rpc/api-reference/methods/getLedgerEntries | getLedgerEntries docs}
|
|
157
157
|
*
|
|
158
|
+
* @deprecated Use {@link getAssetBalance}, instead
|
|
158
159
|
* @example
|
|
159
160
|
* const accountId = "GBZC6Y2Y7Q3ZQ2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4QZJ2XZ3Z5YXZ6Z7Z2Y4";
|
|
160
161
|
* const asset = new Asset(
|
|
@@ -187,6 +188,36 @@ export declare class RpcServer {
|
|
|
187
188
|
* });
|
|
188
189
|
*/
|
|
189
190
|
getClaimableBalance(id: string): Promise<xdr.ClaimableBalanceEntry>;
|
|
191
|
+
/**
|
|
192
|
+
* Fetch the balance of an asset held by an account or contract.
|
|
193
|
+
*
|
|
194
|
+
* The `address` argument may be provided as a string (as a {@link StrKey}),
|
|
195
|
+
* {@link Address}, or {@link Contract}.
|
|
196
|
+
*
|
|
197
|
+
* @param {string|Address|Contract} address The account or contract whose
|
|
198
|
+
* balance should be fetched.
|
|
199
|
+
* @param {Asset} asset The asset whose balance you want to inspect.
|
|
200
|
+
* @param {string} [networkPassphrase] optionally, when requesting the
|
|
201
|
+
* balance of a contract, the network passphrase to which this token
|
|
202
|
+
* applies. If omitted and necessary, a request about network information
|
|
203
|
+
* will be made (see {@link getNetwork}), since contract IDs for assets are
|
|
204
|
+
* specific to a network. You can refer to {@link Networks} for a list of
|
|
205
|
+
* built-in passphrases, e.g., `Networks.TESTNET`.
|
|
206
|
+
* @returns {Promise<Api.BalanceResponse>} Resolves with balance entry details
|
|
207
|
+
* when available.
|
|
208
|
+
*
|
|
209
|
+
* @throws {Error} If the supplied `address` is not a valid account or
|
|
210
|
+
* contract strkey.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* const usdc = new Asset(
|
|
214
|
+
* "USDC",
|
|
215
|
+
* "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
|
|
216
|
+
* );
|
|
217
|
+
* const balance = await server.getAssetBalance("GD...", usdc);
|
|
218
|
+
* console.log(balance.balanceEntry?.amount);
|
|
219
|
+
*/
|
|
220
|
+
getAssetBalance(address: string | Address | Contract, asset: Asset, networkPassphrase?: string): Promise<Api.BalanceResponse>;
|
|
190
221
|
/**
|
|
191
222
|
* General node health check.
|
|
192
223
|
*
|
|
@@ -320,6 +351,7 @@ export declare class RpcServer {
|
|
|
320
351
|
* transaction completion and return a definitive state of success or failure.
|
|
321
352
|
*
|
|
322
353
|
* @param {string} hash the transaction you're polling for
|
|
354
|
+
* @param {[RpcServer.PollingOptions]} [opts] polling options
|
|
323
355
|
* @param {number} [opts.attempts] (optional) the number of attempts to make
|
|
324
356
|
* before returning the last-seen status. By default or on invalid inputs,
|
|
325
357
|
* try 5 times.
|
|
@@ -644,7 +676,7 @@ export declare class RpcServer {
|
|
|
644
676
|
* account, or the existing account if it's already funded with the
|
|
645
677
|
* populated sequence number (note that the account will not be "topped
|
|
646
678
|
* off" if it already exists)
|
|
647
|
-
* @throws If Friendbot is not configured on this network or request failure
|
|
679
|
+
* @throws {Error} If Friendbot is not configured on this network or request failure
|
|
648
680
|
*
|
|
649
681
|
* @see {@link https://developers.stellar.org/docs/learn/fundamentals/networks#friendbot | Friendbot docs}
|
|
650
682
|
* @see {@link module:Friendbot.Api.Response}
|
|
@@ -679,8 +711,8 @@ export declare class RpcServer {
|
|
|
679
711
|
*
|
|
680
712
|
* This is a convenience wrapper around {@link Server.getLedgerEntries}.
|
|
681
713
|
*
|
|
682
|
-
* @param {string} address the contract (string `C...`)
|
|
683
|
-
*
|
|
714
|
+
* @param {string} address the contract (string `C...`) whose balance of
|
|
715
|
+
* `sac` you want to know
|
|
684
716
|
* @param {Asset} sac the built-in SAC token (e.g. `USDC:GABC...`) that
|
|
685
717
|
* you are querying from the given `contract`.
|
|
686
718
|
* @param {string} [networkPassphrase] optionally, the network passphrase to
|
|
@@ -698,6 +730,7 @@ export declare class RpcServer {
|
|
|
698
730
|
* @see getLedgerEntries
|
|
699
731
|
* @see https://developers.stellar.org/docs/tokens/stellar-asset-contract
|
|
700
732
|
*
|
|
733
|
+
* @deprecated Use {@link getAssetBalance}, instead
|
|
701
734
|
* @example
|
|
702
735
|
* // assume `address` is some contract or account with an XLM balance
|
|
703
736
|
* // assume server is an instantiated `Server` instance.
|
|
@@ -733,7 +766,9 @@ export declare class RpcServer {
|
|
|
733
766
|
* // Fetch ledgers starting from a specific sequence number
|
|
734
767
|
* server.getLedgers({
|
|
735
768
|
* startLedger: 36233,
|
|
736
|
-
*
|
|
769
|
+
* pagination: {
|
|
770
|
+
* limit: 10
|
|
771
|
+
* }
|
|
737
772
|
* }).then((response) => {
|
|
738
773
|
* console.log("Ledgers:", response.ledgers);
|
|
739
774
|
* console.log("Latest Ledger:", response.latestLedger);
|
|
@@ -744,12 +779,16 @@ export declare class RpcServer {
|
|
|
744
779
|
* // Paginate through ledgers using cursor
|
|
745
780
|
* const firstPage = await server.getLedgers({
|
|
746
781
|
* startLedger: 36233,
|
|
747
|
-
*
|
|
782
|
+
* pagination: {
|
|
783
|
+
* limit: 5
|
|
784
|
+
* }
|
|
748
785
|
* });
|
|
749
786
|
*
|
|
750
787
|
* const nextPage = await server.getLedgers({
|
|
751
|
-
*
|
|
752
|
-
*
|
|
788
|
+
* pagination: {
|
|
789
|
+
* cursor: firstPage.cursor,
|
|
790
|
+
* limit: 5
|
|
791
|
+
* }
|
|
753
792
|
* });
|
|
754
793
|
*/
|
|
755
794
|
getLedgers(request: Api.GetLedgersRequest): Promise<Api.GetLedgersResponse>;
|