carbon-js-sdk 0.2.15 → 0.2.16-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/clients/CarbonQueryClient.js +2 -2
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.d.ts +5 -0
- package/lib/clients/TokenClient.js +29 -7
- package/lib/clients/ZILClient.js +16 -16
- 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 -1
- package/lib/codec/cdp/asset_params.js +11 -10
- package/lib/codec/cdp/event.d.ts +389 -22
- package/lib/codec/cdp/event.js +2494 -83
- package/lib/codec/cdp/genesis.d.ts +97 -4
- package/lib/codec/cdp/genesis.js +648 -23
- package/lib/codec/cdp/params.d.ts +8 -0
- package/lib/codec/cdp/params.js +52 -9
- package/lib/codec/cdp/query.d.ts +439 -89
- package/lib/codec/cdp/query.js +1995 -177
- package/lib/codec/cdp/reward_scheme.d.ts +0 -13
- package/lib/codec/cdp/reward_scheme.js +1 -91
- package/lib/codec/cdp/tx.d.ts +760 -96
- package/lib/codec/cdp/tx.js +3645 -235
- 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 -2
- package/lib/codec/coin/query.js +2 -2
- 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/genesis.d.ts +1 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +1 -1
- 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 +4 -4
- package/lib/codec/cosmos/gov/v1beta1/tx.d.ts +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +4 -4
- 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 +5 -5
- 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 +89 -18
- package/lib/codec/index.js +463 -180
- 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/liquiditypool.d.ts +3 -0
- package/lib/codec/liquiditypool/liquiditypool.js +44 -1
- package/lib/codec/liquiditypool/proposal.d.ts +1 -1
- package/lib/codec/liquiditypool/proposal.js +1 -1
- package/lib/codec/liquiditypool/query.d.ts +39 -2
- package/lib/codec/liquiditypool/query.js +195 -3
- package/lib/codec/liquiditypool/tx.d.ts +3 -1
- package/lib/codec/liquiditypool/tx.js +35 -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 +1 -1
- package/lib/codec/market/genesis.js +1 -1
- 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/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 +4 -1
- package/lib/codec/oracle/genesis.js +34 -3
- 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 +56 -1
- package/lib/codec/pricing/event.js +298 -2
- package/lib/codec/pricing/genesis.d.ts +2 -1
- package/lib/codec/pricing/genesis.js +20 -5
- package/lib/codec/pricing/legacy.d.ts +22 -0
- package/lib/codec/pricing/legacy.js +93 -0
- package/lib/codec/pricing/pricing.d.ts +14 -0
- package/lib/codec/pricing/pricing.js +103 -1
- package/lib/codec/pricing/query.d.ts +68 -1
- package/lib/codec/pricing/query.js +321 -2
- package/lib/codec/pricing/tx.d.ts +96 -0
- package/lib/codec/pricing/tx.js +399 -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/constant/generic.js +1 -1
- package/lib/constant/network.js +1 -1
- package/lib/modules/admin.d.ts +114 -7
- package/lib/modules/admin.js +275 -53
- package/lib/modules/cdp.d.ts +152 -13
- package/lib/modules/cdp.js +796 -20
- package/lib/modules/gov.js +14 -14
- package/lib/modules/liquiditypool.d.ts +2 -0
- package/lib/modules/liquiditypool.js +3 -1
- package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
- package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
- package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
- package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
- package/lib/provider/amino/types/admin.js +91 -26
- package/lib/provider/amino/types/bank.js +1 -1
- package/lib/provider/amino/types/broker.js +1 -1
- package/lib/provider/amino/types/cdp.js +102 -32
- package/lib/provider/amino/types/coin.js +2 -2
- package/lib/provider/amino/types/gov.js +4 -4
- package/lib/provider/amino/types/ibc.js +1 -1
- package/lib/provider/amino/types/leverage.js +1 -1
- package/lib/provider/amino/types/liquidityPool.js +9 -7
- package/lib/provider/amino/types/market.js +1 -1
- package/lib/provider/amino/types/oracle.js +1 -1
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/position.js +1 -1
- package/lib/provider/amino/types/profile.js +1 -1
- package/lib/provider/amino/types/staking.js +4 -4
- package/lib/provider/amino/types/subaccount.js +3 -3
- package/lib/provider/amino/utils.js +11 -11
- package/lib/provider/keplr/KeplrAccount.js +5 -0
- package/lib/provider/keplr/KeplrStore.js +1 -1
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +1 -1
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.d.ts +1 -0
- package/lib/util/address.js +21 -13
- package/lib/util/api.js +4 -4
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/number.d.ts +1 -0
- package/lib/util/number.js +7 -6
- package/lib/util/tx.d.ts +75 -10
- package/lib/wallet/CarbonSigner.d.ts +5 -2
- package/lib/wallet/CarbonSigner.js +15 -2
- package/lib/wallet/CarbonSigningClient.js +8 -8
- package/lib/wallet/CarbonWallet.js +6 -7
- package/lib/websocket/channel.js +98 -21
- package/lib/websocket/connector.js +3 -3
- package/lib/websocket/models.d.ts +151 -0
- package/lib/websocket/types.d.ts +80 -3
- package/lib/websocket/types.js +29 -0
- package/package.json +1 -1
|
@@ -87,7 +87,7 @@ class CarbonSigningClient extends stargate_1.StargateClient {
|
|
|
87
87
|
*/
|
|
88
88
|
sign(signerAddress, messages, fee, memo, signerData) {
|
|
89
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
return
|
|
90
|
+
return proto_signing_1.isOfflineDirectSigner(this.signer)
|
|
91
91
|
? this.signDirect(signerAddress, messages, fee, memo, signerData)
|
|
92
92
|
: this.signAmino(signerAddress, messages, fee, memo, signerData);
|
|
93
93
|
});
|
|
@@ -99,7 +99,7 @@ class CarbonSigningClient extends stargate_1.StargateClient {
|
|
|
99
99
|
if (!accountFromSigner) {
|
|
100
100
|
throw new Error("Failed to retrieve account from signer");
|
|
101
101
|
}
|
|
102
|
-
const pubkey =
|
|
102
|
+
const pubkey = proto_signing_1.encodePubkey(amino_1.encodeSecp256k1Pubkey(accountFromSigner.pubkey));
|
|
103
103
|
const txBodyEncodeObject = {
|
|
104
104
|
typeUrl: "/cosmos.tx.v1beta1.TxBody",
|
|
105
105
|
value: Object.assign({ messages: messages, memo: memo }, timeoutHeight && {
|
|
@@ -108,13 +108,13 @@ class CarbonSigningClient extends stargate_1.StargateClient {
|
|
|
108
108
|
};
|
|
109
109
|
const txBodyBytes = this.registry.encode(txBodyEncodeObject);
|
|
110
110
|
const gasLimit = math_1.Int53.fromString(fee.gas).toNumber();
|
|
111
|
-
const authInfoBytes =
|
|
112
|
-
const signDoc =
|
|
111
|
+
const authInfoBytes = proto_signing_1.makeAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit);
|
|
112
|
+
const signDoc = proto_signing_1.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
|
|
113
113
|
const { signature, signed } = yield signer.signDirect(signerAddress, signDoc);
|
|
114
114
|
return tx_1.TxRaw.fromPartial({
|
|
115
115
|
bodyBytes: signed.bodyBytes,
|
|
116
116
|
authInfoBytes: signed.authInfoBytes,
|
|
117
|
-
signatures: [
|
|
117
|
+
signatures: [encoding_1.fromBase64(signature.signature)],
|
|
118
118
|
});
|
|
119
119
|
});
|
|
120
120
|
}
|
|
@@ -125,7 +125,7 @@ class CarbonSigningClient extends stargate_1.StargateClient {
|
|
|
125
125
|
if (!accountFromSigner) {
|
|
126
126
|
throw new Error("Failed to retrieve account from signer");
|
|
127
127
|
}
|
|
128
|
-
const pubkey =
|
|
128
|
+
const pubkey = proto_signing_1.encodePubkey(amino_1.encodeSecp256k1Pubkey(accountFromSigner.pubkey));
|
|
129
129
|
const signMode = SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
|
|
130
130
|
const msgs = messages.map((msg) => this.aminoTypes.toAmino(msg));
|
|
131
131
|
const signDoc = makeSignDocAmino(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight !== null && timeoutHeight !== void 0 ? timeoutHeight : 0);
|
|
@@ -140,11 +140,11 @@ class CarbonSigningClient extends stargate_1.StargateClient {
|
|
|
140
140
|
const signedTxBodyBytes = this.registry.encode(signedTxBodyEncodeObject);
|
|
141
141
|
const signedGasLimit = math_1.Int53.fromString(signed.fee.gas).toNumber();
|
|
142
142
|
const signedSequence = math_1.Int53.fromString(signed.sequence).toNumber();
|
|
143
|
-
const signedAuthInfoBytes =
|
|
143
|
+
const signedAuthInfoBytes = proto_signing_1.makeAuthInfoBytes([{ pubkey, sequence: signedSequence }], signed.fee.amount, signedGasLimit, signMode);
|
|
144
144
|
return tx_1.TxRaw.fromPartial({
|
|
145
145
|
bodyBytes: signedTxBodyBytes,
|
|
146
146
|
authInfoBytes: signedAuthInfoBytes,
|
|
147
|
-
signatures: [
|
|
147
|
+
signatures: [encoding_1.fromBase64(signature.signature)],
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -148,7 +148,7 @@ class CarbonWallet {
|
|
|
148
148
|
const signerData = Object.assign({ accountNumber: this.accountInfo.accountNumber, chainId: this.getChainId(), sequence }, explicitSignerData);
|
|
149
149
|
const fee = (_a = opts === null || opts === void 0 ? void 0 : opts.fee) !== null && _a !== void 0 ? _a : this.estimateTxFee(messages, feeDenom);
|
|
150
150
|
const txRaw = yield signingClient.sign(signerAddress, messages, fee, memo, signerData);
|
|
151
|
-
signature =
|
|
151
|
+
signature = amino_1.encodeSecp256k1Signature(account.pubkey, txRaw.signatures[0]);
|
|
152
152
|
return txRaw;
|
|
153
153
|
}
|
|
154
154
|
finally {
|
|
@@ -166,9 +166,8 @@ class CarbonWallet {
|
|
|
166
166
|
const tx = CarbonWallet.TxRaw.encode(txRaw).finish();
|
|
167
167
|
const carbonClient = this.getSigningClient();
|
|
168
168
|
const response = yield carbonClient.broadcastTx(tx, timeoutMs, pollIntervalMs);
|
|
169
|
-
if (
|
|
169
|
+
if (stargate_1.isDeliverTxFailure(response)) {
|
|
170
170
|
// tx failed
|
|
171
|
-
console.error(response);
|
|
172
171
|
throw new Error(`[${response.code}] ${response.rawLog}`);
|
|
173
172
|
}
|
|
174
173
|
return response;
|
|
@@ -206,9 +205,9 @@ class CarbonWallet {
|
|
|
206
205
|
try {
|
|
207
206
|
if (!this.accountInfo || this.sequenceInvalidated)
|
|
208
207
|
yield this.reloadAccountSequence();
|
|
209
|
-
const heightResponse = yield
|
|
208
|
+
const heightResponse = yield fetch_1.fetch(`${this.networkConfig.tmRpcUrl}/blockchain?cache=${new Date().getTime()}`);
|
|
210
209
|
const heightRes = yield heightResponse.json();
|
|
211
|
-
const height =
|
|
210
|
+
const height = number_1.bnOrZero((_a = heightRes.result) === null || _a === void 0 ? void 0 : _a.last_height);
|
|
212
211
|
const timeoutHeight = height.isZero() ? undefined : height.toNumber() + this.defaultTimeoutBlocks;
|
|
213
212
|
const sequence = this.accountInfo.sequence;
|
|
214
213
|
this.accountInfo = Object.assign(Object.assign({}, this.accountInfo), { sequence: sequence + 1 });
|
|
@@ -342,12 +341,12 @@ class CarbonWallet {
|
|
|
342
341
|
const queryClient = this.getQueryClient();
|
|
343
342
|
const { msgGasCosts } = yield queryClient.fee.MsgGasCostAll({});
|
|
344
343
|
this.txGasCosts = msgGasCosts.reduce((result, item) => {
|
|
345
|
-
result[item.msgType] =
|
|
344
|
+
result[item.msgType] = number_1.bnOrZero(item.gasCost);
|
|
346
345
|
return result;
|
|
347
346
|
}, {});
|
|
348
347
|
const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({});
|
|
349
348
|
this.txGasPrices = minGasPrices.reduce((result, item) => {
|
|
350
|
-
result[item.denom] =
|
|
349
|
+
result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
|
|
351
350
|
return result;
|
|
352
351
|
}, {});
|
|
353
352
|
if (!this.txGasPrices[this.defaultFeeDenom]) {
|
package/lib/websocket/channel.js
CHANGED
|
@@ -68,60 +68,96 @@ const generateChannelId = (params) => {
|
|
|
68
68
|
const { channel, id } = params;
|
|
69
69
|
return [channel, id].join(':');
|
|
70
70
|
}
|
|
71
|
+
case types_1.WSChannel.token_prices: {
|
|
72
|
+
const { channel } = params;
|
|
73
|
+
return [channel].join(':');
|
|
74
|
+
}
|
|
75
|
+
case types_1.WSChannel.token_prices_by_denom: {
|
|
76
|
+
const { channel, denom } = params;
|
|
77
|
+
return [channel, denom].join(':');
|
|
78
|
+
}
|
|
71
79
|
case types_1.WSChannel.commitments: {
|
|
72
80
|
const { channel, address } = params;
|
|
73
81
|
return [channel, address].join(':');
|
|
74
82
|
}
|
|
83
|
+
case types_1.WSChannel.cdp_borrows: {
|
|
84
|
+
const { channel, address } = params;
|
|
85
|
+
return [channel, address].join(':');
|
|
86
|
+
}
|
|
87
|
+
case types_1.WSChannel.cdp_collaterals: {
|
|
88
|
+
const { channel, address } = params;
|
|
89
|
+
return [channel, address].join(':');
|
|
90
|
+
}
|
|
91
|
+
case types_1.WSChannel.cdp_liquidate_collaterals: {
|
|
92
|
+
const { channel } = params;
|
|
93
|
+
return [channel].join(':');
|
|
94
|
+
}
|
|
95
|
+
case types_1.WSChannel.cdp_token_debts: {
|
|
96
|
+
const { channel } = params;
|
|
97
|
+
return [channel].join(':');
|
|
98
|
+
}
|
|
99
|
+
case types_1.WSChannel.cdp_token_debts_by_denom: {
|
|
100
|
+
const { channel, denom } = params;
|
|
101
|
+
return [channel, denom].join(':');
|
|
102
|
+
}
|
|
103
|
+
case types_1.WSChannel.cdp_reward_schemes: {
|
|
104
|
+
const { channel } = params;
|
|
105
|
+
return [channel].join(':');
|
|
106
|
+
}
|
|
107
|
+
case types_1.WSChannel.cdp_reward_debts: {
|
|
108
|
+
const { channel, address } = params;
|
|
109
|
+
return [channel, address].join(':');
|
|
110
|
+
}
|
|
75
111
|
default:
|
|
76
112
|
throw new Error(`invalid subscription channel: ${params.channel}`);
|
|
77
113
|
}
|
|
78
114
|
};
|
|
79
115
|
exports.generateChannelId = generateChannelId;
|
|
80
116
|
const parseChannelId = (rawChannelId) => {
|
|
81
|
-
const [channel,
|
|
117
|
+
const [channel, param0, param1] = rawChannelId.split(':');
|
|
82
118
|
switch (channel) {
|
|
83
119
|
case types_1.WSChannel.candlesticks:
|
|
84
120
|
return {
|
|
85
121
|
channel,
|
|
86
|
-
market,
|
|
87
|
-
resolution,
|
|
122
|
+
market: param0,
|
|
123
|
+
resolution: param1,
|
|
88
124
|
};
|
|
89
125
|
case types_1.WSChannel.books:
|
|
90
126
|
return {
|
|
91
127
|
channel,
|
|
92
|
-
market,
|
|
128
|
+
market: param0,
|
|
93
129
|
};
|
|
94
130
|
case types_1.WSChannel.recent_trades:
|
|
95
131
|
return {
|
|
96
132
|
channel,
|
|
97
|
-
market,
|
|
133
|
+
market: param0,
|
|
98
134
|
};
|
|
99
135
|
case types_1.WSChannel.orders:
|
|
100
136
|
return {
|
|
101
137
|
channel,
|
|
102
|
-
address,
|
|
138
|
+
address: param0,
|
|
103
139
|
};
|
|
104
140
|
case types_1.WSChannel.orders_by_market:
|
|
105
141
|
return {
|
|
106
142
|
channel,
|
|
107
|
-
market,
|
|
108
|
-
address,
|
|
143
|
+
market: param0,
|
|
144
|
+
address: param1,
|
|
109
145
|
};
|
|
110
146
|
case types_1.WSChannel.balances:
|
|
111
147
|
return {
|
|
112
148
|
channel,
|
|
113
|
-
address,
|
|
149
|
+
address: param0,
|
|
114
150
|
};
|
|
115
151
|
case types_1.WSChannel.account_trades:
|
|
116
152
|
return {
|
|
117
153
|
channel,
|
|
118
|
-
address,
|
|
154
|
+
address: param0,
|
|
119
155
|
};
|
|
120
156
|
case types_1.WSChannel.account_trades_by_market:
|
|
121
157
|
return {
|
|
122
158
|
channel,
|
|
123
|
-
market,
|
|
124
|
-
address,
|
|
159
|
+
market: param0,
|
|
160
|
+
address: param1,
|
|
125
161
|
};
|
|
126
162
|
case types_1.WSChannel.market_stats:
|
|
127
163
|
return {
|
|
@@ -130,29 +166,29 @@ const parseChannelId = (rawChannelId) => {
|
|
|
130
166
|
case types_1.WSChannel.market_stats_by_market:
|
|
131
167
|
return {
|
|
132
168
|
channel,
|
|
133
|
-
market,
|
|
169
|
+
market: param0,
|
|
134
170
|
};
|
|
135
171
|
case types_1.WSChannel.leverages:
|
|
136
172
|
return {
|
|
137
173
|
channel,
|
|
138
|
-
address,
|
|
174
|
+
address: param0,
|
|
139
175
|
};
|
|
140
176
|
case types_1.WSChannel.leverages_by_market:
|
|
141
177
|
return {
|
|
142
178
|
channel,
|
|
143
|
-
market,
|
|
144
|
-
address,
|
|
179
|
+
market: param0,
|
|
180
|
+
address: param1,
|
|
145
181
|
};
|
|
146
182
|
case types_1.WSChannel.positions:
|
|
147
183
|
return {
|
|
148
184
|
channel,
|
|
149
|
-
address,
|
|
185
|
+
address: param0,
|
|
150
186
|
};
|
|
151
187
|
case types_1.WSChannel.positions_by_market:
|
|
152
188
|
return {
|
|
153
189
|
channel,
|
|
154
|
-
market,
|
|
155
|
-
address,
|
|
190
|
+
market: param0,
|
|
191
|
+
address: param1,
|
|
156
192
|
};
|
|
157
193
|
case types_1.WSChannel.pools:
|
|
158
194
|
return {
|
|
@@ -161,12 +197,53 @@ const parseChannelId = (rawChannelId) => {
|
|
|
161
197
|
case types_1.WSChannel.pools_by_id:
|
|
162
198
|
return {
|
|
163
199
|
channel,
|
|
164
|
-
id,
|
|
200
|
+
id: param0,
|
|
165
201
|
};
|
|
166
202
|
case types_1.WSChannel.commitments:
|
|
167
203
|
return {
|
|
168
204
|
channel,
|
|
169
|
-
address,
|
|
205
|
+
address: param0,
|
|
206
|
+
};
|
|
207
|
+
case types_1.WSChannel.token_prices:
|
|
208
|
+
return {
|
|
209
|
+
channel,
|
|
210
|
+
};
|
|
211
|
+
case types_1.WSChannel.token_prices:
|
|
212
|
+
return {
|
|
213
|
+
channel,
|
|
214
|
+
denom: param0,
|
|
215
|
+
};
|
|
216
|
+
case types_1.WSChannel.cdp_borrows:
|
|
217
|
+
return {
|
|
218
|
+
channel,
|
|
219
|
+
address: param0,
|
|
220
|
+
};
|
|
221
|
+
case types_1.WSChannel.cdp_collaterals:
|
|
222
|
+
return {
|
|
223
|
+
channel,
|
|
224
|
+
address: param0,
|
|
225
|
+
};
|
|
226
|
+
case types_1.WSChannel.cdp_liquidate_collaterals:
|
|
227
|
+
return {
|
|
228
|
+
channel,
|
|
229
|
+
};
|
|
230
|
+
case types_1.WSChannel.cdp_token_debts:
|
|
231
|
+
return {
|
|
232
|
+
channel,
|
|
233
|
+
};
|
|
234
|
+
case types_1.WSChannel.cdp_token_debts_by_denom:
|
|
235
|
+
return {
|
|
236
|
+
channel,
|
|
237
|
+
denom: param0,
|
|
238
|
+
};
|
|
239
|
+
case types_1.WSChannel.cdp_reward_schemes:
|
|
240
|
+
return {
|
|
241
|
+
channel,
|
|
242
|
+
};
|
|
243
|
+
case types_1.WSChannel.cdp_reward_debts:
|
|
244
|
+
return {
|
|
245
|
+
channel,
|
|
246
|
+
address: param0,
|
|
170
247
|
};
|
|
171
248
|
default:
|
|
172
249
|
throw new Error('Error parsing channelId');
|
|
@@ -171,7 +171,7 @@ class WSConnector {
|
|
|
171
171
|
params = [params]; // eslint-disable-line no-param-reassign
|
|
172
172
|
}
|
|
173
173
|
for (const param of params) {
|
|
174
|
-
const channelId =
|
|
174
|
+
const channelId = channel_1.generateChannelId(param);
|
|
175
175
|
const shouldSubscribe = this.channelHandlers[channelId] === undefined;
|
|
176
176
|
this.channelHandlers[channelId] = handler;
|
|
177
177
|
if (shouldSubscribe) {
|
|
@@ -193,7 +193,7 @@ class WSConnector {
|
|
|
193
193
|
}
|
|
194
194
|
const channelIds = [];
|
|
195
195
|
for (const param of params) {
|
|
196
|
-
const channelId =
|
|
196
|
+
const channelId = channel_1.generateChannelId(param);
|
|
197
197
|
delete this.channelHandlers[channelId];
|
|
198
198
|
}
|
|
199
199
|
this.send('unsubscribe', {
|
|
@@ -279,7 +279,7 @@ class WSConnector {
|
|
|
279
279
|
if (!channelHandler) {
|
|
280
280
|
this.debugLog(`handler not found for channel: ${message.channel}`);
|
|
281
281
|
try {
|
|
282
|
-
const params =
|
|
282
|
+
const params = channel_1.parseChannelId(message.channel);
|
|
283
283
|
this.unsubscribe({ channel: params.channel });
|
|
284
284
|
}
|
|
285
285
|
catch (error) {
|
|
@@ -143,6 +143,9 @@ export interface Pool {
|
|
|
143
143
|
num_quotes: number;
|
|
144
144
|
shares_amount: string;
|
|
145
145
|
market: string;
|
|
146
|
+
amp_bps: string;
|
|
147
|
+
v_amount_a: string;
|
|
148
|
+
v_amount_b: string;
|
|
146
149
|
};
|
|
147
150
|
rewards_weight: string;
|
|
148
151
|
total_commitment: string;
|
|
@@ -160,3 +163,151 @@ export interface Commitment {
|
|
|
160
163
|
export interface CommitmentEvent extends Commitment {
|
|
161
164
|
Type?: string;
|
|
162
165
|
}
|
|
166
|
+
export interface TokenPrice {
|
|
167
|
+
denom: string;
|
|
168
|
+
index: string;
|
|
169
|
+
index_updated_at: string;
|
|
170
|
+
twap: string;
|
|
171
|
+
}
|
|
172
|
+
export interface CDPParams {
|
|
173
|
+
interest_fee: string;
|
|
174
|
+
liquidation_fee: string;
|
|
175
|
+
stablecoin_interest_rate: string;
|
|
176
|
+
complete_liquidation_threshold: string;
|
|
177
|
+
minimum_close_factor: string;
|
|
178
|
+
small_liquidation_size: string;
|
|
179
|
+
}
|
|
180
|
+
export interface RateStrategy {
|
|
181
|
+
name: string;
|
|
182
|
+
optimal_usage: string;
|
|
183
|
+
base_variable_borrow_rate: string;
|
|
184
|
+
variable_rate_slope_1: string;
|
|
185
|
+
variable_rate_slope_2: string;
|
|
186
|
+
base_stable_borrow_rate: string;
|
|
187
|
+
stable_rate_slope_1: string;
|
|
188
|
+
stable_rate_slope_2: string;
|
|
189
|
+
optimal_stable_to_total_debt_ratio: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated old websocket response struct for get_cdp_assets_all
|
|
193
|
+
* use AssetParams instead
|
|
194
|
+
*/
|
|
195
|
+
export interface Asset {
|
|
196
|
+
asset_params: {
|
|
197
|
+
denom: string;
|
|
198
|
+
oracle_id: string;
|
|
199
|
+
rate_strategy_name: string;
|
|
200
|
+
loan_to_value: string;
|
|
201
|
+
liquidation_threshold: string;
|
|
202
|
+
liquidation_bonus: string;
|
|
203
|
+
supply_cap: string;
|
|
204
|
+
borrow_cap: string;
|
|
205
|
+
};
|
|
206
|
+
asset_utilization: {
|
|
207
|
+
denom: string;
|
|
208
|
+
total_borrowed: string;
|
|
209
|
+
total_amount: string;
|
|
210
|
+
utilization_rate: string;
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export interface AssetParams {
|
|
214
|
+
denom: string;
|
|
215
|
+
oracle_id: string;
|
|
216
|
+
rate_strategy_name: string;
|
|
217
|
+
allow_repay_stablecoin_interest_debt: boolean;
|
|
218
|
+
loan_to_value: string;
|
|
219
|
+
liquidation_threshold: string;
|
|
220
|
+
liquidation_discount: string;
|
|
221
|
+
supply_cap: string;
|
|
222
|
+
borrow_cap: string;
|
|
223
|
+
}
|
|
224
|
+
export interface Collateral {
|
|
225
|
+
cdp_denom: string;
|
|
226
|
+
denom: string;
|
|
227
|
+
collateral_amount: string;
|
|
228
|
+
}
|
|
229
|
+
export interface Debt {
|
|
230
|
+
denom: string;
|
|
231
|
+
principal_debt: string;
|
|
232
|
+
initial_cumulative_interest_multiplier: string;
|
|
233
|
+
}
|
|
234
|
+
export interface AccountData {
|
|
235
|
+
total_collaterals_usd: string;
|
|
236
|
+
total_debts_usd: string;
|
|
237
|
+
available_borrows_usd: string;
|
|
238
|
+
curr_liquidation_threshold: string;
|
|
239
|
+
health_factor: string;
|
|
240
|
+
}
|
|
241
|
+
export interface CDPAccountStablecoin {
|
|
242
|
+
principal_debt: string;
|
|
243
|
+
interest_debt: string;
|
|
244
|
+
initial_cumulative_interest_multiplier: string;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Response for get_cdp_total_borrows and get_cdp_borrows
|
|
248
|
+
* Do not confuse with Debt
|
|
249
|
+
*/
|
|
250
|
+
export interface CDPBorrow {
|
|
251
|
+
address: string;
|
|
252
|
+
amount: string;
|
|
253
|
+
denom: string;
|
|
254
|
+
type: string;
|
|
255
|
+
initial_cumulative_interest_multiplier?: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Response for get_cdp_total_collaterals and get_cdp_collaterals
|
|
259
|
+
* Do not confuse with Collateral
|
|
260
|
+
*/
|
|
261
|
+
export interface CDPCollateral {
|
|
262
|
+
address: string;
|
|
263
|
+
amount: string;
|
|
264
|
+
denom: string;
|
|
265
|
+
}
|
|
266
|
+
export interface CDPDebtInfo {
|
|
267
|
+
denom: string;
|
|
268
|
+
last_updated_time: string;
|
|
269
|
+
total_principal: string;
|
|
270
|
+
cumulative_interest_multiplier: string;
|
|
271
|
+
total_accumulated_interest: string;
|
|
272
|
+
utilization_rate: string;
|
|
273
|
+
}
|
|
274
|
+
export interface CDPStableCoinDebtInfo {
|
|
275
|
+
denom: string;
|
|
276
|
+
last_updated_time: string;
|
|
277
|
+
total_principal: string;
|
|
278
|
+
cumulative_interest_multiplier: string;
|
|
279
|
+
total_accumulated_interest: string;
|
|
280
|
+
}
|
|
281
|
+
export interface CDPLiquidation {
|
|
282
|
+
liquidator: string;
|
|
283
|
+
debtor: string;
|
|
284
|
+
collateral_denom: string;
|
|
285
|
+
collateral_amount_liquidated: string;
|
|
286
|
+
collateral_amount_liquidator: string;
|
|
287
|
+
collateral_amount_fee: string;
|
|
288
|
+
liquidation_price: string;
|
|
289
|
+
market_price: string;
|
|
290
|
+
discount: string;
|
|
291
|
+
debt_denom: string;
|
|
292
|
+
debt_amount: string;
|
|
293
|
+
block_height: number;
|
|
294
|
+
block_time: string;
|
|
295
|
+
transaction_hash: string;
|
|
296
|
+
}
|
|
297
|
+
export interface RewardScheme {
|
|
298
|
+
id: number;
|
|
299
|
+
creator: string;
|
|
300
|
+
reward_denom: string;
|
|
301
|
+
asset_denom: string;
|
|
302
|
+
reward_type: string;
|
|
303
|
+
reward_amount_per_second: string;
|
|
304
|
+
start_time: string;
|
|
305
|
+
end_time: string;
|
|
306
|
+
reward_per_share_last_updated_at: string;
|
|
307
|
+
reward_per_share: string;
|
|
308
|
+
}
|
|
309
|
+
export interface RewardDebt {
|
|
310
|
+
user_address: string;
|
|
311
|
+
reward_scheme_id: number;
|
|
312
|
+
reward_debt: string;
|
|
313
|
+
}
|
package/lib/websocket/types.d.ts
CHANGED
|
@@ -15,7 +15,16 @@ export declare enum WSChannel {
|
|
|
15
15
|
positions_by_market = "positions_by_market",
|
|
16
16
|
pools = "pools",
|
|
17
17
|
pools_by_id = "pools_by_id",
|
|
18
|
-
|
|
18
|
+
token_prices = "token_prices",
|
|
19
|
+
token_prices_by_denom = "token_prices_by_denom",
|
|
20
|
+
commitments = "commitments",
|
|
21
|
+
cdp_borrows = "cdp_borrows",
|
|
22
|
+
cdp_collaterals = "cdp_collaterals",
|
|
23
|
+
cdp_liquidate_collaterals = "cdp_liquidate_collaterals",
|
|
24
|
+
cdp_token_debts = "cdp_token_debts",
|
|
25
|
+
cdp_token_debts_by_denom = "cdp_token_debts_by_denom",
|
|
26
|
+
cdp_reward_schemes = "cdp_reward_schemes",
|
|
27
|
+
cdp_reward_debts = "cdp_reward_debts"
|
|
19
28
|
}
|
|
20
29
|
export declare enum WSRequest {
|
|
21
30
|
MarketStats = "get_market_stats",
|
|
@@ -31,7 +40,27 @@ export declare enum WSRequest {
|
|
|
31
40
|
Balances = "get_balances",
|
|
32
41
|
OrderBook = "get_orderbook",
|
|
33
42
|
Pools = "get_pools",
|
|
34
|
-
Commitments = "get_commitments"
|
|
43
|
+
Commitments = "get_commitments",
|
|
44
|
+
CDPAllAssets = "get_cdp_all_assets",
|
|
45
|
+
CDPAssets = "get_cdp_assets",
|
|
46
|
+
CDPAccountCollaterals = "get_cdp_account_collaterals",
|
|
47
|
+
CDPAccountDebts = "get_cdp_account_debts",
|
|
48
|
+
CDPAccountData = "get_cdp_account_data",
|
|
49
|
+
CDPParams = "get_cdp_params",
|
|
50
|
+
CDPAllRateStrategies = "get_cdp_all_rate_strategies",
|
|
51
|
+
CDPRateStrategies = "get_cdp_rate_strategies",
|
|
52
|
+
CDPBorrows = "get_cdp_borrows",
|
|
53
|
+
CDPTotalBorrows = "get_cdp_total_borrows",
|
|
54
|
+
CDPCollaterals = "get_cdp_collaterals",
|
|
55
|
+
CDPTotalCollaterals = "get_cdp_total_collaterals",
|
|
56
|
+
CDPLiquidateCollateral = "get_cdp_liquidate_collateral",
|
|
57
|
+
CDPTokenDebt = "get_cdp_token_debt",
|
|
58
|
+
CDPAllTokenDebts = "get_cdp_all_token_debts",
|
|
59
|
+
CDPStablecoinDebt = "get_cdp_stablecoin_debt",
|
|
60
|
+
CDPLiquidations = "get_cdp_liquidations",
|
|
61
|
+
CDPAccountStablecoin = "get_cdp_account_stablecoin",
|
|
62
|
+
CDPRewardSchemes = "get_cdp_reward_schemes",
|
|
63
|
+
CDPRewardsDebts = "get_cdp_reward_debts"
|
|
35
64
|
}
|
|
36
65
|
export interface WsGetRecentTradesParams {
|
|
37
66
|
market: string;
|
|
@@ -75,6 +104,31 @@ export interface WsGetPositionsParams {
|
|
|
75
104
|
export interface WsGetCommitmentsParams {
|
|
76
105
|
address: string;
|
|
77
106
|
}
|
|
107
|
+
export interface WsGetCDPParams {
|
|
108
|
+
}
|
|
109
|
+
export interface WsGetCDPAssetParams {
|
|
110
|
+
denom: string;
|
|
111
|
+
}
|
|
112
|
+
export interface WsGetCDPAccountParams {
|
|
113
|
+
address: string;
|
|
114
|
+
}
|
|
115
|
+
export interface WsGetCDPRateStrategiesParams {
|
|
116
|
+
name: string;
|
|
117
|
+
}
|
|
118
|
+
export interface WsGetCdpTokenDebt {
|
|
119
|
+
denom: string;
|
|
120
|
+
}
|
|
121
|
+
export interface WsGetCdpAllTokenDebts {
|
|
122
|
+
}
|
|
123
|
+
export interface WsGetCdpStablecoinDebt {
|
|
124
|
+
}
|
|
125
|
+
export interface WsGetCdpLiquidations {
|
|
126
|
+
}
|
|
127
|
+
export interface WsGetCdpRewardSchemes {
|
|
128
|
+
}
|
|
129
|
+
export interface WsGetCdpRewardDebts {
|
|
130
|
+
address: string;
|
|
131
|
+
}
|
|
78
132
|
export interface WsSubscribeParams {
|
|
79
133
|
channel: WSChannel;
|
|
80
134
|
}
|
|
@@ -137,4 +191,27 @@ export interface WsUnsubscribeCandlesticksParams extends WsSubscribeParams {
|
|
|
137
191
|
market: string;
|
|
138
192
|
resolution: string;
|
|
139
193
|
}
|
|
140
|
-
export
|
|
194
|
+
export interface WsSubscribeCDPBorrows extends WsSubscribeParams {
|
|
195
|
+
address: string;
|
|
196
|
+
}
|
|
197
|
+
export interface WsSubscribeCDPCollaterals extends WsSubscribeParams {
|
|
198
|
+
address: string;
|
|
199
|
+
}
|
|
200
|
+
export interface WsSubscribeCDPLiquidateCollaterals extends WsSubscribeParams {
|
|
201
|
+
}
|
|
202
|
+
export interface WsSubscribeTokenDebts extends WsSubscribeParams {
|
|
203
|
+
}
|
|
204
|
+
export interface WsSubscribeTokenDebtByDenom extends WsSubscribeParams {
|
|
205
|
+
denom: string;
|
|
206
|
+
}
|
|
207
|
+
export interface WsSubscribeRewardSchemes extends WsSubscribeParams {
|
|
208
|
+
}
|
|
209
|
+
export interface WsSubscribeRewardDebts extends WsSubscribeParams {
|
|
210
|
+
address?: string;
|
|
211
|
+
}
|
|
212
|
+
export interface WsSubscribeTokenPrices extends WsSubscribeParams {
|
|
213
|
+
denom: string;
|
|
214
|
+
}
|
|
215
|
+
export interface WsSubscribeAllTokenPrices extends WsSubscribeParams {
|
|
216
|
+
}
|
|
217
|
+
export declare type WsSubscriptionParams = WsSubscribeCandlesticksParams | WsSubscribeBooksParams | WsSubscribeRecentTradesParams | WsSubscribeOrdersAllParams | WsSubscribeOrdersByMarketParams | WsSubscribeWalletBalanceParams | WsSubscribeAccountTradesAllParams | WsSubscribeAccountTradesByMarketParams | WsSubscribeMarketStatsAllParams | WsSubscribeMarketStatsByMarketParams | WsSubscribeLeveragesAllParams | WsSubscribeLeveragesByMarketParams | WsSubscribePositionsAllParams | WsSubscribePositionsByMarketParams | WsSubscribePoolsAllParams | WsSubscribePoolsByIdParams | WsSubscribeTokenPrices | WsSubscribeAllTokenPrices | WsSubscribeCommitmentParams | WsUnsubscribeCandlesticksParams | WsSubscribeCDPBorrows | WsSubscribeCDPCollaterals | WsSubscribeCDPLiquidateCollaterals | WsSubscribeTokenDebts | WsSubscribeTokenDebtByDenom | WsSubscribeRewardSchemes | WsSubscribeRewardDebts;
|
package/lib/websocket/types.js
CHANGED
|
@@ -19,7 +19,16 @@ var WSChannel;
|
|
|
19
19
|
WSChannel["positions_by_market"] = "positions_by_market";
|
|
20
20
|
WSChannel["pools"] = "pools";
|
|
21
21
|
WSChannel["pools_by_id"] = "pools_by_id";
|
|
22
|
+
WSChannel["token_prices"] = "token_prices";
|
|
23
|
+
WSChannel["token_prices_by_denom"] = "token_prices_by_denom";
|
|
22
24
|
WSChannel["commitments"] = "commitments";
|
|
25
|
+
WSChannel["cdp_borrows"] = "cdp_borrows";
|
|
26
|
+
WSChannel["cdp_collaterals"] = "cdp_collaterals";
|
|
27
|
+
WSChannel["cdp_liquidate_collaterals"] = "cdp_liquidate_collaterals";
|
|
28
|
+
WSChannel["cdp_token_debts"] = "cdp_token_debts";
|
|
29
|
+
WSChannel["cdp_token_debts_by_denom"] = "cdp_token_debts_by_denom";
|
|
30
|
+
WSChannel["cdp_reward_schemes"] = "cdp_reward_schemes";
|
|
31
|
+
WSChannel["cdp_reward_debts"] = "cdp_reward_debts";
|
|
23
32
|
})(WSChannel = exports.WSChannel || (exports.WSChannel = {}));
|
|
24
33
|
var WSRequest;
|
|
25
34
|
(function (WSRequest) {
|
|
@@ -37,4 +46,24 @@ var WSRequest;
|
|
|
37
46
|
WSRequest["OrderBook"] = "get_orderbook";
|
|
38
47
|
WSRequest["Pools"] = "get_pools";
|
|
39
48
|
WSRequest["Commitments"] = "get_commitments";
|
|
49
|
+
WSRequest["CDPAllAssets"] = "get_cdp_all_assets";
|
|
50
|
+
WSRequest["CDPAssets"] = "get_cdp_assets";
|
|
51
|
+
WSRequest["CDPAccountCollaterals"] = "get_cdp_account_collaterals";
|
|
52
|
+
WSRequest["CDPAccountDebts"] = "get_cdp_account_debts";
|
|
53
|
+
WSRequest["CDPAccountData"] = "get_cdp_account_data";
|
|
54
|
+
WSRequest["CDPParams"] = "get_cdp_params";
|
|
55
|
+
WSRequest["CDPAllRateStrategies"] = "get_cdp_all_rate_strategies";
|
|
56
|
+
WSRequest["CDPRateStrategies"] = "get_cdp_rate_strategies";
|
|
57
|
+
WSRequest["CDPBorrows"] = "get_cdp_borrows";
|
|
58
|
+
WSRequest["CDPTotalBorrows"] = "get_cdp_total_borrows";
|
|
59
|
+
WSRequest["CDPCollaterals"] = "get_cdp_collaterals";
|
|
60
|
+
WSRequest["CDPTotalCollaterals"] = "get_cdp_total_collaterals";
|
|
61
|
+
WSRequest["CDPLiquidateCollateral"] = "get_cdp_liquidate_collateral";
|
|
62
|
+
WSRequest["CDPTokenDebt"] = "get_cdp_token_debt";
|
|
63
|
+
WSRequest["CDPAllTokenDebts"] = "get_cdp_all_token_debts";
|
|
64
|
+
WSRequest["CDPStablecoinDebt"] = "get_cdp_stablecoin_debt";
|
|
65
|
+
WSRequest["CDPLiquidations"] = "get_cdp_liquidations";
|
|
66
|
+
WSRequest["CDPAccountStablecoin"] = "get_cdp_account_stablecoin";
|
|
67
|
+
WSRequest["CDPRewardSchemes"] = "get_cdp_reward_schemes";
|
|
68
|
+
WSRequest["CDPRewardsDebts"] = "get_cdp_reward_debts";
|
|
40
69
|
})(WSRequest = exports.WSRequest || (exports.WSRequest = {}));
|