carbon-js-sdk 0.6.5 → 0.6.6
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.js +1 -1
- package/lib/clients/BatchQueryClient.js +4 -4
- package/lib/clients/CarbonQueryClient.js +1 -1
- package/lib/clients/ETHClient.js +15 -15
- package/lib/clients/HydrogenClient.js +1 -1
- package/lib/clients/InsightsQueryClient.js +3 -3
- package/lib/clients/NEOClient.js +7 -7
- package/lib/clients/TokenClient.js +2 -2
- package/lib/clients/ZILClient.js +17 -17
- package/lib/codec/admin/export.d.ts +2 -0
- package/lib/codec/admin/export.js +13 -0
- package/lib/codec/alliance/export.d.ts +8 -0
- package/lib/codec/alliance/export.js +64 -0
- package/lib/codec/bank/export.d.ts +2 -0
- package/lib/codec/bank/export.js +14 -0
- package/lib/codec/book/export.d.ts +4 -0
- package/lib/codec/book/export.js +23 -0
- package/lib/codec/broker/export.d.ts +7 -0
- package/lib/codec/broker/export.js +27 -0
- package/lib/codec/carbon-models.d.ts +27 -0
- package/lib/codec/carbon-models.js +49 -0
- package/lib/codec/cdp/export.d.ts +13 -0
- package/lib/codec/cdp/export.js +208 -0
- package/lib/codec/coin/export.d.ts +8 -0
- package/lib/codec/coin/export.js +107 -0
- package/lib/codec/cosmos/gov/v1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1/tx.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
- package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
- package/lib/codec/cosmos/group/v1/events.js +2 -2
- package/lib/codec/cosmos/group/v1/tx.js +4 -4
- package/lib/codec/cosmos/tx/v1beta1/tx.js +4 -4
- package/lib/codec/erc20/export.d.ts +5 -0
- package/lib/codec/erc20/export.js +37 -0
- package/lib/codec/evmbank/export.d.ts +2 -0
- package/lib/codec/evmbank/export.js +8 -0
- package/lib/codec/evmmerge/export.d.ts +6 -0
- package/lib/codec/evmmerge/export.js +20 -0
- package/lib/codec/fee/export.d.ts +5 -0
- package/lib/codec/fee/export.js +32 -0
- package/lib/codec/inflation/export.d.ts +2 -0
- package/lib/codec/inflation/export.js +8 -0
- package/lib/codec/insurance/export.d.ts +4 -0
- package/lib/codec/insurance/export.js +14 -0
- package/lib/codec/leverage/export.d.ts +4 -0
- package/lib/codec/leverage/export.js +16 -0
- package/lib/codec/liquidation/export.d.ts +5 -0
- package/lib/codec/liquidation/export.js +17 -0
- package/lib/codec/liquiditypool/export.d.ts +6 -0
- package/lib/codec/liquiditypool/export.js +124 -0
- package/lib/codec/market/export.d.ts +6 -0
- package/lib/codec/market/export.js +61 -0
- package/lib/codec/marketstats/export.d.ts +3 -0
- package/lib/codec/marketstats/export.js +12 -0
- package/lib/codec/misc/export.d.ts +6 -0
- package/lib/codec/misc/export.js +29 -0
- package/lib/codec/oracle/export.d.ts +6 -0
- package/lib/codec/oracle/export.js +58 -0
- package/lib/codec/order/export.d.ts +5 -0
- package/lib/codec/order/export.js +39 -0
- package/lib/codec/perpspool/event.d.ts +95 -0
- package/lib/codec/perpspool/event.js +561 -0
- package/lib/codec/perpspool/export.d.ts +7 -0
- package/lib/codec/perpspool/export.js +68 -0
- package/lib/codec/perpspool/genesis.d.ts +61 -0
- package/lib/codec/perpspool/genesis.js +343 -0
- package/lib/codec/perpspool/market.d.ts +96 -0
- package/lib/codec/perpspool/market.js +493 -0
- package/lib/codec/perpspool/params.d.ts +30 -0
- package/lib/codec/perpspool/params.js +189 -0
- package/lib/codec/perpspool/pool.d.ts +103 -0
- package/lib/codec/perpspool/pool.js +638 -0
- package/lib/codec/perpspool/query.d.ts +246 -0
- package/lib/codec/perpspool/query.js +1124 -0
- package/lib/codec/perpspool/tx.d.ts +229 -0
- package/lib/codec/perpspool/tx.js +1144 -0
- package/lib/codec/position/export.d.ts +4 -0
- package/lib/codec/position/export.js +20 -0
- package/lib/codec/pricing/export.d.ts +6 -0
- package/lib/codec/pricing/export.js +45 -0
- package/lib/codec/profile/export.d.ts +4 -0
- package/lib/codec/profile/export.js +17 -0
- package/lib/codec/sequence/export.d.ts +3 -0
- package/lib/codec/sequence/export.js +13 -0
- package/lib/codec/subaccount/export.d.ts +4 -0
- package/lib/codec/subaccount/export.js +33 -0
- package/lib/constant/generic.js +1 -1
- package/lib/modules/cdp.js +44 -44
- package/lib/modules/cosmwasm.js +2 -2
- package/lib/modules/erc20.js +5 -4
- package/lib/modules/evm.js +5 -5
- package/lib/modules/gov.js +12 -12
- package/lib/modules/liquiditypool.js +1 -1
- package/lib/modules/order.js +2 -2
- package/lib/modules/perpspool.d.ts +49 -0
- package/lib/modules/perpspool.js +118 -0
- 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 +27 -27
- 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 +25 -25
- package/lib/provider/amino/types/coin.js +4 -4
- package/lib/provider/amino/types/evm.js +2 -2
- package/lib/provider/amino/types/evmmerge.js +1 -1
- package/lib/provider/amino/types/feemarket.js +1 -1
- package/lib/provider/amino/types/gov.js +5 -5
- 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 +7 -7
- package/lib/provider/amino/types/market.js +6 -6
- package/lib/provider/amino/types/oracle.js +2 -2
- package/lib/provider/amino/types/order.js +4 -4
- package/lib/provider/amino/types/perpspool.d.ts +4 -0
- package/lib/provider/amino/types/perpspool.js +73 -0
- 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 +11 -5
- package/lib/provider/ledger/ledger.js +2 -2
- package/lib/provider/metamask/MetaMask.js +13 -13
- package/lib/provider/o3/O3Wallet.js +2 -2
- package/lib/util/address.js +14 -14
- package/lib/util/api.js +4 -4
- package/lib/util/blockchain.d.ts +1 -1
- package/lib/util/blockchain.js +4 -4
- package/lib/util/eip712.js +3 -3
- package/lib/util/fetch.js +1 -1
- package/lib/util/generic.js +3 -3
- package/lib/util/legacyEIP712.js +2 -2
- package/lib/util/network.js +3 -3
- package/lib/util/number.js +5 -5
- package/lib/wallet/CarbonSigner.js +2 -2
- package/lib/wallet/CarbonSigningClient.js +15 -15
- package/lib/wallet/CarbonWallet.js +9 -9
- package/lib/websocket/connector.js +3 -3
- package/package.json +1 -1
package/lib/CarbonSDK.js
CHANGED
|
@@ -72,7 +72,7 @@ class CarbonSDK {
|
|
|
72
72
|
this.evmChainId = (_g = (_f = opts.evmChainId) !== null && _f !== void 0 ? _f : constant_1.CarbonEvmChainIDs[this.network]) !== null && _g !== void 0 ? _g : constant_1.CarbonEvmChainIDs[constant_1.Network.MainNet];
|
|
73
73
|
let grpcClient;
|
|
74
74
|
if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
|
|
75
|
-
const transport = typeof window === "undefined" ?
|
|
75
|
+
const transport = typeof window === "undefined" ? grpc_web_node_http_transport_1.NodeHttpTransport() : undefined;
|
|
76
76
|
grpcClient = (_h = opts.grpcQueryClient) !== null && _h !== void 0 ? _h : new GrpcQueryClient_1.default(this.networkConfig.grpcWebUrl, {
|
|
77
77
|
transport,
|
|
78
78
|
});
|
|
@@ -29,7 +29,7 @@ class BatchQueryClient {
|
|
|
29
29
|
};
|
|
30
30
|
if (typeof endpoint === "string") {
|
|
31
31
|
// accept host.name:port and assume http protocol
|
|
32
|
-
this.url =
|
|
32
|
+
this.url = rpcclient_1.hasProtocol(endpoint) ? endpoint : "http://" + endpoint;
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
this.url = endpoint.url;
|
|
@@ -71,7 +71,7 @@ class BatchQueryClient {
|
|
|
71
71
|
return;
|
|
72
72
|
const requests = batch.map((s) => s.request);
|
|
73
73
|
const requestIds = requests.map((request) => request.id);
|
|
74
|
-
|
|
74
|
+
http_1.http("POST", this.url, this.headers, requests).then((raw) => {
|
|
75
75
|
// Requests with a single entry return as an object
|
|
76
76
|
const arr = Array.isArray(raw) ? raw : [raw];
|
|
77
77
|
arr.forEach((el, i) => {
|
|
@@ -79,8 +79,8 @@ class BatchQueryClient {
|
|
|
79
79
|
if (!req)
|
|
80
80
|
return;
|
|
81
81
|
const { reject, resolve } = req;
|
|
82
|
-
const response =
|
|
83
|
-
if (
|
|
82
|
+
const response = json_rpc_1.parseJsonRpcResponse(el);
|
|
83
|
+
if (json_rpc_1.isJsonRpcErrorResponse(response)) {
|
|
84
84
|
reject(new Error(JSON.stringify(response.error)));
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
@@ -52,7 +52,7 @@ const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
|
52
52
|
class CarbonQueryClient {
|
|
53
53
|
constructor(opts) {
|
|
54
54
|
var _a;
|
|
55
|
-
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a :
|
|
55
|
+
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : stargate_1.createProtobufRpcClient(new stargate_1.QueryClient(opts.tmClient));
|
|
56
56
|
this.tmClient = opts.tmClient;
|
|
57
57
|
this.baseClient = rpcClient;
|
|
58
58
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
package/lib/clients/ETHClient.js
CHANGED
|
@@ -44,15 +44,15 @@ class ETHClient {
|
|
|
44
44
|
?
|
|
45
45
|
this.tokenClient.getBlockchainV2(token.denom) == ETHClient.BLOCKCHAINV2_MAPPING[this.blockchain]
|
|
46
46
|
:
|
|
47
|
-
|
|
47
|
+
blockchain_1.blockchainForChainId(token.chainId.toNumber(), api.network) == this.blockchain;
|
|
48
48
|
return isCorrectBlockchain &&
|
|
49
49
|
token.tokenAddress.length == 40 &&
|
|
50
|
-
token.bridgeAddress.toLowerCase() ==
|
|
50
|
+
token.bridgeAddress.toLowerCase() == generic_1.stripHexPrefix(lockProxyAddress) &&
|
|
51
51
|
(!whitelistDenoms || whitelistDenoms.includes(token.denom)) &&
|
|
52
|
-
this.verifyChecksum(
|
|
52
|
+
this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
53
53
|
});
|
|
54
54
|
const assetIds = tokens.map((token) => {
|
|
55
|
-
return this.verifyChecksum(
|
|
55
|
+
return this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
|
|
56
56
|
});
|
|
57
57
|
const provider = this.getProvider();
|
|
58
58
|
const contractAddress = this.getBalanceReaderAddress();
|
|
@@ -101,14 +101,14 @@ class ETHClient {
|
|
|
101
101
|
}
|
|
102
102
|
const carbonNetwork = networkConfig.network;
|
|
103
103
|
const fromTokenId = fromToken.id;
|
|
104
|
-
const fromTokenAddress =
|
|
104
|
+
const fromTokenAddress = generic_1.appendHexPrefix(fromToken.tokenAddress);
|
|
105
105
|
const toTokenDenom = toToken.denom;
|
|
106
106
|
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
|
|
107
107
|
const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
|
|
108
108
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
|
|
109
109
|
const nonce = yield this.getTxNonce(fromAddress, params.nonce, rpcProvider);
|
|
110
110
|
const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
|
|
111
|
-
const feeAddress =
|
|
111
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
112
112
|
const tokenCreator = fromToken.creator;
|
|
113
113
|
const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, carbonNetwork);
|
|
114
114
|
const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
|
|
@@ -137,9 +137,9 @@ class ETHClient {
|
|
|
137
137
|
throw new Error("Minimum gas required: 150,000");
|
|
138
138
|
}
|
|
139
139
|
const networkConfig = this.getNetworkConfig();
|
|
140
|
-
const assetId =
|
|
141
|
-
const targetProxyHash =
|
|
142
|
-
const feeAddress =
|
|
140
|
+
const assetId = generic_1.appendHexPrefix(token.tokenAddress);
|
|
141
|
+
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
|
|
142
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
143
143
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
|
|
144
144
|
const swthAddress = ethers_1.ethers.utils.hexlify(address);
|
|
145
145
|
const contractAddress = this.getLockProxyAddress();
|
|
@@ -190,16 +190,16 @@ class ETHClient {
|
|
|
190
190
|
return "insufficient balance";
|
|
191
191
|
}
|
|
192
192
|
const networkConfig = this.getNetworkConfig();
|
|
193
|
-
const assetId =
|
|
194
|
-
const targetProxyHash =
|
|
195
|
-
const feeAddress =
|
|
193
|
+
const assetId = generic_1.appendHexPrefix(tokenWithExternalBalances.tokenAddress);
|
|
194
|
+
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(tokenWithExternalBalances));
|
|
195
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
196
196
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(tokenWithExternalBalances.id));
|
|
197
197
|
const nonce = Math.floor(Math.random() * 1000000000); // random nonce to prevent replay attacks
|
|
198
198
|
const message = ethers_1.ethers.utils.solidityKeccak256(["string", "address", "bytes", "bytes", "bytes", "uint256", "uint256", "uint256"], ["sendTokens", assetId, targetProxyHash, toAssetHash, feeAddress, amount, feeAmount, nonce]);
|
|
199
199
|
// logger("sendDeposit message", message)
|
|
200
200
|
let signatureResult;
|
|
201
201
|
const { address, signature } = yield getSignatureCallback(message);
|
|
202
|
-
const signatureBytes = ethers_1.ethers.utils.arrayify(
|
|
202
|
+
const signatureBytes = ethers_1.ethers.utils.arrayify(generic_1.appendHexPrefix(signature));
|
|
203
203
|
const rsv = ethers_1.ethers.utils.splitSignature(signatureBytes);
|
|
204
204
|
// logger("sign result", address, signature)
|
|
205
205
|
signatureResult = {
|
|
@@ -238,7 +238,7 @@ class ETHClient {
|
|
|
238
238
|
if (!feeInfo.deposit_fee) {
|
|
239
239
|
throw new Error("unsupported token");
|
|
240
240
|
}
|
|
241
|
-
if (
|
|
241
|
+
if (blockchain_1.blockchainForChainId(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
|
|
242
242
|
throw new Error("unsupported token");
|
|
243
243
|
}
|
|
244
244
|
let feeAmount = ethers_1.ethers.BigNumber.from(feeInfo.deposit_fee);
|
|
@@ -304,7 +304,7 @@ class ETHClient {
|
|
|
304
304
|
getTargetProxyHash(token) {
|
|
305
305
|
const networkConfig = this.getNetworkConfig();
|
|
306
306
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
307
|
-
const addressHex =
|
|
307
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
308
308
|
return addressHex;
|
|
309
309
|
}
|
|
310
310
|
getProvider() {
|
|
@@ -29,7 +29,7 @@ exports.HydrogenEndpoints = {
|
|
|
29
29
|
const formatDateField = (value) => {
|
|
30
30
|
if (typeof value !== "string")
|
|
31
31
|
return null;
|
|
32
|
-
return
|
|
32
|
+
return dayjs_1.default(value);
|
|
33
33
|
};
|
|
34
34
|
// temporary function to parse okt/okc blockchain
|
|
35
35
|
// to remove when automatic deposit/withdraw feature is deployed
|
|
@@ -101,12 +101,12 @@ class InsightsQueryClient {
|
|
|
101
101
|
const meta = response.data.result.meta;
|
|
102
102
|
const parsedEntries = rawEntries.map(entry => ({
|
|
103
103
|
lastHeight: entry.lastHeight,
|
|
104
|
-
time:
|
|
104
|
+
time: dayjs_1.default(entry.time),
|
|
105
105
|
volumeValue: new bignumber_js_1.default(entry.volumeValue)
|
|
106
106
|
}));
|
|
107
107
|
const parsedMeta = {
|
|
108
|
-
from:
|
|
109
|
-
until:
|
|
108
|
+
from: dayjs_1.default(meta.from),
|
|
109
|
+
until: dayjs_1.default(meta.until),
|
|
110
110
|
interval: meta.interval,
|
|
111
111
|
};
|
|
112
112
|
return { result: { entries: parsedEntries, meta: parsedMeta } };
|
package/lib/clients/NEOClient.js
CHANGED
|
@@ -68,13 +68,13 @@ class NEOClient {
|
|
|
68
68
|
?
|
|
69
69
|
!!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
|
|
70
70
|
:
|
|
71
|
-
|
|
71
|
+
blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
|
|
72
72
|
return (isCorrectBlockchain || token.denom === "swth") && token.tokenAddress.length == 40 && token.bridgeAddress.length == 40;
|
|
73
73
|
});
|
|
74
74
|
const client = new Neon.rpc.RPCClient(url, "2.5.2"); // TODO: should we change the RPC version??
|
|
75
75
|
// NOTE: fetching of tokens is chunked in sets of 15 as we may hit
|
|
76
76
|
// the gas limit on the RPC node and error out otherwise
|
|
77
|
-
const promises =
|
|
77
|
+
const promises = lodash_1.chunk(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
var _a, _b, _c;
|
|
79
79
|
let acc = {};
|
|
80
80
|
for (const token of partition) {
|
|
@@ -116,8 +116,8 @@ class NEOClient {
|
|
|
116
116
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
117
117
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
118
118
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(swthAddress, networkConfig.network);
|
|
119
|
-
const toAddress =
|
|
120
|
-
const zeroAddressHex =
|
|
119
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
120
|
+
const zeroAddressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
|
|
121
121
|
const amount = ethers_1.ethers.BigNumber.from(token.externalBalance);
|
|
122
122
|
const feeAmount = ethers_1.ethers.BigNumber.from(feeAmountInput !== null && feeAmountInput !== void 0 ? feeAmountInput : "100000000");
|
|
123
123
|
const feeAddress = feeAmount.isZero() ? zeroAddressHex : networkConfig.feeAddress;
|
|
@@ -162,7 +162,7 @@ class NEOClient {
|
|
|
162
162
|
const fromAddress = util_1.AddressUtils.NEOAddress.publicKeyToAddress(publicKeyOutput.publicKey);
|
|
163
163
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
164
164
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
165
|
-
const toAddress =
|
|
165
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
166
166
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
167
167
|
if (amount.lt(feeAmount)) {
|
|
168
168
|
throw new Error("Invalid amount");
|
|
@@ -198,7 +198,7 @@ class NEOClient {
|
|
|
198
198
|
const fromAddress = ledger.scriptHash;
|
|
199
199
|
const targetProxyHash = this.getTargetProxyHash(token);
|
|
200
200
|
const toAssetHash = Neon.u.str2hexstring(token.id);
|
|
201
|
-
const toAddress =
|
|
201
|
+
const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
|
|
202
202
|
const feeAddress = networkConfig.feeAddress;
|
|
203
203
|
const nonce = Math.floor(Math.random() * 1000000);
|
|
204
204
|
if (amount.lt(feeAmount)) {
|
|
@@ -313,7 +313,7 @@ class NEOClient {
|
|
|
313
313
|
getTargetProxyHash(token) {
|
|
314
314
|
const networkConfig = this.getNetworkConfig();
|
|
315
315
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
316
|
-
const addressHex =
|
|
316
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
317
317
|
return addressHex;
|
|
318
318
|
}
|
|
319
319
|
getNetworkConfig() {
|
|
@@ -544,7 +544,7 @@ class TokenClient {
|
|
|
544
544
|
if (!token)
|
|
545
545
|
return undefined;
|
|
546
546
|
const bridge = this.getBridgeFromToken(token);
|
|
547
|
-
if (!bridge || !
|
|
547
|
+
if (!bridge || !blockchain_1.isIbcBridge(bridge))
|
|
548
548
|
return undefined;
|
|
549
549
|
return bridge.chain_id_name;
|
|
550
550
|
}
|
|
@@ -620,7 +620,7 @@ class TokenClient {
|
|
|
620
620
|
processTokenPrices(tokenPrices) {
|
|
621
621
|
return tokenPrices.reduce((prevPrices, price) => {
|
|
622
622
|
const newPrev = prevPrices;
|
|
623
|
-
newPrev[price.denom] =
|
|
623
|
+
newPrev[price.denom] = number_1.bnOrZero(price.twap).shiftedBy(-constant_1.decTypeDecimals);
|
|
624
624
|
return newPrev;
|
|
625
625
|
}, {});
|
|
626
626
|
}
|
package/lib/clients/ZILClient.js
CHANGED
|
@@ -77,12 +77,12 @@ class ZILClient {
|
|
|
77
77
|
?
|
|
78
78
|
!!sdk.token.getBlockchainV2(token.denom) && (blockchain_1.BLOCKCHAIN_V2_TO_V1_MAPPING[sdk.token.getBlockchainV2(token.denom)] == this.blockchain)
|
|
79
79
|
:
|
|
80
|
-
|
|
80
|
+
blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain;
|
|
81
81
|
return isCorrectBlockchain && token.tokenAddress.length == 40 && (!whitelistDenoms || whitelistDenoms.includes(token.denom));
|
|
82
82
|
});
|
|
83
83
|
const requests = tokens.map((token) => token.tokenAddress === zeroAddress
|
|
84
|
-
?
|
|
85
|
-
:
|
|
84
|
+
? exports.balanceBatchRequest(address.replace(/^0x/i, ""))
|
|
85
|
+
: exports.tokenBalanceBatchRequest(token.tokenAddress, address));
|
|
86
86
|
const response = yield fetch(this.getProviderUrl(), {
|
|
87
87
|
method: "post",
|
|
88
88
|
headers: { "content-type": "application/json" },
|
|
@@ -107,7 +107,7 @@ class ZILClient {
|
|
|
107
107
|
// if (!isValidAddress) {
|
|
108
108
|
// throw new Error("invalid address")
|
|
109
109
|
// }
|
|
110
|
-
return
|
|
110
|
+
return zilliqa_1.fromBech32Address(bech32Address).toLowerCase().substr(2);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
// see examplesV2/zil_client.ts on how to confirm the transactions
|
|
@@ -153,7 +153,7 @@ class ZILClient {
|
|
|
153
153
|
zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
|
|
154
154
|
}
|
|
155
155
|
const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
|
|
156
|
-
const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(
|
|
156
|
+
const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(zilAddress));
|
|
157
157
|
if (balanceAndNonceResp.error !== undefined) {
|
|
158
158
|
throw new Error(balanceAndNonceResp.error.message);
|
|
159
159
|
}
|
|
@@ -171,7 +171,7 @@ class ZILClient {
|
|
|
171
171
|
vname: "spender",
|
|
172
172
|
type: "ByStr20",
|
|
173
173
|
// TODO: Check if bridgeAddress corresponds to carbon token lock_proxy_hash
|
|
174
|
-
value: spenderAddress !== null && spenderAddress !== void 0 ? spenderAddress :
|
|
174
|
+
value: spenderAddress !== null && spenderAddress !== void 0 ? spenderAddress : generic_1.appendHexPrefix(token.bridgeAddress),
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
vname: "amount",
|
|
@@ -189,7 +189,7 @@ class ZILClient {
|
|
|
189
189
|
}
|
|
190
190
|
checkAllowanceZRC2(token, owner, spender) {
|
|
191
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
-
const contractAddress =
|
|
192
|
+
const contractAddress = generic_1.appendHexPrefix(token.tokenAddress);
|
|
193
193
|
const zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
|
|
194
194
|
const resp = yield zilliqa.blockchain.getSmartContractSubState(contractAddress, "allowances", [owner, spender]);
|
|
195
195
|
if (resp.error !== undefined) {
|
|
@@ -211,13 +211,13 @@ class ZILClient {
|
|
|
211
211
|
}
|
|
212
212
|
const carbonNetwork = networkConfig.network;
|
|
213
213
|
const fromTokenId = fromToken.id;
|
|
214
|
-
const fromTokenAddr =
|
|
214
|
+
const fromTokenAddr = generic_1.appendHexPrefix(fromToken.tokenAddress);
|
|
215
215
|
const toTokenDenom = toToken.denom;
|
|
216
|
-
const targetProxyHash =
|
|
216
|
+
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(fromToken));
|
|
217
217
|
const recoveryAddressHex = ethers_1.ethers.utils.hexlify(index_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
|
|
218
218
|
const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
|
|
219
219
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
|
|
220
|
-
const feeAddress =
|
|
220
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
221
221
|
const contractAddress = this.getBridgeEntranceAddr();
|
|
222
222
|
let zilliqa;
|
|
223
223
|
if (typeof signer === "string") {
|
|
@@ -232,7 +232,7 @@ class ZILClient {
|
|
|
232
232
|
zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
|
|
233
233
|
}
|
|
234
234
|
const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
|
|
235
|
-
const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(
|
|
235
|
+
const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(fromAddress));
|
|
236
236
|
if (balanceAndNonceResp.error !== undefined) {
|
|
237
237
|
throw new Error(balanceAndNonceResp.error.message);
|
|
238
238
|
}
|
|
@@ -309,13 +309,13 @@ class ZILClient {
|
|
|
309
309
|
return __awaiter(this, void 0, void 0, function* () {
|
|
310
310
|
const { address, amount, token, gasPrice, gasLimit, zilAddress, signer } = params;
|
|
311
311
|
const networkConfig = this.getNetworkConfig();
|
|
312
|
-
const assetId =
|
|
313
|
-
const targetProxyHash =
|
|
314
|
-
const feeAddress =
|
|
312
|
+
const assetId = generic_1.appendHexPrefix(token.tokenAddress);
|
|
313
|
+
const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
|
|
314
|
+
const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
|
|
315
315
|
const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
|
|
316
316
|
const swthAddress = ethers_1.ethers.utils.hexlify(address);
|
|
317
317
|
// TODO: Check if bridgeAddress corresponds to carbon token lock_proxy_hash
|
|
318
|
-
const contractAddress =
|
|
318
|
+
const contractAddress = generic_1.appendHexPrefix(token.bridgeAddress);
|
|
319
319
|
let zilliqa;
|
|
320
320
|
if (typeof signer === "string") {
|
|
321
321
|
zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
|
|
@@ -329,7 +329,7 @@ class ZILClient {
|
|
|
329
329
|
zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
|
|
330
330
|
}
|
|
331
331
|
const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
|
|
332
|
-
const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(
|
|
332
|
+
const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(zilAddress));
|
|
333
333
|
if (balanceAndNonceResp.error !== undefined) {
|
|
334
334
|
throw new Error(balanceAndNonceResp.error.message);
|
|
335
335
|
}
|
|
@@ -414,7 +414,7 @@ class ZILClient {
|
|
|
414
414
|
getTargetProxyHash(token) {
|
|
415
415
|
const networkConfig = this.getNetworkConfig();
|
|
416
416
|
const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
|
|
417
|
-
const addressHex =
|
|
417
|
+
const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
|
|
418
418
|
return addressHex;
|
|
419
419
|
}
|
|
420
420
|
getNetworkConfig() {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgAcceptAdminTransferResponse = exports.MsgAcceptAdminTransfer = exports.MsgInitiateAdminTransferResponse = exports.MsgInitiateAdminTransfer = exports.QueryAdminRecipientResponse = exports.QueryAdminRecipientRequest = exports.QueryAdminResponse = exports.QueryAdminRequest = void 0;
|
|
4
|
+
var query_1 = require("./query");
|
|
5
|
+
Object.defineProperty(exports, "QueryAdminRequest", { enumerable: true, get: function () { return query_1.QueryAdminRequest; } });
|
|
6
|
+
Object.defineProperty(exports, "QueryAdminResponse", { enumerable: true, get: function () { return query_1.QueryAdminResponse; } });
|
|
7
|
+
Object.defineProperty(exports, "QueryAdminRecipientRequest", { enumerable: true, get: function () { return query_1.QueryAdminRecipientRequest; } });
|
|
8
|
+
Object.defineProperty(exports, "QueryAdminRecipientResponse", { enumerable: true, get: function () { return query_1.QueryAdminRecipientResponse; } });
|
|
9
|
+
var tx_1 = require("./tx");
|
|
10
|
+
Object.defineProperty(exports, "MsgInitiateAdminTransfer", { enumerable: true, get: function () { return tx_1.MsgInitiateAdminTransfer; } });
|
|
11
|
+
Object.defineProperty(exports, "MsgInitiateAdminTransferResponse", { enumerable: true, get: function () { return tx_1.MsgInitiateAdminTransferResponse; } });
|
|
12
|
+
Object.defineProperty(exports, "MsgAcceptAdminTransfer", { enumerable: true, get: function () { return tx_1.MsgAcceptAdminTransfer; } });
|
|
13
|
+
Object.defineProperty(exports, "MsgAcceptAdminTransferResponse", { enumerable: true, get: function () { return tx_1.MsgAcceptAdminTransferResponse; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { RewardWeightRange, AllianceAsset, RewardWeightChangeSnapshot } from "./alliance";
|
|
2
|
+
export { Delegation, Redelegation, QueuedRedelegation, Undelegation, QueuedUndelegation, AllianceValidatorInfo } from "./delegations";
|
|
3
|
+
export { DelegateAllianceEvent, UndelegateAllianceEvent, RedelegateAllianceEvent, ClaimAllianceRewardsEvent } from "./events";
|
|
4
|
+
export { ValidatorInfoState, RedelegationState, UndelegationState, RewardWeightChangeSnapshotState } from "./genesis";
|
|
5
|
+
export { MsgCreateAllianceProposal, MsgUpdateAllianceProposal, MsgDeleteAllianceProposal } from "./gov";
|
|
6
|
+
export { Params, RewardHistory } from "./params";
|
|
7
|
+
export { QueryParamsRequest, QueryParamsResponse, QueryAlliancesRequest, QueryAlliancesResponse, QueryAllianceRequest, QueryAllianceResponse, QueryIBCAllianceRequest, QueryAllianceValidatorRequest, QueryAllAllianceValidatorsRequest, QueryAllAlliancesDelegationsRequest, QueryAlliancesDelegationsRequest, QueryAlliancesDelegationByValidatorRequest, DelegationResponse, QueryAlliancesDelegationsResponse, QueryAllianceDelegationRequest, QueryIBCAllianceDelegationRequest, QueryAllianceDelegationResponse, QueryAllianceDelegationRewardsRequest, QueryIBCAllianceDelegationRewardsRequest, QueryAllianceDelegationRewardsResponse, QueryAllianceValidatorResponse, QueryAllianceValidatorsResponse } from "./query";
|
|
8
|
+
export { MsgDelegate, MsgDelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgRedelegate, MsgRedelegateResponse, MsgClaimDelegationRewards, MsgClaimDelegationRewardsResponse } from "./tx";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgRedelegateResponse = exports.MsgRedelegate = exports.MsgUndelegateResponse = exports.MsgUndelegate = exports.MsgDelegateResponse = exports.MsgDelegate = exports.QueryAllianceValidatorsResponse = exports.QueryAllianceValidatorResponse = exports.QueryAllianceDelegationRewardsResponse = exports.QueryIBCAllianceDelegationRewardsRequest = exports.QueryAllianceDelegationRewardsRequest = exports.QueryAllianceDelegationResponse = exports.QueryIBCAllianceDelegationRequest = exports.QueryAllianceDelegationRequest = exports.QueryAlliancesDelegationsResponse = exports.DelegationResponse = exports.QueryAlliancesDelegationByValidatorRequest = exports.QueryAlliancesDelegationsRequest = exports.QueryAllAlliancesDelegationsRequest = exports.QueryAllAllianceValidatorsRequest = exports.QueryAllianceValidatorRequest = exports.QueryIBCAllianceRequest = exports.QueryAllianceResponse = exports.QueryAllianceRequest = exports.QueryAlliancesResponse = exports.QueryAlliancesRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.RewardHistory = exports.Params = exports.MsgDeleteAllianceProposal = exports.MsgUpdateAllianceProposal = exports.MsgCreateAllianceProposal = exports.RewardWeightChangeSnapshotState = exports.UndelegationState = exports.RedelegationState = exports.ValidatorInfoState = exports.ClaimAllianceRewardsEvent = exports.RedelegateAllianceEvent = exports.UndelegateAllianceEvent = exports.DelegateAllianceEvent = exports.AllianceValidatorInfo = exports.QueuedUndelegation = exports.Undelegation = exports.QueuedRedelegation = exports.Redelegation = exports.Delegation = exports.RewardWeightChangeSnapshot = exports.AllianceAsset = exports.RewardWeightRange = void 0;
|
|
4
|
+
exports.MsgClaimDelegationRewardsResponse = exports.MsgClaimDelegationRewards = void 0;
|
|
5
|
+
var alliance_1 = require("./alliance");
|
|
6
|
+
Object.defineProperty(exports, "RewardWeightRange", { enumerable: true, get: function () { return alliance_1.RewardWeightRange; } });
|
|
7
|
+
Object.defineProperty(exports, "AllianceAsset", { enumerable: true, get: function () { return alliance_1.AllianceAsset; } });
|
|
8
|
+
Object.defineProperty(exports, "RewardWeightChangeSnapshot", { enumerable: true, get: function () { return alliance_1.RewardWeightChangeSnapshot; } });
|
|
9
|
+
var delegations_1 = require("./delegations");
|
|
10
|
+
Object.defineProperty(exports, "Delegation", { enumerable: true, get: function () { return delegations_1.Delegation; } });
|
|
11
|
+
Object.defineProperty(exports, "Redelegation", { enumerable: true, get: function () { return delegations_1.Redelegation; } });
|
|
12
|
+
Object.defineProperty(exports, "QueuedRedelegation", { enumerable: true, get: function () { return delegations_1.QueuedRedelegation; } });
|
|
13
|
+
Object.defineProperty(exports, "Undelegation", { enumerable: true, get: function () { return delegations_1.Undelegation; } });
|
|
14
|
+
Object.defineProperty(exports, "QueuedUndelegation", { enumerable: true, get: function () { return delegations_1.QueuedUndelegation; } });
|
|
15
|
+
Object.defineProperty(exports, "AllianceValidatorInfo", { enumerable: true, get: function () { return delegations_1.AllianceValidatorInfo; } });
|
|
16
|
+
var events_1 = require("./events");
|
|
17
|
+
Object.defineProperty(exports, "DelegateAllianceEvent", { enumerable: true, get: function () { return events_1.DelegateAllianceEvent; } });
|
|
18
|
+
Object.defineProperty(exports, "UndelegateAllianceEvent", { enumerable: true, get: function () { return events_1.UndelegateAllianceEvent; } });
|
|
19
|
+
Object.defineProperty(exports, "RedelegateAllianceEvent", { enumerable: true, get: function () { return events_1.RedelegateAllianceEvent; } });
|
|
20
|
+
Object.defineProperty(exports, "ClaimAllianceRewardsEvent", { enumerable: true, get: function () { return events_1.ClaimAllianceRewardsEvent; } });
|
|
21
|
+
var genesis_1 = require("./genesis");
|
|
22
|
+
Object.defineProperty(exports, "ValidatorInfoState", { enumerable: true, get: function () { return genesis_1.ValidatorInfoState; } });
|
|
23
|
+
Object.defineProperty(exports, "RedelegationState", { enumerable: true, get: function () { return genesis_1.RedelegationState; } });
|
|
24
|
+
Object.defineProperty(exports, "UndelegationState", { enumerable: true, get: function () { return genesis_1.UndelegationState; } });
|
|
25
|
+
Object.defineProperty(exports, "RewardWeightChangeSnapshotState", { enumerable: true, get: function () { return genesis_1.RewardWeightChangeSnapshotState; } });
|
|
26
|
+
var gov_1 = require("./gov");
|
|
27
|
+
Object.defineProperty(exports, "MsgCreateAllianceProposal", { enumerable: true, get: function () { return gov_1.MsgCreateAllianceProposal; } });
|
|
28
|
+
Object.defineProperty(exports, "MsgUpdateAllianceProposal", { enumerable: true, get: function () { return gov_1.MsgUpdateAllianceProposal; } });
|
|
29
|
+
Object.defineProperty(exports, "MsgDeleteAllianceProposal", { enumerable: true, get: function () { return gov_1.MsgDeleteAllianceProposal; } });
|
|
30
|
+
var params_1 = require("./params");
|
|
31
|
+
Object.defineProperty(exports, "Params", { enumerable: true, get: function () { return params_1.Params; } });
|
|
32
|
+
Object.defineProperty(exports, "RewardHistory", { enumerable: true, get: function () { return params_1.RewardHistory; } });
|
|
33
|
+
var query_1 = require("./query");
|
|
34
|
+
Object.defineProperty(exports, "QueryParamsRequest", { enumerable: true, get: function () { return query_1.QueryParamsRequest; } });
|
|
35
|
+
Object.defineProperty(exports, "QueryParamsResponse", { enumerable: true, get: function () { return query_1.QueryParamsResponse; } });
|
|
36
|
+
Object.defineProperty(exports, "QueryAlliancesRequest", { enumerable: true, get: function () { return query_1.QueryAlliancesRequest; } });
|
|
37
|
+
Object.defineProperty(exports, "QueryAlliancesResponse", { enumerable: true, get: function () { return query_1.QueryAlliancesResponse; } });
|
|
38
|
+
Object.defineProperty(exports, "QueryAllianceRequest", { enumerable: true, get: function () { return query_1.QueryAllianceRequest; } });
|
|
39
|
+
Object.defineProperty(exports, "QueryAllianceResponse", { enumerable: true, get: function () { return query_1.QueryAllianceResponse; } });
|
|
40
|
+
Object.defineProperty(exports, "QueryIBCAllianceRequest", { enumerable: true, get: function () { return query_1.QueryIBCAllianceRequest; } });
|
|
41
|
+
Object.defineProperty(exports, "QueryAllianceValidatorRequest", { enumerable: true, get: function () { return query_1.QueryAllianceValidatorRequest; } });
|
|
42
|
+
Object.defineProperty(exports, "QueryAllAllianceValidatorsRequest", { enumerable: true, get: function () { return query_1.QueryAllAllianceValidatorsRequest; } });
|
|
43
|
+
Object.defineProperty(exports, "QueryAllAlliancesDelegationsRequest", { enumerable: true, get: function () { return query_1.QueryAllAlliancesDelegationsRequest; } });
|
|
44
|
+
Object.defineProperty(exports, "QueryAlliancesDelegationsRequest", { enumerable: true, get: function () { return query_1.QueryAlliancesDelegationsRequest; } });
|
|
45
|
+
Object.defineProperty(exports, "QueryAlliancesDelegationByValidatorRequest", { enumerable: true, get: function () { return query_1.QueryAlliancesDelegationByValidatorRequest; } });
|
|
46
|
+
Object.defineProperty(exports, "DelegationResponse", { enumerable: true, get: function () { return query_1.DelegationResponse; } });
|
|
47
|
+
Object.defineProperty(exports, "QueryAlliancesDelegationsResponse", { enumerable: true, get: function () { return query_1.QueryAlliancesDelegationsResponse; } });
|
|
48
|
+
Object.defineProperty(exports, "QueryAllianceDelegationRequest", { enumerable: true, get: function () { return query_1.QueryAllianceDelegationRequest; } });
|
|
49
|
+
Object.defineProperty(exports, "QueryIBCAllianceDelegationRequest", { enumerable: true, get: function () { return query_1.QueryIBCAllianceDelegationRequest; } });
|
|
50
|
+
Object.defineProperty(exports, "QueryAllianceDelegationResponse", { enumerable: true, get: function () { return query_1.QueryAllianceDelegationResponse; } });
|
|
51
|
+
Object.defineProperty(exports, "QueryAllianceDelegationRewardsRequest", { enumerable: true, get: function () { return query_1.QueryAllianceDelegationRewardsRequest; } });
|
|
52
|
+
Object.defineProperty(exports, "QueryIBCAllianceDelegationRewardsRequest", { enumerable: true, get: function () { return query_1.QueryIBCAllianceDelegationRewardsRequest; } });
|
|
53
|
+
Object.defineProperty(exports, "QueryAllianceDelegationRewardsResponse", { enumerable: true, get: function () { return query_1.QueryAllianceDelegationRewardsResponse; } });
|
|
54
|
+
Object.defineProperty(exports, "QueryAllianceValidatorResponse", { enumerable: true, get: function () { return query_1.QueryAllianceValidatorResponse; } });
|
|
55
|
+
Object.defineProperty(exports, "QueryAllianceValidatorsResponse", { enumerable: true, get: function () { return query_1.QueryAllianceValidatorsResponse; } });
|
|
56
|
+
var tx_1 = require("./tx");
|
|
57
|
+
Object.defineProperty(exports, "MsgDelegate", { enumerable: true, get: function () { return tx_1.MsgDelegate; } });
|
|
58
|
+
Object.defineProperty(exports, "MsgDelegateResponse", { enumerable: true, get: function () { return tx_1.MsgDelegateResponse; } });
|
|
59
|
+
Object.defineProperty(exports, "MsgUndelegate", { enumerable: true, get: function () { return tx_1.MsgUndelegate; } });
|
|
60
|
+
Object.defineProperty(exports, "MsgUndelegateResponse", { enumerable: true, get: function () { return tx_1.MsgUndelegateResponse; } });
|
|
61
|
+
Object.defineProperty(exports, "MsgRedelegate", { enumerable: true, get: function () { return tx_1.MsgRedelegate; } });
|
|
62
|
+
Object.defineProperty(exports, "MsgRedelegateResponse", { enumerable: true, get: function () { return tx_1.MsgRedelegateResponse; } });
|
|
63
|
+
Object.defineProperty(exports, "MsgClaimDelegationRewards", { enumerable: true, get: function () { return tx_1.MsgClaimDelegationRewards; } });
|
|
64
|
+
Object.defineProperty(exports, "MsgClaimDelegationRewardsResponse", { enumerable: true, get: function () { return tx_1.MsgClaimDelegationRewardsResponse; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryInternalTransfersResponse = exports.QueryInternalTransfersRequest = exports.Coin = exports.InternalTransfer = exports.CoinBurn = exports.CoinMint = exports.CoinSent = exports.CoinReceived = exports.CoinSpent = void 0;
|
|
4
|
+
var event_1 = require("./event");
|
|
5
|
+
Object.defineProperty(exports, "CoinSpent", { enumerable: true, get: function () { return event_1.CoinSpent; } });
|
|
6
|
+
Object.defineProperty(exports, "CoinReceived", { enumerable: true, get: function () { return event_1.CoinReceived; } });
|
|
7
|
+
Object.defineProperty(exports, "CoinSent", { enumerable: true, get: function () { return event_1.CoinSent; } });
|
|
8
|
+
Object.defineProperty(exports, "CoinMint", { enumerable: true, get: function () { return event_1.CoinMint; } });
|
|
9
|
+
Object.defineProperty(exports, "CoinBurn", { enumerable: true, get: function () { return event_1.CoinBurn; } });
|
|
10
|
+
var query_1 = require("./query");
|
|
11
|
+
Object.defineProperty(exports, "InternalTransfer", { enumerable: true, get: function () { return query_1.InternalTransfer; } });
|
|
12
|
+
Object.defineProperty(exports, "Coin", { enumerable: true, get: function () { return query_1.Coin; } });
|
|
13
|
+
Object.defineProperty(exports, "QueryInternalTransfersRequest", { enumerable: true, get: function () { return query_1.QueryInternalTransfersRequest; } });
|
|
14
|
+
Object.defineProperty(exports, "QueryInternalTransfersResponse", { enumerable: true, get: function () { return query_1.QueryInternalTransfersResponse; } });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { OrderBookLevel, OrderBook, StopBook, StopOrder } from "./book";
|
|
2
|
+
export { OrderBookEvent } from "./event";
|
|
3
|
+
export { StopbookV2320 } from "./legacy";
|
|
4
|
+
export { QueryImpactPriceRequest, QueryImpactPriceResponse, QueryGetBookRequest, QueryGetBookResponse, QueryAllBookRequest, QueryAllBookResponse, QueryGetStopBookRequest, QueryGetStopBookResponse, QueryAllStopBookRequest, QueryAllStopBookResponse } from "./query";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryAllStopBookResponse = exports.QueryAllStopBookRequest = exports.QueryGetStopBookResponse = exports.QueryGetStopBookRequest = exports.QueryAllBookResponse = exports.QueryAllBookRequest = exports.QueryGetBookResponse = exports.QueryGetBookRequest = exports.QueryImpactPriceResponse = exports.QueryImpactPriceRequest = exports.StopbookV2320 = exports.OrderBookEvent = exports.StopOrder = exports.StopBook = exports.OrderBook = exports.OrderBookLevel = void 0;
|
|
4
|
+
var book_1 = require("./book");
|
|
5
|
+
Object.defineProperty(exports, "OrderBookLevel", { enumerable: true, get: function () { return book_1.OrderBookLevel; } });
|
|
6
|
+
Object.defineProperty(exports, "OrderBook", { enumerable: true, get: function () { return book_1.OrderBook; } });
|
|
7
|
+
Object.defineProperty(exports, "StopBook", { enumerable: true, get: function () { return book_1.StopBook; } });
|
|
8
|
+
Object.defineProperty(exports, "StopOrder", { enumerable: true, get: function () { return book_1.StopOrder; } });
|
|
9
|
+
var event_1 = require("./event");
|
|
10
|
+
Object.defineProperty(exports, "OrderBookEvent", { enumerable: true, get: function () { return event_1.OrderBookEvent; } });
|
|
11
|
+
var legacy_1 = require("./legacy");
|
|
12
|
+
Object.defineProperty(exports, "StopbookV2320", { enumerable: true, get: function () { return legacy_1.StopbookV2320; } });
|
|
13
|
+
var query_1 = require("./query");
|
|
14
|
+
Object.defineProperty(exports, "QueryImpactPriceRequest", { enumerable: true, get: function () { return query_1.QueryImpactPriceRequest; } });
|
|
15
|
+
Object.defineProperty(exports, "QueryImpactPriceResponse", { enumerable: true, get: function () { return query_1.QueryImpactPriceResponse; } });
|
|
16
|
+
Object.defineProperty(exports, "QueryGetBookRequest", { enumerable: true, get: function () { return query_1.QueryGetBookRequest; } });
|
|
17
|
+
Object.defineProperty(exports, "QueryGetBookResponse", { enumerable: true, get: function () { return query_1.QueryGetBookResponse; } });
|
|
18
|
+
Object.defineProperty(exports, "QueryAllBookRequest", { enumerable: true, get: function () { return query_1.QueryAllBookRequest; } });
|
|
19
|
+
Object.defineProperty(exports, "QueryAllBookResponse", { enumerable: true, get: function () { return query_1.QueryAllBookResponse; } });
|
|
20
|
+
Object.defineProperty(exports, "QueryGetStopBookRequest", { enumerable: true, get: function () { return query_1.QueryGetStopBookRequest; } });
|
|
21
|
+
Object.defineProperty(exports, "QueryGetStopBookResponse", { enumerable: true, get: function () { return query_1.QueryGetStopBookResponse; } });
|
|
22
|
+
Object.defineProperty(exports, "QueryAllStopBookRequest", { enumerable: true, get: function () { return query_1.QueryAllStopBookRequest; } });
|
|
23
|
+
Object.defineProperty(exports, "QueryAllStopBookResponse", { enumerable: true, get: function () { return query_1.QueryAllStopBookResponse; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { SpotAmm, PerpsAmm, PerpsMarketAmm } from "./amm";
|
|
2
|
+
export { Candlestick } from "./candlestick";
|
|
3
|
+
export { TradeEvent, FundingEvent } from "./event";
|
|
4
|
+
export { IncomingLiquidations } from "./incoming_liquidations";
|
|
5
|
+
export { MinMaxBoundary } from "./pagination";
|
|
6
|
+
export { QueryCandlesticksRequest, QueryCandlesticksResponse, QueryTradesRequest, QueryTradesResponse, QueryTradesForPositionRequest, QueryTradesForPositionResponse } from "./query";
|
|
7
|
+
export { LiquidatorPosition, MsgInitiateLiquidation, MsgInitiateLiquidationResponse } from "./tx";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgInitiateLiquidationResponse = exports.MsgInitiateLiquidation = exports.LiquidatorPosition = exports.QueryTradesForPositionResponse = exports.QueryTradesForPositionRequest = exports.QueryTradesResponse = exports.QueryTradesRequest = exports.QueryCandlesticksResponse = exports.QueryCandlesticksRequest = exports.MinMaxBoundary = exports.IncomingLiquidations = exports.FundingEvent = exports.TradeEvent = exports.Candlestick = exports.PerpsMarketAmm = exports.PerpsAmm = exports.SpotAmm = void 0;
|
|
4
|
+
var amm_1 = require("./amm");
|
|
5
|
+
Object.defineProperty(exports, "SpotAmm", { enumerable: true, get: function () { return amm_1.SpotAmm; } });
|
|
6
|
+
Object.defineProperty(exports, "PerpsAmm", { enumerable: true, get: function () { return amm_1.PerpsAmm; } });
|
|
7
|
+
Object.defineProperty(exports, "PerpsMarketAmm", { enumerable: true, get: function () { return amm_1.PerpsMarketAmm; } });
|
|
8
|
+
var candlestick_1 = require("./candlestick");
|
|
9
|
+
Object.defineProperty(exports, "Candlestick", { enumerable: true, get: function () { return candlestick_1.Candlestick; } });
|
|
10
|
+
var event_1 = require("./event");
|
|
11
|
+
Object.defineProperty(exports, "TradeEvent", { enumerable: true, get: function () { return event_1.TradeEvent; } });
|
|
12
|
+
Object.defineProperty(exports, "FundingEvent", { enumerable: true, get: function () { return event_1.FundingEvent; } });
|
|
13
|
+
var incoming_liquidations_1 = require("./incoming_liquidations");
|
|
14
|
+
Object.defineProperty(exports, "IncomingLiquidations", { enumerable: true, get: function () { return incoming_liquidations_1.IncomingLiquidations; } });
|
|
15
|
+
var pagination_1 = require("./pagination");
|
|
16
|
+
Object.defineProperty(exports, "MinMaxBoundary", { enumerable: true, get: function () { return pagination_1.MinMaxBoundary; } });
|
|
17
|
+
var query_1 = require("./query");
|
|
18
|
+
Object.defineProperty(exports, "QueryCandlesticksRequest", { enumerable: true, get: function () { return query_1.QueryCandlesticksRequest; } });
|
|
19
|
+
Object.defineProperty(exports, "QueryCandlesticksResponse", { enumerable: true, get: function () { return query_1.QueryCandlesticksResponse; } });
|
|
20
|
+
Object.defineProperty(exports, "QueryTradesRequest", { enumerable: true, get: function () { return query_1.QueryTradesRequest; } });
|
|
21
|
+
Object.defineProperty(exports, "QueryTradesResponse", { enumerable: true, get: function () { return query_1.QueryTradesResponse; } });
|
|
22
|
+
Object.defineProperty(exports, "QueryTradesForPositionRequest", { enumerable: true, get: function () { return query_1.QueryTradesForPositionRequest; } });
|
|
23
|
+
Object.defineProperty(exports, "QueryTradesForPositionResponse", { enumerable: true, get: function () { return query_1.QueryTradesForPositionResponse; } });
|
|
24
|
+
var tx_1 = require("./tx");
|
|
25
|
+
Object.defineProperty(exports, "LiquidatorPosition", { enumerable: true, get: function () { return tx_1.LiquidatorPosition; } });
|
|
26
|
+
Object.defineProperty(exports, "MsgInitiateLiquidation", { enumerable: true, get: function () { return tx_1.MsgInitiateLiquidation; } });
|
|
27
|
+
Object.defineProperty(exports, "MsgInitiateLiquidationResponse", { enumerable: true, get: function () { return tx_1.MsgInitiateLiquidationResponse; } });
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * as Admin from "./admin/export";
|
|
2
|
+
export * as Alliance from "./alliance/export";
|
|
3
|
+
export * as Bank from "./bank/export";
|
|
4
|
+
export * as Book from "./book/export";
|
|
5
|
+
export * as Broker from "./broker/export";
|
|
6
|
+
export * as Cdp from "./cdp/export";
|
|
7
|
+
export * as Coin from "./coin/export";
|
|
8
|
+
export * as Erc20 from "./erc20/export";
|
|
9
|
+
export * as Evmbank from "./evmbank/export";
|
|
10
|
+
export * as Evmmerge from "./evmmerge/export";
|
|
11
|
+
export * as Fee from "./fee/export";
|
|
12
|
+
export * as Inflation from "./inflation/export";
|
|
13
|
+
export * as Insurance from "./insurance/export";
|
|
14
|
+
export * as Leverage from "./leverage/export";
|
|
15
|
+
export * as Liquidation from "./liquidation/export";
|
|
16
|
+
export * as Liquiditypool from "./liquiditypool/export";
|
|
17
|
+
export * as Market from "./market/export";
|
|
18
|
+
export * as Marketstats from "./marketstats/export";
|
|
19
|
+
export * as Misc from "./misc/export";
|
|
20
|
+
export * as Oracle from "./oracle/export";
|
|
21
|
+
export * as Order from "./order/export";
|
|
22
|
+
export * as Perpspool from "./perpspool/export";
|
|
23
|
+
export * as Position from "./position/export";
|
|
24
|
+
export * as Pricing from "./pricing/export";
|
|
25
|
+
export * as Profile from "./profile/export";
|
|
26
|
+
export * as Sequence from "./sequence/export";
|
|
27
|
+
export * as Subaccount from "./subaccount/export";
|