@meshtrade/api-web 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.
- package/README.md +68 -0
- package/dist/buf/validate/validate_pb.d.ts +4597 -0
- package/dist/buf/validate/validate_pb.js +354 -0
- package/dist/google/type/date_pb.d.ts +52 -0
- package/dist/google/type/date_pb.js +26 -0
- package/dist/meshtrade/common/config.d.ts +7 -0
- package/dist/meshtrade/common/config.js +9 -0
- package/dist/meshtrade/common/connectInterceptors.d.ts +73 -0
- package/dist/meshtrade/common/connectInterceptors.js +126 -0
- package/dist/meshtrade/common/validation.d.ts +62 -0
- package/dist/meshtrade/common/validation.js +77 -0
- package/dist/meshtrade/compliance/client/v1/client_pb.d.ts +138 -0
- package/dist/meshtrade/compliance/client/v1/client_pb.js +23 -0
- package/dist/meshtrade/compliance/client/v1/company_pb.d.ts +313 -0
- package/dist/meshtrade/compliance/client/v1/company_pb.js +100 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_pb.d.ts +81 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_pb.js +22 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_role_pb.d.ts +88 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_role_pb.js +95 -0
- package/dist/meshtrade/compliance/client/v1/fund_pb.d.ts +65 -0
- package/dist/meshtrade/compliance/client/v1/fund_pb.js +18 -0
- package/dist/meshtrade/compliance/client/v1/identification_document_type_pb.d.ts +55 -0
- package/dist/meshtrade/compliance/client/v1/identification_document_type_pb.js +62 -0
- package/dist/meshtrade/compliance/client/v1/index.d.ts +16 -0
- package/dist/meshtrade/compliance/client/v1/index.js +59 -0
- package/dist/meshtrade/compliance/client/v1/industry_classification_pb.d.ts +86 -0
- package/dist/meshtrade/compliance/client/v1/industry_classification_pb.js +16 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_connection_type_pb.d.ts +133 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_connection_type_pb.js +140 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_pb.d.ts +143 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_pb.js +24 -0
- package/dist/meshtrade/compliance/client/v1/pep_status_pb.d.ts +46 -0
- package/dist/meshtrade/compliance/client/v1/pep_status_pb.js +53 -0
- package/dist/meshtrade/compliance/client/v1/service_pb.d.ts +123 -0
- package/dist/meshtrade/compliance/client/v1/service_pb.js +45 -0
- package/dist/meshtrade/compliance/client/v1/service_web_meshts.d.ts +48 -0
- package/dist/meshtrade/compliance/client/v1/service_web_meshts.js +92 -0
- package/dist/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb.d.ts +180 -0
- package/dist/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb.js +187 -0
- package/dist/meshtrade/compliance/client/v1/tax_residency_pb.d.ts +40 -0
- package/dist/meshtrade/compliance/client/v1/tax_residency_pb.js +17 -0
- package/dist/meshtrade/compliance/client/v1/trust_pb.d.ts +65 -0
- package/dist/meshtrade/compliance/client/v1/trust_pb.js +18 -0
- package/dist/meshtrade/compliance/client/v1/verification_status_pb.d.ts +57 -0
- package/dist/meshtrade/compliance/client/v1/verification_status_pb.js +64 -0
- package/dist/meshtrade/iam/api_user/v1/api_credentials_pb.d.ts +43 -0
- package/dist/meshtrade/iam/api_user/v1/api_credentials_pb.js +17 -0
- package/dist/meshtrade/iam/api_user/v1/api_user_pb.d.ts +152 -0
- package/dist/meshtrade/iam/api_user/v1/api_user_pb.js +95 -0
- package/dist/meshtrade/iam/api_user/v1/index.d.ts +4 -0
- package/dist/meshtrade/iam/api_user/v1/index.js +45 -0
- package/dist/meshtrade/iam/api_user/v1/service_pb.d.ts +343 -0
- package/dist/meshtrade/iam/api_user/v1/service_pb.js +86 -0
- package/dist/meshtrade/iam/api_user/v1/service_web_meshts.d.ts +84 -0
- package/dist/meshtrade/iam/api_user/v1/service_web_meshts.js +152 -0
- package/dist/meshtrade/iam/group/v1/group_pb.d.ts +58 -0
- package/dist/meshtrade/iam/group/v1/group_pb.js +17 -0
- package/dist/meshtrade/iam/group/v1/index.d.ts +3 -0
- package/dist/meshtrade/iam/group/v1/index.js +44 -0
- package/dist/meshtrade/iam/group/v1/service_pb.d.ts +306 -0
- package/dist/meshtrade/iam/group/v1/service_pb.js +75 -0
- package/dist/meshtrade/iam/group/v1/service_web_meshts.d.ts +60 -0
- package/dist/meshtrade/iam/group/v1/service_web_meshts.js +112 -0
- package/dist/meshtrade/iam/role/v1/index.d.ts +2 -0
- package/dist/meshtrade/iam/role/v1/index.js +43 -0
- package/dist/meshtrade/iam/role/v1/role.d.ts +71 -0
- package/dist/meshtrade/iam/role/v1/role.js +192 -0
- package/dist/meshtrade/iam/role/v1/role_pb.d.ts +164 -0
- package/dist/meshtrade/iam/role/v1/role_pb.js +171 -0
- package/dist/meshtrade/iam/user/v1/index.d.ts +3 -0
- package/dist/meshtrade/iam/user/v1/index.js +44 -0
- package/dist/meshtrade/iam/user/v1/service_pb.d.ts +379 -0
- package/dist/meshtrade/iam/user/v1/service_pb.js +90 -0
- package/dist/meshtrade/iam/user/v1/service_web_meshts.d.ts +78 -0
- package/dist/meshtrade/iam/user/v1/service_web_meshts.js +142 -0
- package/dist/meshtrade/iam/user/v1/user_pb.d.ts +58 -0
- package/dist/meshtrade/iam/user/v1/user_pb.js +17 -0
- package/dist/meshtrade/ledger/transaction/v1/index.d.ts +5 -0
- package/dist/meshtrade/ledger/transaction/v1/index.js +46 -0
- package/dist/meshtrade/ledger/transaction/v1/service_pb.d.ts +102 -0
- package/dist/meshtrade/ledger/transaction/v1/service_pb.js +41 -0
- package/dist/meshtrade/ledger/transaction/v1/service_web_meshts.d.ts +50 -0
- package/dist/meshtrade/ledger/transaction/v1/service_web_meshts.js +91 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_action_pb.d.ts +46 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_action_pb.js +53 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_state.d.ts +14 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_state.js +64 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_state_pb.d.ts +50 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_state_pb.js +57 -0
- package/dist/meshtrade/market_data/price/v1/index.d.ts +3 -0
- package/dist/meshtrade/market_data/price/v1/index.js +44 -0
- package/dist/meshtrade/market_data/price/v1/price_pb.d.ts +50 -0
- package/dist/meshtrade/market_data/price/v1/price_pb.js +19 -0
- package/dist/meshtrade/market_data/price/v1/service_pb.d.ts +48 -0
- package/dist/meshtrade/market_data/price/v1/service_pb.js +27 -0
- package/dist/meshtrade/market_data/price/v1/service_web_meshts.d.ts +36 -0
- package/dist/meshtrade/market_data/price/v1/service_web_meshts.js +72 -0
- package/dist/meshtrade/option/method_options/v1/index.d.ts +1 -0
- package/dist/meshtrade/option/method_options/v1/index.js +42 -0
- package/dist/meshtrade/option/method_options/v1/method_options_pb.d.ts +132 -0
- package/dist/meshtrade/option/method_options/v1/method_options_pb.js +108 -0
- package/dist/meshtrade/reporting/account_report/v1/account_report_pb.d.ts +136 -0
- package/dist/meshtrade/reporting/account_report/v1/account_report_pb.js +28 -0
- package/dist/meshtrade/reporting/account_report/v1/disclaimer_pb.d.ts +39 -0
- package/dist/meshtrade/reporting/account_report/v1/disclaimer_pb.js +16 -0
- package/dist/meshtrade/reporting/account_report/v1/fee_entry_pb.d.ts +66 -0
- package/dist/meshtrade/reporting/account_report/v1/fee_entry_pb.js +18 -0
- package/dist/meshtrade/reporting/account_report/v1/income_entry_pb.d.ts +139 -0
- package/dist/meshtrade/reporting/account_report/v1/income_entry_pb.js +80 -0
- package/dist/meshtrade/reporting/account_report/v1/index.d.ts +7 -0
- package/dist/meshtrade/reporting/account_report/v1/index.js +48 -0
- package/dist/meshtrade/reporting/account_report/v1/service_pb.d.ts +162 -0
- package/dist/meshtrade/reporting/account_report/v1/service_pb.js +46 -0
- package/dist/meshtrade/reporting/account_report/v1/service_web_meshts.d.ts +42 -0
- package/dist/meshtrade/reporting/account_report/v1/service_web_meshts.js +82 -0
- package/dist/meshtrade/reporting/account_report/v1/trading_statement_entry_pb.d.ts +80 -0
- package/dist/meshtrade/reporting/account_report/v1/trading_statement_entry_pb.js +18 -0
- package/dist/meshtrade/studio/instrument/v1/index.d.ts +3 -0
- package/dist/meshtrade/studio/instrument/v1/index.js +44 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_pb.d.ts +53 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_pb.js +18 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_type_pb.d.ts +214 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_type_pb.js +221 -0
- package/dist/meshtrade/studio/instrument/v1/unit_pb.d.ts +148 -0
- package/dist/meshtrade/studio/instrument/v1/unit_pb.js +155 -0
- package/dist/meshtrade/trading/limit_order/v1/index.d.ts +3 -0
- package/dist/meshtrade/trading/limit_order/v1/index.js +44 -0
- package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.d.ts +211 -0
- package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.js +111 -0
- package/dist/meshtrade/trading/limit_order/v1/service_pb.d.ts +357 -0
- package/dist/meshtrade/trading/limit_order/v1/service_pb.js +73 -0
- package/dist/meshtrade/trading/limit_order/v1/service_web_meshts.d.ts +81 -0
- package/dist/meshtrade/trading/limit_order/v1/service_web_meshts.js +141 -0
- package/dist/meshtrade/trading/market_order/v1/index.d.ts +3 -0
- package/dist/meshtrade/trading/market_order/v1/index.js +44 -0
- package/dist/meshtrade/trading/market_order/v1/market_order_pb.d.ts +20 -0
- package/dist/meshtrade/trading/market_order/v1/market_order_pb.js +16 -0
- package/dist/meshtrade/trading/market_order/v1/service_pb.d.ts +34 -0
- package/dist/meshtrade/trading/market_order/v1/service_pb.js +22 -0
- package/dist/meshtrade/trading/market_order/v1/service_web_meshts.d.ts +36 -0
- package/dist/meshtrade/trading/market_order/v1/service_web_meshts.js +72 -0
- package/dist/meshtrade/type/v1/address_pb.d.ts +82 -0
- package/dist/meshtrade/type/v1/address_pb.js +16 -0
- package/dist/meshtrade/type/v1/amount.d.ts +13 -0
- package/dist/meshtrade/type/v1/amount.js +68 -0
- package/dist/meshtrade/type/v1/amountWrapper.d.ts +74 -0
- package/dist/meshtrade/type/v1/amountWrapper.js +98 -0
- package/dist/meshtrade/type/v1/amount_pb.d.ts +44 -0
- package/dist/meshtrade/type/v1/amount_pb.js +18 -0
- package/dist/meshtrade/type/v1/contact_details_pb.d.ts +98 -0
- package/dist/meshtrade/type/v1/contact_details_pb.js +16 -0
- package/dist/meshtrade/type/v1/date.d.ts +49 -0
- package/dist/meshtrade/type/v1/date.js +136 -0
- package/dist/meshtrade/type/v1/date_pb.d.ts +50 -0
- package/dist/meshtrade/type/v1/date_pb.js +16 -0
- package/dist/meshtrade/type/v1/decimalConversions.d.ts +24 -0
- package/dist/meshtrade/type/v1/decimalConversions.js +39 -0
- package/dist/meshtrade/type/v1/decimal_pb.d.ts +24 -0
- package/dist/meshtrade/type/v1/decimal_pb.js +16 -0
- package/dist/meshtrade/type/v1/index.d.ts +15 -0
- package/dist/meshtrade/type/v1/index.js +56 -0
- package/dist/meshtrade/type/v1/ledger.d.ts +27 -0
- package/dist/meshtrade/type/v1/ledger.js +115 -0
- package/dist/meshtrade/type/v1/ledger_pb.d.ts +83 -0
- package/dist/meshtrade/type/v1/ledger_pb.js +90 -0
- package/dist/meshtrade/type/v1/sorting_pb.d.ts +35 -0
- package/dist/meshtrade/type/v1/sorting_pb.js +42 -0
- package/dist/meshtrade/type/v1/time_of_day.d.ts +74 -0
- package/dist/meshtrade/type/v1/time_of_day.js +199 -0
- package/dist/meshtrade/type/v1/time_of_day_pb.d.ts +67 -0
- package/dist/meshtrade/type/v1/time_of_day_pb.js +16 -0
- package/dist/meshtrade/type/v1/token.d.ts +4 -0
- package/dist/meshtrade/type/v1/token.js +23 -0
- package/dist/meshtrade/type/v1/tokenWrapper.d.ts +49 -0
- package/dist/meshtrade/type/v1/tokenWrapper.js +92 -0
- package/dist/meshtrade/type/v1/token_pb.d.ts +56 -0
- package/dist/meshtrade/type/v1/token_pb.js +17 -0
- package/dist/meshtrade/wallet/account/v1/account_pb.d.ts +264 -0
- package/dist/meshtrade/wallet/account/v1/account_pb.js +74 -0
- package/dist/meshtrade/wallet/account/v1/index.d.ts +3 -0
- package/dist/meshtrade/wallet/account/v1/index.js +44 -0
- package/dist/meshtrade/wallet/account/v1/service_pb.d.ts +559 -0
- package/dist/meshtrade/wallet/account/v1/service_pb.js +112 -0
- package/dist/meshtrade/wallet/account/v1/service_web_meshts.d.ts +84 -0
- package/dist/meshtrade/wallet/account/v1/service_web_meshts.js +152 -0
- package/package.json +171 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-meshts v1
|
|
3
|
+
// @generated from file meshtrade/ledger/transaction/v1/service.proto (package meshtrade.ledger.transaction.v1, syntax proto3)
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TransactionServiceWeb = void 0;
|
|
7
|
+
const connect_1 = require("@connectrpc/connect");
|
|
8
|
+
const connect_web_1 = require("@connectrpc/connect-web");
|
|
9
|
+
const service_pb_1 = require("./service_pb");
|
|
10
|
+
const config_1 = require("../../../common/config");
|
|
11
|
+
const validation_1 = require("../../../common/validation");
|
|
12
|
+
const connectInterceptors_1 = require("../../../common/connectInterceptors");
|
|
13
|
+
/**
|
|
14
|
+
* Web client for interacting with the meshtrade.ledger.transaction.v1 transaction v1 API resource service.
|
|
15
|
+
* Uses Connect-ES with gRPC-Web transport for browser-compatible gRPC communication.
|
|
16
|
+
*/
|
|
17
|
+
class TransactionServiceWeb {
|
|
18
|
+
/**
|
|
19
|
+
* Constructs an instance of TransactionServiceWeb.
|
|
20
|
+
* @param {ConfigOpts} [config] - Optional configuration for the client.
|
|
21
|
+
* @param {Interceptor[]} [interceptors] - For internal use by `withGroup`.
|
|
22
|
+
*/
|
|
23
|
+
constructor(config, interceptors) {
|
|
24
|
+
this._config = (0, config_1.getConfigFromOpts)(config);
|
|
25
|
+
this._interceptors = interceptors || [];
|
|
26
|
+
// Create the gRPC-Web transport with interceptors
|
|
27
|
+
const transport = (0, connect_web_1.createGrpcWebTransport)({
|
|
28
|
+
baseUrl: this._config.apiServerURL,
|
|
29
|
+
interceptors: this._interceptors,
|
|
30
|
+
// Enable credentials (cookies) for cross-origin requests
|
|
31
|
+
fetch: (input, init) => globalThis.fetch(input, { ...init, credentials: 'include' }),
|
|
32
|
+
});
|
|
33
|
+
// Construct the Connect-ES client
|
|
34
|
+
this._client = (0, connect_1.createClient)(service_pb_1.TransactionService, transport);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns a new client instance configured to send the specified group
|
|
38
|
+
* resource name in the request headers for subsequent API calls.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} group - The operating group context to inject into the request
|
|
41
|
+
* in the format `groups/{ulid}` where {ulid} is a 26-character ULID.
|
|
42
|
+
* Example: 'groups/01ARZ3NDEKTSV4YWVF8F5BH32'
|
|
43
|
+
* @returns {TransactionServiceWeb} A new, configured instance of the client.
|
|
44
|
+
* @throws {Error} If the group format is invalid (validation occurs in createGroupInterceptor)
|
|
45
|
+
*/
|
|
46
|
+
withGroup(group) {
|
|
47
|
+
// Check if a group interceptor already exists.
|
|
48
|
+
// Group interceptors are identified by having a 'groupContext' property
|
|
49
|
+
const hasGroupInterceptor = this._interceptors.some((interceptor) => interceptor.groupContext !== undefined);
|
|
50
|
+
if (hasGroupInterceptor) {
|
|
51
|
+
throw new Error("Attempted to set group context twice. A group has already been set for this client instance.");
|
|
52
|
+
}
|
|
53
|
+
// Create a new interceptor for the group context
|
|
54
|
+
const groupInterceptor = (0, connectInterceptors_1.createGroupInterceptor)(group);
|
|
55
|
+
// Return a new client instance with the existing interceptors plus the new one
|
|
56
|
+
return new TransactionServiceWeb(this._config, [
|
|
57
|
+
...this._interceptors,
|
|
58
|
+
groupInterceptor,
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves a transaction.
|
|
63
|
+
* @param {GetTransactionStateRequest} request - The request object for gettransactionstate.
|
|
64
|
+
* @returns {Promise<GetTransactionStateResponse>} A promise that resolves with the transaction.
|
|
65
|
+
*/
|
|
66
|
+
getTransactionState(request) {
|
|
67
|
+
// Validate request
|
|
68
|
+
(0, validation_1.validateRequest)(request);
|
|
69
|
+
return this._client.getTransactionState(request);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Performs monitortransactionstate operation on transaction.
|
|
73
|
+
* Server-side streaming method with client-side validation and authentication.
|
|
74
|
+
* @param {MonitorTransactionStateRequest} request - The request object for monitortransactionstate.
|
|
75
|
+
* @returns {AsyncIterable<MonitorTransactionStateResponse>} An async iterable of MonitorTransactionStateResponse messages.
|
|
76
|
+
* @throws {Error} If request validation fails.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const stream = client.monitorTransactionState(request);
|
|
80
|
+
* for await (const response of stream) {
|
|
81
|
+
* // Process each response
|
|
82
|
+
* console.log(response);
|
|
83
|
+
* }
|
|
84
|
+
*/
|
|
85
|
+
monitorTransactionState(request) {
|
|
86
|
+
// Validate request before initiating stream
|
|
87
|
+
(0, validation_1.validateRequest)(request);
|
|
88
|
+
return this._client.monitorTransactionState(request);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.TransactionServiceWeb = TransactionServiceWeb;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
/**
|
|
3
|
+
* Describes the file meshtrade/ledger/transaction/v1/transaction_action.proto.
|
|
4
|
+
*/
|
|
5
|
+
export declare const file_meshtrade_ledger_transaction_v1_transaction_action: GenFile;
|
|
6
|
+
/**
|
|
7
|
+
* @generated from enum meshtrade.ledger.transaction.v1.TransactionAction
|
|
8
|
+
*/
|
|
9
|
+
export declare enum TransactionAction {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Unknown or not specified.
|
|
13
|
+
* This is a default value to prevent accidental assignment and should not be used.
|
|
14
|
+
*
|
|
15
|
+
* @generated from enum value: TRANSACTION_ACTION_UNSPECIFIED = 0;
|
|
16
|
+
*/
|
|
17
|
+
UNSPECIFIED = 0,
|
|
18
|
+
/**
|
|
19
|
+
* @generated from enum value: TRANSACTION_ACTION_DO_NOTHING = 1;
|
|
20
|
+
*/
|
|
21
|
+
DO_NOTHING = 1,
|
|
22
|
+
/**
|
|
23
|
+
* @generated from enum value: TRANSACTION_ACTION_BUILD = 2;
|
|
24
|
+
*/
|
|
25
|
+
BUILD = 2,
|
|
26
|
+
/**
|
|
27
|
+
* @generated from enum value: TRANSACTION_ACTION_COMMIT = 3;
|
|
28
|
+
*/
|
|
29
|
+
COMMIT = 3,
|
|
30
|
+
/**
|
|
31
|
+
* @generated from enum value: TRANSACTION_ACTION_SIGN = 4;
|
|
32
|
+
*/
|
|
33
|
+
SIGN = 4,
|
|
34
|
+
/**
|
|
35
|
+
* @generated from enum value: TRANSACTION_ACTION_MARK_PENDING = 5;
|
|
36
|
+
*/
|
|
37
|
+
MARK_PENDING = 5,
|
|
38
|
+
/**
|
|
39
|
+
* @generated from enum value: TRANSACTION_ACTION_SUBMIT = 6;
|
|
40
|
+
*/
|
|
41
|
+
SUBMIT = 6
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Describes the enum meshtrade.ledger.transaction.v1.TransactionAction.
|
|
45
|
+
*/
|
|
46
|
+
export declare const TransactionActionSchema: GenEnum<TransactionAction>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-es v2.10.1 with parameter "target=ts"
|
|
3
|
+
// @generated from file meshtrade/ledger/transaction/v1/transaction_action.proto (package meshtrade.ledger.transaction.v1, syntax proto3)
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TransactionActionSchema = exports.TransactionAction = exports.file_meshtrade_ledger_transaction_v1_transaction_action = void 0;
|
|
7
|
+
const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
|
|
8
|
+
/**
|
|
9
|
+
* Describes the file meshtrade/ledger/transaction/v1/transaction_action.proto.
|
|
10
|
+
*/
|
|
11
|
+
exports.file_meshtrade_ledger_transaction_v1_transaction_action = (0, codegenv2_1.fileDesc)("CjhtZXNodHJhZGUvbGVkZ2VyL3RyYW5zYWN0aW9uL3YxL3RyYW5zYWN0aW9uX2FjdGlvbi5wcm90bxIfbWVzaHRyYWRlLmxlZGdlci50cmFuc2FjdGlvbi52MSr4AQoRVHJhbnNhY3Rpb25BY3Rpb24SIgoeVFJBTlNBQ1RJT05fQUNUSU9OX1VOU1BFQ0lGSUVEEAASIQodVFJBTlNBQ1RJT05fQUNUSU9OX0RPX05PVEhJTkcQARIcChhUUkFOU0FDVElPTl9BQ1RJT05fQlVJTEQQAhIdChlUUkFOU0FDVElPTl9BQ1RJT05fQ09NTUlUEAMSGwoXVFJBTlNBQ1RJT05fQUNUSU9OX1NJR04QBBIjCh9UUkFOU0FDVElPTl9BQ1RJT05fTUFSS19QRU5ESU5HEAUSHQoZVFJBTlNBQ1RJT05fQUNUSU9OX1NVQk1JVBAGQmoKJmNvLm1lc2h0cmFkZS5hcGkubGVkZ2VyLnRyYW5zYWN0aW9uLnYxWkBnaXRodWIuY29tL21lc2h0cmFkZS9hcGkvZ28vbGVkZ2VyL3RyYW5zYWN0aW9uL3YxO3RyYW5zYWN0aW9uX3YxYgZwcm90bzM");
|
|
12
|
+
/**
|
|
13
|
+
* @generated from enum meshtrade.ledger.transaction.v1.TransactionAction
|
|
14
|
+
*/
|
|
15
|
+
var TransactionAction;
|
|
16
|
+
(function (TransactionAction) {
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Unknown or not specified.
|
|
20
|
+
* This is a default value to prevent accidental assignment and should not be used.
|
|
21
|
+
*
|
|
22
|
+
* @generated from enum value: TRANSACTION_ACTION_UNSPECIFIED = 0;
|
|
23
|
+
*/
|
|
24
|
+
TransactionAction[TransactionAction["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
25
|
+
/**
|
|
26
|
+
* @generated from enum value: TRANSACTION_ACTION_DO_NOTHING = 1;
|
|
27
|
+
*/
|
|
28
|
+
TransactionAction[TransactionAction["DO_NOTHING"] = 1] = "DO_NOTHING";
|
|
29
|
+
/**
|
|
30
|
+
* @generated from enum value: TRANSACTION_ACTION_BUILD = 2;
|
|
31
|
+
*/
|
|
32
|
+
TransactionAction[TransactionAction["BUILD"] = 2] = "BUILD";
|
|
33
|
+
/**
|
|
34
|
+
* @generated from enum value: TRANSACTION_ACTION_COMMIT = 3;
|
|
35
|
+
*/
|
|
36
|
+
TransactionAction[TransactionAction["COMMIT"] = 3] = "COMMIT";
|
|
37
|
+
/**
|
|
38
|
+
* @generated from enum value: TRANSACTION_ACTION_SIGN = 4;
|
|
39
|
+
*/
|
|
40
|
+
TransactionAction[TransactionAction["SIGN"] = 4] = "SIGN";
|
|
41
|
+
/**
|
|
42
|
+
* @generated from enum value: TRANSACTION_ACTION_MARK_PENDING = 5;
|
|
43
|
+
*/
|
|
44
|
+
TransactionAction[TransactionAction["MARK_PENDING"] = 5] = "MARK_PENDING";
|
|
45
|
+
/**
|
|
46
|
+
* @generated from enum value: TRANSACTION_ACTION_SUBMIT = 6;
|
|
47
|
+
*/
|
|
48
|
+
TransactionAction[TransactionAction["SUBMIT"] = 6] = "SUBMIT";
|
|
49
|
+
})(TransactionAction || (exports.TransactionAction = TransactionAction = {}));
|
|
50
|
+
/**
|
|
51
|
+
* Describes the enum meshtrade.ledger.transaction.v1.TransactionAction.
|
|
52
|
+
*/
|
|
53
|
+
exports.TransactionActionSchema = (0, codegenv2_1.enumDesc)(exports.file_meshtrade_ledger_transaction_v1_transaction_action, 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.UNSPECIFIED]: "-",
|
|
12
|
+
[transaction_state_pb_1.TransactionState.DRAFT]: "Draft",
|
|
13
|
+
[transaction_state_pb_1.TransactionState.SIGNING_IN_PROGRESS]: "Signing in Progress",
|
|
14
|
+
[transaction_state_pb_1.TransactionState.PENDING]: "Pending",
|
|
15
|
+
[transaction_state_pb_1.TransactionState.SUBMISSION_IN_PROGRESS]: "Submission in Progress",
|
|
16
|
+
[transaction_state_pb_1.TransactionState.FAILED]: "Failed",
|
|
17
|
+
[transaction_state_pb_1.TransactionState.INDETERMINATE]: "Indeterminate",
|
|
18
|
+
[transaction_state_pb_1.TransactionState.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,50 @@
|
|
|
1
|
+
import type { GenEnum, GenFile } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
/**
|
|
3
|
+
* Describes the file meshtrade/ledger/transaction/v1/transaction_state.proto.
|
|
4
|
+
*/
|
|
5
|
+
export declare const file_meshtrade_ledger_transaction_v1_transaction_state: GenFile;
|
|
6
|
+
/**
|
|
7
|
+
* @generated from enum meshtrade.ledger.transaction.v1.TransactionState
|
|
8
|
+
*/
|
|
9
|
+
export declare enum TransactionState {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Unknown or not specified.
|
|
13
|
+
* This is a default value to prevent accidental assignment and should not be used.
|
|
14
|
+
*
|
|
15
|
+
* @generated from enum value: TRANSACTION_STATE_UNSPECIFIED = 0;
|
|
16
|
+
*/
|
|
17
|
+
UNSPECIFIED = 0,
|
|
18
|
+
/**
|
|
19
|
+
* @generated from enum value: TRANSACTION_STATE_DRAFT = 1;
|
|
20
|
+
*/
|
|
21
|
+
DRAFT = 1,
|
|
22
|
+
/**
|
|
23
|
+
* @generated from enum value: TRANSACTION_STATE_SIGNING_IN_PROGRESS = 2;
|
|
24
|
+
*/
|
|
25
|
+
SIGNING_IN_PROGRESS = 2,
|
|
26
|
+
/**
|
|
27
|
+
* @generated from enum value: TRANSACTION_STATE_PENDING = 3;
|
|
28
|
+
*/
|
|
29
|
+
PENDING = 3,
|
|
30
|
+
/**
|
|
31
|
+
* @generated from enum value: TRANSACTION_STATE_SUBMISSION_IN_PROGRESS = 4;
|
|
32
|
+
*/
|
|
33
|
+
SUBMISSION_IN_PROGRESS = 4,
|
|
34
|
+
/**
|
|
35
|
+
* @generated from enum value: TRANSACTION_STATE_FAILED = 5;
|
|
36
|
+
*/
|
|
37
|
+
FAILED = 5,
|
|
38
|
+
/**
|
|
39
|
+
* @generated from enum value: TRANSACTION_STATE_INDETERMINATE = 6;
|
|
40
|
+
*/
|
|
41
|
+
INDETERMINATE = 6,
|
|
42
|
+
/**
|
|
43
|
+
* @generated from enum value: TRANSACTION_STATE_SUCCESSFUL = 7;
|
|
44
|
+
*/
|
|
45
|
+
SUCCESSFUL = 7
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Describes the enum meshtrade.ledger.transaction.v1.TransactionState.
|
|
49
|
+
*/
|
|
50
|
+
export declare const TransactionStateSchema: GenEnum<TransactionState>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-es v2.10.1 with parameter "target=ts"
|
|
3
|
+
// @generated from file meshtrade/ledger/transaction/v1/transaction_state.proto (package meshtrade.ledger.transaction.v1, syntax proto3)
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TransactionStateSchema = exports.TransactionState = exports.file_meshtrade_ledger_transaction_v1_transaction_state = void 0;
|
|
7
|
+
const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
|
|
8
|
+
/**
|
|
9
|
+
* Describes the file meshtrade/ledger/transaction/v1/transaction_state.proto.
|
|
10
|
+
*/
|
|
11
|
+
exports.file_meshtrade_ledger_transaction_v1_transaction_state = (0, codegenv2_1.fileDesc)("CjdtZXNodHJhZGUvbGVkZ2VyL3RyYW5zYWN0aW9uL3YxL3RyYW5zYWN0aW9uX3N0YXRlLnByb3RvEh9tZXNodHJhZGUubGVkZ2VyLnRyYW5zYWN0aW9uLnYxKq8CChBUcmFuc2FjdGlvblN0YXRlEiEKHVRSQU5TQUNUSU9OX1NUQVRFX1VOU1BFQ0lGSUVEEAASGwoXVFJBTlNBQ1RJT05fU1RBVEVfRFJBRlQQARIpCiVUUkFOU0FDVElPTl9TVEFURV9TSUdOSU5HX0lOX1BST0dSRVNTEAISHQoZVFJBTlNBQ1RJT05fU1RBVEVfUEVORElORxADEiwKKFRSQU5TQUNUSU9OX1NUQVRFX1NVQk1JU1NJT05fSU5fUFJPR1JFU1MQBBIcChhUUkFOU0FDVElPTl9TVEFURV9GQUlMRUQQBRIjCh9UUkFOU0FDVElPTl9TVEFURV9JTkRFVEVSTUlOQVRFEAYSIAocVFJBTlNBQ1RJT05fU1RBVEVfU1VDQ0VTU0ZVTBAHQmoKJmNvLm1lc2h0cmFkZS5hcGkubGVkZ2VyLnRyYW5zYWN0aW9uLnYxWkBnaXRodWIuY29tL21lc2h0cmFkZS9hcGkvZ28vbGVkZ2VyL3RyYW5zYWN0aW9uL3YxO3RyYW5zYWN0aW9uX3YxYgZwcm90bzM");
|
|
12
|
+
/**
|
|
13
|
+
* @generated from enum meshtrade.ledger.transaction.v1.TransactionState
|
|
14
|
+
*/
|
|
15
|
+
var TransactionState;
|
|
16
|
+
(function (TransactionState) {
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Unknown or not specified.
|
|
20
|
+
* This is a default value to prevent accidental assignment and should not be used.
|
|
21
|
+
*
|
|
22
|
+
* @generated from enum value: TRANSACTION_STATE_UNSPECIFIED = 0;
|
|
23
|
+
*/
|
|
24
|
+
TransactionState[TransactionState["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
25
|
+
/**
|
|
26
|
+
* @generated from enum value: TRANSACTION_STATE_DRAFT = 1;
|
|
27
|
+
*/
|
|
28
|
+
TransactionState[TransactionState["DRAFT"] = 1] = "DRAFT";
|
|
29
|
+
/**
|
|
30
|
+
* @generated from enum value: TRANSACTION_STATE_SIGNING_IN_PROGRESS = 2;
|
|
31
|
+
*/
|
|
32
|
+
TransactionState[TransactionState["SIGNING_IN_PROGRESS"] = 2] = "SIGNING_IN_PROGRESS";
|
|
33
|
+
/**
|
|
34
|
+
* @generated from enum value: TRANSACTION_STATE_PENDING = 3;
|
|
35
|
+
*/
|
|
36
|
+
TransactionState[TransactionState["PENDING"] = 3] = "PENDING";
|
|
37
|
+
/**
|
|
38
|
+
* @generated from enum value: TRANSACTION_STATE_SUBMISSION_IN_PROGRESS = 4;
|
|
39
|
+
*/
|
|
40
|
+
TransactionState[TransactionState["SUBMISSION_IN_PROGRESS"] = 4] = "SUBMISSION_IN_PROGRESS";
|
|
41
|
+
/**
|
|
42
|
+
* @generated from enum value: TRANSACTION_STATE_FAILED = 5;
|
|
43
|
+
*/
|
|
44
|
+
TransactionState[TransactionState["FAILED"] = 5] = "FAILED";
|
|
45
|
+
/**
|
|
46
|
+
* @generated from enum value: TRANSACTION_STATE_INDETERMINATE = 6;
|
|
47
|
+
*/
|
|
48
|
+
TransactionState[TransactionState["INDETERMINATE"] = 6] = "INDETERMINATE";
|
|
49
|
+
/**
|
|
50
|
+
* @generated from enum value: TRANSACTION_STATE_SUCCESSFUL = 7;
|
|
51
|
+
*/
|
|
52
|
+
TransactionState[TransactionState["SUCCESSFUL"] = 7] = "SUCCESSFUL";
|
|
53
|
+
})(TransactionState || (exports.TransactionState = TransactionState = {}));
|
|
54
|
+
/**
|
|
55
|
+
* Describes the enum meshtrade.ledger.transaction.v1.TransactionState.
|
|
56
|
+
*/
|
|
57
|
+
exports.TransactionStateSchema = (0, codegenv2_1.enumDesc)(exports.file_meshtrade_ledger_transaction_v1_transaction_state, 0);
|
|
@@ -0,0 +1,44 @@
|
|
|
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_pb"), exports);
|
|
31
|
+
__exportStar(require("./service_web_meshts"), exports);
|
|
32
|
+
// ===================================================================
|
|
33
|
+
// END OF AUTO-GENERATED SECTION
|
|
34
|
+
// ===================================================================
|
|
35
|
+
//
|
|
36
|
+
// MANUAL EXPORTS - ADD YOUR CUSTOM EXPORTS BELOW
|
|
37
|
+
//
|
|
38
|
+
// You can safely add your own export statements in this section.
|
|
39
|
+
// They will be preserved across code generation.
|
|
40
|
+
//
|
|
41
|
+
// Example:
|
|
42
|
+
// export * from "./my_custom_module";
|
|
43
|
+
// export { MyCustomClass } from "./another_module";
|
|
44
|
+
// ===================================================================
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { Decimal } from "../../../type/v1/decimal_pb";
|
|
4
|
+
import type { Token } from "../../../type/v1/token_pb";
|
|
5
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
6
|
+
/**
|
|
7
|
+
* Describes the file meshtrade/market_data/price/v1/price.proto.
|
|
8
|
+
*/
|
|
9
|
+
export declare const file_meshtrade_market_data_price_v1_price: GenFile;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* Is a Price
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
* BaseToken
|
|
16
|
+
*
|
|
17
|
+
* @generated from message meshtrade.market_data.price.v1.Price
|
|
18
|
+
*/
|
|
19
|
+
export type Price = Message<"meshtrade.market_data.price.v1.Price"> & {
|
|
20
|
+
/**
|
|
21
|
+
* @generated from field: meshtrade.type.v1.Token base_token = 1;
|
|
22
|
+
*/
|
|
23
|
+
baseToken?: Token;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* QuoteToken
|
|
27
|
+
*
|
|
28
|
+
* @generated from field: meshtrade.type.v1.Token quote_token = 2;
|
|
29
|
+
*/
|
|
30
|
+
quoteToken?: Token;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* Mid price in quote
|
|
34
|
+
*
|
|
35
|
+
* @generated from field: meshtrade.type.v1.Decimal mid_price = 3;
|
|
36
|
+
*/
|
|
37
|
+
midPrice?: Decimal;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* Time of Price
|
|
41
|
+
*
|
|
42
|
+
* @generated from field: google.protobuf.Timestamp time = 4;
|
|
43
|
+
*/
|
|
44
|
+
time?: Timestamp;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Describes the message meshtrade.market_data.price.v1.Price.
|
|
48
|
+
* Use `create(PriceSchema)` to create a new message.
|
|
49
|
+
*/
|
|
50
|
+
export declare const PriceSchema: GenMessage<Price>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-es v2.10.1 with parameter "target=ts"
|
|
3
|
+
// @generated from file meshtrade/market_data/price/v1/price.proto (package meshtrade.market_data.price.v1, syntax proto3)
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PriceSchema = exports.file_meshtrade_market_data_price_v1_price = void 0;
|
|
7
|
+
const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
|
|
8
|
+
const wkt_1 = require("@bufbuild/protobuf/wkt");
|
|
9
|
+
const decimal_pb_1 = require("../../../type/v1/decimal_pb");
|
|
10
|
+
const token_pb_1 = require("../../../type/v1/token_pb");
|
|
11
|
+
/**
|
|
12
|
+
* Describes the file meshtrade/market_data/price/v1/price.proto.
|
|
13
|
+
*/
|
|
14
|
+
exports.file_meshtrade_market_data_price_v1_price = (0, codegenv2_1.fileDesc)("CiptZXNodHJhZGUvbWFya2V0X2RhdGEvcHJpY2UvdjEvcHJpY2UucHJvdG8SHm1lc2h0cmFkZS5tYXJrZXRfZGF0YS5wcmljZS52MSK9AQoFUHJpY2USLAoKYmFzZV90b2tlbhgBIAEoCzIYLm1lc2h0cmFkZS50eXBlLnYxLlRva2VuEi0KC3F1b3RlX3Rva2VuGAIgASgLMhgubWVzaHRyYWRlLnR5cGUudjEuVG9rZW4SLQoJbWlkX3ByaWNlGAMgASgLMhoubWVzaHRyYWRlLnR5cGUudjEuRGVjaW1hbBIoCgR0aW1lGAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEJiCiVjby5tZXNodHJhZGUuYXBpLm1hcmtldF9kYXRhLnByaWNlLnYxWjlnaXRodWIuY29tL21lc2h0cmFkZS9hcGkvZ28vbWFya2V0X2RhdGEvcHJpY2UvdjE7cHJpY2VfdjFiBnByb3RvMw", [wkt_1.file_google_protobuf_timestamp, decimal_pb_1.file_meshtrade_type_v1_decimal, token_pb_1.file_meshtrade_type_v1_token]);
|
|
15
|
+
/**
|
|
16
|
+
* Describes the message meshtrade.market_data.price.v1.Price.
|
|
17
|
+
* Use `create(PriceSchema)` to create a new message.
|
|
18
|
+
*/
|
|
19
|
+
exports.PriceSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_market_data_price_v1_price, 0);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { PriceSchema } from "./price_pb";
|
|
3
|
+
import type { Token } from "../../../type/v1/token_pb";
|
|
4
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
5
|
+
/**
|
|
6
|
+
* Describes the file meshtrade/market_data/price/v1/service.proto.
|
|
7
|
+
*/
|
|
8
|
+
export declare const file_meshtrade_market_data_price_v1_service: GenFile;
|
|
9
|
+
/**
|
|
10
|
+
* @generated from message meshtrade.market_data.price.v1.GetCurrentPriceByTokenPairRequest
|
|
11
|
+
*/
|
|
12
|
+
export type GetCurrentPriceByTokenPairRequest = Message<"meshtrade.market_data.price.v1.GetCurrentPriceByTokenPairRequest"> & {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* BaseToken is the token for which a price is rquired.
|
|
16
|
+
*
|
|
17
|
+
* @generated from field: meshtrade.type.v1.Token base_token = 1;
|
|
18
|
+
*/
|
|
19
|
+
baseToken?: Token;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* QuoteToken is the token in which price is to be quoted.
|
|
23
|
+
*
|
|
24
|
+
* @generated from field: meshtrade.type.v1.Token quote_token = 2;
|
|
25
|
+
*/
|
|
26
|
+
quoteToken?: Token;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Describes the message meshtrade.market_data.price.v1.GetCurrentPriceByTokenPairRequest.
|
|
30
|
+
* Use `create(GetCurrentPriceByTokenPairRequestSchema)` to create a new message.
|
|
31
|
+
*/
|
|
32
|
+
export declare const GetCurrentPriceByTokenPairRequestSchema: GenMessage<GetCurrentPriceByTokenPairRequest>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* PriceService provides prices.
|
|
36
|
+
*
|
|
37
|
+
* @generated from service meshtrade.market_data.price.v1.PriceService
|
|
38
|
+
*/
|
|
39
|
+
export declare const PriceService: GenService<{
|
|
40
|
+
/**
|
|
41
|
+
* @generated from rpc meshtrade.market_data.price.v1.PriceService.GetCurrentPriceByTokenPair
|
|
42
|
+
*/
|
|
43
|
+
getCurrentPriceByTokenPair: {
|
|
44
|
+
methodKind: "unary";
|
|
45
|
+
input: typeof GetCurrentPriceByTokenPairRequestSchema;
|
|
46
|
+
output: typeof PriceSchema;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-es v2.10.1 with parameter "target=ts"
|
|
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.PriceService = exports.GetCurrentPriceByTokenPairRequestSchema = exports.file_meshtrade_market_data_price_v1_service = void 0;
|
|
7
|
+
const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
|
|
8
|
+
const validate_pb_1 = require("../../../../buf/validate/validate_pb");
|
|
9
|
+
const price_pb_1 = require("./price_pb");
|
|
10
|
+
const method_options_pb_1 = require("../../../option/method_options/v1/method_options_pb");
|
|
11
|
+
const token_pb_1 = require("../../../type/v1/token_pb");
|
|
12
|
+
/**
|
|
13
|
+
* Describes the file meshtrade/market_data/price/v1/service.proto.
|
|
14
|
+
*/
|
|
15
|
+
exports.file_meshtrade_market_data_price_v1_service = (0, codegenv2_1.fileDesc)("CixtZXNodHJhZGUvbWFya2V0X2RhdGEvcHJpY2UvdjEvc2VydmljZS5wcm90bxIebWVzaHRyYWRlLm1hcmtldF9kYXRhLnByaWNlLnYxIpABCiFHZXRDdXJyZW50UHJpY2VCeVRva2VuUGFpclJlcXVlc3QSNAoKYmFzZV90b2tlbhgBIAEoCzIYLm1lc2h0cmFkZS50eXBlLnYxLlRva2VuQga6SAPIAQESNQoLcXVvdGVfdG9rZW4YAiABKAsyGC5tZXNodHJhZGUudHlwZS52MS5Ub2tlbkIGukgDyAEBMrMBCgxQcmljZVNlcnZpY2USogEKGkdldEN1cnJlbnRQcmljZUJ5VG9rZW5QYWlyEkEubWVzaHRyYWRlLm1hcmtldF9kYXRhLnByaWNlLnYxLkdldEN1cnJlbnRQcmljZUJ5VG9rZW5QYWlyUmVxdWVzdBolLm1lc2h0cmFkZS5tYXJrZXRfZGF0YS5wcmljZS52MS5QcmljZSIasrUYFggBEAIaEICk6AOBpOgDgqToA4Ok6ANCYgolY28ubWVzaHRyYWRlLmFwaS5tYXJrZXRfZGF0YS5wcmljZS52MVo5Z2l0aHViLmNvbS9tZXNodHJhZGUvYXBpL2dvL21hcmtldF9kYXRhL3ByaWNlL3YxO3ByaWNlX3YxYgZwcm90bzM", [validate_pb_1.file_buf_validate_validate, price_pb_1.file_meshtrade_market_data_price_v1_price, method_options_pb_1.file_meshtrade_option_method_options_v1_method_options, token_pb_1.file_meshtrade_type_v1_token]);
|
|
16
|
+
/**
|
|
17
|
+
* Describes the message meshtrade.market_data.price.v1.GetCurrentPriceByTokenPairRequest.
|
|
18
|
+
* Use `create(GetCurrentPriceByTokenPairRequestSchema)` to create a new message.
|
|
19
|
+
*/
|
|
20
|
+
exports.GetCurrentPriceByTokenPairRequestSchema = (0, codegenv2_1.messageDesc)(exports.file_meshtrade_market_data_price_v1_service, 0);
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* PriceService provides prices.
|
|
24
|
+
*
|
|
25
|
+
* @generated from service meshtrade.market_data.price.v1.PriceService
|
|
26
|
+
*/
|
|
27
|
+
exports.PriceService = (0, codegenv2_1.serviceDesc)(exports.file_meshtrade_market_data_price_v1_service, 0);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Interceptor } from "@connectrpc/connect";
|
|
2
|
+
import { GetCurrentPriceByTokenPairRequest } from "./service_pb";
|
|
3
|
+
import { Price } from "./price_pb";
|
|
4
|
+
import { ConfigOpts } from "../../../common/config";
|
|
5
|
+
/**
|
|
6
|
+
* Web client for interacting with the meshtrade.market_data.price.v1 price v1 API resource service.
|
|
7
|
+
* Uses Connect-ES with gRPC-Web transport for browser-compatible gRPC communication.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PriceServiceWeb {
|
|
10
|
+
private _client;
|
|
11
|
+
private readonly _config;
|
|
12
|
+
private readonly _interceptors;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs an instance of PriceServiceWeb.
|
|
15
|
+
* @param {ConfigOpts} [config] - Optional configuration for the client.
|
|
16
|
+
* @param {Interceptor[]} [interceptors] - For internal use by `withGroup`.
|
|
17
|
+
*/
|
|
18
|
+
constructor(config?: ConfigOpts, interceptors?: Interceptor[]);
|
|
19
|
+
/**
|
|
20
|
+
* Returns a new client instance configured to send the specified group
|
|
21
|
+
* resource name in the request headers for subsequent API calls.
|
|
22
|
+
*
|
|
23
|
+
* @param {string} group - The operating group context to inject into the request
|
|
24
|
+
* in the format `groups/{ulid}` where {ulid} is a 26-character ULID.
|
|
25
|
+
* Example: 'groups/01ARZ3NDEKTSV4YWVF8F5BH32'
|
|
26
|
+
* @returns {PriceServiceWeb} A new, configured instance of the client.
|
|
27
|
+
* @throws {Error} If the group format is invalid (validation occurs in createGroupInterceptor)
|
|
28
|
+
*/
|
|
29
|
+
withGroup(group: string): PriceServiceWeb;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves a price.
|
|
32
|
+
* @param {GetCurrentPriceByTokenPairRequest} request - The request object for getcurrentpricebytokenpair.
|
|
33
|
+
* @returns {Promise<Price>} A promise that resolves with the price.
|
|
34
|
+
*/
|
|
35
|
+
getCurrentPriceByTokenPair(request: GetCurrentPriceByTokenPairRequest): Promise<Price>;
|
|
36
|
+
}
|