carbon-js-sdk 0.2.9 → 0.2.11-dev.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.
- package/lib/clients/InsightsQueryClient.d.ts +3 -1
- package/lib/clients/InsightsQueryClient.js +17 -6
- package/lib/clients/NEOClient.js +15 -15
- package/lib/codec/book/genesis.d.ts +1 -1
- package/lib/codec/book/genesis.js +1 -1
- package/lib/codec/book/query.d.ts +1 -1
- package/lib/codec/book/query.js +1 -1
- package/lib/codec/broker/genesis.d.ts +1 -1
- package/lib/codec/broker/genesis.js +1 -1
- package/lib/codec/broker/query.d.ts +3 -3
- package/lib/codec/broker/query.js +3 -3
- package/lib/codec/btcx/denom_cross_chain_info.d.ts +1 -1
- package/lib/codec/btcx/denom_cross_chain_info.js +1 -1
- package/lib/codec/btcx/query.d.ts +1 -1
- package/lib/codec/btcx/query.js +1 -1
- package/lib/codec/ccm/genesis.d.ts +1 -1
- package/lib/codec/ccm/genesis.js +1 -1
- package/lib/codec/cdp/asset_params.d.ts +1 -0
- package/lib/codec/cdp/asset_params.js +31 -15
- package/lib/codec/cdp/event.d.ts +226 -22
- package/lib/codec/cdp/event.js +1414 -80
- package/lib/codec/cdp/genesis.d.ts +57 -4
- package/lib/codec/cdp/genesis.js +417 -22
- package/lib/codec/cdp/params.d.ts +1 -1
- package/lib/codec/cdp/params.js +11 -11
- package/lib/codec/cdp/query.d.ts +328 -94
- package/lib/codec/cdp/query.js +1300 -236
- package/lib/codec/cdp/stablecoin_debt_info.d.ts +23 -0
- package/lib/codec/cdp/stablecoin_debt_info.js +157 -0
- package/lib/codec/cdp/tx.d.ts +466 -96
- package/lib/codec/cdp/tx.js +1961 -181
- package/lib/codec/coin/event.d.ts +1 -1
- package/lib/codec/coin/event.js +1 -1
- package/lib/codec/coin/genesis.d.ts +2 -2
- package/lib/codec/coin/genesis.js +2 -2
- package/lib/codec/coin/proposal.d.ts +1 -1
- package/lib/codec/coin/proposal.js +1 -1
- package/lib/codec/coin/query.d.ts +2 -5
- package/lib/codec/coin/query.js +2 -8
- package/lib/codec/coin/token.d.ts +11 -0
- package/lib/codec/coin/token.js +65 -1
- package/lib/codec/coin/tx.d.ts +1 -1
- package/lib/codec/coin/tx.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/auth/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/auth/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/auth/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/authz/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/authz/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/bank.js +1 -1
- package/lib/codec/cosmos/bank/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/bank/v1beta1/query.js +3 -3
- package/lib/codec/cosmos/bank/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/bank/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/capability/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/crisis/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/distribution.js +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/genesis.d.ts +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/genesis.js +2 -2
- package/lib/codec/cosmos/distribution/v1beta1/query.d.ts +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/query.js +3 -3
- package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/distribution/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/evidence/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/feegrant.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
- package/lib/codec/cosmos/gov/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/mint/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/mint/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/params/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/slashing/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/slashing/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/authz.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/authz.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/genesis.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/query.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +1 -1
- package/lib/codec/cosmos/staking/v1beta1/staking.js +1 -1
- package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +1 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +1 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/service.js +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +3 -3
- package/lib/codec/cosmos/tx/v1beta1/tx.js +3 -3
- package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +1 -1
- package/lib/codec/cosmos/upgrade/v1beta1/query.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/tx.js +1 -1
- package/lib/codec/cosmos/vesting/v1beta1/vesting.d.ts +2 -2
- package/lib/codec/cosmos/vesting/v1beta1/vesting.js +2 -2
- package/lib/codec/fee/genesis.d.ts +1 -1
- package/lib/codec/fee/genesis.js +1 -1
- package/lib/codec/fee/proposal.d.ts +1 -1
- package/lib/codec/fee/proposal.js +1 -1
- package/lib/codec/fee/query.d.ts +1 -1
- package/lib/codec/fee/query.js +1 -1
- package/lib/codec/fee/tx.d.ts +1 -1
- package/lib/codec/fee/tx.js +1 -1
- package/lib/codec/headersync/genesis.d.ts +1 -1
- package/lib/codec/headersync/genesis.js +1 -1
- package/lib/codec/headersync/query.d.ts +1 -1
- package/lib/codec/headersync/query.js +1 -1
- package/lib/codec/index.d.ts +53 -22
- package/lib/codec/index.js +514 -384
- package/lib/codec/inflation/genesis.d.ts +1 -1
- package/lib/codec/inflation/genesis.js +1 -1
- package/lib/codec/inflation/query.d.ts +1 -1
- package/lib/codec/inflation/query.js +1 -1
- package/lib/codec/insurance/genesis.d.ts +1 -1
- package/lib/codec/insurance/genesis.js +1 -1
- package/lib/codec/leverage/genesis.d.ts +1 -1
- package/lib/codec/leverage/genesis.js +1 -1
- package/lib/codec/leverage/query.d.ts +1 -1
- package/lib/codec/leverage/query.js +1 -1
- package/lib/codec/liquidation/genesis.d.ts +1 -1
- package/lib/codec/liquidation/genesis.js +1 -1
- package/lib/codec/liquidation/query.d.ts +1 -1
- package/lib/codec/liquidation/query.js +1 -1
- package/lib/codec/liquidation/quote_changes.d.ts +1 -1
- package/lib/codec/liquidation/quote_changes.js +1 -1
- package/lib/codec/liquiditypool/event.d.ts +2 -2
- package/lib/codec/liquiditypool/event.js +2 -2
- package/lib/codec/liquiditypool/genesis.d.ts +2 -2
- package/lib/codec/liquiditypool/genesis.js +2 -2
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +2 -2
- package/lib/codec/liquiditypool/query.js +2 -2
- package/lib/codec/liquiditypool/tx.d.ts +1 -1
- package/lib/codec/liquiditypool/tx.js +1 -1
- package/lib/codec/lockproxy/genesis.d.ts +1 -1
- package/lib/codec/lockproxy/genesis.js +1 -1
- package/lib/codec/lockproxy/query.d.ts +1 -1
- package/lib/codec/lockproxy/query.js +1 -1
- package/lib/codec/market/event.d.ts +1 -1
- package/lib/codec/market/event.js +1 -1
- package/lib/codec/market/genesis.d.ts +2 -1
- package/lib/codec/market/genesis.js +20 -2
- package/lib/codec/market/proposal.d.ts +1 -1
- package/lib/codec/market/proposal.js +1 -1
- package/lib/codec/market/query.d.ts +1 -1
- package/lib/codec/market/query.js +1 -1
- package/lib/codec/market/tx.d.ts +1 -1
- package/lib/codec/market/tx.js +1 -1
- package/lib/codec/marketstats/genesis.d.ts +1 -1
- package/lib/codec/marketstats/genesis.js +1 -1
- package/lib/codec/marketstats/query.d.ts +2 -2
- package/lib/codec/marketstats/query.js +2 -2
- package/lib/codec/misc/message.d.ts +1 -1
- package/lib/codec/misc/message.js +1 -1
- package/lib/codec/misc/query.d.ts +3 -3
- package/lib/codec/misc/query.js +3 -3
- package/lib/codec/misc/trade.d.ts +1 -0
- package/lib/codec/misc/trade.js +17 -0
- package/lib/codec/misc/transaction.d.ts +1 -1
- package/lib/codec/misc/transaction.js +1 -1
- package/lib/codec/oracle/event.d.ts +1 -1
- package/lib/codec/oracle/event.js +1 -1
- package/lib/codec/oracle/genesis.d.ts +1 -1
- package/lib/codec/oracle/genesis.js +1 -1
- package/lib/codec/oracle/proposal.d.ts +1 -1
- package/lib/codec/oracle/proposal.js +1 -1
- package/lib/codec/oracle/query.d.ts +2 -2
- package/lib/codec/oracle/query.js +2 -2
- package/lib/codec/order/event.d.ts +1 -1
- package/lib/codec/order/event.js +1 -1
- package/lib/codec/order/genesis.d.ts +1 -1
- package/lib/codec/order/genesis.js +1 -1
- package/lib/codec/order/query.d.ts +1 -1
- package/lib/codec/order/query.js +1 -1
- package/lib/codec/position/event.d.ts +1 -1
- package/lib/codec/position/event.js +1 -1
- package/lib/codec/position/genesis.d.ts +1 -1
- package/lib/codec/position/genesis.js +1 -1
- package/lib/codec/position/query.d.ts +1 -1
- package/lib/codec/position/query.js +1 -1
- package/lib/codec/pricing/event.d.ts +11 -1
- package/lib/codec/pricing/event.js +52 -2
- package/lib/codec/pricing/genesis.d.ts +2 -1
- package/lib/codec/pricing/genesis.js +20 -5
- package/lib/codec/pricing/pricing.d.ts +13 -0
- package/lib/codec/pricing/pricing.js +83 -1
- package/lib/codec/pricing/query.d.ts +1 -1
- package/lib/codec/pricing/query.js +1 -1
- package/lib/codec/profile/event.d.ts +1 -1
- package/lib/codec/profile/event.js +1 -1
- package/lib/codec/profile/genesis.d.ts +1 -1
- package/lib/codec/profile/genesis.js +1 -1
- package/lib/codec/profile/query.d.ts +1 -1
- package/lib/codec/profile/query.js +1 -1
- package/lib/codec/subaccount/genesis.d.ts +1 -1
- package/lib/codec/subaccount/genesis.js +1 -1
- package/lib/codec/subaccount/query.d.ts +1 -1
- package/lib/codec/subaccount/query.js +1 -1
- package/lib/codec/tendermint/abci/types.d.ts +4 -4
- package/lib/codec/tendermint/abci/types.js +4 -4
- package/lib/codec/tendermint/types/block.d.ts +2 -2
- package/lib/codec/tendermint/types/block.js +2 -2
- package/lib/codec/tendermint/types/evidence.d.ts +2 -2
- package/lib/codec/tendermint/types/evidence.js +2 -2
- package/lib/codec/tendermint/types/types.d.ts +3 -3
- package/lib/codec/tendermint/types/types.js +3 -3
- package/lib/codec/tendermint/types/validator.d.ts +1 -1
- package/lib/codec/tendermint/types/validator.js +1 -1
- package/lib/insights/common.d.ts +2 -0
- package/lib/insights/common.js +2 -0
- package/lib/insights/competition.d.ts +49 -7
- package/lib/modules/admin.d.ts +61 -1
- package/lib/modules/admin.js +193 -42
- package/lib/modules/cdp.d.ts +55 -12
- package/lib/modules/cdp.js +134 -20
- package/lib/provider/amino/types/admin.js +48 -7
- package/lib/provider/amino/types/cdp.js +72 -32
- package/lib/util/tx.d.ts +42 -14
- package/lib/websocket/channel.js +26 -0
- package/lib/websocket/models.d.ts +63 -0
- package/lib/websocket/types.d.ts +38 -3
- package/lib/websocket/types.js +16 -0
- package/package.json +3 -1
|
@@ -16,7 +16,9 @@ declare class InsightsQueryClient {
|
|
|
16
16
|
PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
|
|
17
17
|
PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
|
|
18
18
|
PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
|
|
19
|
-
|
|
19
|
+
CompetitionList(req?: Insights.QueryGetCompetitionListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionListResponse>>;
|
|
20
|
+
VolumeCompetitionLeaderboard(req: Insights.QueryGetVolumeCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetVolumeCompetitionLeaderboardResponse>>;
|
|
21
|
+
PNLCompetitionLeaderboard(req: Insights.QueryGetPNLCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPNLCompetitionLeaderboardResponse>>;
|
|
20
22
|
PoolsLiquidity(req?: Insights.QueryGetPoolsLiquidityRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsLiquidityResponse>>;
|
|
21
23
|
MarketsVolume(req?: Insights.QueryGetMarketVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetMarketVolumeResponse>>;
|
|
22
24
|
Nodes(req?: Insights.QueryGetNodesRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetNodesResponse>>;
|
|
@@ -135,18 +135,29 @@ class InsightsQueryClient {
|
|
|
135
135
|
return response.data;
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
CompetitionList(req = {}) {
|
|
139
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
const request = this.apiManager.path('competition/list', {}, req);
|
|
141
|
+
const response = yield request.get();
|
|
142
|
+
return response.data;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
VolumeCompetitionLeaderboard(req) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const queryParams = Object.assign(Object.assign(Object.assign({ competitionId: req.competitionId }, req.from && { from: req.from }), req.until && { until: req.until }), req.market && { market: req.market });
|
|
145
148
|
const request = this.apiManager.path('competition/leaderboard', {}, queryParams);
|
|
146
149
|
const response = yield request.get();
|
|
147
150
|
return response.data;
|
|
148
151
|
});
|
|
149
152
|
}
|
|
153
|
+
PNLCompetitionLeaderboard(req) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
const queryParams = Object.assign({ competitionId: req.competitionId }, req.market && { market: req.market });
|
|
156
|
+
const request = this.apiManager.path('competition/leaderboardpnl', {}, queryParams);
|
|
157
|
+
const response = yield request.get();
|
|
158
|
+
return response.data;
|
|
159
|
+
});
|
|
160
|
+
}
|
|
150
161
|
PoolsLiquidity(req = {}) {
|
|
151
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
163
|
const queryParams = {
|
package/lib/clients/NEOClient.js
CHANGED
|
@@ -37,8 +37,8 @@ const util_1 = require("../util");
|
|
|
37
37
|
const address_1 = require("../util/address");
|
|
38
38
|
const blockchain_1 = require("../util/blockchain");
|
|
39
39
|
const generic_1 = require("../util/generic");
|
|
40
|
-
const plugin_1 = __importDefault(require("@cityofzion/neon-api/lib/plugin"));
|
|
41
40
|
const Neon = __importStar(require("@cityofzion/neon-core"));
|
|
41
|
+
const neon_js_1 = require("@cityofzion/neon-js");
|
|
42
42
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
43
43
|
const ethers_1 = require("ethers");
|
|
44
44
|
const lodash_1 = require("lodash");
|
|
@@ -132,9 +132,9 @@ class NEOClient {
|
|
|
132
132
|
]);
|
|
133
133
|
const rpcUrl = yield this.getProviderUrl();
|
|
134
134
|
const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
|
|
135
|
-
? new
|
|
136
|
-
: new
|
|
137
|
-
return
|
|
135
|
+
? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
|
|
136
|
+
: new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
137
|
+
return neon_js_1.api.doInvoke({
|
|
138
138
|
api: apiProvider,
|
|
139
139
|
url: rpcUrl,
|
|
140
140
|
account,
|
|
@@ -214,8 +214,8 @@ class NEOClient {
|
|
|
214
214
|
sb.emitAppCall(scriptHash, "lock", data);
|
|
215
215
|
const rpcUrl = yield this.getProviderUrl();
|
|
216
216
|
const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
|
|
217
|
-
? new
|
|
218
|
-
: new
|
|
217
|
+
? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
|
|
218
|
+
: new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
219
219
|
let invokeTxConfig = {
|
|
220
220
|
account: Object.assign(Object.assign({}, new Neon.wallet.Account("")), {
|
|
221
221
|
// overwrite the address and public key to values provided by the ledger.
|
|
@@ -233,16 +233,16 @@ class NEOClient {
|
|
|
233
233
|
};
|
|
234
234
|
// similar to Neon.doInvoke(invokeTxConfig), but
|
|
235
235
|
// separates out sendTx to broadcast to several nodes
|
|
236
|
-
invokeTxConfig = yield
|
|
237
|
-
invokeTxConfig = yield
|
|
238
|
-
invokeTxConfig = yield
|
|
239
|
-
invokeTxConfig = yield
|
|
236
|
+
invokeTxConfig = yield neon_js_1.api.fillBalance(invokeTxConfig);
|
|
237
|
+
invokeTxConfig = yield neon_js_1.api.createInvocationTx(invokeTxConfig);
|
|
238
|
+
invokeTxConfig = yield neon_js_1.api.modifyTransactionForEmptyTransaction(invokeTxConfig);
|
|
239
|
+
invokeTxConfig = yield neon_js_1.api.signTx(invokeTxConfig);
|
|
240
240
|
// provide notification to caller that signature is
|
|
241
241
|
// done and proceeding to broadcasting tx
|
|
242
242
|
if (signCompleteCallback) {
|
|
243
243
|
signCompleteCallback();
|
|
244
244
|
}
|
|
245
|
-
yield
|
|
245
|
+
yield neon_js_1.api.sendTx(Object.assign(Object.assign({}, invokeTxConfig), { rpcUrl }));
|
|
246
246
|
return (_a = invokeTxConfig.tx) === null || _a === void 0 ? void 0 : _a.hash;
|
|
247
247
|
});
|
|
248
248
|
}
|
|
@@ -270,7 +270,7 @@ class NEOClient {
|
|
|
270
270
|
const wrapperContractScriptHash = this.getConfig().wrapperScriptHash;
|
|
271
271
|
const wrapperContractAddress = Neon.wallet.getAddressFromScriptHash(wrapperContractScriptHash);
|
|
272
272
|
// Build config
|
|
273
|
-
const intent =
|
|
273
|
+
const intent = neon_js_1.api.makeIntent({ NEO: neoAmount.toNumber() }, wrapperContractAddress);
|
|
274
274
|
const props = {
|
|
275
275
|
scriptHash: wrapperContractScriptHash,
|
|
276
276
|
operation: "mintTokens",
|
|
@@ -279,8 +279,8 @@ class NEOClient {
|
|
|
279
279
|
const script = Neon.sc.createScript(props);
|
|
280
280
|
const networkConfig = this.getNetworkConfig();
|
|
281
281
|
const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
|
|
282
|
-
? new
|
|
283
|
-
: new
|
|
282
|
+
? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
|
|
283
|
+
: new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
284
284
|
const config = {
|
|
285
285
|
api: apiProvider,
|
|
286
286
|
url: rpcUrl,
|
|
@@ -289,7 +289,7 @@ class NEOClient {
|
|
|
289
289
|
script: script
|
|
290
290
|
};
|
|
291
291
|
// Neon API
|
|
292
|
-
const response = yield
|
|
292
|
+
const response = yield neon_js_1.api.doInvoke(config);
|
|
293
293
|
return response;
|
|
294
294
|
});
|
|
295
295
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { OrderBook, StopBook } from "
|
|
3
|
+
import { OrderBook, StopBook } from "./book";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.book";
|
|
5
5
|
/** GenesisState defines the book module's genesis state. */
|
|
6
6
|
export interface GenesisState {
|
|
@@ -7,7 +7,7 @@ exports.GenesisState = exports.protobufPackage = void 0;
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const book_1 = require("
|
|
10
|
+
const book_1 = require("./book");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.book";
|
|
12
12
|
const baseGenesisState = {};
|
|
13
13
|
exports.GenesisState = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { OrderBook } from "
|
|
3
|
+
import { OrderBook } from "./book";
|
|
4
4
|
import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
|
|
5
5
|
export declare const protobufPackage = "Switcheo.carbon.book";
|
|
6
6
|
/** this line is used by starport scaffolding # 3 */
|
package/lib/codec/book/query.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryAllBookResponse = exports.QueryAllBookReq
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const book_1 = require("
|
|
10
|
+
const book_1 = require("./book");
|
|
11
11
|
const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
|
|
12
12
|
exports.protobufPackage = "Switcheo.carbon.book";
|
|
13
13
|
const baseQueryGetBookRequest = { market: "" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Amm } from "
|
|
3
|
+
import { Amm } from "./amm";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.broker";
|
|
5
5
|
/** GenesisState defines the broker module's genesis state. */
|
|
6
6
|
export interface GenesisState {
|
|
@@ -7,7 +7,7 @@ exports.GenesisState = exports.protobufPackage = void 0;
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const amm_1 = require("
|
|
10
|
+
const amm_1 = require("./amm");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.broker";
|
|
12
12
|
const baseGenesisState = {};
|
|
13
13
|
exports.GenesisState = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { PageRequest, PageResponse } from "../query/pagination";
|
|
4
|
-
import { MinMaxBoundary } from "
|
|
5
|
-
import { Candlestick } from "
|
|
6
|
-
import { TradeEvent } from "
|
|
4
|
+
import { MinMaxBoundary } from "./pagination";
|
|
5
|
+
import { Candlestick } from "./candlestick";
|
|
6
|
+
import { TradeEvent } from "./event";
|
|
7
7
|
export declare const protobufPackage = "Switcheo.carbon.broker";
|
|
8
8
|
export interface QueryCandlesticksRequest {
|
|
9
9
|
market: string;
|
|
@@ -8,9 +8,9 @@ exports.QueryClientImpl = exports.QueryTradesForPositionResponse = exports.Query
|
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
10
|
const pagination_1 = require("../query/pagination");
|
|
11
|
-
const pagination_2 = require("
|
|
12
|
-
const candlestick_1 = require("
|
|
13
|
-
const event_1 = require("
|
|
11
|
+
const pagination_2 = require("./pagination");
|
|
12
|
+
const candlestick_1 = require("./candlestick");
|
|
13
|
+
const event_1 = require("./event");
|
|
14
14
|
exports.protobufPackage = "Switcheo.carbon.broker";
|
|
15
15
|
const baseQueryCandlesticksRequest = {
|
|
16
16
|
market: "",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { DenomInfo } from "
|
|
3
|
+
import { DenomInfo } from "./denom_info";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.btcx";
|
|
5
5
|
export interface DenomCrossChainInfo {
|
|
6
6
|
denomInfo?: DenomInfo;
|
|
@@ -7,7 +7,7 @@ exports.DenomCrossChainInfo = exports.protobufPackage = void 0;
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const denom_info_1 = require("
|
|
10
|
+
const denom_info_1 = require("./denom_info");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.btcx";
|
|
12
12
|
const baseDenomCrossChainInfo = {
|
|
13
13
|
toChainId: long_1.default.UZERO,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { DenomInfo } from "
|
|
3
|
+
import { DenomInfo } from "./denom_info";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.btcx";
|
|
5
5
|
/** this line is used by starport scaffolding # 3 */
|
|
6
6
|
export interface QueryGetDenomInfoRequest {
|
package/lib/codec/btcx/query.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryGetDenomCrossChainInfoResponse = exports.
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const denom_info_1 = require("
|
|
10
|
+
const denom_info_1 = require("./denom_info");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.btcx";
|
|
12
12
|
const baseQueryGetDenomInfoRequest = { denom: "" };
|
|
13
13
|
exports.QueryGetDenomInfoRequest = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import { Params } from "
|
|
3
|
+
import { Params } from "./ccm";
|
|
4
4
|
export declare const protobufPackage = "Switcheo.carbon.ccm";
|
|
5
5
|
/** GenesisState defines the ccm module's genesis state. */
|
|
6
6
|
export interface GenesisState {
|
package/lib/codec/ccm/genesis.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.GenesisState_ZionCreatedTxDetailsEntry = exports.GenesisState_DenomCreat
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
-
const ccm_1 = require("
|
|
10
|
+
const ccm_1 = require("./ccm");
|
|
11
11
|
exports.protobufPackage = "Switcheo.carbon.ccm";
|
|
12
12
|
const baseGenesisState = { createdTxCount: "" };
|
|
13
13
|
exports.GenesisState = {
|
|
@@ -12,6 +12,7 @@ const baseAssetParams = {
|
|
|
12
12
|
denom: "",
|
|
13
13
|
oracleId: "",
|
|
14
14
|
rateStrategyName: "",
|
|
15
|
+
repayStablecoinInterestDebt: false,
|
|
15
16
|
loanToValue: "",
|
|
16
17
|
liquidationThreshold: "",
|
|
17
18
|
liquidationBonus: "",
|
|
@@ -29,20 +30,23 @@ exports.AssetParams = {
|
|
|
29
30
|
if (message.rateStrategyName !== "") {
|
|
30
31
|
writer.uint32(26).string(message.rateStrategyName);
|
|
31
32
|
}
|
|
33
|
+
if (message.repayStablecoinInterestDebt === true) {
|
|
34
|
+
writer.uint32(32).bool(message.repayStablecoinInterestDebt);
|
|
35
|
+
}
|
|
32
36
|
if (message.loanToValue !== "") {
|
|
33
|
-
writer.uint32(
|
|
37
|
+
writer.uint32(42).string(message.loanToValue);
|
|
34
38
|
}
|
|
35
39
|
if (message.liquidationThreshold !== "") {
|
|
36
|
-
writer.uint32(
|
|
40
|
+
writer.uint32(50).string(message.liquidationThreshold);
|
|
37
41
|
}
|
|
38
42
|
if (message.liquidationBonus !== "") {
|
|
39
|
-
writer.uint32(
|
|
43
|
+
writer.uint32(58).string(message.liquidationBonus);
|
|
40
44
|
}
|
|
41
45
|
if (message.supplyCap !== "") {
|
|
42
|
-
writer.uint32(
|
|
46
|
+
writer.uint32(66).string(message.supplyCap);
|
|
43
47
|
}
|
|
44
48
|
if (message.borrowCap !== "") {
|
|
45
|
-
writer.uint32(
|
|
49
|
+
writer.uint32(74).string(message.borrowCap);
|
|
46
50
|
}
|
|
47
51
|
return writer;
|
|
48
52
|
},
|
|
@@ -63,18 +67,21 @@ exports.AssetParams = {
|
|
|
63
67
|
message.rateStrategyName = reader.string();
|
|
64
68
|
break;
|
|
65
69
|
case 4:
|
|
66
|
-
message.
|
|
70
|
+
message.repayStablecoinInterestDebt = reader.bool();
|
|
67
71
|
break;
|
|
68
72
|
case 5:
|
|
69
|
-
message.
|
|
73
|
+
message.loanToValue = reader.string();
|
|
70
74
|
break;
|
|
71
75
|
case 6:
|
|
72
|
-
message.
|
|
76
|
+
message.liquidationThreshold = reader.string();
|
|
73
77
|
break;
|
|
74
78
|
case 7:
|
|
75
|
-
message.
|
|
79
|
+
message.liquidationBonus = reader.string();
|
|
76
80
|
break;
|
|
77
81
|
case 8:
|
|
82
|
+
message.supplyCap = reader.string();
|
|
83
|
+
break;
|
|
84
|
+
case 9:
|
|
78
85
|
message.borrowCap = reader.string();
|
|
79
86
|
break;
|
|
80
87
|
default:
|
|
@@ -98,6 +105,11 @@ exports.AssetParams = {
|
|
|
98
105
|
object.rateStrategyName !== undefined && object.rateStrategyName !== null
|
|
99
106
|
? String(object.rateStrategyName)
|
|
100
107
|
: "";
|
|
108
|
+
message.repayStablecoinInterestDebt =
|
|
109
|
+
object.repayStablecoinInterestDebt !== undefined &&
|
|
110
|
+
object.repayStablecoinInterestDebt !== null
|
|
111
|
+
? Boolean(object.repayStablecoinInterestDebt)
|
|
112
|
+
: false;
|
|
101
113
|
message.loanToValue =
|
|
102
114
|
object.loanToValue !== undefined && object.loanToValue !== null
|
|
103
115
|
? String(object.loanToValue)
|
|
@@ -127,6 +139,8 @@ exports.AssetParams = {
|
|
|
127
139
|
message.oracleId !== undefined && (obj.oracleId = message.oracleId);
|
|
128
140
|
message.rateStrategyName !== undefined &&
|
|
129
141
|
(obj.rateStrategyName = message.rateStrategyName);
|
|
142
|
+
message.repayStablecoinInterestDebt !== undefined &&
|
|
143
|
+
(obj.repayStablecoinInterestDebt = message.repayStablecoinInterestDebt);
|
|
130
144
|
message.loanToValue !== undefined &&
|
|
131
145
|
(obj.loanToValue = message.loanToValue);
|
|
132
146
|
message.liquidationThreshold !== undefined &&
|
|
@@ -138,16 +152,18 @@ exports.AssetParams = {
|
|
|
138
152
|
return obj;
|
|
139
153
|
},
|
|
140
154
|
fromPartial(object) {
|
|
141
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
155
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
142
156
|
const message = Object.assign({}, baseAssetParams);
|
|
143
157
|
message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
|
|
144
158
|
message.oracleId = (_b = object.oracleId) !== null && _b !== void 0 ? _b : "";
|
|
145
159
|
message.rateStrategyName = (_c = object.rateStrategyName) !== null && _c !== void 0 ? _c : "";
|
|
146
|
-
message.
|
|
147
|
-
|
|
148
|
-
message.
|
|
149
|
-
message.
|
|
150
|
-
message.
|
|
160
|
+
message.repayStablecoinInterestDebt =
|
|
161
|
+
(_d = object.repayStablecoinInterestDebt) !== null && _d !== void 0 ? _d : false;
|
|
162
|
+
message.loanToValue = (_e = object.loanToValue) !== null && _e !== void 0 ? _e : "";
|
|
163
|
+
message.liquidationThreshold = (_f = object.liquidationThreshold) !== null && _f !== void 0 ? _f : "";
|
|
164
|
+
message.liquidationBonus = (_g = object.liquidationBonus) !== null && _g !== void 0 ? _g : "";
|
|
165
|
+
message.supplyCap = (_h = object.supplyCap) !== null && _h !== void 0 ? _h : "";
|
|
166
|
+
message.borrowCap = (_j = object.borrowCap) !== null && _j !== void 0 ? _j : "";
|
|
151
167
|
return message;
|
|
152
168
|
},
|
|
153
169
|
};
|