@xchainjs/xchain-thornode 0.3.3 → 0.3.4

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/lib/index.js CHANGED
@@ -2468,6 +2468,8 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2468
2468
  * @param {string} [toAsset] the target asset
2469
2469
  * @param {number} [amount] the source asset amount in 1e8 decimals
2470
2470
  * @param {string} [destination] the destination address, required to generate memo
2471
+ * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2472
+ * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2471
2473
  * @param {string} [fromAddress] the from address, required if the from asset is a synth
2472
2474
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2473
2475
  * @param {number} [affiliateBps] the affiliate fee in basis points
@@ -2475,7 +2477,7 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2475
2477
  * @param {*} [options] Override http request option.
2476
2478
  * @throws {RequiredError}
2477
2479
  */
2478
- quoteswap: (height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
2480
+ quoteswap: (height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
2479
2481
  const localVarPath = `/thorchain/quote/swap`;
2480
2482
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
2481
2483
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -2501,6 +2503,12 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2501
2503
  if (destination !== undefined) {
2502
2504
  localVarQueryParameter['destination'] = destination;
2503
2505
  }
2506
+ if (streamingInterval !== undefined) {
2507
+ localVarQueryParameter['streaming_interval'] = streamingInterval;
2508
+ }
2509
+ if (streamingQuantity !== undefined) {
2510
+ localVarQueryParameter['streaming_quantity'] = streamingQuantity;
2511
+ }
2504
2512
  if (fromAddress !== undefined) {
2505
2513
  localVarQueryParameter['from_address'] = fromAddress;
2506
2514
  }
@@ -2602,6 +2610,8 @@ const QuoteApiFp = function (configuration) {
2602
2610
  * @param {string} [toAsset] the target asset
2603
2611
  * @param {number} [amount] the source asset amount in 1e8 decimals
2604
2612
  * @param {string} [destination] the destination address, required to generate memo
2613
+ * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2614
+ * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2605
2615
  * @param {string} [fromAddress] the from address, required if the from asset is a synth
2606
2616
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2607
2617
  * @param {number} [affiliateBps] the affiliate fee in basis points
@@ -2609,9 +2619,9 @@ const QuoteApiFp = function (configuration) {
2609
2619
  * @param {*} [options] Override http request option.
2610
2620
  * @throws {RequiredError}
2611
2621
  */
2612
- quoteswap(height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2622
+ quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2613
2623
  return __awaiter(this, void 0, void 0, function* () {
2614
- const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteswap(height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options);
2624
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options);
2615
2625
  return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
2616
2626
  });
2617
2627
  },
@@ -2684,6 +2694,8 @@ const QuoteApiFactory = function (configuration, basePath, axios) {
2684
2694
  * @param {string} [toAsset] the target asset
2685
2695
  * @param {number} [amount] the source asset amount in 1e8 decimals
2686
2696
  * @param {string} [destination] the destination address, required to generate memo
2697
+ * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2698
+ * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2687
2699
  * @param {string} [fromAddress] the from address, required if the from asset is a synth
2688
2700
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2689
2701
  * @param {number} [affiliateBps] the affiliate fee in basis points
@@ -2691,8 +2703,8 @@ const QuoteApiFactory = function (configuration, basePath, axios) {
2691
2703
  * @param {*} [options] Override http request option.
2692
2704
  * @throws {RequiredError}
2693
2705
  */
2694
- quoteswap(height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2695
- return localVarFp.quoteswap(height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
2706
+ quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2707
+ return localVarFp.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
2696
2708
  },
2697
2709
  };
2698
2710
  };
@@ -2767,6 +2779,8 @@ class QuoteApi extends BaseAPI {
2767
2779
  * @param {string} [toAsset] the target asset
2768
2780
  * @param {number} [amount] the source asset amount in 1e8 decimals
2769
2781
  * @param {string} [destination] the destination address, required to generate memo
2782
+ * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2783
+ * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2770
2784
  * @param {string} [fromAddress] the from address, required if the from asset is a synth
2771
2785
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2772
2786
  * @param {number} [affiliateBps] the affiliate fee in basis points
@@ -2775,8 +2789,8 @@ class QuoteApi extends BaseAPI {
2775
2789
  * @throws {RequiredError}
2776
2790
  * @memberof QuoteApi
2777
2791
  */
2778
- quoteswap(height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2779
- return QuoteApiFp(this.configuration).quoteswap(height, fromAsset, toAsset, amount, destination, fromAddress, toleranceBps, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
2792
+ quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2793
+ return QuoteApiFp(this.configuration).quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
2780
2794
  }
2781
2795
  }
2782
2796
  /**
@@ -2952,6 +2966,165 @@ class SaversApi extends BaseAPI {
2952
2966
  return SaversApiFp(this.configuration).savers(asset, height, options).then((request) => request(this.axios, this.basePath));
2953
2967
  }
2954
2968
  }
2969
+ /**
2970
+ * StreamingSwapApi - axios parameter creator
2971
+ * @export
2972
+ */
2973
+ const StreamingSwapApiAxiosParamCreator = function (configuration) {
2974
+ return {
2975
+ /**
2976
+ * Returns the state of a streaming swap
2977
+ * @param {string} hash
2978
+ * @param {number} [height] optional block height, defaults to current tip
2979
+ * @param {*} [options] Override http request option.
2980
+ * @throws {RequiredError}
2981
+ */
2982
+ streamSwap: (hash, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
2983
+ // verify required parameter 'hash' is not null or undefined
2984
+ assertParamExists('streamSwap', 'hash', hash);
2985
+ const localVarPath = `/thorchain/swap/streaming/{hash}`
2986
+ .replace(`{${"hash"}}`, encodeURIComponent(String(hash)));
2987
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2988
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2989
+ let baseOptions;
2990
+ if (configuration) {
2991
+ baseOptions = configuration.baseOptions;
2992
+ }
2993
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2994
+ const localVarHeaderParameter = {};
2995
+ const localVarQueryParameter = {};
2996
+ if (height !== undefined) {
2997
+ localVarQueryParameter['height'] = height;
2998
+ }
2999
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3000
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3001
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3002
+ return {
3003
+ url: toPathString(localVarUrlObj),
3004
+ options: localVarRequestOptions,
3005
+ };
3006
+ }),
3007
+ /**
3008
+ * Returns the state of all streaming swaps
3009
+ * @param {number} [height] optional block height, defaults to current tip
3010
+ * @param {*} [options] Override http request option.
3011
+ * @throws {RequiredError}
3012
+ */
3013
+ streamSwaps: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
3014
+ const localVarPath = `/thorchain/swaps/streaming`;
3015
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3016
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3017
+ let baseOptions;
3018
+ if (configuration) {
3019
+ baseOptions = configuration.baseOptions;
3020
+ }
3021
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
3022
+ const localVarHeaderParameter = {};
3023
+ const localVarQueryParameter = {};
3024
+ if (height !== undefined) {
3025
+ localVarQueryParameter['height'] = height;
3026
+ }
3027
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3028
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3029
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3030
+ return {
3031
+ url: toPathString(localVarUrlObj),
3032
+ options: localVarRequestOptions,
3033
+ };
3034
+ }),
3035
+ };
3036
+ };
3037
+ /**
3038
+ * StreamingSwapApi - functional programming interface
3039
+ * @export
3040
+ */
3041
+ const StreamingSwapApiFp = function (configuration) {
3042
+ const localVarAxiosParamCreator = StreamingSwapApiAxiosParamCreator(configuration);
3043
+ return {
3044
+ /**
3045
+ * Returns the state of a streaming swap
3046
+ * @param {string} hash
3047
+ * @param {number} [height] optional block height, defaults to current tip
3048
+ * @param {*} [options] Override http request option.
3049
+ * @throws {RequiredError}
3050
+ */
3051
+ streamSwap(hash, height, options) {
3052
+ return __awaiter(this, void 0, void 0, function* () {
3053
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.streamSwap(hash, height, options);
3054
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
3055
+ });
3056
+ },
3057
+ /**
3058
+ * Returns the state of all streaming swaps
3059
+ * @param {number} [height] optional block height, defaults to current tip
3060
+ * @param {*} [options] Override http request option.
3061
+ * @throws {RequiredError}
3062
+ */
3063
+ streamSwaps(height, options) {
3064
+ return __awaiter(this, void 0, void 0, function* () {
3065
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.streamSwaps(height, options);
3066
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
3067
+ });
3068
+ },
3069
+ };
3070
+ };
3071
+ /**
3072
+ * StreamingSwapApi - factory interface
3073
+ * @export
3074
+ */
3075
+ const StreamingSwapApiFactory = function (configuration, basePath, axios) {
3076
+ const localVarFp = StreamingSwapApiFp(configuration);
3077
+ return {
3078
+ /**
3079
+ * Returns the state of a streaming swap
3080
+ * @param {string} hash
3081
+ * @param {number} [height] optional block height, defaults to current tip
3082
+ * @param {*} [options] Override http request option.
3083
+ * @throws {RequiredError}
3084
+ */
3085
+ streamSwap(hash, height, options) {
3086
+ return localVarFp.streamSwap(hash, height, options).then((request) => request(axios, basePath));
3087
+ },
3088
+ /**
3089
+ * Returns the state of all streaming swaps
3090
+ * @param {number} [height] optional block height, defaults to current tip
3091
+ * @param {*} [options] Override http request option.
3092
+ * @throws {RequiredError}
3093
+ */
3094
+ streamSwaps(height, options) {
3095
+ return localVarFp.streamSwaps(height, options).then((request) => request(axios, basePath));
3096
+ },
3097
+ };
3098
+ };
3099
+ /**
3100
+ * StreamingSwapApi - object-oriented interface
3101
+ * @export
3102
+ * @class StreamingSwapApi
3103
+ * @extends {BaseAPI}
3104
+ */
3105
+ class StreamingSwapApi extends BaseAPI {
3106
+ /**
3107
+ * Returns the state of a streaming swap
3108
+ * @param {string} hash
3109
+ * @param {number} [height] optional block height, defaults to current tip
3110
+ * @param {*} [options] Override http request option.
3111
+ * @throws {RequiredError}
3112
+ * @memberof StreamingSwapApi
3113
+ */
3114
+ streamSwap(hash, height, options) {
3115
+ return StreamingSwapApiFp(this.configuration).streamSwap(hash, height, options).then((request) => request(this.axios, this.basePath));
3116
+ }
3117
+ /**
3118
+ * Returns the state of all streaming swaps
3119
+ * @param {number} [height] optional block height, defaults to current tip
3120
+ * @param {*} [options] Override http request option.
3121
+ * @throws {RequiredError}
3122
+ * @memberof StreamingSwapApi
3123
+ */
3124
+ streamSwaps(height, options) {
3125
+ return StreamingSwapApiFp(this.configuration).streamSwaps(height, options).then((request) => request(this.axios, this.basePath));
3126
+ }
3127
+ }
2955
3128
  /**
2956
3129
  * TSSApi - axios parameter creator
2957
3130
  * @export
@@ -3984,7 +4157,7 @@ class VaultsApi extends BaseAPI {
3984
4157
  * Thornode API
3985
4158
  * Thornode REST API.
3986
4159
  *
3987
- * The version of the OpenAPI document: 1.113.1
4160
+ * The version of the OpenAPI document: 1.116.0
3988
4161
  * Contact: devs@thorchain.org
3989
4162
  *
3990
4163
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4070,6 +4243,10 @@ exports.SaversApi = SaversApi;
4070
4243
  exports.SaversApiAxiosParamCreator = SaversApiAxiosParamCreator;
4071
4244
  exports.SaversApiFactory = SaversApiFactory;
4072
4245
  exports.SaversApiFp = SaversApiFp;
4246
+ exports.StreamingSwapApi = StreamingSwapApi;
4247
+ exports.StreamingSwapApiAxiosParamCreator = StreamingSwapApiAxiosParamCreator;
4248
+ exports.StreamingSwapApiFactory = StreamingSwapApiFactory;
4249
+ exports.StreamingSwapApiFp = StreamingSwapApiFp;
4073
4250
  exports.THORNODE_API_9R_URL = THORNODE_API_9R_URL;
4074
4251
  exports.TSSApi = TSSApi;
4075
4252
  exports.TSSApiAxiosParamCreator = TSSApiAxiosParamCreator;