carbon-js-sdk 0.4.31 → 0.5.0-alpha.1

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 (117) hide show
  1. package/lib/CarbonSDK.d.ts +12 -2
  2. package/lib/CarbonSDK.js +31 -3
  3. package/lib/clients/CarbonQueryClient.d.ts +15 -0
  4. package/lib/clients/CarbonQueryClient.js +79 -64
  5. package/lib/clients/InsightsQueryClient.d.ts +2 -0
  6. package/lib/clients/InsightsQueryClient.js +14 -0
  7. package/lib/clients/index.d.ts +4 -3
  8. package/lib/clients/index.js +9 -7
  9. package/lib/codec/bank/query.d.ts +14 -1
  10. package/lib/codec/bank/query.js +148 -29
  11. package/lib/codec/broker/amm.d.ts +35 -7
  12. package/lib/codec/broker/amm.js +185 -6
  13. package/lib/codec/broker/candlestick.d.ts +1 -0
  14. package/lib/codec/broker/candlestick.js +19 -0
  15. package/lib/codec/broker/genesis.d.ts +2 -2
  16. package/lib/codec/broker/genesis.js +9 -9
  17. package/lib/codec/cdp/event.d.ts +2 -0
  18. package/lib/codec/cdp/event.js +34 -0
  19. package/lib/codec/coin/token.d.ts +0 -2
  20. package/lib/codec/coin/token.js +2 -29
  21. package/lib/codec/cosmos/group/v1/query.d.ts +41 -0
  22. package/lib/codec/cosmos/group/v1/query.js +124 -1
  23. package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +2 -0
  24. package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +3 -0
  25. package/lib/codec/{crisis/genesis.d.ts → evmmerge/address.d.ts} +10 -9
  26. package/lib/codec/evmmerge/address.js +75 -0
  27. package/lib/codec/evmmerge/query.d.ts +32 -0
  28. package/lib/codec/evmmerge/query.js +138 -1
  29. package/lib/codec/index.d.ts +57 -5
  30. package/lib/codec/index.js +25025 -812
  31. package/lib/codec/market/genesis.d.ts +3 -0
  32. package/lib/codec/market/genesis.js +33 -2
  33. package/lib/codec/market/market.d.ts +12 -0
  34. package/lib/codec/market/market.js +61 -1
  35. package/lib/codec/market/query.d.ts +93 -0
  36. package/lib/codec/market/query.js +420 -1
  37. package/lib/codec/market/tx.d.ts +135 -3
  38. package/lib/codec/market/tx.js +731 -7
  39. package/lib/codec/perpsliquidity/event.d.ts +1 -0
  40. package/lib/codec/perpsliquidity/event.js +18 -3
  41. package/lib/codec/perpsliquidity/params.d.ts +0 -2
  42. package/lib/codec/perpsliquidity/params.js +1 -18
  43. package/lib/codec/perpsliquidity/pool.d.ts +19 -1
  44. package/lib/codec/perpsliquidity/pool.js +150 -26
  45. package/lib/codec/perpsliquidity/query.d.ts +1 -1
  46. package/lib/codec/perpsliquidity/tx.d.ts +4 -1
  47. package/lib/codec/perpsliquidity/tx.js +32 -2
  48. package/lib/codec/tendermint/abci/types.d.ts +1 -1
  49. package/lib/codec/tendermint/crypto/keys.d.ts +1 -1
  50. package/lib/codec/tendermint/types/types.d.ts +1 -1
  51. package/lib/constant/network.d.ts +9 -1
  52. package/lib/constant/network.js +19 -5
  53. package/lib/constant/walletProvider.d.ts +3 -1
  54. package/lib/constant/walletProvider.js +3 -0
  55. package/lib/insights/common.d.ts +2 -0
  56. package/lib/insights/common.js +4 -0
  57. package/lib/insights/index.d.ts +2 -0
  58. package/lib/insights/index.js +2 -0
  59. package/lib/modules/cdp.d.ts +1 -1
  60. package/lib/modules/cdp.js +56 -43
  61. package/lib/modules/erc20.d.ts +26 -0
  62. package/lib/modules/erc20.js +79 -0
  63. package/lib/modules/ibc.d.ts +3 -0
  64. package/lib/modules/ibc.js +16 -18
  65. package/lib/modules/index.d.ts +5 -0
  66. package/lib/modules/index.js +5 -0
  67. package/lib/modules/market.d.ts +36 -0
  68. package/lib/modules/market.js +94 -1
  69. package/lib/modules/order.d.ts +2 -0
  70. package/lib/modules/order.js +11 -4
  71. package/lib/modules/perpsliquidity.d.ts +2 -7
  72. package/lib/modules/perpsliquidity.js +9 -8
  73. package/lib/provider/amino/AminoTypesMap.js +1 -1
  74. package/lib/provider/amino/types/erc20.d.ts +4 -0
  75. package/lib/provider/amino/types/erc20.js +40 -0
  76. package/lib/provider/amino/types/gov.js +20 -0
  77. package/lib/provider/amino/types/index.d.ts +5 -0
  78. package/lib/provider/amino/types/index.js +11 -1
  79. package/lib/provider/amino/types/liquidityPool.js +1 -8
  80. package/lib/provider/amino/types/market.js +38 -0
  81. package/lib/provider/amino/types/oracle.js +6 -0
  82. package/lib/provider/amino/types/perpsliquidity.js +2 -1
  83. package/lib/provider/keplr/KeplrAccount.d.ts +2 -0
  84. package/lib/provider/keplr/KeplrAccount.js +41 -0
  85. package/lib/provider/leap/LeapAccount.js +4 -0
  86. package/lib/provider/ledger/ledger.js +5 -6
  87. package/lib/provider/metamask/MetaMask.d.ts +27 -2
  88. package/lib/provider/metamask/MetaMask.js +317 -12
  89. package/lib/provider/metamask/legacy-accounts.d.ts +1 -0
  90. package/lib/provider/metamask/legacy-accounts.js +28 -3
  91. package/lib/provider/o3/O3Wallet.js +3 -0
  92. package/lib/util/address.d.ts +5 -1
  93. package/lib/util/address.js +11 -0
  94. package/lib/util/blockchain.d.ts +4 -5
  95. package/lib/util/blockchain.js +9 -3
  96. package/lib/util/ethermint.js +4 -2
  97. package/lib/util/tx.d.ts +41 -0
  98. package/lib/wallet/CarbonSigner.d.ts +21 -4
  99. package/lib/wallet/CarbonSigner.js +20 -1
  100. package/lib/wallet/CarbonSigningClient.d.ts +1 -0
  101. package/lib/wallet/CarbonSigningClient.js +54 -6
  102. package/lib/wallet/CarbonWallet.d.ts +41 -2
  103. package/lib/wallet/CarbonWallet.js +200 -21
  104. package/package.json +8 -16
  105. package/lib/codec/crisis/genesis.js +0 -46
  106. package/lib/codec/crisis/query.d.ts +0 -43
  107. package/lib/codec/crisis/query.js +0 -103
  108. package/lib/codec/crisis/tx.d.ts +0 -12
  109. package/lib/codec/crisis/tx.js +0 -20
  110. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +0 -76
  111. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +0 -424
  112. package/lib/codec/market/legacy.d.ts +0 -62
  113. package/lib/codec/market/legacy.js +0 -630
  114. package/lib/codec/query/pagination.d.ts +0 -29
  115. package/lib/codec/query/pagination.js +0 -126
  116. package/lib/modules/vault.d.ts +0 -56
  117. package/lib/modules/vault.js +0 -128
@@ -4,10 +4,11 @@ import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
4
4
  import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
5
5
  import * as clients from "./clients";
6
6
  import N3Client from "./clients/N3Client";
7
- import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
7
+ import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PositionModule, ProfileModule, SubAccountModule, XChainModule, EvmModule, ERC20Module, FeemarketModule, EvmMergeModule, PerpsLiquidityModule } from "./modules";
8
8
  import { StakingModule } from "./modules/staking";
9
9
  import { CosmosLedger, Keplr, LeapExtended } from "./provider";
10
- import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts } from "./wallet";
10
+ import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts, MetaMaskWalletOpts } from "./wallet";
11
+ import { MetaMask } from "./provider/metamask/MetaMask";
11
12
  export { CarbonTx } from "./util";
12
13
  export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
13
14
  export { DenomPrefix } from "./constant";
@@ -15,6 +16,7 @@ export interface CarbonSDKOpts {
15
16
  network: Network;
16
17
  tmClient: Tendermint34Client;
17
18
  chainId?: string;
19
+ evmChainId?: string;
18
20
  token?: TokenClient;
19
21
  config?: Partial<NetworkConfig>;
20
22
  defaultTimeoutBlocks?: number;
@@ -51,6 +53,8 @@ declare class CarbonSDK {
51
53
  alliance: AllianceModule;
52
54
  order: OrderModule;
53
55
  lp: LiquidityPoolModule;
56
+ erc20: ERC20Module;
57
+ plp: PerpsLiquidityModule;
54
58
  subaccount: SubAccountModule;
55
59
  profile: ProfileModule;
56
60
  cdp: CDPModule;
@@ -66,6 +70,9 @@ declare class CarbonSDK {
66
70
  fee: FeeModule;
67
71
  ibc: IBCModule;
68
72
  xchain: XChainModule;
73
+ evm: EvmModule;
74
+ evmmerge: EvmMergeModule;
75
+ feemarket: FeemarketModule;
69
76
  neo: NEOClient;
70
77
  eth: ETHClient;
71
78
  bsc: ETHClient;
@@ -75,6 +82,7 @@ declare class CarbonSDK {
75
82
  zil: ZILClient;
76
83
  n3: N3Client;
77
84
  chainId: string;
85
+ evmChainId: string;
78
86
  constructor(opts: CarbonSDKOpts);
79
87
  static instance(opts?: CarbonSDKInitOpts): Promise<CarbonSDK>;
80
88
  static instanceWithWallet(wallet: CarbonWallet, sdkOpts?: CarbonSDKInitOpts): Promise<ConnectedCarbonSDK>;
@@ -84,6 +92,7 @@ declare class CarbonSDK {
84
92
  static instanceWithLedger(ledger: CosmosLedger, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
85
93
  static instanceWithKeplr(keplr: Keplr, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
86
94
  static instanceWithLeap(leap: LeapExtended, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
95
+ static instanceWithMetamask(metamask: MetaMask, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
87
96
  static instanceViewOnly(bech32Address: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
88
97
  initialize(): Promise<CarbonSDK>;
89
98
  clone(): CarbonSDK;
@@ -96,6 +105,7 @@ declare class CarbonSDK {
96
105
  connectWithLedger(ledger: CosmosLedger, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
97
106
  connectWithKeplr(keplr: Keplr, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
98
107
  connectWithLeap(leap: LeapExtended, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
108
+ connectWithMetamask(metamask: MetaMask, opts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
99
109
  connectViewOnly(bech32Address: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
100
110
  getConfig(): NetworkConfig;
101
111
  getTokenClient(): TokenClient;
package/lib/CarbonSDK.js CHANGED
@@ -60,20 +60,24 @@ const DEFAULT_SDK_INIT_OPTS = {
60
60
  */
61
61
  class CarbonSDK {
62
62
  constructor(opts) {
63
- var _a, _b, _c, _d, _e;
63
+ var _a, _b, _c, _d, _e, _f, _g;
64
64
  this.network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
65
65
  this.configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
66
66
  this.networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[this.network], this.configOverride);
67
67
  this.tmClient = opts.tmClient;
68
68
  this.chainId = (_d = (_c = opts.chainId) !== null && _c !== void 0 ? _c : constant_1.CarbonChainIDs[this.network]) !== null && _d !== void 0 ? _d : constant_1.CarbonChainIDs[constant_1.Network.MainNet];
69
+ this.evmChainId = (_f = (_e = opts.evmChainId) !== null && _e !== void 0 ? _e : constant_1.CarbonEvmChainIDs[this.network]) !== null && _f !== void 0 ? _f : constant_1.CarbonEvmChainIDs[constant_1.Network.MainNet];
69
70
  this.query = new clients_1.CarbonQueryClient(opts.tmClient);
70
71
  this.insights = new clients_1.InsightsQueryClient(this.networkConfig);
71
- this.token = (_e = opts.token) !== null && _e !== void 0 ? _e : clients_1.TokenClient.instance(this.query, this);
72
+ this.token = (_g = opts.token) !== null && _g !== void 0 ? _g : clients_1.TokenClient.instance(this.query, this);
73
+ this.hydrogen = new clients_1.HydrogenClient(this.networkConfig, this.token);
72
74
  this.hydrogen = clients_1.HydrogenClient.instance(this.networkConfig, this.token);
73
75
  this.admin = new modules_1.AdminModule(this);
74
76
  this.alliance = new modules_1.AllianceModule(this);
75
77
  this.order = new modules_1.OrderModule(this);
76
78
  this.lp = new modules_1.LiquidityPoolModule(this);
79
+ this.erc20 = new modules_1.ERC20Module(this);
80
+ this.plp = new modules_1.PerpsLiquidityModule(this);
77
81
  this.subaccount = new modules_1.SubAccountModule(this);
78
82
  this.profile = new modules_1.ProfileModule(this);
79
83
  this.cdp = new modules_1.CDPModule(this);
@@ -89,6 +93,9 @@ class CarbonSDK {
89
93
  this.fee = new modules_1.FeeModule(this);
90
94
  this.ibc = new modules_1.IBCModule(this);
91
95
  this.xchain = new modules_1.XChainModule(this);
96
+ this.evm = new modules_1.EvmModule(this);
97
+ this.evmmerge = new modules_1.EvmMergeModule(this);
98
+ this.feemarket = new modules_1.FeemarketModule(this);
92
99
  this.neo = clients_1.NEOClient.instance({
93
100
  configProvider: this,
94
101
  blockchain: blockchain_1.Blockchain.Neo,
@@ -133,7 +140,8 @@ class CarbonSDK {
133
140
  const network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
134
141
  const configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
135
142
  const networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[network], configOverride);
136
- const tmClient = (_c = opts.tmClient) !== null && _c !== void 0 ? _c : util_1.GenericUtils.modifyTmClient(yield tendermint_rpc_1.Tendermint34Client.connect(networkConfig.tmRpcUrl));
143
+ const batchQueryClient = new clients.BatchQueryClient(networkConfig.tmRpcUrl);
144
+ const tmClient = (_c = opts.tmClient) !== null && _c !== void 0 ? _c : util_1.GenericUtils.modifyTmClient(yield tendermint_rpc_1.Tendermint34Client.create(batchQueryClient));
137
145
  const defaultTimeoutBlocks = opts.defaultTimeoutBlocks;
138
146
  const chainId = (_d = (yield tmClient.status())) === null || _d === void 0 ? void 0 : _d.nodeInfo.network;
139
147
  const sdk = new CarbonSDK({ network, config: configOverride, tmClient, defaultTimeoutBlocks, chainId });
@@ -188,6 +196,12 @@ class CarbonSDK {
188
196
  return sdk.connectWithLeap(leap, walletOpts);
189
197
  });
190
198
  }
199
+ static instanceWithMetamask(metamask, sdkOpts = DEFAULT_SDK_INIT_OPTS, walletOpts, metamaskWalletOpts) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ const sdk = yield CarbonSDK.instance(sdkOpts);
202
+ return sdk.connectWithMetamask(metamask, walletOpts, metamaskWalletOpts);
203
+ });
204
+ }
191
205
  static instanceViewOnly(bech32Address, sdkOpts = DEFAULT_SDK_INIT_OPTS, walletOpts) {
192
206
  return __awaiter(this, void 0, void 0, function* () {
193
207
  const sdk = yield CarbonSDK.instance(sdkOpts);
@@ -291,6 +305,20 @@ class CarbonSDK {
291
305
  return this.connect(wallet);
292
306
  });
293
307
  }
308
+ connectWithMetamask(metamask, opts, metamaskWalletOpts) {
309
+ return __awaiter(this, void 0, void 0, function* () {
310
+ const evmChainId = this.evmChainId;
311
+ const addressOptions = {
312
+ network: this.networkConfig.network,
313
+ bech32Prefix: this.networkConfig.Bech32Prefix,
314
+ };
315
+ const address = yield metamask.defaultAccount();
316
+ const publicKeyHex = yield metamask.getPublicKey(address, metamaskWalletOpts === null || metamaskWalletOpts === void 0 ? void 0 : metamaskWalletOpts.publicKeyMessage);
317
+ const publicKeyBase64 = Buffer.from(publicKeyHex, "hex").toString("base64");
318
+ const wallet = wallet_1.CarbonWallet.withMetamask(metamask, evmChainId, publicKeyBase64, addressOptions, Object.assign(Object.assign({}, opts), { network: this.network, config: this.configOverride }));
319
+ return this.connect(wallet);
320
+ });
321
+ }
294
322
  connectViewOnly(bech32Address, opts) {
295
323
  return __awaiter(this, void 0, void 0, function* () {
296
324
  const wallet = wallet_1.CarbonWallet.withAddress(bech32Address, Object.assign(Object.assign({}, opts), { network: this.network, config: this.configOverride }));
@@ -5,6 +5,7 @@ import { QueryClientImpl as CDPQueryClient } from "../codec/cdp/query";
5
5
  import { QueryClientImpl as CoinQueryClient } from "../codec/coin/query";
6
6
  import { QueryClientImpl as AuthQueryClient } from "../codec/cosmos/auth/v1beta1/query";
7
7
  import { QueryClientImpl as BankQueryClient } from "../codec/cosmos/bank/v1beta1/query";
8
+ import { QueryClientImpl as NativeBankQueryClient } from "../codec/bank/query";
8
9
  import { ServiceClientImpl as CosmosTmClient } from "../codec/cosmos/base/tendermint/v1beta1/query";
9
10
  import { QueryClientImpl as DistributionQueryClient } from "../codec/cosmos/distribution/v1beta1/query";
10
11
  import { QueryClientImpl as EvidenceQueryClient } from "../codec/cosmos/evidence/v1beta1/query";
@@ -14,6 +15,10 @@ import { QueryClientImpl as ParamsQueryClient } from "../codec/cosmos/params/v1b
14
15
  import { QueryClientImpl as SlashingQueryClient } from "../codec/cosmos/slashing/v1beta1/query";
15
16
  import { QueryClientImpl as StakingQueryClient } from "../codec/cosmos/staking/v1beta1/query";
16
17
  import { QueryClientImpl as UpgradeQueryClient } from "../codec/cosmos/upgrade/v1beta1/query";
18
+ import { QueryClientImpl as EthermintEVMQueryClient } from "../codec/ethermint/evm/v1/query";
19
+ import { QueryClientImpl as EvmMergeQueryClient } from "../codec/evmmerge/query";
20
+ import { QueryClientImpl as EvmBankQueryClient } from "../codec/evmbank/query";
21
+ import { QueryClientImpl as EthermintFeeMarketQueryClient } from "../codec/ethermint/feemarket/v1/query";
17
22
  import { QueryClientImpl as FeeQueryClient } from "../codec/fee/query";
18
23
  import { QueryClientImpl as HeadersyncQueryClient } from "../codec/headersync/query";
19
24
  import { QueryClientImpl as IBCInterchainControlQueryClient } from "../codec/ibc/applications/interchain_accounts/controller/v1/query";
@@ -37,6 +42,7 @@ import { QueryClientImpl as PricingQueryClient } from "../codec/pricing/query";
37
42
  import { QueryClientImpl as ProfileQueryClient } from "../codec/profile/query";
38
43
  import { QueryClientImpl as SubaccountQueryClient } from "../codec/subaccount/query";
39
44
  import { QueryClientImpl as AllianceClient } from "../codec/alliance/query";
45
+ import { QueryClientImpl as PerpsLiquidityQueryClient } from "../codec/perpsliquidity/query";
40
46
  import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
41
47
  import BlockchainClient from "./BlockchainClient";
42
48
  export interface IBCClientGroup {
@@ -47,6 +53,10 @@ export interface IBCClientGroup {
47
53
  connection: IBCConnectionQueryClient;
48
54
  channel: IBCChannelQueryClient;
49
55
  }
56
+ export interface EthermintClientGroup {
57
+ evm: EthermintEVMQueryClient;
58
+ feeMarket: EthermintFeeMarketQueryClient;
59
+ }
50
60
  declare class CarbonQueryClient {
51
61
  private readonly tmClient;
52
62
  adl: ADLQueryClient;
@@ -70,8 +80,10 @@ declare class CarbonQueryClient {
70
80
  profile: ProfileQueryClient;
71
81
  subaccount: SubaccountQueryClient;
72
82
  headersync: HeadersyncQueryClient;
83
+ perpsliquidity: PerpsLiquidityQueryClient;
73
84
  auth: AuthQueryClient;
74
85
  bank: BankQueryClient;
86
+ nativeBank: NativeBankQueryClient;
75
87
  distribution: DistributionQueryClient;
76
88
  evidence: EvidenceQueryClient;
77
89
  gov: GovQueryClient;
@@ -84,6 +96,9 @@ declare class CarbonQueryClient {
84
96
  alliance: AllianceClient;
85
97
  chain: BlockchainClient;
86
98
  ibc: IBCClientGroup;
99
+ ethermint: EthermintClientGroup;
100
+ evmmerge: EvmMergeQueryClient;
101
+ evmbank: EvmBankQueryClient;
87
102
  private baseClient;
88
103
  constructor(tmClient: Tendermint34Client);
89
104
  getProtobufRpcClient(): import("@cosmjs/stargate").ProtobufRpcClient;
@@ -10,38 +10,44 @@ const query_4 = require("../codec/cdp/query");
10
10
  const query_5 = require("../codec/coin/query");
11
11
  const query_6 = require("../codec/cosmos/auth/v1beta1/query");
12
12
  const query_7 = require("../codec/cosmos/bank/v1beta1/query");
13
- const query_8 = require("../codec/cosmos/base/tendermint/v1beta1/query");
14
- const query_9 = require("../codec/cosmos/distribution/v1beta1/query");
15
- const query_10 = require("../codec/cosmos/evidence/v1beta1/query");
16
- const query_11 = require("../codec/cosmos/gov/v1beta1/query");
17
- const query_12 = require("../codec/cosmos/mint/v1beta1/query");
18
- const query_13 = require("../codec/cosmos/params/v1beta1/query");
19
- const query_14 = require("../codec/cosmos/slashing/v1beta1/query");
20
- const query_15 = require("../codec/cosmos/staking/v1beta1/query");
21
- const query_16 = require("../codec/cosmos/upgrade/v1beta1/query");
22
- const query_17 = require("../codec/fee/query");
23
- const query_18 = require("../codec/headersync/query");
24
- const query_19 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
25
- const query_20 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
26
- const query_21 = require("../codec/ibc/applications/transfer/v1/query");
27
- const query_22 = require("../codec/ibc/core/client/v1/query");
28
- const query_23 = require("../codec/ibc/core/connection/v1/query");
29
- const query_24 = require("../codec/ibc/core/channel/v1/query");
30
- const query_25 = require("../codec/inflation/query");
31
- const query_26 = require("../codec/insurance/query");
32
- const query_27 = require("../codec/leverage/query");
33
- const query_28 = require("../codec/liquidation/query");
34
- const query_29 = require("../codec/liquiditypool/query");
35
- const query_30 = require("../codec/market/query");
36
- const query_31 = require("../codec/marketstats/query");
37
- const query_32 = require("../codec/misc/query");
38
- const query_33 = require("../codec/oracle/query");
39
- const query_34 = require("../codec/order/query");
40
- const query_35 = require("../codec/position/query");
41
- const query_36 = require("../codec/pricing/query");
42
- const query_37 = require("../codec/profile/query");
43
- const query_38 = require("../codec/subaccount/query");
44
- const query_39 = require("../codec/alliance/query");
13
+ const query_8 = require("../codec/bank/query");
14
+ const query_9 = require("../codec/cosmos/base/tendermint/v1beta1/query");
15
+ const query_10 = require("../codec/cosmos/distribution/v1beta1/query");
16
+ const query_11 = require("../codec/cosmos/evidence/v1beta1/query");
17
+ const query_12 = require("../codec/cosmos/gov/v1beta1/query");
18
+ const query_13 = require("../codec/cosmos/mint/v1beta1/query");
19
+ const query_14 = require("../codec/cosmos/params/v1beta1/query");
20
+ const query_15 = require("../codec/cosmos/slashing/v1beta1/query");
21
+ const query_16 = require("../codec/cosmos/staking/v1beta1/query");
22
+ const query_17 = require("../codec/cosmos/upgrade/v1beta1/query");
23
+ const query_18 = require("../codec/ethermint/evm/v1/query");
24
+ const query_19 = require("../codec/evmmerge/query");
25
+ const query_20 = require("../codec/evmbank/query");
26
+ const query_21 = require("../codec/ethermint/feemarket/v1/query");
27
+ const query_22 = require("../codec/fee/query");
28
+ const query_23 = require("../codec/headersync/query");
29
+ const query_24 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
30
+ const query_25 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
31
+ const query_26 = require("../codec/ibc/applications/transfer/v1/query");
32
+ const query_27 = require("../codec/ibc/core/client/v1/query");
33
+ const query_28 = require("../codec/ibc/core/connection/v1/query");
34
+ const query_29 = require("../codec/ibc/core/channel/v1/query");
35
+ const query_30 = require("../codec/inflation/query");
36
+ const query_31 = require("../codec/insurance/query");
37
+ const query_32 = require("../codec/leverage/query");
38
+ const query_33 = require("../codec/liquidation/query");
39
+ const query_34 = require("../codec/liquiditypool/query");
40
+ const query_35 = require("../codec/market/query");
41
+ const query_36 = require("../codec/marketstats/query");
42
+ const query_37 = require("../codec/misc/query");
43
+ const query_38 = require("../codec/oracle/query");
44
+ const query_39 = require("../codec/order/query");
45
+ const query_40 = require("../codec/position/query");
46
+ const query_41 = require("../codec/pricing/query");
47
+ const query_42 = require("../codec/profile/query");
48
+ const query_43 = require("../codec/subaccount/query");
49
+ const query_44 = require("../codec/alliance/query");
50
+ const query_45 = require("../codec/perpsliquidity/query");
45
51
  const stargate_1 = require("@cosmjs/stargate");
46
52
  const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
47
53
  class CarbonQueryClient {
@@ -51,45 +57,54 @@ class CarbonQueryClient {
51
57
  const rpcClient = stargate_1.createProtobufRpcClient(this.baseClient);
52
58
  this.chain = BlockchainClient_1.default.connectWithTm(this.tmClient);
53
59
  this.adl = new query_1.QueryClientImpl(rpcClient);
54
- this.alliance = new query_39.QueryClientImpl(rpcClient);
60
+ this.alliance = new query_44.QueryClientImpl(rpcClient);
55
61
  this.book = new query_2.QueryClientImpl(rpcClient);
56
62
  this.broker = new query_3.QueryClientImpl(rpcClient);
57
63
  this.coin = new query_5.QueryClientImpl(rpcClient);
58
64
  this.cdp = new query_4.QueryClientImpl(rpcClient);
59
- this.fee = new query_17.QueryClientImpl(rpcClient);
60
- this.inflation = new query_25.QueryClientImpl(rpcClient);
61
- this.insurance = new query_26.QueryClientImpl(rpcClient);
62
- this.leverage = new query_27.QueryClientImpl(rpcClient);
63
- this.liquidation = new query_28.QueryClientImpl(rpcClient);
64
- this.liquiditypool = new query_29.QueryClientImpl(rpcClient);
65
- this.market = new query_30.QueryClientImpl(rpcClient);
66
- this.marketstats = new query_31.QueryClientImpl(rpcClient);
67
- this.misc = new query_32.QueryClientImpl(rpcClient);
68
- this.oracle = new query_33.QueryClientImpl(rpcClient);
69
- this.order = new query_34.QueryClientImpl(rpcClient);
70
- this.position = new query_35.QueryClientImpl(rpcClient);
71
- this.pricing = new query_36.QueryClientImpl(rpcClient);
72
- this.profile = new query_37.QueryClientImpl(rpcClient);
73
- this.subaccount = new query_38.QueryClientImpl(rpcClient);
74
- this.headersync = new query_18.QueryClientImpl(rpcClient);
65
+ this.fee = new query_22.QueryClientImpl(rpcClient);
66
+ this.inflation = new query_30.QueryClientImpl(rpcClient);
67
+ this.insurance = new query_31.QueryClientImpl(rpcClient);
68
+ this.leverage = new query_32.QueryClientImpl(rpcClient);
69
+ this.liquidation = new query_33.QueryClientImpl(rpcClient);
70
+ this.liquiditypool = new query_34.QueryClientImpl(rpcClient);
71
+ this.market = new query_35.QueryClientImpl(rpcClient);
72
+ this.marketstats = new query_36.QueryClientImpl(rpcClient);
73
+ this.misc = new query_37.QueryClientImpl(rpcClient);
74
+ this.oracle = new query_38.QueryClientImpl(rpcClient);
75
+ this.order = new query_39.QueryClientImpl(rpcClient);
76
+ this.position = new query_40.QueryClientImpl(rpcClient);
77
+ this.pricing = new query_41.QueryClientImpl(rpcClient);
78
+ this.profile = new query_42.QueryClientImpl(rpcClient);
79
+ this.subaccount = new query_43.QueryClientImpl(rpcClient);
80
+ this.headersync = new query_23.QueryClientImpl(rpcClient);
81
+ this.evmmerge = new query_19.QueryClientImpl(rpcClient);
82
+ this.evmbank = new query_20.QueryClientImpl(rpcClient);
83
+ this.perpsliquidity = new query_45.QueryClientImpl(rpcClient);
75
84
  this.auth = new query_6.QueryClientImpl(rpcClient);
76
85
  this.bank = new query_7.QueryClientImpl(rpcClient);
77
- this.distribution = new query_9.QueryClientImpl(rpcClient);
78
- this.evidence = new query_10.QueryClientImpl(rpcClient);
79
- this.gov = new query_11.QueryClientImpl(rpcClient);
80
- this.mint = new query_12.QueryClientImpl(rpcClient);
81
- this.params = new query_13.QueryClientImpl(rpcClient);
82
- this.slashing = new query_14.QueryClientImpl(rpcClient);
83
- this.staking = new query_15.QueryClientImpl(rpcClient);
84
- this.upgrade = new query_16.QueryClientImpl(rpcClient);
85
- this.cosmosTm = new query_8.ServiceClientImpl(rpcClient);
86
+ this.nativeBank = new query_8.QueryClientImpl(rpcClient);
87
+ this.distribution = new query_10.QueryClientImpl(rpcClient);
88
+ this.evidence = new query_11.QueryClientImpl(rpcClient);
89
+ this.gov = new query_12.QueryClientImpl(rpcClient);
90
+ this.mint = new query_13.QueryClientImpl(rpcClient);
91
+ this.params = new query_14.QueryClientImpl(rpcClient);
92
+ this.slashing = new query_15.QueryClientImpl(rpcClient);
93
+ this.staking = new query_16.QueryClientImpl(rpcClient);
94
+ this.upgrade = new query_17.QueryClientImpl(rpcClient);
95
+ this.cosmosTm = new query_9.ServiceClientImpl(rpcClient);
96
+ this.alliance = new query_44.QueryClientImpl(rpcClient);
86
97
  this.ibc = {
87
- controller: new query_19.QueryClientImpl(rpcClient),
88
- host: new query_20.QueryClientImpl(rpcClient),
89
- transfer: new query_21.QueryClientImpl(rpcClient),
90
- client: new query_22.QueryClientImpl(rpcClient),
91
- connection: new query_23.QueryClientImpl(rpcClient),
92
- channel: new query_24.QueryClientImpl(rpcClient),
98
+ controller: new query_24.QueryClientImpl(rpcClient),
99
+ host: new query_25.QueryClientImpl(rpcClient),
100
+ transfer: new query_26.QueryClientImpl(rpcClient),
101
+ client: new query_27.QueryClientImpl(rpcClient),
102
+ connection: new query_28.QueryClientImpl(rpcClient),
103
+ channel: new query_29.QueryClientImpl(rpcClient),
104
+ };
105
+ this.ethermint = {
106
+ evm: new query_18.QueryClientImpl(rpcClient),
107
+ feeMarket: new query_21.QueryClientImpl(rpcClient),
93
108
  };
94
109
  }
95
110
  getProtobufRpcClient() {
@@ -37,5 +37,7 @@ declare class InsightsQueryClient {
37
37
  DenomToGeckoIdMap(): Promise<Insights.InsightsQueryResponse<Insights.QueryDenomToGeckoIdMap>>;
38
38
  FundingHistory(query: Insights.QueryGetFundingRateRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingRateResponse>>;
39
39
  ProposalVotes(req: Insights.GetProposalVotesPathParams, query: Insights.GetProposalVotesQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetProposalVotesResponse>>;
40
+ Delegations(req: Insights.GetDelegationsPathParams, query: Insights.GetDelegationsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetDelegationsResponse>>;
41
+ OraclePrices(req?: Insights.QueryGetOraclesPriceRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetOraclesPriceResponse>>;
40
42
  }
41
43
  export default InsightsQueryClient;
@@ -340,5 +340,19 @@ class InsightsQueryClient {
340
340
  return response.data;
341
341
  });
342
342
  }
343
+ Delegations(req, query) {
344
+ return __awaiter(this, void 0, void 0, function* () {
345
+ const request = this.apiManager.path("delegations/delegator", req, query);
346
+ const response = yield request.get();
347
+ return response.data;
348
+ });
349
+ }
350
+ OraclePrices(req = {}) {
351
+ return __awaiter(this, void 0, void 0, function* () {
352
+ const request = this.apiManager.path("info/oracles_price", {}, req);
353
+ const response = yield request.get();
354
+ return response.data;
355
+ });
356
+ }
343
357
  }
344
358
  exports.default = InsightsQueryClient;
@@ -1,8 +1,9 @@
1
+ export { default as BatchQueryClient } from "./BatchQueryClient";
1
2
  export { default as BlockchainClient } from "./BlockchainClient";
2
3
  export { default as CarbonQueryClient } from "./CarbonQueryClient";
3
4
  export { default as ETHClient } from "./ETHClient";
5
+ export { default as HydrogenClient } from "./HydrogenClient";
6
+ export { default as InsightsQueryClient } from "./InsightsQueryClient";
4
7
  export { default as NEOClient } from "./NEOClient";
5
- export { default as ZILClient } from "./ZILClient";
6
8
  export { default as TokenClient } from "./TokenClient";
7
- export { default as InsightsQueryClient } from "./InsightsQueryClient";
8
- export { default as HydrogenClient } from "./HydrogenClient";
9
+ export { default as ZILClient } from "./ZILClient";
@@ -3,20 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.HydrogenClient = exports.InsightsQueryClient = exports.TokenClient = exports.ZILClient = exports.NEOClient = exports.ETHClient = exports.CarbonQueryClient = exports.BlockchainClient = void 0;
6
+ exports.ZILClient = exports.TokenClient = exports.NEOClient = exports.InsightsQueryClient = exports.HydrogenClient = exports.ETHClient = exports.CarbonQueryClient = exports.BlockchainClient = exports.BatchQueryClient = void 0;
7
+ var BatchQueryClient_1 = require("./BatchQueryClient");
8
+ Object.defineProperty(exports, "BatchQueryClient", { enumerable: true, get: function () { return __importDefault(BatchQueryClient_1).default; } });
7
9
  var BlockchainClient_1 = require("./BlockchainClient");
8
10
  Object.defineProperty(exports, "BlockchainClient", { enumerable: true, get: function () { return __importDefault(BlockchainClient_1).default; } });
9
11
  var CarbonQueryClient_1 = require("./CarbonQueryClient");
10
12
  Object.defineProperty(exports, "CarbonQueryClient", { enumerable: true, get: function () { return __importDefault(CarbonQueryClient_1).default; } });
11
13
  var ETHClient_1 = require("./ETHClient");
12
14
  Object.defineProperty(exports, "ETHClient", { enumerable: true, get: function () { return __importDefault(ETHClient_1).default; } });
15
+ var HydrogenClient_1 = require("./HydrogenClient");
16
+ Object.defineProperty(exports, "HydrogenClient", { enumerable: true, get: function () { return __importDefault(HydrogenClient_1).default; } });
17
+ var InsightsQueryClient_1 = require("./InsightsQueryClient");
18
+ Object.defineProperty(exports, "InsightsQueryClient", { enumerable: true, get: function () { return __importDefault(InsightsQueryClient_1).default; } });
13
19
  var NEOClient_1 = require("./NEOClient");
14
20
  Object.defineProperty(exports, "NEOClient", { enumerable: true, get: function () { return __importDefault(NEOClient_1).default; } });
15
- var ZILClient_1 = require("./ZILClient");
16
- Object.defineProperty(exports, "ZILClient", { enumerable: true, get: function () { return __importDefault(ZILClient_1).default; } });
17
21
  var TokenClient_1 = require("./TokenClient");
18
22
  Object.defineProperty(exports, "TokenClient", { enumerable: true, get: function () { return __importDefault(TokenClient_1).default; } });
19
- var InsightsQueryClient_1 = require("./InsightsQueryClient");
20
- Object.defineProperty(exports, "InsightsQueryClient", { enumerable: true, get: function () { return __importDefault(InsightsQueryClient_1).default; } });
21
- var HydrogenClient_1 = require("./HydrogenClient");
22
- Object.defineProperty(exports, "HydrogenClient", { enumerable: true, get: function () { return __importDefault(HydrogenClient_1).default; } });
23
+ var ZILClient_1 = require("./ZILClient");
24
+ Object.defineProperty(exports, "ZILClient", { enumerable: true, get: function () { return __importDefault(ZILClient_1).default; } });
@@ -5,9 +5,15 @@ export declare const protobufPackage = "Switcheo.carbon.bank";
5
5
  export interface InternalTransfer {
6
6
  sender: string;
7
7
  receiver: string;
8
+ transactionHash: string;
9
+ coins: Coin[];
10
+ transactionMemo: string;
11
+ transactionBlockHeight: Long;
12
+ transactionBlockTime?: Date;
13
+ }
14
+ export interface Coin {
8
15
  denom: string;
9
16
  amount: string;
10
- transactionHash: string;
11
17
  }
12
18
  export interface QueryInternalTransfersRequest {
13
19
  address: string;
@@ -27,6 +33,13 @@ export declare const InternalTransfer: {
27
33
  toJSON(message: InternalTransfer): unknown;
28
34
  fromPartial(object: DeepPartial<InternalTransfer>): InternalTransfer;
29
35
  };
36
+ export declare const Coin: {
37
+ encode(message: Coin, writer?: _m0.Writer): _m0.Writer;
38
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Coin;
39
+ fromJSON(object: any): Coin;
40
+ toJSON(message: Coin): unknown;
41
+ fromPartial(object: DeepPartial<Coin>): Coin;
42
+ };
30
43
  export declare const QueryInternalTransfersRequest: {
31
44
  encode(message: QueryInternalTransfersRequest, writer?: _m0.Writer): _m0.Writer;
32
45
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryInternalTransfersRequest;