@meshtrade/api-old 1.30.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.
Files changed (205) hide show
  1. package/README.md +117 -0
  2. package/dist/buf/validate/validate_pb.js +17134 -0
  3. package/dist/meshtrade/common/config.d.ts +7 -0
  4. package/dist/meshtrade/common/config.js +9 -0
  5. package/dist/meshtrade/common/groupHeaderInterceptor.d.ts +64 -0
  6. package/dist/meshtrade/common/groupHeaderInterceptor.js +76 -0
  7. package/dist/meshtrade/common/grpc_web.d.ts +18 -0
  8. package/dist/meshtrade/common/grpc_web.js +34 -0
  9. package/dist/meshtrade/common/validation.d.ts +62 -0
  10. package/dist/meshtrade/common/validation.js +77 -0
  11. package/dist/meshtrade/compliance/client/v1/client_pb.d.ts +91 -0
  12. package/dist/meshtrade/compliance/client/v1/client_pb.js +645 -0
  13. package/dist/meshtrade/compliance/client/v1/company_pb.d.ts +178 -0
  14. package/dist/meshtrade/compliance/client/v1/company_pb.js +1322 -0
  15. package/dist/meshtrade/compliance/client/v1/company_representative_pb.d.ts +56 -0
  16. package/dist/meshtrade/compliance/client/v1/company_representative_pb.js +422 -0
  17. package/dist/meshtrade/compliance/client/v1/company_representative_role_pb.d.ts +15 -0
  18. package/dist/meshtrade/compliance/client/v1/company_representative_role_pb.js +40 -0
  19. package/dist/meshtrade/compliance/client/v1/fund_pb.d.ts +42 -0
  20. package/dist/meshtrade/compliance/client/v1/fund_pb.js +321 -0
  21. package/dist/meshtrade/compliance/client/v1/identification_document_type_pb.d.ts +11 -0
  22. package/dist/meshtrade/compliance/client/v1/identification_document_type_pb.js +36 -0
  23. package/dist/meshtrade/compliance/client/v1/index.d.ts +18 -0
  24. package/dist/meshtrade/compliance/client/v1/index.js +61 -0
  25. package/dist/meshtrade/compliance/client/v1/industry_classification_pb.d.ts +50 -0
  26. package/dist/meshtrade/compliance/client/v1/industry_classification_pb.js +386 -0
  27. package/dist/meshtrade/compliance/client/v1/natural_person_connection_type_pb.d.ts +22 -0
  28. package/dist/meshtrade/compliance/client/v1/natural_person_connection_type_pb.js +47 -0
  29. package/dist/meshtrade/compliance/client/v1/natural_person_pb.d.ts +94 -0
  30. package/dist/meshtrade/compliance/client/v1/natural_person_pb.js +729 -0
  31. package/dist/meshtrade/compliance/client/v1/pep_status_pb.d.ts +10 -0
  32. package/dist/meshtrade/compliance/client/v1/pep_status_pb.js +35 -0
  33. package/dist/meshtrade/compliance/client/v1/service_grpc_web_client_meshts.d.ts +47 -0
  34. package/dist/meshtrade/compliance/client/v1/service_grpc_web_client_meshts.js +78 -0
  35. package/dist/meshtrade/compliance/client/v1/service_grpc_web_pb.d.ts +56 -0
  36. package/dist/meshtrade/compliance/client/v1/service_grpc_web_pb.js +270 -0
  37. package/dist/meshtrade/compliance/client/v1/service_pb.d.ts +79 -0
  38. package/dist/meshtrade/compliance/client/v1/service_pb.js +660 -0
  39. package/dist/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb.d.ts +29 -0
  40. package/dist/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb.js +54 -0
  41. package/dist/meshtrade/compliance/client/v1/tax_residency_pb.d.ts +27 -0
  42. package/dist/meshtrade/compliance/client/v1/tax_residency_pb.js +208 -0
  43. package/dist/meshtrade/compliance/client/v1/trust_pb.d.ts +42 -0
  44. package/dist/meshtrade/compliance/client/v1/trust_pb.js +321 -0
  45. package/dist/meshtrade/compliance/client/v1/verification_status_pb.d.ts +11 -0
  46. package/dist/meshtrade/compliance/client/v1/verification_status_pb.js +36 -0
  47. package/dist/meshtrade/iam/api_user/v1/api_credentials_pb.d.ts +27 -0
  48. package/dist/meshtrade/iam/api_user/v1/api_credentials_pb.js +208 -0
  49. package/dist/meshtrade/iam/api_user/v1/api_user_pb.d.ts +57 -0
  50. package/dist/meshtrade/iam/api_user/v1/api_user_pb.js +376 -0
  51. package/dist/meshtrade/iam/api_user/v1/index.d.ts +5 -0
  52. package/dist/meshtrade/iam/api_user/v1/index.js +46 -0
  53. package/dist/meshtrade/iam/api_user/v1/service_grpc_web_client_meshts.d.ts +83 -0
  54. package/dist/meshtrade/iam/api_user/v1/service_grpc_web_client_meshts.js +126 -0
  55. package/dist/meshtrade/iam/api_user/v1/service_grpc_web_pb.d.ts +128 -0
  56. package/dist/meshtrade/iam/api_user/v1/service_grpc_web_pb.js +636 -0
  57. package/dist/meshtrade/iam/api_user/v1/service_pb.d.ts +219 -0
  58. package/dist/meshtrade/iam/api_user/v1/service_pb.js +1866 -0
  59. package/dist/meshtrade/iam/group/v1/group_pb.d.ts +35 -0
  60. package/dist/meshtrade/iam/group/v1/group_pb.js +268 -0
  61. package/dist/meshtrade/iam/group/v1/index.d.ts +4 -0
  62. package/dist/meshtrade/iam/group/v1/index.js +45 -0
  63. package/dist/meshtrade/iam/group/v1/service_grpc_web_client_meshts.d.ts +59 -0
  64. package/dist/meshtrade/iam/group/v1/service_grpc_web_client_meshts.js +94 -0
  65. package/dist/meshtrade/iam/group/v1/service_grpc_web_pb.d.ts +80 -0
  66. package/dist/meshtrade/iam/group/v1/service_grpc_web_pb.js +394 -0
  67. package/dist/meshtrade/iam/group/v1/service_pb.d.ts +200 -0
  68. package/dist/meshtrade/iam/group/v1/service_pb.js +1664 -0
  69. package/dist/meshtrade/iam/role/v1/index.d.ts +2 -0
  70. package/dist/meshtrade/iam/role/v1/index.js +43 -0
  71. package/dist/meshtrade/iam/role/v1/role.d.ts +71 -0
  72. package/dist/meshtrade/iam/role/v1/role.js +192 -0
  73. package/dist/meshtrade/iam/role/v1/role_pb.d.ts +41 -0
  74. package/dist/meshtrade/iam/role/v1/role_pb.js +66 -0
  75. package/dist/meshtrade/iam/user/v1/index.d.ts +4 -0
  76. package/dist/meshtrade/iam/user/v1/index.js +45 -0
  77. package/dist/meshtrade/iam/user/v1/service_grpc_web_client_meshts.d.ts +77 -0
  78. package/dist/meshtrade/iam/user/v1/service_grpc_web_client_meshts.js +118 -0
  79. package/dist/meshtrade/iam/user/v1/service_grpc_web_pb.d.ts +116 -0
  80. package/dist/meshtrade/iam/user/v1/service_grpc_web_pb.js +577 -0
  81. package/dist/meshtrade/iam/user/v1/service_pb.d.ts +262 -0
  82. package/dist/meshtrade/iam/user/v1/service_pb.js +2202 -0
  83. package/dist/meshtrade/iam/user/v1/user_pb.d.ts +37 -0
  84. package/dist/meshtrade/iam/user/v1/user_pb.js +294 -0
  85. package/dist/meshtrade/ledger/transaction/v1/index.d.ts +6 -0
  86. package/dist/meshtrade/ledger/transaction/v1/index.js +47 -0
  87. package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_client_meshts.d.ts +56 -0
  88. package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_client_meshts.js +96 -0
  89. package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_pb.d.ts +41 -0
  90. package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_pb.js +204 -0
  91. package/dist/meshtrade/ledger/transaction/v1/service_pb.d.ts +79 -0
  92. package/dist/meshtrade/ledger/transaction/v1/service_pb.js +638 -0
  93. package/dist/meshtrade/ledger/transaction/v1/transaction_action_pb.d.ts +13 -0
  94. package/dist/meshtrade/ledger/transaction/v1/transaction_action_pb.js +38 -0
  95. package/dist/meshtrade/ledger/transaction/v1/transaction_state.d.ts +14 -0
  96. package/dist/meshtrade/ledger/transaction/v1/transaction_state.js +64 -0
  97. package/dist/meshtrade/ledger/transaction/v1/transaction_state_pb.d.ts +14 -0
  98. package/dist/meshtrade/ledger/transaction/v1/transaction_state_pb.js +39 -0
  99. package/dist/meshtrade/market_data/price/v1/index.d.ts +4 -0
  100. package/dist/meshtrade/market_data/price/v1/index.js +45 -0
  101. package/dist/meshtrade/market_data/price/v1/price_pb.d.ts +45 -0
  102. package/dist/meshtrade/market_data/price/v1/price_pb.js +356 -0
  103. package/dist/meshtrade/market_data/price/v1/service_grpc_web_client_meshts.d.ts +35 -0
  104. package/dist/meshtrade/market_data/price/v1/service_grpc_web_client_meshts.js +62 -0
  105. package/dist/meshtrade/market_data/price/v1/service_grpc_web_pb.d.ts +32 -0
  106. package/dist/meshtrade/market_data/price/v1/service_grpc_web_pb.js +150 -0
  107. package/dist/meshtrade/market_data/price/v1/service_pb.d.ts +34 -0
  108. package/dist/meshtrade/market_data/price/v1/service_pb.js +256 -0
  109. package/dist/meshtrade/option/method_options/v1/index.d.ts +1 -0
  110. package/dist/meshtrade/option/method_options/v1/index.js +42 -0
  111. package/dist/meshtrade/option/method_options/v1/method_options_pb.d.ts +44 -0
  112. package/dist/meshtrade/option/method_options/v1/method_options_pb.js +314 -0
  113. package/dist/meshtrade/reporting/account_report/v1/account_report_pb.d.ts +112 -0
  114. package/dist/meshtrade/reporting/account_report/v1/account_report_pb.js +897 -0
  115. package/dist/meshtrade/reporting/account_report/v1/disclaimer_pb.d.ts +26 -0
  116. package/dist/meshtrade/reporting/account_report/v1/disclaimer_pb.js +206 -0
  117. package/dist/meshtrade/reporting/account_report/v1/fee_entry_pb.d.ts +50 -0
  118. package/dist/meshtrade/reporting/account_report/v1/fee_entry_pb.js +393 -0
  119. package/dist/meshtrade/reporting/account_report/v1/income_entry_pb.d.ts +66 -0
  120. package/dist/meshtrade/reporting/account_report/v1/income_entry_pb.js +460 -0
  121. package/dist/meshtrade/reporting/account_report/v1/index.d.ts +8 -0
  122. package/dist/meshtrade/reporting/account_report/v1/index.js +49 -0
  123. package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_client_meshts.d.ts +41 -0
  124. package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_client_meshts.js +70 -0
  125. package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_pb.d.ts +44 -0
  126. package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_pb.js +213 -0
  127. package/dist/meshtrade/reporting/account_report/v1/service_pb.d.ts +99 -0
  128. package/dist/meshtrade/reporting/account_report/v1/service_pb.js +796 -0
  129. package/dist/meshtrade/reporting/account_report/v1/trading_statement_entry_pb.d.ts +62 -0
  130. package/dist/meshtrade/reporting/account_report/v1/trading_statement_entry_pb.js +495 -0
  131. package/dist/meshtrade/studio/instrument/v1/index.d.ts +3 -0
  132. package/dist/meshtrade/studio/instrument/v1/index.js +44 -0
  133. package/dist/meshtrade/studio/instrument/v1/instrument_pb.d.ts +38 -0
  134. package/dist/meshtrade/studio/instrument/v1/instrument_pb.js +291 -0
  135. package/dist/meshtrade/studio/instrument/v1/instrument_type_pb.d.ts +34 -0
  136. package/dist/meshtrade/studio/instrument/v1/instrument_type_pb.js +59 -0
  137. package/dist/meshtrade/studio/instrument/v1/unit_pb.d.ts +25 -0
  138. package/dist/meshtrade/studio/instrument/v1/unit_pb.js +50 -0
  139. package/dist/meshtrade/trading/limit_order/v1/index.d.ts +4 -0
  140. package/dist/meshtrade/trading/limit_order/v1/index.js +45 -0
  141. package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.d.ts +83 -0
  142. package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.js +559 -0
  143. package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_client_meshts.d.ts +87 -0
  144. package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_client_meshts.js +136 -0
  145. package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_pb.d.ts +102 -0
  146. package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_pb.js +509 -0
  147. package/dist/meshtrade/trading/limit_order/v1/service_pb.d.ts +203 -0
  148. package/dist/meshtrade/trading/limit_order/v1/service_pb.js +1692 -0
  149. package/dist/meshtrade/trading/market_order/v1/index.d.ts +4 -0
  150. package/dist/meshtrade/trading/market_order/v1/index.js +45 -0
  151. package/dist/meshtrade/trading/market_order/v1/market_order_pb.d.ts +22 -0
  152. package/dist/meshtrade/trading/market_order/v1/market_order_pb.js +176 -0
  153. package/dist/meshtrade/trading/market_order/v1/service_grpc_web_client_meshts.d.ts +35 -0
  154. package/dist/meshtrade/trading/market_order/v1/service_grpc_web_client_meshts.js +62 -0
  155. package/dist/meshtrade/trading/market_order/v1/service_grpc_web_pb.d.ts +32 -0
  156. package/dist/meshtrade/trading/market_order/v1/service_grpc_web_pb.js +146 -0
  157. package/dist/meshtrade/trading/market_order/v1/service_pb.d.ts +24 -0
  158. package/dist/meshtrade/trading/market_order/v1/service_pb.js +180 -0
  159. package/dist/meshtrade/type/v1/address_pb.d.ts +44 -0
  160. package/dist/meshtrade/type/v1/address_pb.js +352 -0
  161. package/dist/meshtrade/type/v1/amount.d.ts +13 -0
  162. package/dist/meshtrade/type/v1/amount.js +66 -0
  163. package/dist/meshtrade/type/v1/amountWrapper.d.ts +74 -0
  164. package/dist/meshtrade/type/v1/amountWrapper.js +98 -0
  165. package/dist/meshtrade/type/v1/amount_pb.d.ts +32 -0
  166. package/dist/meshtrade/type/v1/amount_pb.js +252 -0
  167. package/dist/meshtrade/type/v1/contact_details_pb.d.ts +54 -0
  168. package/dist/meshtrade/type/v1/contact_details_pb.js +416 -0
  169. package/dist/meshtrade/type/v1/date.d.ts +49 -0
  170. package/dist/meshtrade/type/v1/date.js +136 -0
  171. package/dist/meshtrade/type/v1/date_pb.d.ts +30 -0
  172. package/dist/meshtrade/type/v1/date_pb.js +236 -0
  173. package/dist/meshtrade/type/v1/decimalConversions.d.ts +24 -0
  174. package/dist/meshtrade/type/v1/decimalConversions.js +40 -0
  175. package/dist/meshtrade/type/v1/decimal_pb.d.ts +22 -0
  176. package/dist/meshtrade/type/v1/decimal_pb.js +176 -0
  177. package/dist/meshtrade/type/v1/index.d.ts +15 -0
  178. package/dist/meshtrade/type/v1/index.js +56 -0
  179. package/dist/meshtrade/type/v1/ledger.d.ts +27 -0
  180. package/dist/meshtrade/type/v1/ledger.js +115 -0
  181. package/dist/meshtrade/type/v1/ledger_pb.d.ts +14 -0
  182. package/dist/meshtrade/type/v1/ledger_pb.js +39 -0
  183. package/dist/meshtrade/type/v1/sorting_pb.d.ts +9 -0
  184. package/dist/meshtrade/type/v1/sorting_pb.js +34 -0
  185. package/dist/meshtrade/type/v1/time_of_day.d.ts +74 -0
  186. package/dist/meshtrade/type/v1/time_of_day.js +205 -0
  187. package/dist/meshtrade/type/v1/time_of_day_pb.d.ts +34 -0
  188. package/dist/meshtrade/type/v1/time_of_day_pb.js +266 -0
  189. package/dist/meshtrade/type/v1/token.d.ts +4 -0
  190. package/dist/meshtrade/type/v1/token.js +24 -0
  191. package/dist/meshtrade/type/v1/tokenWrapper.d.ts +49 -0
  192. package/dist/meshtrade/type/v1/tokenWrapper.js +76 -0
  193. package/dist/meshtrade/type/v1/token_pb.d.ts +31 -0
  194. package/dist/meshtrade/type/v1/token_pb.js +238 -0
  195. package/dist/meshtrade/wallet/account/v1/account_pb.d.ts +149 -0
  196. package/dist/meshtrade/wallet/account/v1/account_pb.js +1160 -0
  197. package/dist/meshtrade/wallet/account/v1/index.d.ts +4 -0
  198. package/dist/meshtrade/wallet/account/v1/index.js +45 -0
  199. package/dist/meshtrade/wallet/account/v1/service_grpc_web_client_meshts.d.ts +83 -0
  200. package/dist/meshtrade/wallet/account/v1/service_grpc_web_client_meshts.js +126 -0
  201. package/dist/meshtrade/wallet/account/v1/service_grpc_web_pb.d.ts +128 -0
  202. package/dist/meshtrade/wallet/account/v1/service_grpc_web_pb.js +638 -0
  203. package/dist/meshtrade/wallet/account/v1/service_pb.d.ts +350 -0
  204. package/dist/meshtrade/wallet/account/v1/service_pb.js +2930 -0
  205. package/package.json +171 -0
@@ -0,0 +1,14 @@
1
+ import { TransactionState } from "./transaction_state_pb";
2
+ export declare const allTransactionStates: TransactionState[];
3
+ /**
4
+ * Converts a TransactionState enum instance to a custom string representation.
5
+ * @param {TransactionState} transactionState - The transactionState to convert.
6
+ * @returns {string} The custom string representation of the transactionState.
7
+ */
8
+ export declare function transactionStateToString(transactionState: TransactionState): string;
9
+ /**
10
+ * Converts a custom string representation to a TransactionState enum instance.
11
+ * @param {string} transactionStateStr - The custom string representation of the transactionState.
12
+ * @returns {TransactionState} The corresponding TransactionState enum instance.
13
+ */
14
+ export declare function stringToTransactionState(transactionStateStr: string): TransactionState;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allTransactionStates = void 0;
4
+ exports.transactionStateToString = transactionStateToString;
5
+ exports.stringToTransactionState = stringToTransactionState;
6
+ const transaction_state_pb_1 = require("./transaction_state_pb");
7
+ // Get all transactionStates as enum values
8
+ exports.allTransactionStates = Object.values(transaction_state_pb_1.TransactionState).filter((value) => typeof value === "number");
9
+ // Define explicit mappings between TransactionState enums and custom string representations
10
+ const networkToStringMapping = {
11
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_UNSPECIFIED]: "-",
12
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_DRAFT]: "Draft",
13
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_SIGNING_IN_PROGRESS]: "Signing in Progress",
14
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_PENDING]: "Pending",
15
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_SUBMISSION_IN_PROGRESS]: "Submission in Progress",
16
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_FAILED]: "Failed",
17
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_INDETERMINATE]: "Indeterminate",
18
+ [transaction_state_pb_1.TransactionState.TRANSACTION_STATE_SUCCESSFUL]: "Successful",
19
+ };
20
+ // Reverse mapping from string to TransactionState enum
21
+ const stringToTransactionStateMapping = {};
22
+ for (const [key, value] of Object.entries(networkToStringMapping)) {
23
+ stringToTransactionStateMapping[value] = Number(key);
24
+ }
25
+ class UnsupportedTransactionStateError extends Error {
26
+ constructor(transactionState) {
27
+ const message = `Unsupported TransactionState: ${transactionState}`;
28
+ super(message);
29
+ this.transactionState = transactionState;
30
+ }
31
+ }
32
+ /**
33
+ * Converts a TransactionState enum instance to a custom string representation.
34
+ * @param {TransactionState} transactionState - The transactionState to convert.
35
+ * @returns {string} The custom string representation of the transactionState.
36
+ */
37
+ function transactionStateToString(transactionState) {
38
+ if (transactionState in networkToStringMapping) {
39
+ return networkToStringMapping[transactionState];
40
+ }
41
+ else {
42
+ throw new UnsupportedTransactionStateError(transactionState);
43
+ }
44
+ }
45
+ class UnsupportedTransactionStateStringError extends Error {
46
+ constructor(transactionStateStr) {
47
+ const message = `Unsupported transactionState string: ${transactionStateStr}`;
48
+ super(message);
49
+ this.transactionStateStr = transactionStateStr;
50
+ }
51
+ }
52
+ /**
53
+ * Converts a custom string representation to a TransactionState enum instance.
54
+ * @param {string} transactionStateStr - The custom string representation of the transactionState.
55
+ * @returns {TransactionState} The corresponding TransactionState enum instance.
56
+ */
57
+ function stringToTransactionState(transactionStateStr) {
58
+ if (transactionStateStr in stringToTransactionStateMapping) {
59
+ return stringToTransactionStateMapping[transactionStateStr];
60
+ }
61
+ else {
62
+ throw new UnsupportedTransactionStateStringError(transactionStateStr);
63
+ }
64
+ }
@@ -0,0 +1,14 @@
1
+ import * as jspb from 'google-protobuf'
2
+
3
+
4
+
5
+ export enum TransactionState {
6
+ TRANSACTION_STATE_UNSPECIFIED = 0,
7
+ TRANSACTION_STATE_DRAFT = 1,
8
+ TRANSACTION_STATE_SIGNING_IN_PROGRESS = 2,
9
+ TRANSACTION_STATE_PENDING = 3,
10
+ TRANSACTION_STATE_SUBMISSION_IN_PROGRESS = 4,
11
+ TRANSACTION_STATE_FAILED = 5,
12
+ TRANSACTION_STATE_INDETERMINATE = 6,
13
+ TRANSACTION_STATE_SUCCESSFUL = 7,
14
+ }
@@ -0,0 +1,39 @@
1
+ // source: meshtrade/ledger/transaction/v1/transaction_state.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global =
17
+ (typeof globalThis !== 'undefined' && globalThis) ||
18
+ (typeof window !== 'undefined' && window) ||
19
+ (typeof global !== 'undefined' && global) ||
20
+ (typeof self !== 'undefined' && self) ||
21
+ (function () { return this; }).call(null) ||
22
+ Function('return this')();
23
+
24
+ goog.exportSymbol('proto.meshtrade.ledger.transaction.v1.TransactionState', null, global);
25
+ /**
26
+ * @enum {number}
27
+ */
28
+ proto.meshtrade.ledger.transaction.v1.TransactionState = {
29
+ TRANSACTION_STATE_UNSPECIFIED: 0,
30
+ TRANSACTION_STATE_DRAFT: 1,
31
+ TRANSACTION_STATE_SIGNING_IN_PROGRESS: 2,
32
+ TRANSACTION_STATE_PENDING: 3,
33
+ TRANSACTION_STATE_SUBMISSION_IN_PROGRESS: 4,
34
+ TRANSACTION_STATE_FAILED: 5,
35
+ TRANSACTION_STATE_INDETERMINATE: 6,
36
+ TRANSACTION_STATE_SUCCESSFUL: 7
37
+ };
38
+
39
+ goog.object.extend(exports, proto.meshtrade.ledger.transaction.v1);
@@ -0,0 +1,4 @@
1
+ export * from "./price_pb";
2
+ export * from "./service_grpc_web_client_meshts";
3
+ export * from "./service_grpc_web_pb";
4
+ export * from "./service_pb";
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ // ===================================================================
3
+ // AUTO-GENERATED SECTION - ONLY EDIT BELOW THE CLOSING COMMENT BLOCK
4
+ // ===================================================================
5
+ // This section is automatically managed by protoc-gen-meshts.
6
+ //
7
+ // DO NOT EDIT ANYTHING IN THIS SECTION MANUALLY!
8
+ // Your changes will be overwritten during code generation.
9
+ //
10
+ // To add custom exports, scroll down to the
11
+ // "MANUAL EXPORTS" section indicated below.
12
+ // ===================================================================
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ // Generated exports
29
+ __exportStar(require("./price_pb"), exports);
30
+ __exportStar(require("./service_grpc_web_client_meshts"), exports);
31
+ __exportStar(require("./service_grpc_web_pb"), exports);
32
+ __exportStar(require("./service_pb"), exports);
33
+ // ===================================================================
34
+ // END OF AUTO-GENERATED SECTION
35
+ // ===================================================================
36
+ //
37
+ // MANUAL EXPORTS - ADD YOUR CUSTOM EXPORTS BELOW
38
+ //
39
+ // You can safely add your own export statements in this section.
40
+ // They will be preserved across code generation.
41
+ //
42
+ // Example:
43
+ // export * from "./my_custom_module";
44
+ // export { MyCustomClass } from "./another_module";
45
+ // ===================================================================
@@ -0,0 +1,45 @@
1
+ import * as jspb from 'google-protobuf'
2
+
3
+ import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb'; // proto import: "google/protobuf/timestamp.proto"
4
+ import * as meshtrade_type_v1_decimal_pb from '../../../../meshtrade/type/v1/decimal_pb'; // proto import: "meshtrade/type/v1/decimal.proto"
5
+ import * as meshtrade_type_v1_token_pb from '../../../../meshtrade/type/v1/token_pb'; // proto import: "meshtrade/type/v1/token.proto"
6
+
7
+
8
+ export class Price extends jspb.Message {
9
+ getBaseToken(): meshtrade_type_v1_token_pb.Token | undefined;
10
+ setBaseToken(value?: meshtrade_type_v1_token_pb.Token): Price;
11
+ hasBaseToken(): boolean;
12
+ clearBaseToken(): Price;
13
+
14
+ getQuoteToken(): meshtrade_type_v1_token_pb.Token | undefined;
15
+ setQuoteToken(value?: meshtrade_type_v1_token_pb.Token): Price;
16
+ hasQuoteToken(): boolean;
17
+ clearQuoteToken(): Price;
18
+
19
+ getMidPrice(): meshtrade_type_v1_decimal_pb.Decimal | undefined;
20
+ setMidPrice(value?: meshtrade_type_v1_decimal_pb.Decimal): Price;
21
+ hasMidPrice(): boolean;
22
+ clearMidPrice(): Price;
23
+
24
+ getTime(): google_protobuf_timestamp_pb.Timestamp | undefined;
25
+ setTime(value?: google_protobuf_timestamp_pb.Timestamp): Price;
26
+ hasTime(): boolean;
27
+ clearTime(): Price;
28
+
29
+ serializeBinary(): Uint8Array;
30
+ toObject(includeInstance?: boolean): Price.AsObject;
31
+ static toObject(includeInstance: boolean, msg: Price): Price.AsObject;
32
+ static serializeBinaryToWriter(message: Price, writer: jspb.BinaryWriter): void;
33
+ static deserializeBinary(bytes: Uint8Array): Price;
34
+ static deserializeBinaryFromReader(message: Price, reader: jspb.BinaryReader): Price;
35
+ }
36
+
37
+ export namespace Price {
38
+ export type AsObject = {
39
+ baseToken?: meshtrade_type_v1_token_pb.Token.AsObject,
40
+ quoteToken?: meshtrade_type_v1_token_pb.Token.AsObject,
41
+ midPrice?: meshtrade_type_v1_decimal_pb.Decimal.AsObject,
42
+ time?: google_protobuf_timestamp_pb.Timestamp.AsObject,
43
+ }
44
+ }
45
+
@@ -0,0 +1,356 @@
1
+ // source: meshtrade/market_data/price/v1/price.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global =
17
+ (typeof globalThis !== 'undefined' && globalThis) ||
18
+ (typeof window !== 'undefined' && window) ||
19
+ (typeof global !== 'undefined' && global) ||
20
+ (typeof self !== 'undefined' && self) ||
21
+ (function () { return this; }).call(null) ||
22
+ Function('return this')();
23
+
24
+ var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
25
+ goog.object.extend(proto, google_protobuf_timestamp_pb);
26
+ var meshtrade_type_v1_decimal_pb = require('../../../../meshtrade/type/v1/decimal_pb.js');
27
+ goog.object.extend(proto, meshtrade_type_v1_decimal_pb);
28
+ var meshtrade_type_v1_token_pb = require('../../../../meshtrade/type/v1/token_pb.js');
29
+ goog.object.extend(proto, meshtrade_type_v1_token_pb);
30
+ goog.exportSymbol('proto.meshtrade.market_data.price.v1.Price', null, global);
31
+ /**
32
+ * Generated by JsPbCodeGenerator.
33
+ * @param {Array=} opt_data Optional initial data array, typically from a
34
+ * server response, or constructed directly in Javascript. The array is used
35
+ * in place and becomes part of the constructed object. It is not cloned.
36
+ * If no data is provided, the constructed object will be empty, but still
37
+ * valid.
38
+ * @extends {jspb.Message}
39
+ * @constructor
40
+ */
41
+ proto.meshtrade.market_data.price.v1.Price = function(opt_data) {
42
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
43
+ };
44
+ goog.inherits(proto.meshtrade.market_data.price.v1.Price, jspb.Message);
45
+ if (goog.DEBUG && !COMPILED) {
46
+ /**
47
+ * @public
48
+ * @override
49
+ */
50
+ proto.meshtrade.market_data.price.v1.Price.displayName = 'proto.meshtrade.market_data.price.v1.Price';
51
+ }
52
+
53
+
54
+
55
+ if (jspb.Message.GENERATE_TO_OBJECT) {
56
+ /**
57
+ * Creates an object representation of this proto.
58
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
59
+ * Optional fields that are not set will be set to undefined.
60
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
61
+ * For the list of reserved names please see:
62
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
63
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
64
+ * JSPB instance for transitional soy proto support:
65
+ * http://goto/soy-param-migration
66
+ * @return {!Object}
67
+ */
68
+ proto.meshtrade.market_data.price.v1.Price.prototype.toObject = function(opt_includeInstance) {
69
+ return proto.meshtrade.market_data.price.v1.Price.toObject(opt_includeInstance, this);
70
+ };
71
+
72
+
73
+ /**
74
+ * Static version of the {@see toObject} method.
75
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
76
+ * the JSPB instance for transitional soy proto support:
77
+ * http://goto/soy-param-migration
78
+ * @param {!proto.meshtrade.market_data.price.v1.Price} msg The msg instance to transform.
79
+ * @return {!Object}
80
+ * @suppress {unusedLocalVariables} f is only used for nested messages
81
+ */
82
+ proto.meshtrade.market_data.price.v1.Price.toObject = function(includeInstance, msg) {
83
+ var f, obj = {
84
+ baseToken: (f = msg.getBaseToken()) && meshtrade_type_v1_token_pb.Token.toObject(includeInstance, f),
85
+ quoteToken: (f = msg.getQuoteToken()) && meshtrade_type_v1_token_pb.Token.toObject(includeInstance, f),
86
+ midPrice: (f = msg.getMidPrice()) && meshtrade_type_v1_decimal_pb.Decimal.toObject(includeInstance, f),
87
+ time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
88
+ };
89
+
90
+ if (includeInstance) {
91
+ obj.$jspbMessageInstance = msg;
92
+ }
93
+ return obj;
94
+ };
95
+ }
96
+
97
+
98
+ /**
99
+ * Deserializes binary data (in protobuf wire format).
100
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
101
+ * @return {!proto.meshtrade.market_data.price.v1.Price}
102
+ */
103
+ proto.meshtrade.market_data.price.v1.Price.deserializeBinary = function(bytes) {
104
+ var reader = new jspb.BinaryReader(bytes);
105
+ var msg = new proto.meshtrade.market_data.price.v1.Price;
106
+ return proto.meshtrade.market_data.price.v1.Price.deserializeBinaryFromReader(msg, reader);
107
+ };
108
+
109
+
110
+ /**
111
+ * Deserializes binary data (in protobuf wire format) from the
112
+ * given reader into the given message object.
113
+ * @param {!proto.meshtrade.market_data.price.v1.Price} msg The message object to deserialize into.
114
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
115
+ * @return {!proto.meshtrade.market_data.price.v1.Price}
116
+ */
117
+ proto.meshtrade.market_data.price.v1.Price.deserializeBinaryFromReader = function(msg, reader) {
118
+ while (reader.nextField()) {
119
+ if (reader.isEndGroup()) {
120
+ break;
121
+ }
122
+ var field = reader.getFieldNumber();
123
+ switch (field) {
124
+ case 1:
125
+ var value = new meshtrade_type_v1_token_pb.Token;
126
+ reader.readMessage(value,meshtrade_type_v1_token_pb.Token.deserializeBinaryFromReader);
127
+ msg.setBaseToken(value);
128
+ break;
129
+ case 2:
130
+ var value = new meshtrade_type_v1_token_pb.Token;
131
+ reader.readMessage(value,meshtrade_type_v1_token_pb.Token.deserializeBinaryFromReader);
132
+ msg.setQuoteToken(value);
133
+ break;
134
+ case 3:
135
+ var value = new meshtrade_type_v1_decimal_pb.Decimal;
136
+ reader.readMessage(value,meshtrade_type_v1_decimal_pb.Decimal.deserializeBinaryFromReader);
137
+ msg.setMidPrice(value);
138
+ break;
139
+ case 4:
140
+ var value = new google_protobuf_timestamp_pb.Timestamp;
141
+ reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
142
+ msg.setTime(value);
143
+ break;
144
+ default:
145
+ reader.skipField();
146
+ break;
147
+ }
148
+ }
149
+ return msg;
150
+ };
151
+
152
+
153
+ /**
154
+ * Serializes the message to binary data (in protobuf wire format).
155
+ * @return {!Uint8Array}
156
+ */
157
+ proto.meshtrade.market_data.price.v1.Price.prototype.serializeBinary = function() {
158
+ var writer = new jspb.BinaryWriter();
159
+ proto.meshtrade.market_data.price.v1.Price.serializeBinaryToWriter(this, writer);
160
+ return writer.getResultBuffer();
161
+ };
162
+
163
+
164
+ /**
165
+ * Serializes the given message to binary data (in protobuf wire
166
+ * format), writing to the given BinaryWriter.
167
+ * @param {!proto.meshtrade.market_data.price.v1.Price} message
168
+ * @param {!jspb.BinaryWriter} writer
169
+ * @suppress {unusedLocalVariables} f is only used for nested messages
170
+ */
171
+ proto.meshtrade.market_data.price.v1.Price.serializeBinaryToWriter = function(message, writer) {
172
+ var f = undefined;
173
+ f = message.getBaseToken();
174
+ if (f != null) {
175
+ writer.writeMessage(
176
+ 1,
177
+ f,
178
+ meshtrade_type_v1_token_pb.Token.serializeBinaryToWriter
179
+ );
180
+ }
181
+ f = message.getQuoteToken();
182
+ if (f != null) {
183
+ writer.writeMessage(
184
+ 2,
185
+ f,
186
+ meshtrade_type_v1_token_pb.Token.serializeBinaryToWriter
187
+ );
188
+ }
189
+ f = message.getMidPrice();
190
+ if (f != null) {
191
+ writer.writeMessage(
192
+ 3,
193
+ f,
194
+ meshtrade_type_v1_decimal_pb.Decimal.serializeBinaryToWriter
195
+ );
196
+ }
197
+ f = message.getTime();
198
+ if (f != null) {
199
+ writer.writeMessage(
200
+ 4,
201
+ f,
202
+ google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
203
+ );
204
+ }
205
+ };
206
+
207
+
208
+ /**
209
+ * optional meshtrade.type.v1.Token base_token = 1;
210
+ * @return {?proto.meshtrade.type.v1.Token}
211
+ */
212
+ proto.meshtrade.market_data.price.v1.Price.prototype.getBaseToken = function() {
213
+ return /** @type{?proto.meshtrade.type.v1.Token} */ (
214
+ jspb.Message.getWrapperField(this, meshtrade_type_v1_token_pb.Token, 1));
215
+ };
216
+
217
+
218
+ /**
219
+ * @param {?proto.meshtrade.type.v1.Token|undefined} value
220
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
221
+ */
222
+ proto.meshtrade.market_data.price.v1.Price.prototype.setBaseToken = function(value) {
223
+ return jspb.Message.setWrapperField(this, 1, value);
224
+ };
225
+
226
+
227
+ /**
228
+ * Clears the message field making it undefined.
229
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
230
+ */
231
+ proto.meshtrade.market_data.price.v1.Price.prototype.clearBaseToken = function() {
232
+ return this.setBaseToken(undefined);
233
+ };
234
+
235
+
236
+ /**
237
+ * Returns whether this field is set.
238
+ * @return {boolean}
239
+ */
240
+ proto.meshtrade.market_data.price.v1.Price.prototype.hasBaseToken = function() {
241
+ return jspb.Message.getField(this, 1) != null;
242
+ };
243
+
244
+
245
+ /**
246
+ * optional meshtrade.type.v1.Token quote_token = 2;
247
+ * @return {?proto.meshtrade.type.v1.Token}
248
+ */
249
+ proto.meshtrade.market_data.price.v1.Price.prototype.getQuoteToken = function() {
250
+ return /** @type{?proto.meshtrade.type.v1.Token} */ (
251
+ jspb.Message.getWrapperField(this, meshtrade_type_v1_token_pb.Token, 2));
252
+ };
253
+
254
+
255
+ /**
256
+ * @param {?proto.meshtrade.type.v1.Token|undefined} value
257
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
258
+ */
259
+ proto.meshtrade.market_data.price.v1.Price.prototype.setQuoteToken = function(value) {
260
+ return jspb.Message.setWrapperField(this, 2, value);
261
+ };
262
+
263
+
264
+ /**
265
+ * Clears the message field making it undefined.
266
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
267
+ */
268
+ proto.meshtrade.market_data.price.v1.Price.prototype.clearQuoteToken = function() {
269
+ return this.setQuoteToken(undefined);
270
+ };
271
+
272
+
273
+ /**
274
+ * Returns whether this field is set.
275
+ * @return {boolean}
276
+ */
277
+ proto.meshtrade.market_data.price.v1.Price.prototype.hasQuoteToken = function() {
278
+ return jspb.Message.getField(this, 2) != null;
279
+ };
280
+
281
+
282
+ /**
283
+ * optional meshtrade.type.v1.Decimal mid_price = 3;
284
+ * @return {?proto.meshtrade.type.v1.Decimal}
285
+ */
286
+ proto.meshtrade.market_data.price.v1.Price.prototype.getMidPrice = function() {
287
+ return /** @type{?proto.meshtrade.type.v1.Decimal} */ (
288
+ jspb.Message.getWrapperField(this, meshtrade_type_v1_decimal_pb.Decimal, 3));
289
+ };
290
+
291
+
292
+ /**
293
+ * @param {?proto.meshtrade.type.v1.Decimal|undefined} value
294
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
295
+ */
296
+ proto.meshtrade.market_data.price.v1.Price.prototype.setMidPrice = function(value) {
297
+ return jspb.Message.setWrapperField(this, 3, value);
298
+ };
299
+
300
+
301
+ /**
302
+ * Clears the message field making it undefined.
303
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
304
+ */
305
+ proto.meshtrade.market_data.price.v1.Price.prototype.clearMidPrice = function() {
306
+ return this.setMidPrice(undefined);
307
+ };
308
+
309
+
310
+ /**
311
+ * Returns whether this field is set.
312
+ * @return {boolean}
313
+ */
314
+ proto.meshtrade.market_data.price.v1.Price.prototype.hasMidPrice = function() {
315
+ return jspb.Message.getField(this, 3) != null;
316
+ };
317
+
318
+
319
+ /**
320
+ * optional google.protobuf.Timestamp time = 4;
321
+ * @return {?proto.google.protobuf.Timestamp}
322
+ */
323
+ proto.meshtrade.market_data.price.v1.Price.prototype.getTime = function() {
324
+ return /** @type{?proto.google.protobuf.Timestamp} */ (
325
+ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
326
+ };
327
+
328
+
329
+ /**
330
+ * @param {?proto.google.protobuf.Timestamp|undefined} value
331
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
332
+ */
333
+ proto.meshtrade.market_data.price.v1.Price.prototype.setTime = function(value) {
334
+ return jspb.Message.setWrapperField(this, 4, value);
335
+ };
336
+
337
+
338
+ /**
339
+ * Clears the message field making it undefined.
340
+ * @return {!proto.meshtrade.market_data.price.v1.Price} returns this
341
+ */
342
+ proto.meshtrade.market_data.price.v1.Price.prototype.clearTime = function() {
343
+ return this.setTime(undefined);
344
+ };
345
+
346
+
347
+ /**
348
+ * Returns whether this field is set.
349
+ * @return {boolean}
350
+ */
351
+ proto.meshtrade.market_data.price.v1.Price.prototype.hasTime = function() {
352
+ return jspb.Message.getField(this, 4) != null;
353
+ };
354
+
355
+
356
+ goog.object.extend(exports, proto.meshtrade.market_data.price.v1);
@@ -0,0 +1,35 @@
1
+ import { GetCurrentPriceByTokenPairRequest } from "./service_pb";
2
+ import { Price } from "./price_pb";
3
+ import { UnaryInterceptor } from "grpc-web";
4
+ import { ConfigOpts } from "../../../common/config";
5
+ /**
6
+ * Client for interacting with the meshtrade.market_data.price.v1 price v1 API resource service.
7
+ */
8
+ export declare class PriceServiceGrpcWebClientV1 {
9
+ private _service;
10
+ private readonly _config;
11
+ private readonly _interceptors;
12
+ /**
13
+ * Constructs an instance of PriceServiceGrpcWebClientV1.
14
+ * @param {ConfigOpts} [config] - Optional configuration for the client.
15
+ * @param {UnaryInterceptor<any, any>[]} [interceptors] - For internal use by `withGroup`.
16
+ */
17
+ constructor(config?: ConfigOpts, interceptors?: UnaryInterceptor<any, any>[]);
18
+ /**
19
+ * Returns a new client instance configured to send the specified group
20
+ * resource name in the request headers for subsequent API calls.
21
+ *
22
+ * @param {string} group - The operating group context to inject into the request
23
+ * in the format `groups/{ulid}` where {ulid} is a 26-character ULID.
24
+ * Example: 'groups/01ARZ3NDEKTSV4YWVF8F5BH32'
25
+ * @returns {PriceServiceGrpcWebClientV1} A new, configured instance of the client.
26
+ * @throws {Error} If the group format is invalid (validation occurs in GroupHeaderInterceptor)
27
+ */
28
+ withGroup(group: string): PriceServiceGrpcWebClientV1;
29
+ /**
30
+ * Retrieves a price.
31
+ * @param {GetCurrentPriceByTokenPairRequest} request - The request object for getcurrentpricebytokenpair.
32
+ * @returns {Promise<Price>} A promise that resolves with the price.
33
+ */
34
+ getCurrentPriceByTokenPair(request: GetCurrentPriceByTokenPairRequest): Promise<Price>;
35
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ // @generated by protoc-gen-meshts v1
3
+ // @generated from file meshtrade/market_data/price/v1/service.proto (package meshtrade.market_data.price.v1, syntax proto3)
4
+ /* eslint-disable */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PriceServiceGrpcWebClientV1 = void 0;
7
+ const grpc_web_1 = require("../../../common/grpc_web");
8
+ const service_grpc_web_pb_1 = require("./service_grpc_web_pb");
9
+ const config_1 = require("../../../common/config");
10
+ const groupHeaderInterceptor_1 = require("../../../common/groupHeaderInterceptor");
11
+ /**
12
+ * Client for interacting with the meshtrade.market_data.price.v1 price v1 API resource service.
13
+ */
14
+ class PriceServiceGrpcWebClientV1 {
15
+ /**
16
+ * Constructs an instance of PriceServiceGrpcWebClientV1.
17
+ * @param {ConfigOpts} [config] - Optional configuration for the client.
18
+ * @param {UnaryInterceptor<any, any>[]} [interceptors] - For internal use by `withGroup`.
19
+ */
20
+ constructor(config, interceptors) {
21
+ this._config = (0, config_1.getConfigFromOpts)(config);
22
+ this._interceptors = interceptors || [new grpc_web_1.LoggingInterceptor()];
23
+ // Construct the underlying gRPC-web service client
24
+ this._service = new service_grpc_web_pb_1.PriceServicePromiseClient(this._config.apiServerURL, null, {
25
+ withCredentials: true,
26
+ unaryInterceptors: this._interceptors,
27
+ });
28
+ }
29
+ /**
30
+ * Returns a new client instance configured to send the specified group
31
+ * resource name in the request headers for subsequent API calls.
32
+ *
33
+ * @param {string} group - The operating group context to inject into the request
34
+ * in the format `groups/{ulid}` where {ulid} is a 26-character ULID.
35
+ * Example: 'groups/01ARZ3NDEKTSV4YWVF8F5BH32'
36
+ * @returns {PriceServiceGrpcWebClientV1} A new, configured instance of the client.
37
+ * @throws {Error} If the group format is invalid (validation occurs in GroupHeaderInterceptor)
38
+ */
39
+ withGroup(group) {
40
+ // Check if a GroupHeaderInterceptor already exists.
41
+ const hasGroupInterceptor = this._interceptors.some((interceptor) => interceptor instanceof groupHeaderInterceptor_1.GroupHeaderInterceptor);
42
+ if (hasGroupInterceptor) {
43
+ throw new Error("Attempted to set group context twice. A group has already been set for this client instance.");
44
+ }
45
+ // Create a new interceptor for the group context
46
+ const groupInterceptor = new groupHeaderInterceptor_1.GroupHeaderInterceptor(group);
47
+ // Return a new client instance with the existing interceptors plus the new one
48
+ return new PriceServiceGrpcWebClientV1(this._config, [
49
+ ...this._interceptors,
50
+ groupInterceptor,
51
+ ]);
52
+ }
53
+ /**
54
+ * Retrieves a price.
55
+ * @param {GetCurrentPriceByTokenPairRequest} request - The request object for getcurrentpricebytokenpair.
56
+ * @returns {Promise<Price>} A promise that resolves with the price.
57
+ */
58
+ getCurrentPriceByTokenPair(request) {
59
+ return this._service.getCurrentPriceByTokenPair(request);
60
+ }
61
+ }
62
+ exports.PriceServiceGrpcWebClientV1 = PriceServiceGrpcWebClientV1;