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