@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.
- package/README.md +117 -0
- package/dist/buf/validate/validate_pb.js +17134 -0
- package/dist/meshtrade/common/config.d.ts +7 -0
- package/dist/meshtrade/common/config.js +9 -0
- package/dist/meshtrade/common/groupHeaderInterceptor.d.ts +64 -0
- package/dist/meshtrade/common/groupHeaderInterceptor.js +76 -0
- package/dist/meshtrade/common/grpc_web.d.ts +18 -0
- package/dist/meshtrade/common/grpc_web.js +34 -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 +91 -0
- package/dist/meshtrade/compliance/client/v1/client_pb.js +645 -0
- package/dist/meshtrade/compliance/client/v1/company_pb.d.ts +178 -0
- package/dist/meshtrade/compliance/client/v1/company_pb.js +1322 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_pb.d.ts +56 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_pb.js +422 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_role_pb.d.ts +15 -0
- package/dist/meshtrade/compliance/client/v1/company_representative_role_pb.js +40 -0
- package/dist/meshtrade/compliance/client/v1/fund_pb.d.ts +42 -0
- package/dist/meshtrade/compliance/client/v1/fund_pb.js +321 -0
- package/dist/meshtrade/compliance/client/v1/identification_document_type_pb.d.ts +11 -0
- package/dist/meshtrade/compliance/client/v1/identification_document_type_pb.js +36 -0
- package/dist/meshtrade/compliance/client/v1/index.d.ts +18 -0
- package/dist/meshtrade/compliance/client/v1/index.js +61 -0
- package/dist/meshtrade/compliance/client/v1/industry_classification_pb.d.ts +50 -0
- package/dist/meshtrade/compliance/client/v1/industry_classification_pb.js +386 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_connection_type_pb.d.ts +22 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_connection_type_pb.js +47 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_pb.d.ts +94 -0
- package/dist/meshtrade/compliance/client/v1/natural_person_pb.js +729 -0
- package/dist/meshtrade/compliance/client/v1/pep_status_pb.d.ts +10 -0
- package/dist/meshtrade/compliance/client/v1/pep_status_pb.js +35 -0
- package/dist/meshtrade/compliance/client/v1/service_grpc_web_client_meshts.d.ts +47 -0
- package/dist/meshtrade/compliance/client/v1/service_grpc_web_client_meshts.js +78 -0
- package/dist/meshtrade/compliance/client/v1/service_grpc_web_pb.d.ts +56 -0
- package/dist/meshtrade/compliance/client/v1/service_grpc_web_pb.js +270 -0
- package/dist/meshtrade/compliance/client/v1/service_pb.d.ts +79 -0
- package/dist/meshtrade/compliance/client/v1/service_pb.js +660 -0
- package/dist/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb.d.ts +29 -0
- package/dist/meshtrade/compliance/client/v1/source_of_income_and_wealth_pb.js +54 -0
- package/dist/meshtrade/compliance/client/v1/tax_residency_pb.d.ts +27 -0
- package/dist/meshtrade/compliance/client/v1/tax_residency_pb.js +208 -0
- package/dist/meshtrade/compliance/client/v1/trust_pb.d.ts +42 -0
- package/dist/meshtrade/compliance/client/v1/trust_pb.js +321 -0
- package/dist/meshtrade/compliance/client/v1/verification_status_pb.d.ts +11 -0
- package/dist/meshtrade/compliance/client/v1/verification_status_pb.js +36 -0
- package/dist/meshtrade/iam/api_user/v1/api_credentials_pb.d.ts +27 -0
- package/dist/meshtrade/iam/api_user/v1/api_credentials_pb.js +208 -0
- package/dist/meshtrade/iam/api_user/v1/api_user_pb.d.ts +57 -0
- package/dist/meshtrade/iam/api_user/v1/api_user_pb.js +376 -0
- package/dist/meshtrade/iam/api_user/v1/index.d.ts +5 -0
- package/dist/meshtrade/iam/api_user/v1/index.js +46 -0
- package/dist/meshtrade/iam/api_user/v1/service_grpc_web_client_meshts.d.ts +83 -0
- package/dist/meshtrade/iam/api_user/v1/service_grpc_web_client_meshts.js +126 -0
- package/dist/meshtrade/iam/api_user/v1/service_grpc_web_pb.d.ts +128 -0
- package/dist/meshtrade/iam/api_user/v1/service_grpc_web_pb.js +636 -0
- package/dist/meshtrade/iam/api_user/v1/service_pb.d.ts +219 -0
- package/dist/meshtrade/iam/api_user/v1/service_pb.js +1866 -0
- package/dist/meshtrade/iam/group/v1/group_pb.d.ts +35 -0
- package/dist/meshtrade/iam/group/v1/group_pb.js +268 -0
- package/dist/meshtrade/iam/group/v1/index.d.ts +4 -0
- package/dist/meshtrade/iam/group/v1/index.js +45 -0
- package/dist/meshtrade/iam/group/v1/service_grpc_web_client_meshts.d.ts +59 -0
- package/dist/meshtrade/iam/group/v1/service_grpc_web_client_meshts.js +94 -0
- package/dist/meshtrade/iam/group/v1/service_grpc_web_pb.d.ts +80 -0
- package/dist/meshtrade/iam/group/v1/service_grpc_web_pb.js +394 -0
- package/dist/meshtrade/iam/group/v1/service_pb.d.ts +200 -0
- package/dist/meshtrade/iam/group/v1/service_pb.js +1664 -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 +41 -0
- package/dist/meshtrade/iam/role/v1/role_pb.js +66 -0
- package/dist/meshtrade/iam/user/v1/index.d.ts +4 -0
- package/dist/meshtrade/iam/user/v1/index.js +45 -0
- package/dist/meshtrade/iam/user/v1/service_grpc_web_client_meshts.d.ts +77 -0
- package/dist/meshtrade/iam/user/v1/service_grpc_web_client_meshts.js +118 -0
- package/dist/meshtrade/iam/user/v1/service_grpc_web_pb.d.ts +116 -0
- package/dist/meshtrade/iam/user/v1/service_grpc_web_pb.js +577 -0
- package/dist/meshtrade/iam/user/v1/service_pb.d.ts +262 -0
- package/dist/meshtrade/iam/user/v1/service_pb.js +2202 -0
- package/dist/meshtrade/iam/user/v1/user_pb.d.ts +37 -0
- package/dist/meshtrade/iam/user/v1/user_pb.js +294 -0
- package/dist/meshtrade/ledger/transaction/v1/index.d.ts +6 -0
- package/dist/meshtrade/ledger/transaction/v1/index.js +47 -0
- package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_client_meshts.d.ts +56 -0
- package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_client_meshts.js +96 -0
- package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_pb.d.ts +41 -0
- package/dist/meshtrade/ledger/transaction/v1/service_grpc_web_pb.js +204 -0
- package/dist/meshtrade/ledger/transaction/v1/service_pb.d.ts +79 -0
- package/dist/meshtrade/ledger/transaction/v1/service_pb.js +638 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_action_pb.d.ts +13 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_action_pb.js +38 -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 +14 -0
- package/dist/meshtrade/ledger/transaction/v1/transaction_state_pb.js +39 -0
- package/dist/meshtrade/market_data/price/v1/index.d.ts +4 -0
- package/dist/meshtrade/market_data/price/v1/index.js +45 -0
- package/dist/meshtrade/market_data/price/v1/price_pb.d.ts +45 -0
- package/dist/meshtrade/market_data/price/v1/price_pb.js +356 -0
- package/dist/meshtrade/market_data/price/v1/service_grpc_web_client_meshts.d.ts +35 -0
- package/dist/meshtrade/market_data/price/v1/service_grpc_web_client_meshts.js +62 -0
- package/dist/meshtrade/market_data/price/v1/service_grpc_web_pb.d.ts +32 -0
- package/dist/meshtrade/market_data/price/v1/service_grpc_web_pb.js +150 -0
- package/dist/meshtrade/market_data/price/v1/service_pb.d.ts +34 -0
- package/dist/meshtrade/market_data/price/v1/service_pb.js +256 -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 +44 -0
- package/dist/meshtrade/option/method_options/v1/method_options_pb.js +314 -0
- package/dist/meshtrade/reporting/account_report/v1/account_report_pb.d.ts +112 -0
- package/dist/meshtrade/reporting/account_report/v1/account_report_pb.js +897 -0
- package/dist/meshtrade/reporting/account_report/v1/disclaimer_pb.d.ts +26 -0
- package/dist/meshtrade/reporting/account_report/v1/disclaimer_pb.js +206 -0
- package/dist/meshtrade/reporting/account_report/v1/fee_entry_pb.d.ts +50 -0
- package/dist/meshtrade/reporting/account_report/v1/fee_entry_pb.js +393 -0
- package/dist/meshtrade/reporting/account_report/v1/income_entry_pb.d.ts +66 -0
- package/dist/meshtrade/reporting/account_report/v1/income_entry_pb.js +460 -0
- package/dist/meshtrade/reporting/account_report/v1/index.d.ts +8 -0
- package/dist/meshtrade/reporting/account_report/v1/index.js +49 -0
- package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_client_meshts.d.ts +41 -0
- package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_client_meshts.js +70 -0
- package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_pb.d.ts +44 -0
- package/dist/meshtrade/reporting/account_report/v1/service_grpc_web_pb.js +213 -0
- package/dist/meshtrade/reporting/account_report/v1/service_pb.d.ts +99 -0
- package/dist/meshtrade/reporting/account_report/v1/service_pb.js +796 -0
- package/dist/meshtrade/reporting/account_report/v1/trading_statement_entry_pb.d.ts +62 -0
- package/dist/meshtrade/reporting/account_report/v1/trading_statement_entry_pb.js +495 -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 +38 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_pb.js +291 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_type_pb.d.ts +34 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_type_pb.js +59 -0
- package/dist/meshtrade/studio/instrument/v1/unit_pb.d.ts +25 -0
- package/dist/meshtrade/studio/instrument/v1/unit_pb.js +50 -0
- package/dist/meshtrade/trading/limit_order/v1/index.d.ts +4 -0
- package/dist/meshtrade/trading/limit_order/v1/index.js +45 -0
- package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.d.ts +83 -0
- package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.js +559 -0
- package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_client_meshts.d.ts +87 -0
- package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_client_meshts.js +136 -0
- package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_pb.d.ts +102 -0
- package/dist/meshtrade/trading/limit_order/v1/service_grpc_web_pb.js +509 -0
- package/dist/meshtrade/trading/limit_order/v1/service_pb.d.ts +203 -0
- package/dist/meshtrade/trading/limit_order/v1/service_pb.js +1692 -0
- package/dist/meshtrade/trading/market_order/v1/index.d.ts +4 -0
- package/dist/meshtrade/trading/market_order/v1/index.js +45 -0
- package/dist/meshtrade/trading/market_order/v1/market_order_pb.d.ts +22 -0
- package/dist/meshtrade/trading/market_order/v1/market_order_pb.js +176 -0
- package/dist/meshtrade/trading/market_order/v1/service_grpc_web_client_meshts.d.ts +35 -0
- package/dist/meshtrade/trading/market_order/v1/service_grpc_web_client_meshts.js +62 -0
- package/dist/meshtrade/trading/market_order/v1/service_grpc_web_pb.d.ts +32 -0
- package/dist/meshtrade/trading/market_order/v1/service_grpc_web_pb.js +146 -0
- package/dist/meshtrade/trading/market_order/v1/service_pb.d.ts +24 -0
- package/dist/meshtrade/trading/market_order/v1/service_pb.js +180 -0
- package/dist/meshtrade/type/v1/address_pb.d.ts +44 -0
- package/dist/meshtrade/type/v1/address_pb.js +352 -0
- package/dist/meshtrade/type/v1/amount.d.ts +13 -0
- package/dist/meshtrade/type/v1/amount.js +66 -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 +32 -0
- package/dist/meshtrade/type/v1/amount_pb.js +252 -0
- package/dist/meshtrade/type/v1/contact_details_pb.d.ts +54 -0
- package/dist/meshtrade/type/v1/contact_details_pb.js +416 -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 +30 -0
- package/dist/meshtrade/type/v1/date_pb.js +236 -0
- package/dist/meshtrade/type/v1/decimalConversions.d.ts +24 -0
- package/dist/meshtrade/type/v1/decimalConversions.js +40 -0
- package/dist/meshtrade/type/v1/decimal_pb.d.ts +22 -0
- package/dist/meshtrade/type/v1/decimal_pb.js +176 -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 +14 -0
- package/dist/meshtrade/type/v1/ledger_pb.js +39 -0
- package/dist/meshtrade/type/v1/sorting_pb.d.ts +9 -0
- package/dist/meshtrade/type/v1/sorting_pb.js +34 -0
- package/dist/meshtrade/type/v1/time_of_day.d.ts +74 -0
- package/dist/meshtrade/type/v1/time_of_day.js +205 -0
- package/dist/meshtrade/type/v1/time_of_day_pb.d.ts +34 -0
- package/dist/meshtrade/type/v1/time_of_day_pb.js +266 -0
- package/dist/meshtrade/type/v1/token.d.ts +4 -0
- package/dist/meshtrade/type/v1/token.js +24 -0
- package/dist/meshtrade/type/v1/tokenWrapper.d.ts +49 -0
- package/dist/meshtrade/type/v1/tokenWrapper.js +76 -0
- package/dist/meshtrade/type/v1/token_pb.d.ts +31 -0
- package/dist/meshtrade/type/v1/token_pb.js +238 -0
- package/dist/meshtrade/wallet/account/v1/account_pb.d.ts +149 -0
- package/dist/meshtrade/wallet/account/v1/account_pb.js +1160 -0
- package/dist/meshtrade/wallet/account/v1/index.d.ts +4 -0
- package/dist/meshtrade/wallet/account/v1/index.js +45 -0
- package/dist/meshtrade/wallet/account/v1/service_grpc_web_client_meshts.d.ts +83 -0
- package/dist/meshtrade/wallet/account/v1/service_grpc_web_client_meshts.js +126 -0
- package/dist/meshtrade/wallet/account/v1/service_grpc_web_pb.d.ts +128 -0
- package/dist/meshtrade/wallet/account/v1/service_grpc_web_pb.js +638 -0
- package/dist/meshtrade/wallet/account/v1/service_pb.d.ts +350 -0
- package/dist/meshtrade/wallet/account/v1/service_pb.js +2930 -0
- package/package.json +171 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// source: meshtrade/trading/market_order/v1/service.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 meshtrade_option_method_options_v1_method_options_pb = require('../../../../meshtrade/option/method_options/v1/method_options_pb.js');
|
|
25
|
+
goog.object.extend(proto, meshtrade_option_method_options_v1_method_options_pb);
|
|
26
|
+
var meshtrade_trading_market_order_v1_market_order_pb = require('../../../../meshtrade/trading/market_order/v1/market_order_pb.js');
|
|
27
|
+
goog.object.extend(proto, meshtrade_trading_market_order_v1_market_order_pb);
|
|
28
|
+
goog.exportSymbol('proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest', null, global);
|
|
29
|
+
/**
|
|
30
|
+
* Generated by JsPbCodeGenerator.
|
|
31
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
32
|
+
* server response, or constructed directly in Javascript. The array is used
|
|
33
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
|
34
|
+
* If no data is provided, the constructed object will be empty, but still
|
|
35
|
+
* valid.
|
|
36
|
+
* @extends {jspb.Message}
|
|
37
|
+
* @constructor
|
|
38
|
+
*/
|
|
39
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest = function(opt_data) {
|
|
40
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
|
41
|
+
};
|
|
42
|
+
goog.inherits(proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest, jspb.Message);
|
|
43
|
+
if (goog.DEBUG && !COMPILED) {
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
* @override
|
|
47
|
+
*/
|
|
48
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.displayName = 'proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
54
|
+
/**
|
|
55
|
+
* Creates an object representation of this proto.
|
|
56
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
57
|
+
* Optional fields that are not set will be set to undefined.
|
|
58
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
59
|
+
* For the list of reserved names please see:
|
|
60
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
61
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
62
|
+
* JSPB instance for transitional soy proto support:
|
|
63
|
+
* http://goto/soy-param-migration
|
|
64
|
+
* @return {!Object}
|
|
65
|
+
*/
|
|
66
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.prototype.toObject = function(opt_includeInstance) {
|
|
67
|
+
return proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.toObject(opt_includeInstance, this);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Static version of the {@see toObject} method.
|
|
73
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
74
|
+
* the JSPB instance for transitional soy proto support:
|
|
75
|
+
* http://goto/soy-param-migration
|
|
76
|
+
* @param {!proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest} msg The msg instance to transform.
|
|
77
|
+
* @return {!Object}
|
|
78
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
79
|
+
*/
|
|
80
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.toObject = function(includeInstance, msg) {
|
|
81
|
+
var f, obj = {
|
|
82
|
+
number: jspb.Message.getFieldWithDefault(msg, 1, "")
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
if (includeInstance) {
|
|
86
|
+
obj.$jspbMessageInstance = msg;
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Deserializes binary data (in protobuf wire format).
|
|
95
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
96
|
+
* @return {!proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest}
|
|
97
|
+
*/
|
|
98
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.deserializeBinary = function(bytes) {
|
|
99
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
100
|
+
var msg = new proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest;
|
|
101
|
+
return proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.deserializeBinaryFromReader(msg, reader);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
107
|
+
* given reader into the given message object.
|
|
108
|
+
* @param {!proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest} msg The message object to deserialize into.
|
|
109
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
110
|
+
* @return {!proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest}
|
|
111
|
+
*/
|
|
112
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.deserializeBinaryFromReader = function(msg, reader) {
|
|
113
|
+
while (reader.nextField()) {
|
|
114
|
+
if (reader.isEndGroup()) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
var field = reader.getFieldNumber();
|
|
118
|
+
switch (field) {
|
|
119
|
+
case 1:
|
|
120
|
+
var value = /** @type {string} */ (reader.readString());
|
|
121
|
+
msg.setNumber(value);
|
|
122
|
+
break;
|
|
123
|
+
default:
|
|
124
|
+
reader.skipField();
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return msg;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
134
|
+
* @return {!Uint8Array}
|
|
135
|
+
*/
|
|
136
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.prototype.serializeBinary = function() {
|
|
137
|
+
var writer = new jspb.BinaryWriter();
|
|
138
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.serializeBinaryToWriter(this, writer);
|
|
139
|
+
return writer.getResultBuffer();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
145
|
+
* format), writing to the given BinaryWriter.
|
|
146
|
+
* @param {!proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest} message
|
|
147
|
+
* @param {!jspb.BinaryWriter} writer
|
|
148
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
149
|
+
*/
|
|
150
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.serializeBinaryToWriter = function(message, writer) {
|
|
151
|
+
var f = undefined;
|
|
152
|
+
f = message.getNumber();
|
|
153
|
+
if (f.length > 0) {
|
|
154
|
+
writer.writeString(
|
|
155
|
+
1,
|
|
156
|
+
f
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* optional string number = 1;
|
|
164
|
+
* @return {string}
|
|
165
|
+
*/
|
|
166
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.prototype.getNumber = function() {
|
|
167
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @param {string} value
|
|
173
|
+
* @return {!proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest} returns this
|
|
174
|
+
*/
|
|
175
|
+
proto.meshtrade.trading.market_order.v1.GetMarketOrderRequest.prototype.setNumber = function(value) {
|
|
176
|
+
return jspb.Message.setProto3StringField(this, 1, value);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
goog.object.extend(exports, proto.meshtrade.trading.market_order.v1);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as jspb from 'google-protobuf'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class Address extends jspb.Message {
|
|
6
|
+
getAddressLinesList(): Array<string>;
|
|
7
|
+
setAddressLinesList(value: Array<string>): Address;
|
|
8
|
+
clearAddressLinesList(): Address;
|
|
9
|
+
addAddressLines(value: string, index?: number): Address;
|
|
10
|
+
|
|
11
|
+
getSuburb(): string;
|
|
12
|
+
setSuburb(value: string): Address;
|
|
13
|
+
|
|
14
|
+
getCity(): string;
|
|
15
|
+
setCity(value: string): Address;
|
|
16
|
+
|
|
17
|
+
getProvince(): string;
|
|
18
|
+
setProvince(value: string): Address;
|
|
19
|
+
|
|
20
|
+
getCountryCode(): string;
|
|
21
|
+
setCountryCode(value: string): Address;
|
|
22
|
+
|
|
23
|
+
getPostalCode(): string;
|
|
24
|
+
setPostalCode(value: string): Address;
|
|
25
|
+
|
|
26
|
+
serializeBinary(): Uint8Array;
|
|
27
|
+
toObject(includeInstance?: boolean): Address.AsObject;
|
|
28
|
+
static toObject(includeInstance: boolean, msg: Address): Address.AsObject;
|
|
29
|
+
static serializeBinaryToWriter(message: Address, writer: jspb.BinaryWriter): void;
|
|
30
|
+
static deserializeBinary(bytes: Uint8Array): Address;
|
|
31
|
+
static deserializeBinaryFromReader(message: Address, reader: jspb.BinaryReader): Address;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export namespace Address {
|
|
35
|
+
export type AsObject = {
|
|
36
|
+
addressLinesList: Array<string>,
|
|
37
|
+
suburb: string,
|
|
38
|
+
city: string,
|
|
39
|
+
province: string,
|
|
40
|
+
countryCode: string,
|
|
41
|
+
postalCode: string,
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
// source: meshtrade/type/v1/address.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.type.v1.Address', null, global);
|
|
25
|
+
/**
|
|
26
|
+
* Generated by JsPbCodeGenerator.
|
|
27
|
+
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
28
|
+
* server response, or constructed directly in Javascript. The array is used
|
|
29
|
+
* in place and becomes part of the constructed object. It is not cloned.
|
|
30
|
+
* If no data is provided, the constructed object will be empty, but still
|
|
31
|
+
* valid.
|
|
32
|
+
* @extends {jspb.Message}
|
|
33
|
+
* @constructor
|
|
34
|
+
*/
|
|
35
|
+
proto.meshtrade.type.v1.Address = function(opt_data) {
|
|
36
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.meshtrade.type.v1.Address.repeatedFields_, null);
|
|
37
|
+
};
|
|
38
|
+
goog.inherits(proto.meshtrade.type.v1.Address, jspb.Message);
|
|
39
|
+
if (goog.DEBUG && !COMPILED) {
|
|
40
|
+
/**
|
|
41
|
+
* @public
|
|
42
|
+
* @override
|
|
43
|
+
*/
|
|
44
|
+
proto.meshtrade.type.v1.Address.displayName = 'proto.meshtrade.type.v1.Address';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* List of repeated fields within this message type.
|
|
49
|
+
* @private {!Array<number>}
|
|
50
|
+
* @const
|
|
51
|
+
*/
|
|
52
|
+
proto.meshtrade.type.v1.Address.repeatedFields_ = [1];
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
57
|
+
/**
|
|
58
|
+
* Creates an object representation of this proto.
|
|
59
|
+
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
|
60
|
+
* Optional fields that are not set will be set to undefined.
|
|
61
|
+
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
|
62
|
+
* For the list of reserved names please see:
|
|
63
|
+
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
|
64
|
+
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
|
65
|
+
* JSPB instance for transitional soy proto support:
|
|
66
|
+
* http://goto/soy-param-migration
|
|
67
|
+
* @return {!Object}
|
|
68
|
+
*/
|
|
69
|
+
proto.meshtrade.type.v1.Address.prototype.toObject = function(opt_includeInstance) {
|
|
70
|
+
return proto.meshtrade.type.v1.Address.toObject(opt_includeInstance, this);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Static version of the {@see toObject} method.
|
|
76
|
+
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
|
77
|
+
* the JSPB instance for transitional soy proto support:
|
|
78
|
+
* http://goto/soy-param-migration
|
|
79
|
+
* @param {!proto.meshtrade.type.v1.Address} msg The msg instance to transform.
|
|
80
|
+
* @return {!Object}
|
|
81
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
82
|
+
*/
|
|
83
|
+
proto.meshtrade.type.v1.Address.toObject = function(includeInstance, msg) {
|
|
84
|
+
var f, obj = {
|
|
85
|
+
addressLinesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f,
|
|
86
|
+
suburb: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
87
|
+
city: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
88
|
+
province: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
|
89
|
+
countryCode: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
90
|
+
postalCode: jspb.Message.getFieldWithDefault(msg, 6, "")
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
if (includeInstance) {
|
|
94
|
+
obj.$jspbMessageInstance = msg;
|
|
95
|
+
}
|
|
96
|
+
return obj;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Deserializes binary data (in protobuf wire format).
|
|
103
|
+
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
104
|
+
* @return {!proto.meshtrade.type.v1.Address}
|
|
105
|
+
*/
|
|
106
|
+
proto.meshtrade.type.v1.Address.deserializeBinary = function(bytes) {
|
|
107
|
+
var reader = new jspb.BinaryReader(bytes);
|
|
108
|
+
var msg = new proto.meshtrade.type.v1.Address;
|
|
109
|
+
return proto.meshtrade.type.v1.Address.deserializeBinaryFromReader(msg, reader);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Deserializes binary data (in protobuf wire format) from the
|
|
115
|
+
* given reader into the given message object.
|
|
116
|
+
* @param {!proto.meshtrade.type.v1.Address} msg The message object to deserialize into.
|
|
117
|
+
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
|
118
|
+
* @return {!proto.meshtrade.type.v1.Address}
|
|
119
|
+
*/
|
|
120
|
+
proto.meshtrade.type.v1.Address.deserializeBinaryFromReader = function(msg, reader) {
|
|
121
|
+
while (reader.nextField()) {
|
|
122
|
+
if (reader.isEndGroup()) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
var field = reader.getFieldNumber();
|
|
126
|
+
switch (field) {
|
|
127
|
+
case 1:
|
|
128
|
+
var value = /** @type {string} */ (reader.readString());
|
|
129
|
+
msg.addAddressLines(value);
|
|
130
|
+
break;
|
|
131
|
+
case 2:
|
|
132
|
+
var value = /** @type {string} */ (reader.readString());
|
|
133
|
+
msg.setSuburb(value);
|
|
134
|
+
break;
|
|
135
|
+
case 3:
|
|
136
|
+
var value = /** @type {string} */ (reader.readString());
|
|
137
|
+
msg.setCity(value);
|
|
138
|
+
break;
|
|
139
|
+
case 4:
|
|
140
|
+
var value = /** @type {string} */ (reader.readString());
|
|
141
|
+
msg.setProvince(value);
|
|
142
|
+
break;
|
|
143
|
+
case 5:
|
|
144
|
+
var value = /** @type {string} */ (reader.readString());
|
|
145
|
+
msg.setCountryCode(value);
|
|
146
|
+
break;
|
|
147
|
+
case 6:
|
|
148
|
+
var value = /** @type {string} */ (reader.readString());
|
|
149
|
+
msg.setPostalCode(value);
|
|
150
|
+
break;
|
|
151
|
+
default:
|
|
152
|
+
reader.skipField();
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return msg;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Serializes the message to binary data (in protobuf wire format).
|
|
162
|
+
* @return {!Uint8Array}
|
|
163
|
+
*/
|
|
164
|
+
proto.meshtrade.type.v1.Address.prototype.serializeBinary = function() {
|
|
165
|
+
var writer = new jspb.BinaryWriter();
|
|
166
|
+
proto.meshtrade.type.v1.Address.serializeBinaryToWriter(this, writer);
|
|
167
|
+
return writer.getResultBuffer();
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Serializes the given message to binary data (in protobuf wire
|
|
173
|
+
* format), writing to the given BinaryWriter.
|
|
174
|
+
* @param {!proto.meshtrade.type.v1.Address} message
|
|
175
|
+
* @param {!jspb.BinaryWriter} writer
|
|
176
|
+
* @suppress {unusedLocalVariables} f is only used for nested messages
|
|
177
|
+
*/
|
|
178
|
+
proto.meshtrade.type.v1.Address.serializeBinaryToWriter = function(message, writer) {
|
|
179
|
+
var f = undefined;
|
|
180
|
+
f = message.getAddressLinesList();
|
|
181
|
+
if (f.length > 0) {
|
|
182
|
+
writer.writeRepeatedString(
|
|
183
|
+
1,
|
|
184
|
+
f
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
f = message.getSuburb();
|
|
188
|
+
if (f.length > 0) {
|
|
189
|
+
writer.writeString(
|
|
190
|
+
2,
|
|
191
|
+
f
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
f = message.getCity();
|
|
195
|
+
if (f.length > 0) {
|
|
196
|
+
writer.writeString(
|
|
197
|
+
3,
|
|
198
|
+
f
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
f = message.getProvince();
|
|
202
|
+
if (f.length > 0) {
|
|
203
|
+
writer.writeString(
|
|
204
|
+
4,
|
|
205
|
+
f
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
f = message.getCountryCode();
|
|
209
|
+
if (f.length > 0) {
|
|
210
|
+
writer.writeString(
|
|
211
|
+
5,
|
|
212
|
+
f
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
f = message.getPostalCode();
|
|
216
|
+
if (f.length > 0) {
|
|
217
|
+
writer.writeString(
|
|
218
|
+
6,
|
|
219
|
+
f
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* repeated string address_lines = 1;
|
|
227
|
+
* @return {!Array<string>}
|
|
228
|
+
*/
|
|
229
|
+
proto.meshtrade.type.v1.Address.prototype.getAddressLinesList = function() {
|
|
230
|
+
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @param {!Array<string>} value
|
|
236
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
237
|
+
*/
|
|
238
|
+
proto.meshtrade.type.v1.Address.prototype.setAddressLinesList = function(value) {
|
|
239
|
+
return jspb.Message.setField(this, 1, value || []);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @param {string} value
|
|
245
|
+
* @param {number=} opt_index
|
|
246
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
247
|
+
*/
|
|
248
|
+
proto.meshtrade.type.v1.Address.prototype.addAddressLines = function(value, opt_index) {
|
|
249
|
+
return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Clears the list making it empty but non-null.
|
|
255
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
256
|
+
*/
|
|
257
|
+
proto.meshtrade.type.v1.Address.prototype.clearAddressLinesList = function() {
|
|
258
|
+
return this.setAddressLinesList([]);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* optional string suburb = 2;
|
|
264
|
+
* @return {string}
|
|
265
|
+
*/
|
|
266
|
+
proto.meshtrade.type.v1.Address.prototype.getSuburb = function() {
|
|
267
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @param {string} value
|
|
273
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
274
|
+
*/
|
|
275
|
+
proto.meshtrade.type.v1.Address.prototype.setSuburb = function(value) {
|
|
276
|
+
return jspb.Message.setProto3StringField(this, 2, value);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* optional string city = 3;
|
|
282
|
+
* @return {string}
|
|
283
|
+
*/
|
|
284
|
+
proto.meshtrade.type.v1.Address.prototype.getCity = function() {
|
|
285
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @param {string} value
|
|
291
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
292
|
+
*/
|
|
293
|
+
proto.meshtrade.type.v1.Address.prototype.setCity = function(value) {
|
|
294
|
+
return jspb.Message.setProto3StringField(this, 3, value);
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* optional string province = 4;
|
|
300
|
+
* @return {string}
|
|
301
|
+
*/
|
|
302
|
+
proto.meshtrade.type.v1.Address.prototype.getProvince = function() {
|
|
303
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @param {string} value
|
|
309
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
310
|
+
*/
|
|
311
|
+
proto.meshtrade.type.v1.Address.prototype.setProvince = function(value) {
|
|
312
|
+
return jspb.Message.setProto3StringField(this, 4, value);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* optional string country_code = 5;
|
|
318
|
+
* @return {string}
|
|
319
|
+
*/
|
|
320
|
+
proto.meshtrade.type.v1.Address.prototype.getCountryCode = function() {
|
|
321
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @param {string} value
|
|
327
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
328
|
+
*/
|
|
329
|
+
proto.meshtrade.type.v1.Address.prototype.setCountryCode = function(value) {
|
|
330
|
+
return jspb.Message.setProto3StringField(this, 5, value);
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* optional string postal_code = 6;
|
|
336
|
+
* @return {string}
|
|
337
|
+
*/
|
|
338
|
+
proto.meshtrade.type.v1.Address.prototype.getPostalCode = function() {
|
|
339
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @param {string} value
|
|
345
|
+
* @return {!proto.meshtrade.type.v1.Address} returns this
|
|
346
|
+
*/
|
|
347
|
+
proto.meshtrade.type.v1.Address.prototype.setPostalCode = function(value) {
|
|
348
|
+
return jspb.Message.setProto3StringField(this, 6, value);
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
goog.object.extend(exports, proto.meshtrade.type.v1);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Amount } from "./amount_pb";
|
|
2
|
+
import { Token } from "./token_pb";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
import { Decimal } from "./decimal_pb";
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new Amount of the given Token.
|
|
7
|
+
*
|
|
8
|
+
* @param {BigNumber | Decimal | string | undefined} amount - The amount in BigNumber, num.Decimal or string format.
|
|
9
|
+
* @param {Token} token - The token type that the amount is denominated in.
|
|
10
|
+
* @returns {Amount} Returns an Amount object that contains the value in Decimal format and the type of token.
|
|
11
|
+
*/
|
|
12
|
+
export declare function newAmountOfToken(amount: BigNumber | Decimal | string | undefined, token?: Token): Amount;
|
|
13
|
+
export declare function amountIsUndefined(amount?: Amount): boolean;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.newAmountOfToken = newAmountOfToken;
|
|
7
|
+
exports.amountIsUndefined = amountIsUndefined;
|
|
8
|
+
const amount_pb_1 = require("./amount_pb");
|
|
9
|
+
const decimalConversions_1 = require("./decimalConversions");
|
|
10
|
+
const ledger_1 = require("./ledger");
|
|
11
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
12
|
+
const decimal_pb_1 = require("./decimal_pb");
|
|
13
|
+
const ledger_pb_1 = require("./ledger_pb");
|
|
14
|
+
const token_1 = require("./token");
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new Amount object using a BigNumber and a Token.
|
|
17
|
+
*
|
|
18
|
+
* @param {BigNumber} amount - The amount in BigNumber format to be converted to Decimal.
|
|
19
|
+
* @param {Token} token - The token type that the amount is denominated in.
|
|
20
|
+
* @returns {Amount} Returns an Amount object that contains the value in Decimal format and the type of token.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* This function leverages the bigNumberToDecimal function to convert the BigNumber amount into a Decimal object.
|
|
24
|
+
* The resulting Decimal object and the provided Token are then used to construct and return a new Amount object.
|
|
25
|
+
* NOTE: this performs the necessary truncation so that the resultant amount contains a valid number of
|
|
26
|
+
* decimal places for the target ledger.
|
|
27
|
+
*/
|
|
28
|
+
function newAmountFromBigNumber(amount, token) {
|
|
29
|
+
return new amount_pb_1.Amount()
|
|
30
|
+
.setValue((0, decimalConversions_1.bigNumberToDecimal)(amount.decimalPlaces((0, ledger_1.getLedgerNoDecimalPlaces)(token?.getLedger() ?? ledger_pb_1.Ledger.LEDGER_UNSPECIFIED), bignumber_js_1.default.ROUND_HALF_DOWN)))
|
|
31
|
+
.setToken(token);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new Amount of the given Token.
|
|
35
|
+
*
|
|
36
|
+
* @param {BigNumber | Decimal | string | undefined} amount - The amount in BigNumber, num.Decimal or string format.
|
|
37
|
+
* @param {Token} token - The token type that the amount is denominated in.
|
|
38
|
+
* @returns {Amount} Returns an Amount object that contains the value in Decimal format and the type of token.
|
|
39
|
+
*/
|
|
40
|
+
function newAmountOfToken(amount, token) {
|
|
41
|
+
let value = new bignumber_js_1.default("0");
|
|
42
|
+
if (!amount) {
|
|
43
|
+
value = new bignumber_js_1.default("0");
|
|
44
|
+
}
|
|
45
|
+
else if (amount instanceof bignumber_js_1.default) {
|
|
46
|
+
value = amount;
|
|
47
|
+
}
|
|
48
|
+
else if (amount instanceof decimal_pb_1.Decimal) {
|
|
49
|
+
value = (0, decimalConversions_1.decimalToBigNumber)(amount);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (isNaN(Number(amount))) {
|
|
53
|
+
value = new bignumber_js_1.default("0");
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
value = new bignumber_js_1.default(amount);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return newAmountFromBigNumber(value, token);
|
|
60
|
+
}
|
|
61
|
+
function amountIsUndefined(amount) {
|
|
62
|
+
if (!amount) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return (0, token_1.tokenIsUndefined)(amount.getToken());
|
|
66
|
+
}
|