carbon-js-sdk 0.4.19 → 0.4.21

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 (63) hide show
  1. package/lib/clients/TokenClient.js +1 -2
  2. package/lib/codec/ethermint/crypto/v1/ethsecp256k1/export.d.ts +1 -0
  3. package/lib/codec/ethermint/crypto/v1/ethsecp256k1/export.js +6 -0
  4. package/lib/codec/ethermint/evm/v1/export.d.ts +5 -0
  5. package/lib/codec/ethermint/evm/v1/export.js +53 -0
  6. package/lib/codec/ethermint/feemarket/v1/export.d.ts +4 -0
  7. package/lib/codec/ethermint/feemarket/v1/export.js +18 -0
  8. package/lib/codec/ethermint/types/v1/export.d.ts +4 -0
  9. package/lib/codec/ethermint/types/v1/export.js +11 -0
  10. package/lib/codec/ethermint-models.d.ts +4 -0
  11. package/lib/codec/ethermint-models.js +26 -0
  12. package/lib/codec/market/fee.d.ts +123 -0
  13. package/lib/codec/market/fee.js +334 -0
  14. package/lib/codec/perpsliquidity/event.d.ts +102 -0
  15. package/lib/codec/perpsliquidity/event.js +581 -0
  16. package/lib/codec/perpsliquidity/genesis.d.ts +35 -0
  17. package/lib/codec/perpsliquidity/genesis.js +162 -0
  18. package/lib/codec/perpsliquidity/params.d.ts +24 -0
  19. package/lib/codec/perpsliquidity/params.js +103 -0
  20. package/lib/codec/perpsliquidity/pool.d.ts +137 -0
  21. package/lib/codec/perpsliquidity/pool.js +747 -0
  22. package/lib/codec/perpsliquidity/query.d.ts +167 -0
  23. package/lib/codec/perpsliquidity/query.js +719 -0
  24. package/lib/codec/perpsliquidity/tx.d.ts +199 -0
  25. package/lib/codec/perpsliquidity/tx.js +940 -0
  26. package/lib/constant/eip712.d.ts +46 -0
  27. package/lib/constant/eip712.js +106 -0
  28. package/lib/constant/network.js +2 -2
  29. package/lib/modules/evm.d.ts +46 -0
  30. package/lib/modules/evm.js +127 -0
  31. package/lib/modules/evmmerge.d.ts +12 -0
  32. package/lib/modules/evmmerge.js +35 -0
  33. package/lib/modules/feemarket.d.ts +20 -0
  34. package/lib/modules/feemarket.js +45 -0
  35. package/lib/modules/vault.d.ts +44 -0
  36. package/lib/modules/vault.js +95 -0
  37. package/lib/provider/amino/types/evm.d.ts +4 -0
  38. package/lib/provider/amino/types/evm.js +40 -0
  39. package/lib/provider/amino/types/evmmerge.d.ts +4 -0
  40. package/lib/provider/amino/types/evmmerge.js +34 -0
  41. package/lib/provider/amino/types/feemarket.d.ts +4 -0
  42. package/lib/provider/amino/types/feemarket.js +34 -0
  43. package/lib/provider/metamask/legacy-accounts.d.ts +6 -0
  44. package/lib/provider/metamask/legacy-accounts.js +44 -0
  45. package/lib/util/eip712.d.ts +10 -0
  46. package/lib/util/eip712.js +195 -0
  47. package/lib/util/ethermint.d.ts +8 -0
  48. package/lib/util/ethermint.js +68 -0
  49. package/lib/util/legacyEIP712.d.ts +20 -0
  50. package/lib/util/legacyEIP712.js +98 -0
  51. package/package.json +1 -1
  52. package/lib/clients/EvmIbcClient.d.ts +0 -86
  53. package/lib/clients/EvmIbcClient.js +0 -90
  54. package/lib/codec/broker/incoming_pool_swap.d.ts +0 -23
  55. package/lib/codec/broker/incoming_pool_swap.js +0 -136
  56. package/lib/util/ethermint/evm-ibc.d.ts +0 -97
  57. package/lib/util/ethermint/evm-ibc.js +0 -134
  58. package/lib/util/ethermint/index.d.ts +0 -3
  59. package/lib/util/ethermint/index.js +0 -12
  60. package/lib/util/ethermint/keys.d.ts +0 -39
  61. package/lib/util/ethermint/keys.js +0 -138
  62. package/lib/util/ethermint/web3.d.ts +0 -36
  63. package/lib/util/ethermint/web3.js +0 -124
@@ -69,12 +69,11 @@ class TokenClient {
69
69
  this.setCommonAssetConfig();
70
70
  yield this.reloadWrapperMap();
71
71
  yield this.reloadTokens();
72
- yield this.reloadDenomGeckoMap();
73
72
  yield this.reloadDenomTraces();
74
73
  yield this.getBridges();
75
74
  // non-blocking reload
76
75
  try {
77
- this.reloadUSDValues();
76
+ this.reloadDenomGeckoMap().finally(() => this.reloadUSDValues());
78
77
  }
79
78
  catch (error) {
80
79
  console.error("failed to reload usd values");
@@ -0,0 +1 @@
1
+ export { PubKey, PrivKey } from "./keys";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrivKey = exports.PubKey = void 0;
4
+ var keys_1 = require("./keys");
5
+ Object.defineProperty(exports, "PubKey", { enumerable: true, get: function () { return keys_1.PubKey; } });
6
+ Object.defineProperty(exports, "PrivKey", { enumerable: true, get: function () { return keys_1.PrivKey; } });
@@ -0,0 +1,5 @@
1
+ export { EventEthereumTx, EventTxLog, EventMessage, EventBlockBloom } from "./events";
2
+ export { Params, ChainConfig, State, TransactionLogs, Log, TxResult, AccessTuple, TraceConfig } from "./evm";
3
+ export { GenesisAccount } from "./genesis";
4
+ export { QueryAccountRequest, QueryAccountResponse, QueryCosmosAccountRequest, QueryCosmosAccountResponse, QueryValidatorAccountRequest, QueryValidatorAccountResponse, QueryBalanceRequest, QueryBalanceResponse, QueryStorageRequest, QueryStorageResponse, QueryCodeRequest, QueryCodeResponse, QueryTxLogsRequest, QueryTxLogsResponse, QueryParamsRequest, QueryParamsResponse, EthCallRequest, EstimateGasResponse, QueryTraceTxRequest, QueryTraceTxResponse, QueryTraceBlockRequest, QueryTraceBlockResponse, QueryBaseFeeRequest, QueryBaseFeeResponse } from "./query";
5
+ export { MsgEthereumTx, LegacyTx, AccessListTx, DynamicFeeTx, ExtensionOptionsEthereumTx, MsgEthereumTxResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx";
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MsgUpdateParamsResponse = exports.MsgUpdateParams = exports.MsgEthereumTxResponse = exports.ExtensionOptionsEthereumTx = exports.DynamicFeeTx = exports.AccessListTx = exports.LegacyTx = exports.MsgEthereumTx = exports.QueryBaseFeeResponse = exports.QueryBaseFeeRequest = exports.QueryTraceBlockResponse = exports.QueryTraceBlockRequest = exports.QueryTraceTxResponse = exports.QueryTraceTxRequest = exports.EstimateGasResponse = exports.EthCallRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryTxLogsResponse = exports.QueryTxLogsRequest = exports.QueryCodeResponse = exports.QueryCodeRequest = exports.QueryStorageResponse = exports.QueryStorageRequest = exports.QueryBalanceResponse = exports.QueryBalanceRequest = exports.QueryValidatorAccountResponse = exports.QueryValidatorAccountRequest = exports.QueryCosmosAccountResponse = exports.QueryCosmosAccountRequest = exports.QueryAccountResponse = exports.QueryAccountRequest = exports.GenesisAccount = exports.TraceConfig = exports.AccessTuple = exports.TxResult = exports.Log = exports.TransactionLogs = exports.State = exports.ChainConfig = exports.Params = exports.EventBlockBloom = exports.EventMessage = exports.EventTxLog = exports.EventEthereumTx = void 0;
4
+ var events_1 = require("./events");
5
+ Object.defineProperty(exports, "EventEthereumTx", { enumerable: true, get: function () { return events_1.EventEthereumTx; } });
6
+ Object.defineProperty(exports, "EventTxLog", { enumerable: true, get: function () { return events_1.EventTxLog; } });
7
+ Object.defineProperty(exports, "EventMessage", { enumerable: true, get: function () { return events_1.EventMessage; } });
8
+ Object.defineProperty(exports, "EventBlockBloom", { enumerable: true, get: function () { return events_1.EventBlockBloom; } });
9
+ var evm_1 = require("./evm");
10
+ Object.defineProperty(exports, "Params", { enumerable: true, get: function () { return evm_1.Params; } });
11
+ Object.defineProperty(exports, "ChainConfig", { enumerable: true, get: function () { return evm_1.ChainConfig; } });
12
+ Object.defineProperty(exports, "State", { enumerable: true, get: function () { return evm_1.State; } });
13
+ Object.defineProperty(exports, "TransactionLogs", { enumerable: true, get: function () { return evm_1.TransactionLogs; } });
14
+ Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return evm_1.Log; } });
15
+ Object.defineProperty(exports, "TxResult", { enumerable: true, get: function () { return evm_1.TxResult; } });
16
+ Object.defineProperty(exports, "AccessTuple", { enumerable: true, get: function () { return evm_1.AccessTuple; } });
17
+ Object.defineProperty(exports, "TraceConfig", { enumerable: true, get: function () { return evm_1.TraceConfig; } });
18
+ var genesis_1 = require("./genesis");
19
+ Object.defineProperty(exports, "GenesisAccount", { enumerable: true, get: function () { return genesis_1.GenesisAccount; } });
20
+ var query_1 = require("./query");
21
+ Object.defineProperty(exports, "QueryAccountRequest", { enumerable: true, get: function () { return query_1.QueryAccountRequest; } });
22
+ Object.defineProperty(exports, "QueryAccountResponse", { enumerable: true, get: function () { return query_1.QueryAccountResponse; } });
23
+ Object.defineProperty(exports, "QueryCosmosAccountRequest", { enumerable: true, get: function () { return query_1.QueryCosmosAccountRequest; } });
24
+ Object.defineProperty(exports, "QueryCosmosAccountResponse", { enumerable: true, get: function () { return query_1.QueryCosmosAccountResponse; } });
25
+ Object.defineProperty(exports, "QueryValidatorAccountRequest", { enumerable: true, get: function () { return query_1.QueryValidatorAccountRequest; } });
26
+ Object.defineProperty(exports, "QueryValidatorAccountResponse", { enumerable: true, get: function () { return query_1.QueryValidatorAccountResponse; } });
27
+ Object.defineProperty(exports, "QueryBalanceRequest", { enumerable: true, get: function () { return query_1.QueryBalanceRequest; } });
28
+ Object.defineProperty(exports, "QueryBalanceResponse", { enumerable: true, get: function () { return query_1.QueryBalanceResponse; } });
29
+ Object.defineProperty(exports, "QueryStorageRequest", { enumerable: true, get: function () { return query_1.QueryStorageRequest; } });
30
+ Object.defineProperty(exports, "QueryStorageResponse", { enumerable: true, get: function () { return query_1.QueryStorageResponse; } });
31
+ Object.defineProperty(exports, "QueryCodeRequest", { enumerable: true, get: function () { return query_1.QueryCodeRequest; } });
32
+ Object.defineProperty(exports, "QueryCodeResponse", { enumerable: true, get: function () { return query_1.QueryCodeResponse; } });
33
+ Object.defineProperty(exports, "QueryTxLogsRequest", { enumerable: true, get: function () { return query_1.QueryTxLogsRequest; } });
34
+ Object.defineProperty(exports, "QueryTxLogsResponse", { enumerable: true, get: function () { return query_1.QueryTxLogsResponse; } });
35
+ Object.defineProperty(exports, "QueryParamsRequest", { enumerable: true, get: function () { return query_1.QueryParamsRequest; } });
36
+ Object.defineProperty(exports, "QueryParamsResponse", { enumerable: true, get: function () { return query_1.QueryParamsResponse; } });
37
+ Object.defineProperty(exports, "EthCallRequest", { enumerable: true, get: function () { return query_1.EthCallRequest; } });
38
+ Object.defineProperty(exports, "EstimateGasResponse", { enumerable: true, get: function () { return query_1.EstimateGasResponse; } });
39
+ Object.defineProperty(exports, "QueryTraceTxRequest", { enumerable: true, get: function () { return query_1.QueryTraceTxRequest; } });
40
+ Object.defineProperty(exports, "QueryTraceTxResponse", { enumerable: true, get: function () { return query_1.QueryTraceTxResponse; } });
41
+ Object.defineProperty(exports, "QueryTraceBlockRequest", { enumerable: true, get: function () { return query_1.QueryTraceBlockRequest; } });
42
+ Object.defineProperty(exports, "QueryTraceBlockResponse", { enumerable: true, get: function () { return query_1.QueryTraceBlockResponse; } });
43
+ Object.defineProperty(exports, "QueryBaseFeeRequest", { enumerable: true, get: function () { return query_1.QueryBaseFeeRequest; } });
44
+ Object.defineProperty(exports, "QueryBaseFeeResponse", { enumerable: true, get: function () { return query_1.QueryBaseFeeResponse; } });
45
+ var tx_1 = require("./tx");
46
+ Object.defineProperty(exports, "MsgEthereumTx", { enumerable: true, get: function () { return tx_1.MsgEthereumTx; } });
47
+ Object.defineProperty(exports, "LegacyTx", { enumerable: true, get: function () { return tx_1.LegacyTx; } });
48
+ Object.defineProperty(exports, "AccessListTx", { enumerable: true, get: function () { return tx_1.AccessListTx; } });
49
+ Object.defineProperty(exports, "DynamicFeeTx", { enumerable: true, get: function () { return tx_1.DynamicFeeTx; } });
50
+ Object.defineProperty(exports, "ExtensionOptionsEthereumTx", { enumerable: true, get: function () { return tx_1.ExtensionOptionsEthereumTx; } });
51
+ Object.defineProperty(exports, "MsgEthereumTxResponse", { enumerable: true, get: function () { return tx_1.MsgEthereumTxResponse; } });
52
+ Object.defineProperty(exports, "MsgUpdateParams", { enumerable: true, get: function () { return tx_1.MsgUpdateParams; } });
53
+ Object.defineProperty(exports, "MsgUpdateParamsResponse", { enumerable: true, get: function () { return tx_1.MsgUpdateParamsResponse; } });
@@ -0,0 +1,4 @@
1
+ export { EventFeeMarket, EventBlockGas } from "./events";
2
+ export { Params } from "./feemarket";
3
+ export { QueryParamsRequest, QueryParamsResponse, QueryBaseFeeRequest, QueryBaseFeeResponse, QueryBlockGasRequest, QueryBlockGasResponse } from "./query";
4
+ export { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MsgUpdateParamsResponse = exports.MsgUpdateParams = exports.QueryBlockGasResponse = exports.QueryBlockGasRequest = exports.QueryBaseFeeResponse = exports.QueryBaseFeeRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.Params = exports.EventBlockGas = exports.EventFeeMarket = void 0;
4
+ var events_1 = require("./events");
5
+ Object.defineProperty(exports, "EventFeeMarket", { enumerable: true, get: function () { return events_1.EventFeeMarket; } });
6
+ Object.defineProperty(exports, "EventBlockGas", { enumerable: true, get: function () { return events_1.EventBlockGas; } });
7
+ var feemarket_1 = require("./feemarket");
8
+ Object.defineProperty(exports, "Params", { enumerable: true, get: function () { return feemarket_1.Params; } });
9
+ var query_1 = require("./query");
10
+ Object.defineProperty(exports, "QueryParamsRequest", { enumerable: true, get: function () { return query_1.QueryParamsRequest; } });
11
+ Object.defineProperty(exports, "QueryParamsResponse", { enumerable: true, get: function () { return query_1.QueryParamsResponse; } });
12
+ Object.defineProperty(exports, "QueryBaseFeeRequest", { enumerable: true, get: function () { return query_1.QueryBaseFeeRequest; } });
13
+ Object.defineProperty(exports, "QueryBaseFeeResponse", { enumerable: true, get: function () { return query_1.QueryBaseFeeResponse; } });
14
+ Object.defineProperty(exports, "QueryBlockGasRequest", { enumerable: true, get: function () { return query_1.QueryBlockGasRequest; } });
15
+ Object.defineProperty(exports, "QueryBlockGasResponse", { enumerable: true, get: function () { return query_1.QueryBlockGasResponse; } });
16
+ var tx_1 = require("./tx");
17
+ Object.defineProperty(exports, "MsgUpdateParams", { enumerable: true, get: function () { return tx_1.MsgUpdateParams; } });
18
+ Object.defineProperty(exports, "MsgUpdateParamsResponse", { enumerable: true, get: function () { return tx_1.MsgUpdateParamsResponse; } });
@@ -0,0 +1,4 @@
1
+ export { EthAccount } from "./account";
2
+ export { ExtensionOptionDynamicFeeTx } from "./dynamic_fee";
3
+ export { TxResult } from "./indexer";
4
+ export { ExtensionOptionsWeb3Tx } from "./web3";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExtensionOptionsWeb3Tx = exports.TxResult = exports.ExtensionOptionDynamicFeeTx = exports.EthAccount = void 0;
4
+ var account_1 = require("./account");
5
+ Object.defineProperty(exports, "EthAccount", { enumerable: true, get: function () { return account_1.EthAccount; } });
6
+ var dynamic_fee_1 = require("./dynamic_fee");
7
+ Object.defineProperty(exports, "ExtensionOptionDynamicFeeTx", { enumerable: true, get: function () { return dynamic_fee_1.ExtensionOptionDynamicFeeTx; } });
8
+ var indexer_1 = require("./indexer");
9
+ Object.defineProperty(exports, "TxResult", { enumerable: true, get: function () { return indexer_1.TxResult; } });
10
+ var web3_1 = require("./web3");
11
+ Object.defineProperty(exports, "ExtensionOptionsWeb3Tx", { enumerable: true, get: function () { return web3_1.ExtensionOptionsWeb3Tx; } });
@@ -0,0 +1,4 @@
1
+ export * as Crypto from "./ethermint/crypto/v1/ethsecp256k1/export";
2
+ export * as Evm from "./ethermint/evm/v1/export";
3
+ export * as Feemarket from "./ethermint/feemarket/v1/export";
4
+ export * as Types from "./ethermint/types/v1/export";
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.Types = exports.Feemarket = exports.Evm = exports.Crypto = void 0;
23
+ exports.Crypto = __importStar(require("./ethermint/crypto/v1/ethsecp256k1/export"));
24
+ exports.Evm = __importStar(require("./ethermint/evm/v1/export"));
25
+ exports.Feemarket = __importStar(require("./ethermint/feemarket/v1/export"));
26
+ exports.Types = __importStar(require("./ethermint/types/v1/export"));
@@ -0,0 +1,123 @@
1
+ import Long from "long";
2
+ import _m0 from "protobufjs/minimal";
3
+ export declare const protobufPackage = "Switcheo.carbon.market";
4
+ /**
5
+ * A fee structure has multiple fee tiers are sorted by `required_stake`
6
+ * and a single fee category. When a trade is executed, the fee tier with
7
+ * the greatest required stake which is fulfilled by the user is used.
8
+ *
9
+ * There must always be at least one fee tier for the `spot` and `futures`
10
+ * `market_type` fee category that has 0 `required_stake` and no `whitelisted_address` so
11
+ * that it can act as the base fee for that market type.
12
+ */
13
+ export interface FeeStructure {
14
+ feeCategory?: FeeCategory;
15
+ feeTiers: FeeTier[];
16
+ }
17
+ /**
18
+ * The category for a given fee tier, identified by the
19
+ * market being traded via `market_type` or `market_id`, and
20
+ * optionally a `whitelisted_address`.
21
+ */
22
+ export interface FeeCategory {
23
+ /**
24
+ * Either `spot` or `futures` or nil. If nil, then
25
+ * a market_id must be provided.
26
+ */
27
+ marketType: string;
28
+ /**
29
+ * Can be used to override the `market_type` based fee to give
30
+ * specific markets a certain fee discount.
31
+ * Note that if there is already a fee tier for the user's stake that
32
+ * results in a lower fee for a given trade, that fee structure will be used instead.
33
+ */
34
+ marketId: string;
35
+ /**
36
+ * Optional parameter that can be used to give certain addresses
37
+ * additional fee tier(s) for the given `market_type` or `market_id`.
38
+ * Can only be used to reduce fees, not increase them. Can be used with module accounts.
39
+ */
40
+ whitelistedAddress: string;
41
+ }
42
+ /** A fee tier represents the trading fee for a user that meets the required stake. */
43
+ export interface FeeTier {
44
+ /** The required stake for a user for the fee tier to apply. */
45
+ requiredStake: string;
46
+ /** The taker and maker fee that applies when a trade is executed. */
47
+ tradingFees?: TradingFees;
48
+ }
49
+ /**
50
+ * The fees applied for each trade.
51
+ *
52
+ * Note that for greater `required_stake`, either the `taker_fee`
53
+ * or `maker_fee` must be reduced.
54
+ * Neither `taker_fee` nor `maker_fee` can be greater for
55
+ * a greater `required_stake`.
56
+ */
57
+ export interface TradingFees {
58
+ /**
59
+ * The fee applied when the order is executed in the smame
60
+ * block greater as when it is triggered.
61
+ * Cannot be negative.
62
+ */
63
+ takerFee: string;
64
+ /**
65
+ * The fee or rebate (when negative) applied when the order is executed
66
+ * in a block greater than when it is triggered.
67
+ */
68
+ makerFee: string;
69
+ }
70
+ /**
71
+ * Allows non stake coins to count as part of the
72
+ * `required_stake` in a fee tier.
73
+ *
74
+ * For each stake equivalance, the amount of coins for
75
+ * the specificed denom in the user's available balance
76
+ * at the time of the trade will be divided by the `ratio`
77
+ * and added to his actual stake amount when checking
78
+ * for fee tier feecategories.
79
+ */
80
+ export interface StakeEquivalence {
81
+ denom: string;
82
+ ratio: string;
83
+ }
84
+ export declare const FeeStructure: {
85
+ encode(message: FeeStructure, writer?: _m0.Writer): _m0.Writer;
86
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FeeStructure;
87
+ fromJSON(object: any): FeeStructure;
88
+ toJSON(message: FeeStructure): unknown;
89
+ fromPartial(object: DeepPartial<FeeStructure>): FeeStructure;
90
+ };
91
+ export declare const FeeCategory: {
92
+ encode(message: FeeCategory, writer?: _m0.Writer): _m0.Writer;
93
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FeeCategory;
94
+ fromJSON(object: any): FeeCategory;
95
+ toJSON(message: FeeCategory): unknown;
96
+ fromPartial(object: DeepPartial<FeeCategory>): FeeCategory;
97
+ };
98
+ export declare const FeeTier: {
99
+ encode(message: FeeTier, writer?: _m0.Writer): _m0.Writer;
100
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): FeeTier;
101
+ fromJSON(object: any): FeeTier;
102
+ toJSON(message: FeeTier): unknown;
103
+ fromPartial(object: DeepPartial<FeeTier>): FeeTier;
104
+ };
105
+ export declare const TradingFees: {
106
+ encode(message: TradingFees, writer?: _m0.Writer): _m0.Writer;
107
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): TradingFees;
108
+ fromJSON(object: any): TradingFees;
109
+ toJSON(message: TradingFees): unknown;
110
+ fromPartial(object: DeepPartial<TradingFees>): TradingFees;
111
+ };
112
+ export declare const StakeEquivalence: {
113
+ encode(message: StakeEquivalence, writer?: _m0.Writer): _m0.Writer;
114
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): StakeEquivalence;
115
+ fromJSON(object: any): StakeEquivalence;
116
+ toJSON(message: StakeEquivalence): unknown;
117
+ fromPartial(object: DeepPartial<StakeEquivalence>): StakeEquivalence;
118
+ };
119
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
120
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
121
+ [K in keyof T]?: DeepPartial<T[K]>;
122
+ } : Partial<T>;
123
+ export {};
@@ -0,0 +1,334 @@
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.StakeEquivalence = exports.TradingFees = exports.FeeTier = exports.FeeCategory = exports.FeeStructure = exports.protobufPackage = void 0;
7
+ /* eslint-disable */
8
+ const long_1 = __importDefault(require("long"));
9
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
+ exports.protobufPackage = "Switcheo.carbon.market";
11
+ const baseFeeStructure = {};
12
+ exports.FeeStructure = {
13
+ encode(message, writer = minimal_1.default.Writer.create()) {
14
+ if (message.feeCategory !== undefined) {
15
+ exports.FeeCategory.encode(message.feeCategory, writer.uint32(10).fork()).ldelim();
16
+ }
17
+ for (const v of message.feeTiers) {
18
+ exports.FeeTier.encode(v, writer.uint32(18).fork()).ldelim();
19
+ }
20
+ return writer;
21
+ },
22
+ decode(input, length) {
23
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
24
+ let end = length === undefined ? reader.len : reader.pos + length;
25
+ const message = Object.assign({}, baseFeeStructure);
26
+ message.feeTiers = [];
27
+ while (reader.pos < end) {
28
+ const tag = reader.uint32();
29
+ switch (tag >>> 3) {
30
+ case 1:
31
+ message.feeCategory = exports.FeeCategory.decode(reader, reader.uint32());
32
+ break;
33
+ case 2:
34
+ message.feeTiers.push(exports.FeeTier.decode(reader, reader.uint32()));
35
+ break;
36
+ default:
37
+ reader.skipType(tag & 7);
38
+ break;
39
+ }
40
+ }
41
+ return message;
42
+ },
43
+ fromJSON(object) {
44
+ var _a;
45
+ const message = Object.assign({}, baseFeeStructure);
46
+ message.feeCategory =
47
+ object.feeCategory !== undefined && object.feeCategory !== null
48
+ ? exports.FeeCategory.fromJSON(object.feeCategory)
49
+ : undefined;
50
+ message.feeTiers = ((_a = object.feeTiers) !== null && _a !== void 0 ? _a : []).map((e) => exports.FeeTier.fromJSON(e));
51
+ return message;
52
+ },
53
+ toJSON(message) {
54
+ const obj = {};
55
+ message.feeCategory !== undefined &&
56
+ (obj.feeCategory = message.feeCategory
57
+ ? exports.FeeCategory.toJSON(message.feeCategory)
58
+ : undefined);
59
+ if (message.feeTiers) {
60
+ obj.feeTiers = message.feeTiers.map((e) => e ? exports.FeeTier.toJSON(e) : undefined);
61
+ }
62
+ else {
63
+ obj.feeTiers = [];
64
+ }
65
+ return obj;
66
+ },
67
+ fromPartial(object) {
68
+ var _a;
69
+ const message = Object.assign({}, baseFeeStructure);
70
+ message.feeCategory =
71
+ object.feeCategory !== undefined && object.feeCategory !== null
72
+ ? exports.FeeCategory.fromPartial(object.feeCategory)
73
+ : undefined;
74
+ message.feeTiers = ((_a = object.feeTiers) !== null && _a !== void 0 ? _a : []).map((e) => exports.FeeTier.fromPartial(e));
75
+ return message;
76
+ },
77
+ };
78
+ const baseFeeCategory = {
79
+ marketType: "",
80
+ marketId: "",
81
+ whitelistedAddress: "",
82
+ };
83
+ exports.FeeCategory = {
84
+ encode(message, writer = minimal_1.default.Writer.create()) {
85
+ if (message.marketType !== "") {
86
+ writer.uint32(10).string(message.marketType);
87
+ }
88
+ if (message.marketId !== "") {
89
+ writer.uint32(18).string(message.marketId);
90
+ }
91
+ if (message.whitelistedAddress !== "") {
92
+ writer.uint32(34).string(message.whitelistedAddress);
93
+ }
94
+ return writer;
95
+ },
96
+ decode(input, length) {
97
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
98
+ let end = length === undefined ? reader.len : reader.pos + length;
99
+ const message = Object.assign({}, baseFeeCategory);
100
+ while (reader.pos < end) {
101
+ const tag = reader.uint32();
102
+ switch (tag >>> 3) {
103
+ case 1:
104
+ message.marketType = reader.string();
105
+ break;
106
+ case 2:
107
+ message.marketId = reader.string();
108
+ break;
109
+ case 4:
110
+ message.whitelistedAddress = reader.string();
111
+ break;
112
+ default:
113
+ reader.skipType(tag & 7);
114
+ break;
115
+ }
116
+ }
117
+ return message;
118
+ },
119
+ fromJSON(object) {
120
+ const message = Object.assign({}, baseFeeCategory);
121
+ message.marketType =
122
+ object.marketType !== undefined && object.marketType !== null
123
+ ? String(object.marketType)
124
+ : "";
125
+ message.marketId =
126
+ object.marketId !== undefined && object.marketId !== null
127
+ ? String(object.marketId)
128
+ : "";
129
+ message.whitelistedAddress =
130
+ object.whitelistedAddress !== undefined &&
131
+ object.whitelistedAddress !== null
132
+ ? String(object.whitelistedAddress)
133
+ : "";
134
+ return message;
135
+ },
136
+ toJSON(message) {
137
+ const obj = {};
138
+ message.marketType !== undefined && (obj.marketType = message.marketType);
139
+ message.marketId !== undefined && (obj.marketId = message.marketId);
140
+ message.whitelistedAddress !== undefined &&
141
+ (obj.whitelistedAddress = message.whitelistedAddress);
142
+ return obj;
143
+ },
144
+ fromPartial(object) {
145
+ var _a, _b, _c;
146
+ const message = Object.assign({}, baseFeeCategory);
147
+ message.marketType = (_a = object.marketType) !== null && _a !== void 0 ? _a : "";
148
+ message.marketId = (_b = object.marketId) !== null && _b !== void 0 ? _b : "";
149
+ message.whitelistedAddress = (_c = object.whitelistedAddress) !== null && _c !== void 0 ? _c : "";
150
+ return message;
151
+ },
152
+ };
153
+ const baseFeeTier = { requiredStake: "" };
154
+ exports.FeeTier = {
155
+ encode(message, writer = minimal_1.default.Writer.create()) {
156
+ if (message.requiredStake !== "") {
157
+ writer.uint32(10).string(message.requiredStake);
158
+ }
159
+ if (message.tradingFees !== undefined) {
160
+ exports.TradingFees.encode(message.tradingFees, writer.uint32(18).fork()).ldelim();
161
+ }
162
+ return writer;
163
+ },
164
+ decode(input, length) {
165
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
166
+ let end = length === undefined ? reader.len : reader.pos + length;
167
+ const message = Object.assign({}, baseFeeTier);
168
+ while (reader.pos < end) {
169
+ const tag = reader.uint32();
170
+ switch (tag >>> 3) {
171
+ case 1:
172
+ message.requiredStake = reader.string();
173
+ break;
174
+ case 2:
175
+ message.tradingFees = exports.TradingFees.decode(reader, reader.uint32());
176
+ break;
177
+ default:
178
+ reader.skipType(tag & 7);
179
+ break;
180
+ }
181
+ }
182
+ return message;
183
+ },
184
+ fromJSON(object) {
185
+ const message = Object.assign({}, baseFeeTier);
186
+ message.requiredStake =
187
+ object.requiredStake !== undefined && object.requiredStake !== null
188
+ ? String(object.requiredStake)
189
+ : "";
190
+ message.tradingFees =
191
+ object.tradingFees !== undefined && object.tradingFees !== null
192
+ ? exports.TradingFees.fromJSON(object.tradingFees)
193
+ : undefined;
194
+ return message;
195
+ },
196
+ toJSON(message) {
197
+ const obj = {};
198
+ message.requiredStake !== undefined &&
199
+ (obj.requiredStake = message.requiredStake);
200
+ message.tradingFees !== undefined &&
201
+ (obj.tradingFees = message.tradingFees
202
+ ? exports.TradingFees.toJSON(message.tradingFees)
203
+ : undefined);
204
+ return obj;
205
+ },
206
+ fromPartial(object) {
207
+ var _a;
208
+ const message = Object.assign({}, baseFeeTier);
209
+ message.requiredStake = (_a = object.requiredStake) !== null && _a !== void 0 ? _a : "";
210
+ message.tradingFees =
211
+ object.tradingFees !== undefined && object.tradingFees !== null
212
+ ? exports.TradingFees.fromPartial(object.tradingFees)
213
+ : undefined;
214
+ return message;
215
+ },
216
+ };
217
+ const baseTradingFees = { takerFee: "", makerFee: "" };
218
+ exports.TradingFees = {
219
+ encode(message, writer = minimal_1.default.Writer.create()) {
220
+ if (message.takerFee !== "") {
221
+ writer.uint32(42).string(message.takerFee);
222
+ }
223
+ if (message.makerFee !== "") {
224
+ writer.uint32(50).string(message.makerFee);
225
+ }
226
+ return writer;
227
+ },
228
+ decode(input, length) {
229
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
230
+ let end = length === undefined ? reader.len : reader.pos + length;
231
+ const message = Object.assign({}, baseTradingFees);
232
+ while (reader.pos < end) {
233
+ const tag = reader.uint32();
234
+ switch (tag >>> 3) {
235
+ case 5:
236
+ message.takerFee = reader.string();
237
+ break;
238
+ case 6:
239
+ message.makerFee = reader.string();
240
+ break;
241
+ default:
242
+ reader.skipType(tag & 7);
243
+ break;
244
+ }
245
+ }
246
+ return message;
247
+ },
248
+ fromJSON(object) {
249
+ const message = Object.assign({}, baseTradingFees);
250
+ message.takerFee =
251
+ object.takerFee !== undefined && object.takerFee !== null
252
+ ? String(object.takerFee)
253
+ : "";
254
+ message.makerFee =
255
+ object.makerFee !== undefined && object.makerFee !== null
256
+ ? String(object.makerFee)
257
+ : "";
258
+ return message;
259
+ },
260
+ toJSON(message) {
261
+ const obj = {};
262
+ message.takerFee !== undefined && (obj.takerFee = message.takerFee);
263
+ message.makerFee !== undefined && (obj.makerFee = message.makerFee);
264
+ return obj;
265
+ },
266
+ fromPartial(object) {
267
+ var _a, _b;
268
+ const message = Object.assign({}, baseTradingFees);
269
+ message.takerFee = (_a = object.takerFee) !== null && _a !== void 0 ? _a : "";
270
+ message.makerFee = (_b = object.makerFee) !== null && _b !== void 0 ? _b : "";
271
+ return message;
272
+ },
273
+ };
274
+ const baseStakeEquivalence = { denom: "", ratio: "" };
275
+ exports.StakeEquivalence = {
276
+ encode(message, writer = minimal_1.default.Writer.create()) {
277
+ if (message.denom !== "") {
278
+ writer.uint32(10).string(message.denom);
279
+ }
280
+ if (message.ratio !== "") {
281
+ writer.uint32(18).string(message.ratio);
282
+ }
283
+ return writer;
284
+ },
285
+ decode(input, length) {
286
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
287
+ let end = length === undefined ? reader.len : reader.pos + length;
288
+ const message = Object.assign({}, baseStakeEquivalence);
289
+ while (reader.pos < end) {
290
+ const tag = reader.uint32();
291
+ switch (tag >>> 3) {
292
+ case 1:
293
+ message.denom = reader.string();
294
+ break;
295
+ case 2:
296
+ message.ratio = reader.string();
297
+ break;
298
+ default:
299
+ reader.skipType(tag & 7);
300
+ break;
301
+ }
302
+ }
303
+ return message;
304
+ },
305
+ fromJSON(object) {
306
+ const message = Object.assign({}, baseStakeEquivalence);
307
+ message.denom =
308
+ object.denom !== undefined && object.denom !== null
309
+ ? String(object.denom)
310
+ : "";
311
+ message.ratio =
312
+ object.ratio !== undefined && object.ratio !== null
313
+ ? String(object.ratio)
314
+ : "";
315
+ return message;
316
+ },
317
+ toJSON(message) {
318
+ const obj = {};
319
+ message.denom !== undefined && (obj.denom = message.denom);
320
+ message.ratio !== undefined && (obj.ratio = message.ratio);
321
+ return obj;
322
+ },
323
+ fromPartial(object) {
324
+ var _a, _b;
325
+ const message = Object.assign({}, baseStakeEquivalence);
326
+ message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
327
+ message.ratio = (_b = object.ratio) !== null && _b !== void 0 ? _b : "";
328
+ return message;
329
+ },
330
+ };
331
+ if (minimal_1.default.util.Long !== long_1.default) {
332
+ minimal_1.default.util.Long = long_1.default;
333
+ minimal_1.default.configure();
334
+ }