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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount.js";
|
|
2
|
+
import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin.js";
|
|
3
|
+
import { DeepPartial } from "../../helpers.js";
|
|
4
|
+
import _m0 from "protobufjs/minimal.js";
|
|
5
|
+
/** Transfer represents a single transfer between two subaccounts. */
|
|
6
|
+
export interface Transfer {
|
|
7
|
+
/** The sender subaccount ID. */
|
|
8
|
+
sender?: SubaccountId;
|
|
9
|
+
/** The recipient subaccount ID. */
|
|
10
|
+
recipient?: SubaccountId;
|
|
11
|
+
/** Id of the asset to transfer. */
|
|
12
|
+
assetId: number;
|
|
13
|
+
/** The amount of asset to transfer */
|
|
14
|
+
amount: Long;
|
|
15
|
+
}
|
|
16
|
+
/** Transfer represents a single transfer between two subaccounts. */
|
|
17
|
+
export interface TransferSDKType {
|
|
18
|
+
sender?: SubaccountIdSDKType;
|
|
19
|
+
recipient?: SubaccountIdSDKType;
|
|
20
|
+
asset_id: number;
|
|
21
|
+
amount: Long;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MsgDepositToSubaccount represents a single transfer from an `x/bank`
|
|
25
|
+
* account to an `x/subaccounts` subaccount.
|
|
26
|
+
*/
|
|
27
|
+
export interface MsgDepositToSubaccount {
|
|
28
|
+
/** The sender wallet address. */
|
|
29
|
+
sender: string;
|
|
30
|
+
/** The recipient subaccount ID. */
|
|
31
|
+
recipient?: SubaccountId;
|
|
32
|
+
/** Id of the asset to transfer. */
|
|
33
|
+
assetId: number;
|
|
34
|
+
/** The number of quantums of asset to transfer. */
|
|
35
|
+
quantums: Long;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* MsgDepositToSubaccount represents a single transfer from an `x/bank`
|
|
39
|
+
* account to an `x/subaccounts` subaccount.
|
|
40
|
+
*/
|
|
41
|
+
export interface MsgDepositToSubaccountSDKType {
|
|
42
|
+
sender: string;
|
|
43
|
+
recipient?: SubaccountIdSDKType;
|
|
44
|
+
asset_id: number;
|
|
45
|
+
quantums: Long;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* MsgWithdrawFromSubaccount represents a single transfer from an
|
|
49
|
+
* `x/subaccounts` subaccount to an `x/bank` account.
|
|
50
|
+
*/
|
|
51
|
+
export interface MsgWithdrawFromSubaccount {
|
|
52
|
+
/** The sender subaccount ID. */
|
|
53
|
+
sender?: SubaccountId;
|
|
54
|
+
/** The recipient wallet address. */
|
|
55
|
+
recipient: string;
|
|
56
|
+
/** Id of the asset to transfer. */
|
|
57
|
+
assetId: number;
|
|
58
|
+
/** The number of quantums of asset to transfer. */
|
|
59
|
+
quantums: Long;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* MsgWithdrawFromSubaccount represents a single transfer from an
|
|
63
|
+
* `x/subaccounts` subaccount to an `x/bank` account.
|
|
64
|
+
*/
|
|
65
|
+
export interface MsgWithdrawFromSubaccountSDKType {
|
|
66
|
+
sender?: SubaccountIdSDKType;
|
|
67
|
+
recipient: string;
|
|
68
|
+
asset_id: number;
|
|
69
|
+
quantums: Long;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* MsgSendFromModuleToAccount represents a single transfer from a module
|
|
73
|
+
* to an `x/bank` account (can be either a module account address or a user
|
|
74
|
+
* account address).
|
|
75
|
+
* Should only be executed by governance.
|
|
76
|
+
*/
|
|
77
|
+
export interface MsgSendFromModuleToAccount {
|
|
78
|
+
authority: string;
|
|
79
|
+
/** The sender module name. */
|
|
80
|
+
senderModuleName: string;
|
|
81
|
+
/**
|
|
82
|
+
* The recipient account address (can be either a module account address
|
|
83
|
+
* or a user account address).
|
|
84
|
+
*/
|
|
85
|
+
recipient: string;
|
|
86
|
+
/** The coin to transfer, which specifies both denom and amount. */
|
|
87
|
+
coin?: Coin;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* MsgSendFromModuleToAccount represents a single transfer from a module
|
|
91
|
+
* to an `x/bank` account (can be either a module account address or a user
|
|
92
|
+
* account address).
|
|
93
|
+
* Should only be executed by governance.
|
|
94
|
+
*/
|
|
95
|
+
export interface MsgSendFromModuleToAccountSDKType {
|
|
96
|
+
authority: string;
|
|
97
|
+
sender_module_name: string;
|
|
98
|
+
recipient: string;
|
|
99
|
+
coin?: CoinSDKType;
|
|
100
|
+
}
|
|
101
|
+
export declare const Transfer: {
|
|
102
|
+
encode(message: Transfer, writer?: _m0.Writer): _m0.Writer;
|
|
103
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Transfer;
|
|
104
|
+
fromPartial(object: DeepPartial<Transfer>): Transfer;
|
|
105
|
+
};
|
|
106
|
+
export declare const MsgDepositToSubaccount: {
|
|
107
|
+
encode(message: MsgDepositToSubaccount, writer?: _m0.Writer): _m0.Writer;
|
|
108
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositToSubaccount;
|
|
109
|
+
fromPartial(object: DeepPartial<MsgDepositToSubaccount>): MsgDepositToSubaccount;
|
|
110
|
+
};
|
|
111
|
+
export declare const MsgWithdrawFromSubaccount: {
|
|
112
|
+
encode(message: MsgWithdrawFromSubaccount, writer?: _m0.Writer): _m0.Writer;
|
|
113
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawFromSubaccount;
|
|
114
|
+
fromPartial(object: DeepPartial<MsgWithdrawFromSubaccount>): MsgWithdrawFromSubaccount;
|
|
115
|
+
};
|
|
116
|
+
export declare const MsgSendFromModuleToAccount: {
|
|
117
|
+
encode(message: MsgSendFromModuleToAccount, writer?: _m0.Writer): _m0.Writer;
|
|
118
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendFromModuleToAccount;
|
|
119
|
+
fromPartial(object: DeepPartial<MsgSendFromModuleToAccount>): MsgSendFromModuleToAccount;
|
|
120
|
+
};
|
|
@@ -0,0 +1,246 @@
|
|
|
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 { SubaccountId } from "../subaccounts/subaccount.js";
|
|
8
|
+
import { Coin } from "../../cosmos/base/v1beta1/coin.js";
|
|
9
|
+
import { Long } from "../../helpers.js";
|
|
10
|
+
import _m0 from "protobufjs/minimal.js";
|
|
11
|
+
function createBaseTransfer() {
|
|
12
|
+
return {
|
|
13
|
+
sender: undefined,
|
|
14
|
+
recipient: undefined,
|
|
15
|
+
assetId: 0,
|
|
16
|
+
amount: Long.UZERO
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export const Transfer = {
|
|
20
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
21
|
+
if (message.sender !== undefined) {
|
|
22
|
+
SubaccountId.encode(message.sender, writer.uint32(10).fork()).ldelim();
|
|
23
|
+
}
|
|
24
|
+
if (message.recipient !== undefined) {
|
|
25
|
+
SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim();
|
|
26
|
+
}
|
|
27
|
+
if (message.assetId !== 0) {
|
|
28
|
+
writer.uint32(24).uint32(message.assetId);
|
|
29
|
+
}
|
|
30
|
+
if (!message.amount.isZero()) {
|
|
31
|
+
writer.uint32(32).uint64(message.amount);
|
|
32
|
+
}
|
|
33
|
+
return writer;
|
|
34
|
+
},
|
|
35
|
+
decode(input, length) {
|
|
36
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
37
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
38
|
+
const message = createBaseTransfer();
|
|
39
|
+
while (reader.pos < end) {
|
|
40
|
+
const tag = reader.uint32();
|
|
41
|
+
switch (tag >>> 3) {
|
|
42
|
+
case 1:
|
|
43
|
+
message.sender = SubaccountId.decode(reader, reader.uint32());
|
|
44
|
+
break;
|
|
45
|
+
case 2:
|
|
46
|
+
message.recipient = SubaccountId.decode(reader, reader.uint32());
|
|
47
|
+
break;
|
|
48
|
+
case 3:
|
|
49
|
+
message.assetId = reader.uint32();
|
|
50
|
+
break;
|
|
51
|
+
case 4:
|
|
52
|
+
message.amount = reader.uint64();
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
reader.skipType(tag & 7);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return message;
|
|
60
|
+
},
|
|
61
|
+
fromPartial(object) {
|
|
62
|
+
const message = createBaseTransfer();
|
|
63
|
+
message.sender = object.sender !== undefined && object.sender !== null ? SubaccountId.fromPartial(object.sender) : undefined;
|
|
64
|
+
message.recipient = object.recipient !== undefined && object.recipient !== null ? SubaccountId.fromPartial(object.recipient) : undefined;
|
|
65
|
+
message.assetId = object.assetId ?? 0;
|
|
66
|
+
message.amount = object.amount !== undefined && object.amount !== null ? Long.fromValue(object.amount) : Long.UZERO;
|
|
67
|
+
return message;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function createBaseMsgDepositToSubaccount() {
|
|
71
|
+
return {
|
|
72
|
+
sender: "",
|
|
73
|
+
recipient: undefined,
|
|
74
|
+
assetId: 0,
|
|
75
|
+
quantums: Long.UZERO
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export const MsgDepositToSubaccount = {
|
|
79
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
80
|
+
if (message.sender !== "") {
|
|
81
|
+
writer.uint32(10).string(message.sender);
|
|
82
|
+
}
|
|
83
|
+
if (message.recipient !== undefined) {
|
|
84
|
+
SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim();
|
|
85
|
+
}
|
|
86
|
+
if (message.assetId !== 0) {
|
|
87
|
+
writer.uint32(24).uint32(message.assetId);
|
|
88
|
+
}
|
|
89
|
+
if (!message.quantums.isZero()) {
|
|
90
|
+
writer.uint32(32).uint64(message.quantums);
|
|
91
|
+
}
|
|
92
|
+
return writer;
|
|
93
|
+
},
|
|
94
|
+
decode(input, length) {
|
|
95
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
96
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
97
|
+
const message = createBaseMsgDepositToSubaccount();
|
|
98
|
+
while (reader.pos < end) {
|
|
99
|
+
const tag = reader.uint32();
|
|
100
|
+
switch (tag >>> 3) {
|
|
101
|
+
case 1:
|
|
102
|
+
message.sender = reader.string();
|
|
103
|
+
break;
|
|
104
|
+
case 2:
|
|
105
|
+
message.recipient = SubaccountId.decode(reader, reader.uint32());
|
|
106
|
+
break;
|
|
107
|
+
case 3:
|
|
108
|
+
message.assetId = reader.uint32();
|
|
109
|
+
break;
|
|
110
|
+
case 4:
|
|
111
|
+
message.quantums = reader.uint64();
|
|
112
|
+
break;
|
|
113
|
+
default:
|
|
114
|
+
reader.skipType(tag & 7);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return message;
|
|
119
|
+
},
|
|
120
|
+
fromPartial(object) {
|
|
121
|
+
const message = createBaseMsgDepositToSubaccount();
|
|
122
|
+
message.sender = object.sender ?? "";
|
|
123
|
+
message.recipient = object.recipient !== undefined && object.recipient !== null ? SubaccountId.fromPartial(object.recipient) : undefined;
|
|
124
|
+
message.assetId = object.assetId ?? 0;
|
|
125
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
126
|
+
return message;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
function createBaseMsgWithdrawFromSubaccount() {
|
|
130
|
+
return {
|
|
131
|
+
sender: undefined,
|
|
132
|
+
recipient: "",
|
|
133
|
+
assetId: 0,
|
|
134
|
+
quantums: Long.UZERO
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export const MsgWithdrawFromSubaccount = {
|
|
138
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
139
|
+
if (message.sender !== undefined) {
|
|
140
|
+
SubaccountId.encode(message.sender, writer.uint32(18).fork()).ldelim();
|
|
141
|
+
}
|
|
142
|
+
if (message.recipient !== "") {
|
|
143
|
+
writer.uint32(10).string(message.recipient);
|
|
144
|
+
}
|
|
145
|
+
if (message.assetId !== 0) {
|
|
146
|
+
writer.uint32(24).uint32(message.assetId);
|
|
147
|
+
}
|
|
148
|
+
if (!message.quantums.isZero()) {
|
|
149
|
+
writer.uint32(32).uint64(message.quantums);
|
|
150
|
+
}
|
|
151
|
+
return writer;
|
|
152
|
+
},
|
|
153
|
+
decode(input, length) {
|
|
154
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
155
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
156
|
+
const message = createBaseMsgWithdrawFromSubaccount();
|
|
157
|
+
while (reader.pos < end) {
|
|
158
|
+
const tag = reader.uint32();
|
|
159
|
+
switch (tag >>> 3) {
|
|
160
|
+
case 2:
|
|
161
|
+
message.sender = SubaccountId.decode(reader, reader.uint32());
|
|
162
|
+
break;
|
|
163
|
+
case 1:
|
|
164
|
+
message.recipient = reader.string();
|
|
165
|
+
break;
|
|
166
|
+
case 3:
|
|
167
|
+
message.assetId = reader.uint32();
|
|
168
|
+
break;
|
|
169
|
+
case 4:
|
|
170
|
+
message.quantums = reader.uint64();
|
|
171
|
+
break;
|
|
172
|
+
default:
|
|
173
|
+
reader.skipType(tag & 7);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return message;
|
|
178
|
+
},
|
|
179
|
+
fromPartial(object) {
|
|
180
|
+
const message = createBaseMsgWithdrawFromSubaccount();
|
|
181
|
+
message.sender = object.sender !== undefined && object.sender !== null ? SubaccountId.fromPartial(object.sender) : undefined;
|
|
182
|
+
message.recipient = object.recipient ?? "";
|
|
183
|
+
message.assetId = object.assetId ?? 0;
|
|
184
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
185
|
+
return message;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
function createBaseMsgSendFromModuleToAccount() {
|
|
189
|
+
return {
|
|
190
|
+
authority: "",
|
|
191
|
+
senderModuleName: "",
|
|
192
|
+
recipient: "",
|
|
193
|
+
coin: undefined
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
export const MsgSendFromModuleToAccount = {
|
|
197
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
198
|
+
if (message.authority !== "") {
|
|
199
|
+
writer.uint32(10).string(message.authority);
|
|
200
|
+
}
|
|
201
|
+
if (message.senderModuleName !== "") {
|
|
202
|
+
writer.uint32(18).string(message.senderModuleName);
|
|
203
|
+
}
|
|
204
|
+
if (message.recipient !== "") {
|
|
205
|
+
writer.uint32(26).string(message.recipient);
|
|
206
|
+
}
|
|
207
|
+
if (message.coin !== undefined) {
|
|
208
|
+
Coin.encode(message.coin, writer.uint32(34).fork()).ldelim();
|
|
209
|
+
}
|
|
210
|
+
return writer;
|
|
211
|
+
},
|
|
212
|
+
decode(input, length) {
|
|
213
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
214
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
215
|
+
const message = createBaseMsgSendFromModuleToAccount();
|
|
216
|
+
while (reader.pos < end) {
|
|
217
|
+
const tag = reader.uint32();
|
|
218
|
+
switch (tag >>> 3) {
|
|
219
|
+
case 1:
|
|
220
|
+
message.authority = reader.string();
|
|
221
|
+
break;
|
|
222
|
+
case 2:
|
|
223
|
+
message.senderModuleName = reader.string();
|
|
224
|
+
break;
|
|
225
|
+
case 3:
|
|
226
|
+
message.recipient = reader.string();
|
|
227
|
+
break;
|
|
228
|
+
case 4:
|
|
229
|
+
message.coin = Coin.decode(reader, reader.uint32());
|
|
230
|
+
break;
|
|
231
|
+
default:
|
|
232
|
+
reader.skipType(tag & 7);
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return message;
|
|
237
|
+
},
|
|
238
|
+
fromPartial(object) {
|
|
239
|
+
const message = createBaseMsgSendFromModuleToAccount();
|
|
240
|
+
message.authority = object.authority ?? "";
|
|
241
|
+
message.senderModuleName = object.senderModuleName ?? "";
|
|
242
|
+
message.recipient = object.recipient ?? "";
|
|
243
|
+
message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined;
|
|
244
|
+
return message;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Transfer, TransferSDKType } from "./transfer.js";
|
|
2
|
+
import _m0 from "protobufjs/minimal.js";
|
|
3
|
+
import { DeepPartial } from "../../helpers.js";
|
|
4
|
+
/** MsgCreateTransfer is a request type used for initiating new transfers. */
|
|
5
|
+
export interface MsgCreateTransfer {
|
|
6
|
+
/** MsgCreateTransfer is a request type used for initiating new transfers. */
|
|
7
|
+
transfer?: Transfer;
|
|
8
|
+
}
|
|
9
|
+
/** MsgCreateTransfer is a request type used for initiating new transfers. */
|
|
10
|
+
export interface MsgCreateTransferSDKType {
|
|
11
|
+
transfer?: TransferSDKType;
|
|
12
|
+
}
|
|
13
|
+
/** MsgCreateTransferResponse is a response type used for new transfers. */
|
|
14
|
+
export interface MsgCreateTransferResponse {
|
|
15
|
+
}
|
|
16
|
+
/** MsgCreateTransferResponse is a response type used for new transfers. */
|
|
17
|
+
export interface MsgCreateTransferResponseSDKType {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* MsgDepositToSubaccountResponse is a response type used for new
|
|
21
|
+
* account-to-subaccount transfers.
|
|
22
|
+
*/
|
|
23
|
+
export interface MsgDepositToSubaccountResponse {
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* MsgDepositToSubaccountResponse is a response type used for new
|
|
27
|
+
* account-to-subaccount transfers.
|
|
28
|
+
*/
|
|
29
|
+
export interface MsgDepositToSubaccountResponseSDKType {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* MsgWithdrawFromSubaccountResponse is a response type used for new
|
|
33
|
+
* subaccount-to-account transfers.
|
|
34
|
+
*/
|
|
35
|
+
export interface MsgWithdrawFromSubaccountResponse {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* MsgWithdrawFromSubaccountResponse is a response type used for new
|
|
39
|
+
* subaccount-to-account transfers.
|
|
40
|
+
*/
|
|
41
|
+
export interface MsgWithdrawFromSubaccountResponseSDKType {
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* MsgSendFromModuleToAccountResponse is a response type used for new
|
|
45
|
+
* module-to-account transfers.
|
|
46
|
+
*/
|
|
47
|
+
export interface MsgSendFromModuleToAccountResponse {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* MsgSendFromModuleToAccountResponse is a response type used for new
|
|
51
|
+
* module-to-account transfers.
|
|
52
|
+
*/
|
|
53
|
+
export interface MsgSendFromModuleToAccountResponseSDKType {
|
|
54
|
+
}
|
|
55
|
+
export declare const MsgCreateTransfer: {
|
|
56
|
+
encode(message: MsgCreateTransfer, writer?: _m0.Writer): _m0.Writer;
|
|
57
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateTransfer;
|
|
58
|
+
fromPartial(object: DeepPartial<MsgCreateTransfer>): MsgCreateTransfer;
|
|
59
|
+
};
|
|
60
|
+
export declare const MsgCreateTransferResponse: {
|
|
61
|
+
encode(_: MsgCreateTransferResponse, writer?: _m0.Writer): _m0.Writer;
|
|
62
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateTransferResponse;
|
|
63
|
+
fromPartial(_: DeepPartial<MsgCreateTransferResponse>): MsgCreateTransferResponse;
|
|
64
|
+
};
|
|
65
|
+
export declare const MsgDepositToSubaccountResponse: {
|
|
66
|
+
encode(_: MsgDepositToSubaccountResponse, writer?: _m0.Writer): _m0.Writer;
|
|
67
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositToSubaccountResponse;
|
|
68
|
+
fromPartial(_: DeepPartial<MsgDepositToSubaccountResponse>): MsgDepositToSubaccountResponse;
|
|
69
|
+
};
|
|
70
|
+
export declare const MsgWithdrawFromSubaccountResponse: {
|
|
71
|
+
encode(_: MsgWithdrawFromSubaccountResponse, writer?: _m0.Writer): _m0.Writer;
|
|
72
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawFromSubaccountResponse;
|
|
73
|
+
fromPartial(_: DeepPartial<MsgWithdrawFromSubaccountResponse>): MsgWithdrawFromSubaccountResponse;
|
|
74
|
+
};
|
|
75
|
+
export declare const MsgSendFromModuleToAccountResponse: {
|
|
76
|
+
encode(_: MsgSendFromModuleToAccountResponse, writer?: _m0.Writer): _m0.Writer;
|
|
77
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendFromModuleToAccountResponse;
|
|
78
|
+
fromPartial(_: DeepPartial<MsgSendFromModuleToAccountResponse>): MsgSendFromModuleToAccountResponse;
|
|
79
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
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 { Transfer } from "./transfer.js";
|
|
8
|
+
import _m0 from "protobufjs/minimal.js";
|
|
9
|
+
function createBaseMsgCreateTransfer() {
|
|
10
|
+
return {
|
|
11
|
+
transfer: undefined
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export const MsgCreateTransfer = {
|
|
15
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
16
|
+
if (message.transfer !== undefined) {
|
|
17
|
+
Transfer.encode(message.transfer, writer.uint32(10).fork()).ldelim();
|
|
18
|
+
}
|
|
19
|
+
return writer;
|
|
20
|
+
},
|
|
21
|
+
decode(input, length) {
|
|
22
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
23
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
24
|
+
const message = createBaseMsgCreateTransfer();
|
|
25
|
+
while (reader.pos < end) {
|
|
26
|
+
const tag = reader.uint32();
|
|
27
|
+
switch (tag >>> 3) {
|
|
28
|
+
case 1:
|
|
29
|
+
message.transfer = Transfer.decode(reader, reader.uint32());
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
reader.skipType(tag & 7);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return message;
|
|
37
|
+
},
|
|
38
|
+
fromPartial(object) {
|
|
39
|
+
const message = createBaseMsgCreateTransfer();
|
|
40
|
+
message.transfer = object.transfer !== undefined && object.transfer !== null ? Transfer.fromPartial(object.transfer) : undefined;
|
|
41
|
+
return message;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
function createBaseMsgCreateTransferResponse() {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
export const MsgCreateTransferResponse = {
|
|
48
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
49
|
+
return writer;
|
|
50
|
+
},
|
|
51
|
+
decode(input, length) {
|
|
52
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
53
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
54
|
+
const message = createBaseMsgCreateTransferResponse();
|
|
55
|
+
while (reader.pos < end) {
|
|
56
|
+
const tag = reader.uint32();
|
|
57
|
+
switch (tag >>> 3) {
|
|
58
|
+
default:
|
|
59
|
+
reader.skipType(tag & 7);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
fromPartial(_) {
|
|
66
|
+
const message = createBaseMsgCreateTransferResponse();
|
|
67
|
+
return message;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function createBaseMsgDepositToSubaccountResponse() {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
export const MsgDepositToSubaccountResponse = {
|
|
74
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
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 = createBaseMsgDepositToSubaccountResponse();
|
|
81
|
+
while (reader.pos < end) {
|
|
82
|
+
const tag = reader.uint32();
|
|
83
|
+
switch (tag >>> 3) {
|
|
84
|
+
default:
|
|
85
|
+
reader.skipType(tag & 7);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return message;
|
|
90
|
+
},
|
|
91
|
+
fromPartial(_) {
|
|
92
|
+
const message = createBaseMsgDepositToSubaccountResponse();
|
|
93
|
+
return message;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
function createBaseMsgWithdrawFromSubaccountResponse() {
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
export const MsgWithdrawFromSubaccountResponse = {
|
|
100
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
101
|
+
return writer;
|
|
102
|
+
},
|
|
103
|
+
decode(input, length) {
|
|
104
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
105
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
106
|
+
const message = createBaseMsgWithdrawFromSubaccountResponse();
|
|
107
|
+
while (reader.pos < end) {
|
|
108
|
+
const tag = reader.uint32();
|
|
109
|
+
switch (tag >>> 3) {
|
|
110
|
+
default:
|
|
111
|
+
reader.skipType(tag & 7);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return message;
|
|
116
|
+
},
|
|
117
|
+
fromPartial(_) {
|
|
118
|
+
const message = createBaseMsgWithdrawFromSubaccountResponse();
|
|
119
|
+
return message;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
function createBaseMsgSendFromModuleToAccountResponse() {
|
|
123
|
+
return {};
|
|
124
|
+
}
|
|
125
|
+
export const MsgSendFromModuleToAccountResponse = {
|
|
126
|
+
encode(_, writer = _m0.Writer.create()) {
|
|
127
|
+
return writer;
|
|
128
|
+
},
|
|
129
|
+
decode(input, length) {
|
|
130
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
131
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
132
|
+
const message = createBaseMsgSendFromModuleToAccountResponse();
|
|
133
|
+
while (reader.pos < end) {
|
|
134
|
+
const tag = reader.uint32();
|
|
135
|
+
switch (tag >>> 3) {
|
|
136
|
+
default:
|
|
137
|
+
reader.skipType(tag & 7);
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return message;
|
|
142
|
+
},
|
|
143
|
+
fromPartial(_) {
|
|
144
|
+
const message = createBaseMsgSendFromModuleToAccountResponse();
|
|
145
|
+
return message;
|
|
146
|
+
}
|
|
147
|
+
};
|
package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DeepPartial } from "../../helpers.js";
|
|
2
|
+
import * as _m0 from "protobufjs/minimal.js";
|
|
3
|
+
/**
|
|
4
|
+
* AssetPositions define an account’s positions of an `Asset`.
|
|
5
|
+
* Therefore they hold any information needed to trade on Spot and Margin.
|
|
6
|
+
*/
|
|
7
|
+
export interface AssetPosition {
|
|
8
|
+
/** The `Id` of the `Asset`. */
|
|
9
|
+
assetId: number;
|
|
10
|
+
/** The absolute size of the position in base quantums. */
|
|
11
|
+
quantums: Uint8Array;
|
|
12
|
+
/**
|
|
13
|
+
* The `Index` (either `LongIndex` or `ShortIndex`) of the `Asset` the last
|
|
14
|
+
* time this position was settled
|
|
15
|
+
* TODO(DEC-582): pending margin trading being added.
|
|
16
|
+
*/
|
|
17
|
+
index: Long;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* AssetPositions define an account’s positions of an `Asset`.
|
|
21
|
+
* Therefore they hold any information needed to trade on Spot and Margin.
|
|
22
|
+
*/
|
|
23
|
+
export interface AssetPositionSDKType {
|
|
24
|
+
asset_id: number;
|
|
25
|
+
quantums: Uint8Array;
|
|
26
|
+
index: Long;
|
|
27
|
+
}
|
|
28
|
+
export declare const AssetPosition: {
|
|
29
|
+
encode(message: AssetPosition, writer?: _m0.Writer): _m0.Writer;
|
|
30
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AssetPosition;
|
|
31
|
+
fromPartial(object: DeepPartial<AssetPosition>): AssetPosition;
|
|
32
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { Long } from "../../helpers.js";
|
|
8
|
+
import * as _m0 from "protobufjs/minimal.js";
|
|
9
|
+
function createBaseAssetPosition() {
|
|
10
|
+
return {
|
|
11
|
+
assetId: 0,
|
|
12
|
+
quantums: new Uint8Array(),
|
|
13
|
+
index: Long.UZERO
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const AssetPosition = {
|
|
17
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
18
|
+
if (message.assetId !== 0) {
|
|
19
|
+
writer.uint32(8).uint32(message.assetId);
|
|
20
|
+
}
|
|
21
|
+
if (message.quantums.length !== 0) {
|
|
22
|
+
writer.uint32(18).bytes(message.quantums);
|
|
23
|
+
}
|
|
24
|
+
if (!message.index.isZero()) {
|
|
25
|
+
writer.uint32(24).uint64(message.index);
|
|
26
|
+
}
|
|
27
|
+
return writer;
|
|
28
|
+
},
|
|
29
|
+
decode(input, length) {
|
|
30
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
31
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
32
|
+
const message = createBaseAssetPosition();
|
|
33
|
+
while (reader.pos < end) {
|
|
34
|
+
const tag = reader.uint32();
|
|
35
|
+
switch (tag >>> 3) {
|
|
36
|
+
case 1:
|
|
37
|
+
message.assetId = reader.uint32();
|
|
38
|
+
break;
|
|
39
|
+
case 2:
|
|
40
|
+
message.quantums = reader.bytes();
|
|
41
|
+
break;
|
|
42
|
+
case 3:
|
|
43
|
+
message.index = reader.uint64();
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
reader.skipType(tag & 7);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return message;
|
|
51
|
+
},
|
|
52
|
+
fromPartial(object) {
|
|
53
|
+
const message = createBaseAssetPosition();
|
|
54
|
+
message.assetId = object.assetId ?? 0;
|
|
55
|
+
message.quantums = object.quantums ?? new Uint8Array();
|
|
56
|
+
message.index = object.index !== undefined && object.index !== null ? Long.fromValue(object.index) : Long.UZERO;
|
|
57
|
+
return message;
|
|
58
|
+
}
|
|
59
|
+
};
|