@chainstream-io/sdk 0.1.11 → 0.1.13

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/dist/index.cjs CHANGED
@@ -1678,11 +1678,11 @@ function CandleFromJSONTyped(json, ignoreDiscriminator) {
1678
1678
  };
1679
1679
  }
1680
1680
 
1681
- // src/openapi/models/ChainSymbol.ts
1682
- function ChainSymbolFromJSON(json) {
1683
- return ChainSymbolFromJSONTyped(json, false);
1681
+ // src/openapi/models/Chain.ts
1682
+ function ChainFromJSON(json) {
1683
+ return ChainFromJSONTyped(json, false);
1684
1684
  }
1685
- function ChainSymbolFromJSONTyped(json, ignoreDiscriminator) {
1685
+ function ChainFromJSONTyped(json, ignoreDiscriminator) {
1686
1686
  return json;
1687
1687
  }
1688
1688
 
@@ -1695,6 +1695,7 @@ function ClaimRedPacketInputToJSONTyped(value, ignoreDiscriminator = false) {
1695
1695
  return value;
1696
1696
  }
1697
1697
  return {
1698
+ "chain": value["chain"],
1698
1699
  "packetId": value["packetId"],
1699
1700
  "shareId": value["shareId"],
1700
1701
  "password": value["password"],
@@ -1711,6 +1712,7 @@ function CreateRedPacketInputToJSONTyped(value, ignoreDiscriminator = false) {
1711
1712
  return value;
1712
1713
  }
1713
1714
  return {
1715
+ "chain": value["chain"],
1714
1716
  "creator": value["creator"],
1715
1717
  "mint": value["mint"],
1716
1718
  "maxClaims": value["maxClaims"],
@@ -1826,6 +1828,36 @@ function DexPoolDTOFromJSONTyped(json, ignoreDiscriminator) {
1826
1828
  };
1827
1829
  }
1828
1830
 
1831
+ // src/openapi/models/EstimateGasLimitInput.ts
1832
+ function EstimateGasLimitInputToJSON(json) {
1833
+ return EstimateGasLimitInputToJSONTyped(json, false);
1834
+ }
1835
+ function EstimateGasLimitInputToJSONTyped(value, ignoreDiscriminator = false) {
1836
+ if (value == null) {
1837
+ return value;
1838
+ }
1839
+ return {
1840
+ "from": value["from"],
1841
+ "to": value["to"],
1842
+ "data": value["data"],
1843
+ "value": value["value"]
1844
+ };
1845
+ }
1846
+
1847
+ // src/openapi/models/EstimateGasLimitResponse.ts
1848
+ function EstimateGasLimitResponseFromJSON(json) {
1849
+ return EstimateGasLimitResponseFromJSONTyped(json, false);
1850
+ }
1851
+ function EstimateGasLimitResponseFromJSONTyped(json, ignoreDiscriminator) {
1852
+ if (json == null) {
1853
+ return json;
1854
+ }
1855
+ return {
1856
+ "gasLimit": json["gasLimit"],
1857
+ "chain": json["chain"]
1858
+ };
1859
+ }
1860
+
1829
1861
  // src/openapi/models/GainersAndLosersDTO.ts
1830
1862
  function GainersAndLosersDTOFromJSON(json) {
1831
1863
  return GainersAndLosersDTOFromJSONTyped(json, false);
@@ -1860,6 +1892,20 @@ function GainersAndLosersPageFromJSONTyped(json, ignoreDiscriminator) {
1860
1892
  };
1861
1893
  }
1862
1894
 
1895
+ // src/openapi/models/GasPriceResponse.ts
1896
+ function GasPriceResponseFromJSON(json) {
1897
+ return GasPriceResponseFromJSONTyped(json, false);
1898
+ }
1899
+ function GasPriceResponseFromJSONTyped(json, ignoreDiscriminator) {
1900
+ if (json == null) {
1901
+ return json;
1902
+ }
1903
+ return {
1904
+ "gasPrice": json["gasPrice"],
1905
+ "chain": json["chain"]
1906
+ };
1907
+ }
1908
+
1863
1909
  // src/openapi/models/JobDTO.ts
1864
1910
  function JobDTOFromJSON(json) {
1865
1911
  return JobDTOFromJSONTyped(json, false);
@@ -2033,7 +2079,7 @@ function RedPacketClaimDTOFromJSONTyped(json, ignoreDiscriminator) {
2033
2079
  }
2034
2080
  return {
2035
2081
  "packetId": json["packetId"],
2036
- "chain": ChainSymbolFromJSON(json["chain"]),
2082
+ "chain": ChainFromJSON(json["chain"]),
2037
2083
  "claimer": json["claimer"],
2038
2084
  "mint": json["mint"],
2039
2085
  "amount": json["amount"],
@@ -2069,7 +2115,7 @@ function RedPacketDTOFromJSONTyped(json, ignoreDiscriminator) {
2069
2115
  return json;
2070
2116
  }
2071
2117
  return {
2072
- "chain": ChainSymbolFromJSON(json["chain"]),
2118
+ "chain": ChainFromJSON(json["chain"]),
2073
2119
  "id": json["id"],
2074
2120
  "shareId": json["shareId"],
2075
2121
  "txHash": json["txHash"],
@@ -2538,7 +2584,7 @@ function TokenFromJSONTyped(json, ignoreDiscriminator) {
2538
2584
  "description": json["description"] == null ? void 0 : json["description"],
2539
2585
  "market": json["market"] == null ? void 0 : json["market"],
2540
2586
  "extension": json["extension"] == null ? void 0 : json["extension"],
2541
- "stats": TokenStatFromJSON(json["stats"]),
2587
+ "stats": json["stats"] == null ? void 0 : TokenStatFromJSON(json["stats"]),
2542
2588
  "liquidity": json["liquidity"] == null ? void 0 : json["liquidity"].map(DexPoolDTOFromJSON),
2543
2589
  "marketData": TokenMarketDataFromJSON(json["marketData"])
2544
2590
  };
@@ -5647,6 +5693,9 @@ var TradeApi = class extends BaseAPI {
5647
5693
  if (requestParameters["afterBlockHeight"] != null) {
5648
5694
  queryParameters["afterBlockHeight"] = requestParameters["afterBlockHeight"];
5649
5695
  }
5696
+ if (requestParameters["transactionsSignature"] != null) {
5697
+ queryParameters["transactionsSignature"] = requestParameters["transactionsSignature"];
5698
+ }
5650
5699
  if (requestParameters["type"] != null) {
5651
5700
  queryParameters["type"] = requestParameters["type"];
5652
5701
  }
@@ -5839,6 +5888,9 @@ var TradeApi = class extends BaseAPI {
5839
5888
  if (requestParameters["afterBlockHeight"] != null) {
5840
5889
  queryParameters["afterBlockHeight"] = requestParameters["afterBlockHeight"];
5841
5890
  }
5891
+ if (requestParameters["transactionsSignature"] != null) {
5892
+ queryParameters["transactionsSignature"] = requestParameters["transactionsSignature"];
5893
+ }
5842
5894
  if (requestParameters["type"] != null) {
5843
5895
  queryParameters["type"] = requestParameters["type"];
5844
5896
  }
@@ -5872,6 +5924,90 @@ var TradeApi = class extends BaseAPI {
5872
5924
 
5873
5925
  // src/openapi/apis/TransactionApi.ts
5874
5926
  var TransactionApi = class extends BaseAPI {
5927
+ /**
5928
+ * CONTROLLER.TRANSACTION.ESTIMATE_GAS_LIMIT.DESCRIPTION
5929
+ * CONTROLLER.TRANSACTION.ESTIMATE_GAS_LIMIT.SUMMARY
5930
+ */
5931
+ async estimateGasLimitRaw(requestParameters, initOverrides) {
5932
+ if (requestParameters["chain"] == null) {
5933
+ throw new RequiredError(
5934
+ "chain",
5935
+ 'Required parameter "chain" was null or undefined when calling estimateGasLimit().'
5936
+ );
5937
+ }
5938
+ if (requestParameters["estimateGasLimitInput"] == null) {
5939
+ throw new RequiredError(
5940
+ "estimateGasLimitInput",
5941
+ 'Required parameter "estimateGasLimitInput" was null or undefined when calling estimateGasLimit().'
5942
+ );
5943
+ }
5944
+ const queryParameters = {};
5945
+ const headerParameters = {};
5946
+ headerParameters["Content-Type"] = "application/json";
5947
+ if (this.configuration && this.configuration.accessToken) {
5948
+ const token = this.configuration.accessToken;
5949
+ const tokenString = await token("bearer", []);
5950
+ if (tokenString) {
5951
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5952
+ }
5953
+ }
5954
+ let urlPath = `/v1/transaction/{chain}/estimate-gas-limit`;
5955
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters["chain"])));
5956
+ const response = await this.request({
5957
+ path: urlPath,
5958
+ method: "POST",
5959
+ headers: headerParameters,
5960
+ query: queryParameters,
5961
+ body: EstimateGasLimitInputToJSON(requestParameters["estimateGasLimitInput"])
5962
+ }, initOverrides);
5963
+ return new JSONApiResponse(response, (jsonValue) => EstimateGasLimitResponseFromJSON(jsonValue));
5964
+ }
5965
+ /**
5966
+ * CONTROLLER.TRANSACTION.ESTIMATE_GAS_LIMIT.DESCRIPTION
5967
+ * CONTROLLER.TRANSACTION.ESTIMATE_GAS_LIMIT.SUMMARY
5968
+ */
5969
+ async estimateGasLimit(requestParameters, initOverrides) {
5970
+ const response = await this.estimateGasLimitRaw(requestParameters, initOverrides);
5971
+ return await response.value();
5972
+ }
5973
+ /**
5974
+ * CONTROLLER.TRANSACTION.GET_GAS_PRICE.DESCRIPTION
5975
+ * CONTROLLER.TRANSACTION.GET_GAS_PRICE.SUMMARY
5976
+ */
5977
+ async getGasPriceRaw(requestParameters, initOverrides) {
5978
+ if (requestParameters["chain"] == null) {
5979
+ throw new RequiredError(
5980
+ "chain",
5981
+ 'Required parameter "chain" was null or undefined when calling getGasPrice().'
5982
+ );
5983
+ }
5984
+ const queryParameters = {};
5985
+ const headerParameters = {};
5986
+ if (this.configuration && this.configuration.accessToken) {
5987
+ const token = this.configuration.accessToken;
5988
+ const tokenString = await token("bearer", []);
5989
+ if (tokenString) {
5990
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
5991
+ }
5992
+ }
5993
+ let urlPath = `/v1/transaction/{chain}/gas-price`;
5994
+ urlPath = urlPath.replace(`{${"chain"}}`, encodeURIComponent(String(requestParameters["chain"])));
5995
+ const response = await this.request({
5996
+ path: urlPath,
5997
+ method: "GET",
5998
+ headers: headerParameters,
5999
+ query: queryParameters
6000
+ }, initOverrides);
6001
+ return new JSONApiResponse(response, (jsonValue) => GasPriceResponseFromJSON(jsonValue));
6002
+ }
6003
+ /**
6004
+ * CONTROLLER.TRANSACTION.GET_GAS_PRICE.DESCRIPTION
6005
+ * CONTROLLER.TRANSACTION.GET_GAS_PRICE.SUMMARY
6006
+ */
6007
+ async getGasPrice(requestParameters, initOverrides) {
6008
+ const response = await this.getGasPriceRaw(requestParameters, initOverrides);
6009
+ return await response.value();
6010
+ }
5875
6011
  /**
5876
6012
  * CONTROLLER.TRANSACTION.SEND.DESCRIPTION
5877
6013
  * CONTROLLER.TRANSACTION.SEND.SUMMARY