ccxt 4.5.18 → 4.5.20
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/README.md +7 -6
- package/dist/ccxt.browser.min.js +40 -16
- package/dist/cjs/_virtual/index.cjs.js +1459 -9
- package/dist/cjs/ccxt.js +8 -2
- package/dist/cjs/src/abstract/dydx.js +11 -0
- package/dist/cjs/src/base/Exchange.js +164 -10
- package/dist/cjs/src/base/ws/Client.js +3 -1
- package/dist/cjs/src/binance.js +8 -1
- package/dist/cjs/src/bingx.js +20 -0
- package/dist/cjs/src/bitget.js +43 -41
- package/dist/cjs/src/bybit.js +21 -23
- package/dist/cjs/src/deribit.js +6 -0
- package/dist/cjs/src/dydx.js +2454 -0
- package/dist/cjs/src/gate.js +4 -4
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hyperliquid.js +207 -9
- package/dist/cjs/src/kucoin.js +711 -109
- package/dist/cjs/src/mexc.js +2 -3
- package/dist/cjs/src/pro/binance.js +59 -144
- package/dist/cjs/src/pro/dydx.js +418 -0
- package/dist/cjs/src/pro/kraken.js +4 -3
- package/dist/cjs/src/pro/xt.js +218 -4
- package/dist/cjs/src/protobuf/mexc/compiled.cjs.js +1 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +56 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +56 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +48 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +343 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +717 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +60 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +45 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +380 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +72 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +211 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +195 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +49 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +57 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +56 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/helpers.js +79 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/long/index.cjs.js +9 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/onboarding.js +59 -0
- package/dist/cjs/src/static_dependencies/dydx-v4-client/registry.js +39 -0
- package/dist/cjs/src/static_dependencies/noble-hashes/pbkdf2.js +69 -0
- package/dist/cjs/src/static_dependencies/noble-hashes/ripemd160.js +108 -0
- package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +50 -1
- package/dist/cjs/src/static_dependencies/scure-base/index.js +29 -0
- package/dist/cjs/src/static_dependencies/scure-bip32/index.js +278 -0
- package/dist/cjs/src/static_dependencies/scure-bip39/index.js +97 -0
- package/dist/cjs/src/static_dependencies/scure-bip39/wordlists/english.js +2060 -0
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2 -0
- package/dist/cjs/src/toobit.js +2 -1
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/binance.d.ts +7 -0
- package/js/src/abstract/binancecoinm.d.ts +7 -0
- package/js/src/abstract/binanceus.d.ts +7 -0
- package/js/src/abstract/binanceusdm.d.ts +7 -0
- package/js/src/abstract/bitget.d.ts +1 -0
- package/js/src/abstract/dydx.d.ts +61 -0
- package/js/src/abstract/dydx.js +11 -0
- package/js/src/abstract/kucoin.d.ts +1 -1
- package/js/src/abstract/kucoinfutures.d.ts +1 -1
- package/js/src/base/Exchange.d.ts +7 -0
- package/js/src/base/Exchange.js +163 -10
- package/js/src/base/ws/Client.js +3 -1
- package/js/src/binance.js +8 -1
- package/js/src/bingx.js +20 -0
- package/js/src/bitget.d.ts +3 -3
- package/js/src/bitget.js +43 -41
- package/js/src/bybit.d.ts +3 -3
- package/js/src/bybit.js +21 -23
- package/js/src/deribit.js +6 -0
- package/js/src/dydx.d.ts +364 -0
- package/js/src/dydx.js +2453 -0
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +4 -4
- package/js/src/hibachi.js +1 -1
- package/js/src/hyperliquid.d.ts +17 -0
- package/js/src/hyperliquid.js +207 -9
- package/js/src/kucoin.d.ts +48 -1
- package/js/src/kucoin.js +711 -109
- package/js/src/mexc.js +2 -3
- package/js/src/pro/binance.d.ts +2 -2
- package/js/src/pro/binance.js +59 -144
- package/js/src/pro/dydx.d.ts +81 -0
- package/js/src/pro/dydx.js +417 -0
- package/js/src/pro/kraken.js +4 -3
- package/js/src/pro/xt.d.ts +85 -2
- package/js/src/pro/xt.js +218 -4
- package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.d.ts +90 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +163 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.d.ts +26 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.js +51 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.d.ts +48 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +85 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.d.ts +40 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +77 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.d.ts +162 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +329 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.d.ts +460 -0
- package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +698 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.d.ts +127 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +286 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.d.ts +66 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.js +109 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.d.ts +127 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +257 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.d.ts +48 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.js +93 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.d.ts +23 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.js +43 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.d.ts +92 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.js +164 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.d.ts +124 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.js +196 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.d.ts +159 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.js +324 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.d.ts +546 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +872 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.d.ts +84 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +181 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.d.ts +397 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +757 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.d.ts +120 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +246 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.d.ts +79 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +147 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.d.ts +32 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.js +59 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.d.ts +34 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.js +66 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.d.ts +62 -0
- package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +111 -0
- package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.d.ts +207 -0
- package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +50 -0
- package/js/src/static_dependencies/dydx-v4-client/helpers.d.ts +82 -0
- package/js/src/static_dependencies/dydx-v4-client/helpers.js +172 -0
- package/js/src/static_dependencies/dydx-v4-client/long/index.cjs +1473 -0
- package/js/src/static_dependencies/dydx-v4-client/long/index.d.cts +2 -0
- package/js/src/static_dependencies/dydx-v4-client/onboarding.d.ts +35 -0
- package/js/src/static_dependencies/dydx-v4-client/onboarding.js +56 -0
- package/js/src/static_dependencies/dydx-v4-client/registry.d.ts +7 -0
- package/js/src/static_dependencies/dydx-v4-client/registry.js +36 -0
- package/js/src/static_dependencies/noble-hashes/utils.d.ts +1 -0
- package/js/src/static_dependencies/noble-hashes/utils.js +4 -0
- package/js/src/static_dependencies/scure-bip32/index.d.ts +49 -0
- package/js/src/static_dependencies/scure-bip32/index.js +295 -0
- package/js/src/static_dependencies/scure-bip39/index.d.ts +54 -0
- package/js/src/static_dependencies/scure-bip39/index.js +140 -0
- package/js/src/static_dependencies/scure-bip39/wordlists/english.d.ts +1 -0
- package/js/src/static_dependencies/scure-bip39/wordlists/english.js +2054 -0
- package/js/src/toobit.js +2 -1
- package/package.json +9 -3
package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as _m0 from "protobufjs/minimal.js";
|
|
2
|
+
import { DeepPartial } from "../../helpers.js";
|
|
3
|
+
/**
|
|
4
|
+
* PerpetualPositions are an account’s positions of a `Perpetual`.
|
|
5
|
+
* Therefore they hold any information needed to trade perpetuals.
|
|
6
|
+
*/
|
|
7
|
+
export interface PerpetualPosition {
|
|
8
|
+
/** The `Id` of the `Perpetual`. */
|
|
9
|
+
perpetualId: number;
|
|
10
|
+
/** The size of the position in base quantums. */
|
|
11
|
+
quantums: Uint8Array;
|
|
12
|
+
/**
|
|
13
|
+
* The funding_index of the `Perpetual` the last time this position was
|
|
14
|
+
* settled.
|
|
15
|
+
*/
|
|
16
|
+
fundingIndex: Uint8Array;
|
|
17
|
+
/** The quote_balance of the `Perpetual`. */
|
|
18
|
+
quoteBalance: Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* PerpetualPositions are an account’s positions of a `Perpetual`.
|
|
22
|
+
* Therefore they hold any information needed to trade perpetuals.
|
|
23
|
+
*/
|
|
24
|
+
export interface PerpetualPositionSDKType {
|
|
25
|
+
perpetual_id: number;
|
|
26
|
+
quantums: Uint8Array;
|
|
27
|
+
funding_index: Uint8Array;
|
|
28
|
+
quote_balance: Uint8Array;
|
|
29
|
+
}
|
|
30
|
+
export declare const PerpetualPosition: {
|
|
31
|
+
encode(message: PerpetualPosition, writer?: _m0.Writer): _m0.Writer;
|
|
32
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): PerpetualPosition;
|
|
33
|
+
fromPartial(object: DeepPartial<PerpetualPosition>): PerpetualPosition;
|
|
34
|
+
};
|
package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
import * as _m0 from "protobufjs/minimal.js";
|
|
8
|
+
function createBasePerpetualPosition() {
|
|
9
|
+
return {
|
|
10
|
+
perpetualId: 0,
|
|
11
|
+
quantums: new Uint8Array(),
|
|
12
|
+
fundingIndex: new Uint8Array(),
|
|
13
|
+
quoteBalance: new Uint8Array()
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const PerpetualPosition = {
|
|
17
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
18
|
+
if (message.perpetualId !== 0) {
|
|
19
|
+
writer.uint32(8).uint32(message.perpetualId);
|
|
20
|
+
}
|
|
21
|
+
if (message.quantums.length !== 0) {
|
|
22
|
+
writer.uint32(18).bytes(message.quantums);
|
|
23
|
+
}
|
|
24
|
+
if (message.fundingIndex.length !== 0) {
|
|
25
|
+
writer.uint32(26).bytes(message.fundingIndex);
|
|
26
|
+
}
|
|
27
|
+
if (message.quoteBalance.length !== 0) {
|
|
28
|
+
writer.uint32(34).bytes(message.quoteBalance);
|
|
29
|
+
}
|
|
30
|
+
return writer;
|
|
31
|
+
},
|
|
32
|
+
decode(input, length) {
|
|
33
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
34
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
35
|
+
const message = createBasePerpetualPosition();
|
|
36
|
+
while (reader.pos < end) {
|
|
37
|
+
const tag = reader.uint32();
|
|
38
|
+
switch (tag >>> 3) {
|
|
39
|
+
case 1:
|
|
40
|
+
message.perpetualId = reader.uint32();
|
|
41
|
+
break;
|
|
42
|
+
case 2:
|
|
43
|
+
message.quantums = reader.bytes();
|
|
44
|
+
break;
|
|
45
|
+
case 3:
|
|
46
|
+
message.fundingIndex = reader.bytes();
|
|
47
|
+
break;
|
|
48
|
+
case 4:
|
|
49
|
+
message.quoteBalance = reader.bytes();
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
reader.skipType(tag & 7);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return message;
|
|
57
|
+
},
|
|
58
|
+
fromPartial(object) {
|
|
59
|
+
const message = createBasePerpetualPosition();
|
|
60
|
+
message.perpetualId = object.perpetualId ?? 0;
|
|
61
|
+
message.quantums = object.quantums ?? new Uint8Array();
|
|
62
|
+
message.fundingIndex = object.fundingIndex ?? new Uint8Array();
|
|
63
|
+
message.quoteBalance = object.quoteBalance ?? new Uint8Array();
|
|
64
|
+
return message;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AssetPosition, AssetPositionSDKType } from "./asset_position.js";
|
|
2
|
+
import { PerpetualPosition, PerpetualPositionSDKType } from "./perpetual_position.js";
|
|
3
|
+
import _m0 from "protobufjs/minimal.js";
|
|
4
|
+
import { DeepPartial } from "../../helpers.js";
|
|
5
|
+
/** SubaccountId defines a unique identifier for a Subaccount. */
|
|
6
|
+
export interface SubaccountId {
|
|
7
|
+
/** The address of the wallet that owns this subaccount. */
|
|
8
|
+
owner: string;
|
|
9
|
+
/**
|
|
10
|
+
* The unique number of this subaccount for the owner.
|
|
11
|
+
* Currently limited to 128*1000 subaccounts per owner.
|
|
12
|
+
*/
|
|
13
|
+
number: number;
|
|
14
|
+
}
|
|
15
|
+
/** SubaccountId defines a unique identifier for a Subaccount. */
|
|
16
|
+
export interface SubaccountIdSDKType {
|
|
17
|
+
owner: string;
|
|
18
|
+
number: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Subaccount defines a single sub-account for a given address.
|
|
22
|
+
* Subaccounts are uniquely indexed by a subaccountNumber/owner pair.
|
|
23
|
+
*/
|
|
24
|
+
export interface Subaccount {
|
|
25
|
+
/** The Id of the Subaccount */
|
|
26
|
+
id?: SubaccountId;
|
|
27
|
+
/**
|
|
28
|
+
* All `AssetPosition`s associated with this subaccount.
|
|
29
|
+
* Always sorted ascending by `asset_id`.
|
|
30
|
+
*/
|
|
31
|
+
assetPositions: AssetPosition[];
|
|
32
|
+
/**
|
|
33
|
+
* All `PerpetualPosition`s associated with this subaccount.
|
|
34
|
+
* Always sorted ascending by `perpetual_id.
|
|
35
|
+
*/
|
|
36
|
+
perpetualPositions: PerpetualPosition[];
|
|
37
|
+
/**
|
|
38
|
+
* Set by the owner. If true, then margin trades can be made in this
|
|
39
|
+
* subaccount.
|
|
40
|
+
*/
|
|
41
|
+
marginEnabled: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Subaccount defines a single sub-account for a given address.
|
|
45
|
+
* Subaccounts are uniquely indexed by a subaccountNumber/owner pair.
|
|
46
|
+
*/
|
|
47
|
+
export interface SubaccountSDKType {
|
|
48
|
+
id?: SubaccountIdSDKType;
|
|
49
|
+
asset_positions: AssetPositionSDKType[];
|
|
50
|
+
perpetual_positions: PerpetualPositionSDKType[];
|
|
51
|
+
margin_enabled: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare const SubaccountId: {
|
|
54
|
+
encode(message: SubaccountId, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): SubaccountId;
|
|
56
|
+
fromPartial(object: DeepPartial<SubaccountId>): SubaccountId;
|
|
57
|
+
};
|
|
58
|
+
export declare const Subaccount: {
|
|
59
|
+
encode(message: Subaccount, writer?: _m0.Writer): _m0.Writer;
|
|
60
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Subaccount;
|
|
61
|
+
fromPartial(object: DeepPartial<Subaccount>): Subaccount;
|
|
62
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
import { AssetPosition } from "./asset_position.js";
|
|
8
|
+
import { PerpetualPosition } from "./perpetual_position.js";
|
|
9
|
+
import _m0 from "protobufjs/minimal.js";
|
|
10
|
+
function createBaseSubaccountId() {
|
|
11
|
+
return {
|
|
12
|
+
owner: "",
|
|
13
|
+
number: 0
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const SubaccountId = {
|
|
17
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
18
|
+
if (message.owner !== "") {
|
|
19
|
+
writer.uint32(10).string(message.owner);
|
|
20
|
+
}
|
|
21
|
+
if (message.number !== 0) {
|
|
22
|
+
writer.uint32(16).uint32(message.number);
|
|
23
|
+
}
|
|
24
|
+
return writer;
|
|
25
|
+
},
|
|
26
|
+
decode(input, length) {
|
|
27
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
28
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
+
const message = createBaseSubaccountId();
|
|
30
|
+
while (reader.pos < end) {
|
|
31
|
+
const tag = reader.uint32();
|
|
32
|
+
switch (tag >>> 3) {
|
|
33
|
+
case 1:
|
|
34
|
+
message.owner = reader.string();
|
|
35
|
+
break;
|
|
36
|
+
case 2:
|
|
37
|
+
message.number = reader.uint32();
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
reader.skipType(tag & 7);
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return message;
|
|
45
|
+
},
|
|
46
|
+
fromPartial(object) {
|
|
47
|
+
const message = createBaseSubaccountId();
|
|
48
|
+
message.owner = object.owner ?? "";
|
|
49
|
+
message.number = object.number ?? 0;
|
|
50
|
+
return message;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function createBaseSubaccount() {
|
|
54
|
+
return {
|
|
55
|
+
id: undefined,
|
|
56
|
+
assetPositions: [],
|
|
57
|
+
perpetualPositions: [],
|
|
58
|
+
marginEnabled: false
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export const Subaccount = {
|
|
62
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
63
|
+
if (message.id !== undefined) {
|
|
64
|
+
SubaccountId.encode(message.id, writer.uint32(10).fork()).ldelim();
|
|
65
|
+
}
|
|
66
|
+
for (const v of message.assetPositions) {
|
|
67
|
+
AssetPosition.encode(v, writer.uint32(18).fork()).ldelim();
|
|
68
|
+
}
|
|
69
|
+
for (const v of message.perpetualPositions) {
|
|
70
|
+
PerpetualPosition.encode(v, writer.uint32(26).fork()).ldelim();
|
|
71
|
+
}
|
|
72
|
+
if (message.marginEnabled === true) {
|
|
73
|
+
writer.uint32(32).bool(message.marginEnabled);
|
|
74
|
+
}
|
|
75
|
+
return writer;
|
|
76
|
+
},
|
|
77
|
+
decode(input, length) {
|
|
78
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
79
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
80
|
+
const message = createBaseSubaccount();
|
|
81
|
+
while (reader.pos < end) {
|
|
82
|
+
const tag = reader.uint32();
|
|
83
|
+
switch (tag >>> 3) {
|
|
84
|
+
case 1:
|
|
85
|
+
message.id = SubaccountId.decode(reader, reader.uint32());
|
|
86
|
+
break;
|
|
87
|
+
case 2:
|
|
88
|
+
message.assetPositions.push(AssetPosition.decode(reader, reader.uint32()));
|
|
89
|
+
break;
|
|
90
|
+
case 3:
|
|
91
|
+
message.perpetualPositions.push(PerpetualPosition.decode(reader, reader.uint32()));
|
|
92
|
+
break;
|
|
93
|
+
case 4:
|
|
94
|
+
message.marginEnabled = reader.bool();
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
reader.skipType(tag & 7);
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return message;
|
|
102
|
+
},
|
|
103
|
+
fromPartial(object) {
|
|
104
|
+
const message = createBaseSubaccount();
|
|
105
|
+
message.id = object.id !== undefined && object.id !== null ? SubaccountId.fromPartial(object.id) : undefined;
|
|
106
|
+
message.assetPositions = object.assetPositions?.map(e => AssetPosition.fromPartial(e)) || [];
|
|
107
|
+
message.perpetualPositions = object.perpetualPositions?.map(e => PerpetualPosition.fromPartial(e)) || [];
|
|
108
|
+
message.marginEnabled = object.marginEnabled ?? false;
|
|
109
|
+
return message;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal.js";
|
|
2
|
+
import { DeepPartial } from "../../helpers.js";
|
|
3
|
+
/**
|
|
4
|
+
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
5
|
+
* URL that describes the type of the serialized message.
|
|
6
|
+
*
|
|
7
|
+
* Protobuf library provides support to pack/unpack Any values in the form
|
|
8
|
+
* of utility functions or additional generated methods of the Any type.
|
|
9
|
+
*
|
|
10
|
+
* Example 1: Pack and unpack a message in C++.
|
|
11
|
+
*
|
|
12
|
+
* Foo foo = ...;
|
|
13
|
+
* Any any;
|
|
14
|
+
* any.PackFrom(foo);
|
|
15
|
+
* ...
|
|
16
|
+
* if (any.UnpackTo(&foo)) {
|
|
17
|
+
* ...
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* Example 2: Pack and unpack a message in Java.
|
|
21
|
+
*
|
|
22
|
+
* Foo foo = ...;
|
|
23
|
+
* Any any = Any.pack(foo);
|
|
24
|
+
* ...
|
|
25
|
+
* if (any.is(Foo.class)) {
|
|
26
|
+
* foo = any.unpack(Foo.class);
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* Example 3: Pack and unpack a message in Python.
|
|
30
|
+
*
|
|
31
|
+
* foo = Foo(...)
|
|
32
|
+
* any = Any()
|
|
33
|
+
* any.Pack(foo)
|
|
34
|
+
* ...
|
|
35
|
+
* if any.Is(Foo.DESCRIPTOR):
|
|
36
|
+
* any.Unpack(foo)
|
|
37
|
+
* ...
|
|
38
|
+
*
|
|
39
|
+
* Example 4: Pack and unpack a message in Go
|
|
40
|
+
*
|
|
41
|
+
* foo := &pb.Foo{...}
|
|
42
|
+
* any, err := ptypes.MarshalAny(foo)
|
|
43
|
+
* ...
|
|
44
|
+
* foo := &pb.Foo{}
|
|
45
|
+
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
|
46
|
+
* ...
|
|
47
|
+
* }
|
|
48
|
+
*
|
|
49
|
+
* The pack methods provided by protobuf library will by default use
|
|
50
|
+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
51
|
+
* methods only use the fully qualified type name after the last '/'
|
|
52
|
+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
53
|
+
* name "y.z".
|
|
54
|
+
*
|
|
55
|
+
*
|
|
56
|
+
* JSON
|
|
57
|
+
* ====
|
|
58
|
+
* The JSON representation of an `Any` value uses the regular
|
|
59
|
+
* representation of the deserialized, embedded message, with an
|
|
60
|
+
* additional field `@type` which contains the type URL. Example:
|
|
61
|
+
*
|
|
62
|
+
* package google.profile;
|
|
63
|
+
* message Person {
|
|
64
|
+
* string first_name = 1;
|
|
65
|
+
* string last_name = 2;
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* {
|
|
69
|
+
* "@type": "type.googleapis.com/google.profile.Person",
|
|
70
|
+
* "firstName": <string>,
|
|
71
|
+
* "lastName": <string>
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* If the embedded message type is well-known and has a custom JSON
|
|
75
|
+
* representation, that representation will be embedded adding a field
|
|
76
|
+
* `value` which holds the custom JSON in addition to the `@type`
|
|
77
|
+
* field. Example (for message [google.protobuf.Duration][]):
|
|
78
|
+
*
|
|
79
|
+
* {
|
|
80
|
+
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
81
|
+
* "value": "1.212s"
|
|
82
|
+
* }
|
|
83
|
+
*/
|
|
84
|
+
export interface Any {
|
|
85
|
+
/**
|
|
86
|
+
* A URL/resource name that uniquely identifies the type of the serialized
|
|
87
|
+
* protocol buffer message. This string must contain at least
|
|
88
|
+
* one "/" character. The last segment of the URL's path must represent
|
|
89
|
+
* the fully qualified name of the type (as in
|
|
90
|
+
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
91
|
+
* (e.g., leading "." is not accepted).
|
|
92
|
+
*
|
|
93
|
+
* In practice, teams usually precompile into the binary all types that they
|
|
94
|
+
* expect it to use in the context of Any. However, for URLs which use the
|
|
95
|
+
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
96
|
+
* server that maps type URLs to message definitions as follows:
|
|
97
|
+
*
|
|
98
|
+
* * If no scheme is provided, `https` is assumed.
|
|
99
|
+
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
|
100
|
+
* value in binary format, or produce an error.
|
|
101
|
+
* * Applications are allowed to cache lookup results based on the
|
|
102
|
+
* URL, or have them precompiled into a binary to avoid any
|
|
103
|
+
* lookup. Therefore, binary compatibility needs to be preserved
|
|
104
|
+
* on changes to types. (Use versioned type names to manage
|
|
105
|
+
* breaking changes.)
|
|
106
|
+
*
|
|
107
|
+
* Note: this functionality is not currently available in the official
|
|
108
|
+
* protobuf release, and it is not used for type URLs beginning with
|
|
109
|
+
* type.googleapis.com.
|
|
110
|
+
*
|
|
111
|
+
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
112
|
+
* used with implementation specific semantics.
|
|
113
|
+
*/
|
|
114
|
+
typeUrl: string;
|
|
115
|
+
/** Must be a valid serialized protocol buffer of the above specified type. */
|
|
116
|
+
value: Uint8Array;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
120
|
+
* URL that describes the type of the serialized message.
|
|
121
|
+
*
|
|
122
|
+
* Protobuf library provides support to pack/unpack Any values in the form
|
|
123
|
+
* of utility functions or additional generated methods of the Any type.
|
|
124
|
+
*
|
|
125
|
+
* Example 1: Pack and unpack a message in C++.
|
|
126
|
+
*
|
|
127
|
+
* Foo foo = ...;
|
|
128
|
+
* Any any;
|
|
129
|
+
* any.PackFrom(foo);
|
|
130
|
+
* ...
|
|
131
|
+
* if (any.UnpackTo(&foo)) {
|
|
132
|
+
* ...
|
|
133
|
+
* }
|
|
134
|
+
*
|
|
135
|
+
* Example 2: Pack and unpack a message in Java.
|
|
136
|
+
*
|
|
137
|
+
* Foo foo = ...;
|
|
138
|
+
* Any any = Any.pack(foo);
|
|
139
|
+
* ...
|
|
140
|
+
* if (any.is(Foo.class)) {
|
|
141
|
+
* foo = any.unpack(Foo.class);
|
|
142
|
+
* }
|
|
143
|
+
*
|
|
144
|
+
* Example 3: Pack and unpack a message in Python.
|
|
145
|
+
*
|
|
146
|
+
* foo = Foo(...)
|
|
147
|
+
* any = Any()
|
|
148
|
+
* any.Pack(foo)
|
|
149
|
+
* ...
|
|
150
|
+
* if any.Is(Foo.DESCRIPTOR):
|
|
151
|
+
* any.Unpack(foo)
|
|
152
|
+
* ...
|
|
153
|
+
*
|
|
154
|
+
* Example 4: Pack and unpack a message in Go
|
|
155
|
+
*
|
|
156
|
+
* foo := &pb.Foo{...}
|
|
157
|
+
* any, err := ptypes.MarshalAny(foo)
|
|
158
|
+
* ...
|
|
159
|
+
* foo := &pb.Foo{}
|
|
160
|
+
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
|
161
|
+
* ...
|
|
162
|
+
* }
|
|
163
|
+
*
|
|
164
|
+
* The pack methods provided by protobuf library will by default use
|
|
165
|
+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
166
|
+
* methods only use the fully qualified type name after the last '/'
|
|
167
|
+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
168
|
+
* name "y.z".
|
|
169
|
+
*
|
|
170
|
+
*
|
|
171
|
+
* JSON
|
|
172
|
+
* ====
|
|
173
|
+
* The JSON representation of an `Any` value uses the regular
|
|
174
|
+
* representation of the deserialized, embedded message, with an
|
|
175
|
+
* additional field `@type` which contains the type URL. Example:
|
|
176
|
+
*
|
|
177
|
+
* package google.profile;
|
|
178
|
+
* message Person {
|
|
179
|
+
* string first_name = 1;
|
|
180
|
+
* string last_name = 2;
|
|
181
|
+
* }
|
|
182
|
+
*
|
|
183
|
+
* {
|
|
184
|
+
* "@type": "type.googleapis.com/google.profile.Person",
|
|
185
|
+
* "firstName": <string>,
|
|
186
|
+
* "lastName": <string>
|
|
187
|
+
* }
|
|
188
|
+
*
|
|
189
|
+
* If the embedded message type is well-known and has a custom JSON
|
|
190
|
+
* representation, that representation will be embedded adding a field
|
|
191
|
+
* `value` which holds the custom JSON in addition to the `@type`
|
|
192
|
+
* field. Example (for message [google.protobuf.Duration][]):
|
|
193
|
+
*
|
|
194
|
+
* {
|
|
195
|
+
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
196
|
+
* "value": "1.212s"
|
|
197
|
+
* }
|
|
198
|
+
*/
|
|
199
|
+
export interface AnySDKType {
|
|
200
|
+
type_url: string;
|
|
201
|
+
value: Uint8Array;
|
|
202
|
+
}
|
|
203
|
+
export declare const Any: {
|
|
204
|
+
encode(message: Any, writer?: _m0.Writer): _m0.Writer;
|
|
205
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Any;
|
|
206
|
+
fromPartial(object: DeepPartial<Any>): Any;
|
|
207
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
import _m0 from "protobufjs/minimal.js";
|
|
8
|
+
function createBaseAny() {
|
|
9
|
+
return {
|
|
10
|
+
typeUrl: "",
|
|
11
|
+
value: new Uint8Array()
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export const Any = {
|
|
15
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
16
|
+
if (message.typeUrl !== "") {
|
|
17
|
+
writer.uint32(10).string(message.typeUrl);
|
|
18
|
+
}
|
|
19
|
+
if (message.value.length !== 0) {
|
|
20
|
+
writer.uint32(18).bytes(message.value);
|
|
21
|
+
}
|
|
22
|
+
return writer;
|
|
23
|
+
},
|
|
24
|
+
decode(input, length) {
|
|
25
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
26
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
27
|
+
const message = createBaseAny();
|
|
28
|
+
while (reader.pos < end) {
|
|
29
|
+
const tag = reader.uint32();
|
|
30
|
+
switch (tag >>> 3) {
|
|
31
|
+
case 1:
|
|
32
|
+
message.typeUrl = reader.string();
|
|
33
|
+
break;
|
|
34
|
+
case 2:
|
|
35
|
+
message.value = reader.bytes();
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
reader.skipType(tag & 7);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return message;
|
|
43
|
+
},
|
|
44
|
+
fromPartial(object) {
|
|
45
|
+
const message = createBaseAny();
|
|
46
|
+
message.typeUrl = object.typeUrl ?? "";
|
|
47
|
+
message.value = object.value ?? new Uint8Array();
|
|
48
|
+
return message;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file and any referenced files were automatically generated by @osmonauts/telescope@0.86.0
|
|
3
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
4
|
+
* and run the transpile command or yarn proto command to regenerate this bundle.
|
|
5
|
+
*/
|
|
6
|
+
import Long from './long/index.cjs';
|
|
7
|
+
export { Long };
|
|
8
|
+
export declare function bytesFromBase64(b64: string): Uint8Array;
|
|
9
|
+
export declare function base64FromBytes(arr: Uint8Array): string;
|
|
10
|
+
export interface AminoHeight {
|
|
11
|
+
readonly revision_number?: string;
|
|
12
|
+
readonly revision_height?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function omitDefault<T extends string | number | Long>(input: T): T | undefined;
|
|
15
|
+
interface Duration {
|
|
16
|
+
/**
|
|
17
|
+
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
18
|
+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
19
|
+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
20
|
+
*/
|
|
21
|
+
seconds: Long;
|
|
22
|
+
/**
|
|
23
|
+
* Signed fractions of a second at nanosecond resolution of the span
|
|
24
|
+
* of time. Durations less than one second are represented with a 0
|
|
25
|
+
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
26
|
+
* of one second or more, a non-zero value for the `nanos` field must be
|
|
27
|
+
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
28
|
+
* to +999,999,999 inclusive.
|
|
29
|
+
*/
|
|
30
|
+
nanos: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function toDuration(duration: string): Duration;
|
|
33
|
+
export declare function fromDuration(duration: Duration): string;
|
|
34
|
+
export declare function isSet(value: any): boolean;
|
|
35
|
+
export declare function isObject(value: any): boolean;
|
|
36
|
+
export interface PageRequest {
|
|
37
|
+
key: Uint8Array;
|
|
38
|
+
offset: Long;
|
|
39
|
+
limit: Long;
|
|
40
|
+
countTotal: boolean;
|
|
41
|
+
reverse: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface PageRequestParams {
|
|
44
|
+
"pagination.key"?: string;
|
|
45
|
+
"pagination.offset"?: string;
|
|
46
|
+
"pagination.limit"?: string;
|
|
47
|
+
"pagination.count_total"?: boolean;
|
|
48
|
+
"pagination.reverse"?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface Params {
|
|
51
|
+
params: PageRequestParams;
|
|
52
|
+
}
|
|
53
|
+
export declare const setPaginationParams: (options: Params, pagination?: PageRequest) => Params;
|
|
54
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
55
|
+
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
56
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
57
|
+
} : Partial<T>;
|
|
58
|
+
declare type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
59
|
+
export declare type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
60
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
61
|
+
} & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
|
|
62
|
+
export interface Rpc {
|
|
63
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
64
|
+
}
|
|
65
|
+
interface Timestamp {
|
|
66
|
+
/**
|
|
67
|
+
* Represents seconds of UTC time since Unix epoch
|
|
68
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
69
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
70
|
+
*/
|
|
71
|
+
seconds: Long;
|
|
72
|
+
/**
|
|
73
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
74
|
+
* second values with fractions must still have non-negative nanos values
|
|
75
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
76
|
+
* inclusive.
|
|
77
|
+
*/
|
|
78
|
+
nanos: number;
|
|
79
|
+
}
|
|
80
|
+
export declare function toTimestamp(date: Date): Timestamp;
|
|
81
|
+
export declare function fromTimestamp(t: Timestamp): Date;
|
|
82
|
+
export declare function fromJsonTimestamp(o: any): Timestamp;
|