@stellar/stellar-sdk 11.0.0 → 11.1.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 +19 -0
- package/README.md +21 -33
- package/dist/stellar-sdk.js +757 -255
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/config.js +2 -2
- package/lib/contract_spec.d.ts +22 -1
- package/lib/contract_spec.js +684 -187
- package/lib/errors.js +2 -2
- package/lib/federation/server.js +2 -2
- package/lib/horizon/account_call_builder.js +2 -2
- package/lib/horizon/account_response.js +2 -2
- package/lib/horizon/assets_call_builder.js +2 -2
- package/lib/horizon/call_builder.js +2 -2
- package/lib/horizon/claimable_balances_call_builder.js +2 -2
- package/lib/horizon/effect_call_builder.js +2 -2
- package/lib/horizon/friendbot_builder.js +2 -2
- package/lib/horizon/ledger_call_builder.js +2 -2
- package/lib/horizon/liquidity_pool_call_builder.js +2 -2
- package/lib/horizon/offer_call_builder.js +2 -2
- package/lib/horizon/operation_call_builder.js +2 -2
- package/lib/horizon/orderbook_call_builder.js +2 -2
- package/lib/horizon/path_call_builder.js +2 -2
- package/lib/horizon/payment_call_builder.js +2 -2
- package/lib/horizon/server.js +2 -2
- package/lib/horizon/strict_receive_path_call_builder.js +2 -2
- package/lib/horizon/strict_send_path_call_builder.js +2 -2
- package/lib/horizon/trade_aggregation_call_builder.js +2 -2
- package/lib/horizon/trades_call_builder.js +2 -2
- package/lib/horizon/transaction_call_builder.js +2 -2
- package/lib/soroban/parsers.js +2 -2
- package/lib/soroban/server.d.ts +7 -3
- package/lib/soroban/server.js +19 -13
- package/lib/stellartoml/index.js +2 -2
- package/lib/utils.js +2 -2
- package/lib/webauth/errors.js +2 -2
- package/package.json +11 -9
package/lib/config.js
CHANGED
|
@@ -8,8 +8,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
9
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
10
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
13
|
var defaultConfig = {
|
|
14
14
|
allowHttp: false,
|
|
15
15
|
timeout: 0
|
package/lib/contract_spec.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { xdr } from ".";
|
|
2
3
|
export interface Union<T> {
|
|
3
4
|
tag: string;
|
|
4
5
|
values?: T;
|
|
@@ -8,6 +9,7 @@ export interface Union<T> {
|
|
|
8
9
|
* This allows the class to be used to convert between native and raw `xdr.ScVal`s.
|
|
9
10
|
*
|
|
10
11
|
* @example
|
|
12
|
+
* ```js
|
|
11
13
|
* const specEntries = [...]; // XDR spec entries of a smart contract
|
|
12
14
|
* const contractSpec = new ContractSpec(specEntries);
|
|
13
15
|
*
|
|
@@ -25,6 +27,7 @@ export interface Union<T> {
|
|
|
25
27
|
* const result = contractSpec.funcResToNative('funcName', resultScv);
|
|
26
28
|
*
|
|
27
29
|
* console.log(result); // {success: true}
|
|
30
|
+
* ```
|
|
28
31
|
*/
|
|
29
32
|
export declare class ContractSpec {
|
|
30
33
|
entries: xdr.ScSpecEntry[];
|
|
@@ -36,6 +39,13 @@ export declare class ContractSpec {
|
|
|
36
39
|
* @throws {Error} if entries is invalid
|
|
37
40
|
*/
|
|
38
41
|
constructor(entries: xdr.ScSpecEntry[] | string[]);
|
|
42
|
+
/**
|
|
43
|
+
* Gets the XDR functions from the spec.
|
|
44
|
+
*
|
|
45
|
+
* @returns {xdr.ScSpecFunctionV0[]} all contract functions
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
funcs(): xdr.ScSpecFunctionV0[];
|
|
39
49
|
/**
|
|
40
50
|
* Gets the XDR function spec for the given function name.
|
|
41
51
|
*
|
|
@@ -127,4 +137,15 @@ export declare class ContractSpec {
|
|
|
127
137
|
private unionToNative;
|
|
128
138
|
private structToNative;
|
|
129
139
|
private enumToNative;
|
|
140
|
+
/**
|
|
141
|
+
* Converts the contract spec to a JSON schema.
|
|
142
|
+
*
|
|
143
|
+
* If `funcName` is provided, the schema will be a reference to the function schema.
|
|
144
|
+
*
|
|
145
|
+
* @param {string} [funcName] the name of the function to convert
|
|
146
|
+
* @returns {JSONSchema7} the converted JSON schema
|
|
147
|
+
*
|
|
148
|
+
* @throws {Error} if the contract spec is invalid
|
|
149
|
+
*/
|
|
150
|
+
jsonSchema(funcName?: string): JSONSchema7;
|
|
130
151
|
}
|