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.
Files changed (152) hide show
  1. package/README.md +7 -6
  2. package/dist/ccxt.browser.min.js +40 -16
  3. package/dist/cjs/_virtual/index.cjs.js +1459 -9
  4. package/dist/cjs/ccxt.js +8 -2
  5. package/dist/cjs/src/abstract/dydx.js +11 -0
  6. package/dist/cjs/src/base/Exchange.js +164 -10
  7. package/dist/cjs/src/base/ws/Client.js +3 -1
  8. package/dist/cjs/src/binance.js +8 -1
  9. package/dist/cjs/src/bingx.js +20 -0
  10. package/dist/cjs/src/bitget.js +43 -41
  11. package/dist/cjs/src/bybit.js +21 -23
  12. package/dist/cjs/src/deribit.js +6 -0
  13. package/dist/cjs/src/dydx.js +2454 -0
  14. package/dist/cjs/src/gate.js +4 -4
  15. package/dist/cjs/src/hibachi.js +1 -1
  16. package/dist/cjs/src/hyperliquid.js +207 -9
  17. package/dist/cjs/src/kucoin.js +711 -109
  18. package/dist/cjs/src/mexc.js +2 -3
  19. package/dist/cjs/src/pro/binance.js +59 -144
  20. package/dist/cjs/src/pro/dydx.js +418 -0
  21. package/dist/cjs/src/pro/kraken.js +4 -3
  22. package/dist/cjs/src/pro/xt.js +218 -4
  23. package/dist/cjs/src/protobuf/mexc/compiled.cjs.js +1 -0
  24. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +56 -0
  25. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +56 -0
  26. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +48 -0
  27. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +343 -0
  28. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +717 -0
  29. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +60 -0
  30. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +45 -0
  31. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +380 -0
  32. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +72 -0
  33. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +211 -0
  34. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +195 -0
  35. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +49 -0
  36. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +57 -0
  37. package/dist/cjs/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +56 -0
  38. package/dist/cjs/src/static_dependencies/dydx-v4-client/helpers.js +79 -0
  39. package/dist/cjs/src/static_dependencies/dydx-v4-client/long/index.cjs.js +9 -0
  40. package/dist/cjs/src/static_dependencies/dydx-v4-client/onboarding.js +59 -0
  41. package/dist/cjs/src/static_dependencies/dydx-v4-client/registry.js +39 -0
  42. package/dist/cjs/src/static_dependencies/noble-hashes/pbkdf2.js +69 -0
  43. package/dist/cjs/src/static_dependencies/noble-hashes/ripemd160.js +108 -0
  44. package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +50 -1
  45. package/dist/cjs/src/static_dependencies/scure-base/index.js +29 -0
  46. package/dist/cjs/src/static_dependencies/scure-bip32/index.js +278 -0
  47. package/dist/cjs/src/static_dependencies/scure-bip39/index.js +97 -0
  48. package/dist/cjs/src/static_dependencies/scure-bip39/wordlists/english.js +2060 -0
  49. package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2 -0
  50. package/dist/cjs/src/toobit.js +2 -1
  51. package/js/ccxt.d.ts +8 -2
  52. package/js/ccxt.js +6 -2
  53. package/js/src/abstract/binance.d.ts +7 -0
  54. package/js/src/abstract/binancecoinm.d.ts +7 -0
  55. package/js/src/abstract/binanceus.d.ts +7 -0
  56. package/js/src/abstract/binanceusdm.d.ts +7 -0
  57. package/js/src/abstract/bitget.d.ts +1 -0
  58. package/js/src/abstract/dydx.d.ts +61 -0
  59. package/js/src/abstract/dydx.js +11 -0
  60. package/js/src/abstract/kucoin.d.ts +1 -1
  61. package/js/src/abstract/kucoinfutures.d.ts +1 -1
  62. package/js/src/base/Exchange.d.ts +7 -0
  63. package/js/src/base/Exchange.js +163 -10
  64. package/js/src/base/ws/Client.js +3 -1
  65. package/js/src/binance.js +8 -1
  66. package/js/src/bingx.js +20 -0
  67. package/js/src/bitget.d.ts +3 -3
  68. package/js/src/bitget.js +43 -41
  69. package/js/src/bybit.d.ts +3 -3
  70. package/js/src/bybit.js +21 -23
  71. package/js/src/deribit.js +6 -0
  72. package/js/src/dydx.d.ts +364 -0
  73. package/js/src/dydx.js +2453 -0
  74. package/js/src/gate.d.ts +2 -2
  75. package/js/src/gate.js +4 -4
  76. package/js/src/hibachi.js +1 -1
  77. package/js/src/hyperliquid.d.ts +17 -0
  78. package/js/src/hyperliquid.js +207 -9
  79. package/js/src/kucoin.d.ts +48 -1
  80. package/js/src/kucoin.js +711 -109
  81. package/js/src/mexc.js +2 -3
  82. package/js/src/pro/binance.d.ts +2 -2
  83. package/js/src/pro/binance.js +59 -144
  84. package/js/src/pro/dydx.d.ts +81 -0
  85. package/js/src/pro/dydx.js +417 -0
  86. package/js/src/pro/kraken.js +4 -3
  87. package/js/src/pro/xt.d.ts +85 -2
  88. package/js/src/pro/xt.js +218 -4
  89. package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.d.ts +90 -0
  90. package/js/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +163 -0
  91. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.d.ts +26 -0
  92. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/keys.js +51 -0
  93. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.d.ts +48 -0
  94. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +85 -0
  95. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.d.ts +40 -0
  96. package/js/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +77 -0
  97. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.d.ts +162 -0
  98. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +329 -0
  99. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.d.ts +460 -0
  100. package/js/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +698 -0
  101. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.d.ts +127 -0
  102. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +286 -0
  103. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.d.ts +66 -0
  104. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/block_rate_limit_config.js +109 -0
  105. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.d.ts +127 -0
  106. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +257 -0
  107. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.d.ts +48 -0
  108. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/equity_tier_limit_config.js +93 -0
  109. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.d.ts +23 -0
  110. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/finalize_block.js +43 -0
  111. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.d.ts +92 -0
  112. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations.js +164 -0
  113. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.d.ts +124 -0
  114. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/liquidations_config.js +196 -0
  115. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.d.ts +159 -0
  116. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/matches.js +324 -0
  117. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.d.ts +546 -0
  118. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +872 -0
  119. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.d.ts +84 -0
  120. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +181 -0
  121. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.d.ts +397 -0
  122. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +757 -0
  123. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.d.ts +120 -0
  124. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +246 -0
  125. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.d.ts +79 -0
  126. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +147 -0
  127. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.d.ts +32 -0
  128. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/asset_position.js +59 -0
  129. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.d.ts +34 -0
  130. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/perpetual_position.js +66 -0
  131. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.d.ts +62 -0
  132. package/js/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +111 -0
  133. package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.d.ts +207 -0
  134. package/js/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +50 -0
  135. package/js/src/static_dependencies/dydx-v4-client/helpers.d.ts +82 -0
  136. package/js/src/static_dependencies/dydx-v4-client/helpers.js +172 -0
  137. package/js/src/static_dependencies/dydx-v4-client/long/index.cjs +1473 -0
  138. package/js/src/static_dependencies/dydx-v4-client/long/index.d.cts +2 -0
  139. package/js/src/static_dependencies/dydx-v4-client/onboarding.d.ts +35 -0
  140. package/js/src/static_dependencies/dydx-v4-client/onboarding.js +56 -0
  141. package/js/src/static_dependencies/dydx-v4-client/registry.d.ts +7 -0
  142. package/js/src/static_dependencies/dydx-v4-client/registry.js +36 -0
  143. package/js/src/static_dependencies/noble-hashes/utils.d.ts +1 -0
  144. package/js/src/static_dependencies/noble-hashes/utils.js +4 -0
  145. package/js/src/static_dependencies/scure-bip32/index.d.ts +49 -0
  146. package/js/src/static_dependencies/scure-bip32/index.js +295 -0
  147. package/js/src/static_dependencies/scure-bip39/index.d.ts +54 -0
  148. package/js/src/static_dependencies/scure-bip39/index.js +140 -0
  149. package/js/src/static_dependencies/scure-bip39/wordlists/english.d.ts +1 -0
  150. package/js/src/static_dependencies/scure-bip39/wordlists/english.js +2054 -0
  151. package/js/src/toobit.js +2 -1
  152. package/package.json +9 -3
@@ -0,0 +1,85 @@
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 createBaseMultiSignature() {
9
+ return {
10
+ signatures: []
11
+ };
12
+ }
13
+ export const MultiSignature = {
14
+ encode(message, writer = _m0.Writer.create()) {
15
+ for (const v of message.signatures) {
16
+ writer.uint32(10).bytes(v);
17
+ }
18
+ return writer;
19
+ },
20
+ decode(input, length) {
21
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
22
+ let end = length === undefined ? reader.len : reader.pos + length;
23
+ const message = createBaseMultiSignature();
24
+ while (reader.pos < end) {
25
+ const tag = reader.uint32();
26
+ switch (tag >>> 3) {
27
+ case 1:
28
+ message.signatures.push(reader.bytes());
29
+ break;
30
+ default:
31
+ reader.skipType(tag & 7);
32
+ break;
33
+ }
34
+ }
35
+ return message;
36
+ },
37
+ fromPartial(object) {
38
+ const message = createBaseMultiSignature();
39
+ message.signatures = object.signatures?.map(e => e) || [];
40
+ return message;
41
+ }
42
+ };
43
+ function createBaseCompactBitArray() {
44
+ return {
45
+ extraBitsStored: 0,
46
+ elems: new Uint8Array()
47
+ };
48
+ }
49
+ export const CompactBitArray = {
50
+ encode(message, writer = _m0.Writer.create()) {
51
+ if (message.extraBitsStored !== 0) {
52
+ writer.uint32(8).uint32(message.extraBitsStored);
53
+ }
54
+ if (message.elems.length !== 0) {
55
+ writer.uint32(18).bytes(message.elems);
56
+ }
57
+ return writer;
58
+ },
59
+ decode(input, length) {
60
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
61
+ let end = length === undefined ? reader.len : reader.pos + length;
62
+ const message = createBaseCompactBitArray();
63
+ while (reader.pos < end) {
64
+ const tag = reader.uint32();
65
+ switch (tag >>> 3) {
66
+ case 1:
67
+ message.extraBitsStored = reader.uint32();
68
+ break;
69
+ case 2:
70
+ message.elems = reader.bytes();
71
+ break;
72
+ default:
73
+ reader.skipType(tag & 7);
74
+ break;
75
+ }
76
+ }
77
+ return message;
78
+ },
79
+ fromPartial(object) {
80
+ const message = createBaseCompactBitArray();
81
+ message.extraBitsStored = object.extraBitsStored ?? 0;
82
+ message.elems = object.elems ?? new Uint8Array();
83
+ return message;
84
+ }
85
+ };
@@ -0,0 +1,40 @@
1
+ import _m0 from "protobufjs/minimal.js";
2
+ import { DeepPartial } from "../../../helpers.js";
3
+ /**
4
+ * PubKey defines a secp256k1 public key
5
+ * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
6
+ * if the y-coordinate is the lexicographically largest of the two associated with
7
+ * the x-coordinate. Otherwise the first byte is a 0x03.
8
+ * This prefix is followed with the x-coordinate.
9
+ */
10
+ export interface PubKey {
11
+ key: Uint8Array;
12
+ }
13
+ /**
14
+ * PubKey defines a secp256k1 public key
15
+ * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte
16
+ * if the y-coordinate is the lexicographically largest of the two associated with
17
+ * the x-coordinate. Otherwise the first byte is a 0x03.
18
+ * This prefix is followed with the x-coordinate.
19
+ */
20
+ export interface PubKeySDKType {
21
+ key: Uint8Array;
22
+ }
23
+ /** PrivKey defines a secp256k1 private key. */
24
+ export interface PrivKey {
25
+ key: Uint8Array;
26
+ }
27
+ /** PrivKey defines a secp256k1 private key. */
28
+ export interface PrivKeySDKType {
29
+ key: Uint8Array;
30
+ }
31
+ export declare const PubKey: {
32
+ encode(message: PubKey, writer?: _m0.Writer): _m0.Writer;
33
+ decode(input: _m0.Reader | Uint8Array, length?: number): PubKey;
34
+ fromPartial(object: DeepPartial<PubKey>): PubKey;
35
+ };
36
+ export declare const PrivKey: {
37
+ encode(message: PrivKey, writer?: _m0.Writer): _m0.Writer;
38
+ decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey;
39
+ fromPartial(object: DeepPartial<PrivKey>): PrivKey;
40
+ };
@@ -0,0 +1,77 @@
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 createBasePubKey() {
9
+ return {
10
+ key: new Uint8Array()
11
+ };
12
+ }
13
+ export const PubKey = {
14
+ encode(message, writer = _m0.Writer.create()) {
15
+ if (message.key.length !== 0) {
16
+ writer.uint32(10).bytes(message.key);
17
+ }
18
+ return writer;
19
+ },
20
+ decode(input, length) {
21
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
22
+ let end = length === undefined ? reader.len : reader.pos + length;
23
+ const message = createBasePubKey();
24
+ while (reader.pos < end) {
25
+ const tag = reader.uint32();
26
+ switch (tag >>> 3) {
27
+ case 1:
28
+ message.key = reader.bytes();
29
+ break;
30
+ default:
31
+ reader.skipType(tag & 7);
32
+ break;
33
+ }
34
+ }
35
+ return message;
36
+ },
37
+ fromPartial(object) {
38
+ const message = createBasePubKey();
39
+ message.key = object.key ?? new Uint8Array();
40
+ return message;
41
+ }
42
+ };
43
+ function createBasePrivKey() {
44
+ return {
45
+ key: new Uint8Array()
46
+ };
47
+ }
48
+ export const PrivKey = {
49
+ encode(message, writer = _m0.Writer.create()) {
50
+ if (message.key.length !== 0) {
51
+ writer.uint32(10).bytes(message.key);
52
+ }
53
+ return writer;
54
+ },
55
+ decode(input, length) {
56
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
57
+ let end = length === undefined ? reader.len : reader.pos + length;
58
+ const message = createBasePrivKey();
59
+ while (reader.pos < end) {
60
+ const tag = reader.uint32();
61
+ switch (tag >>> 3) {
62
+ case 1:
63
+ message.key = reader.bytes();
64
+ break;
65
+ default:
66
+ reader.skipType(tag & 7);
67
+ break;
68
+ }
69
+ }
70
+ return message;
71
+ },
72
+ fromPartial(object) {
73
+ const message = createBasePrivKey();
74
+ message.key = object.key ?? new Uint8Array();
75
+ return message;
76
+ }
77
+ };
@@ -0,0 +1,162 @@
1
+ import { CompactBitArray, CompactBitArraySDKType } from "../../../crypto/multisig/v1beta1/multisig.js";
2
+ import { Any, AnySDKType } from "../../../../google/protobuf/any.js";
3
+ import _m0 from "protobufjs/minimal.js";
4
+ import { DeepPartial } from "../../../../helpers.js";
5
+ /**
6
+ * SignMode represents a signing mode with its own security guarantees.
7
+ *
8
+ * This enum should be considered a registry of all known sign modes
9
+ * in the Cosmos ecosystem. Apps are not expected to support all known
10
+ * sign modes. Apps that would like to support custom sign modes are
11
+ * encouraged to open a small PR against this file to add a new case
12
+ * to this SignMode enum describing their sign mode so that different
13
+ * apps have a consistent version of this enum.
14
+ */
15
+ export declare enum SignMode {
16
+ /**
17
+ * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
18
+ * rejected.
19
+ */
20
+ SIGN_MODE_UNSPECIFIED = 0,
21
+ /**
22
+ * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
23
+ * verified with raw bytes from Tx.
24
+ */
25
+ SIGN_MODE_DIRECT = 1,
26
+ /**
27
+ * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
28
+ * human-readable textual representation on top of the binary representation
29
+ * from SIGN_MODE_DIRECT.
30
+ *
31
+ * Since: cosmos-sdk 0.50
32
+ */
33
+ SIGN_MODE_TEXTUAL = 2,
34
+ /**
35
+ * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
36
+ * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
37
+ * require signers signing over other signers' `signer_info`.
38
+ *
39
+ * Since: cosmos-sdk 0.46
40
+ */
41
+ SIGN_MODE_DIRECT_AUX = 3,
42
+ /**
43
+ * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
44
+ * Amino JSON and will be removed in the future.
45
+ */
46
+ SIGN_MODE_LEGACY_AMINO_JSON = 127,
47
+ /**
48
+ * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
49
+ * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191
50
+ *
51
+ * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
52
+ * but is not implemented on the SDK by default. To enable EIP-191, you need
53
+ * to pass a custom `TxConfig` that has an implementation of
54
+ * `SignModeHandler` for EIP-191. The SDK may decide to fully support
55
+ * EIP-191 in the future.
56
+ *
57
+ * Since: cosmos-sdk 0.45.2
58
+ */
59
+ SIGN_MODE_EIP_191 = 191,
60
+ UNRECOGNIZED = -1
61
+ }
62
+ export declare const SignModeSDKType: typeof SignMode;
63
+ export declare function signModeFromJSON(object: any): SignMode;
64
+ export declare function signModeToJSON(object: SignMode): string;
65
+ /** SignatureDescriptors wraps multiple SignatureDescriptor's. */
66
+ export interface SignatureDescriptors {
67
+ /** signatures are the signature descriptors */
68
+ signatures: SignatureDescriptor[];
69
+ }
70
+ /** SignatureDescriptors wraps multiple SignatureDescriptor's. */
71
+ export interface SignatureDescriptorsSDKType {
72
+ signatures: SignatureDescriptorSDKType[];
73
+ }
74
+ /**
75
+ * SignatureDescriptor is a convenience type which represents the full data for
76
+ * a signature including the public key of the signer, signing modes and the
77
+ * signature itself. It is primarily used for coordinating signatures between
78
+ * clients.
79
+ */
80
+ export interface SignatureDescriptor {
81
+ /** public_key is the public key of the signer */
82
+ publicKey?: Any;
83
+ data?: SignatureDescriptor_Data;
84
+ /**
85
+ * sequence is the sequence of the account, which describes the
86
+ * number of committed transactions signed by a given address. It is used to prevent
87
+ * replay attacks.
88
+ */
89
+ sequence: Long;
90
+ }
91
+ /**
92
+ * SignatureDescriptor is a convenience type which represents the full data for
93
+ * a signature including the public key of the signer, signing modes and the
94
+ * signature itself. It is primarily used for coordinating signatures between
95
+ * clients.
96
+ */
97
+ export interface SignatureDescriptorSDKType {
98
+ public_key?: AnySDKType;
99
+ data?: SignatureDescriptor_DataSDKType;
100
+ sequence: Long;
101
+ }
102
+ /** Data represents signature data */
103
+ export interface SignatureDescriptor_Data {
104
+ /** single represents a single signer */
105
+ single?: SignatureDescriptor_Data_Single;
106
+ /** multi represents a multisig signer */
107
+ multi?: SignatureDescriptor_Data_Multi;
108
+ }
109
+ /** Data represents signature data */
110
+ export interface SignatureDescriptor_DataSDKType {
111
+ single?: SignatureDescriptor_Data_SingleSDKType;
112
+ multi?: SignatureDescriptor_Data_MultiSDKType;
113
+ }
114
+ /** Single is the signature data for a single signer */
115
+ export interface SignatureDescriptor_Data_Single {
116
+ /** mode is the signing mode of the single signer */
117
+ mode: SignMode;
118
+ /** signature is the raw signature bytes */
119
+ signature: Uint8Array;
120
+ }
121
+ /** Single is the signature data for a single signer */
122
+ export interface SignatureDescriptor_Data_SingleSDKType {
123
+ mode: SignMode;
124
+ signature: Uint8Array;
125
+ }
126
+ /** Multi is the signature data for a multisig public key */
127
+ export interface SignatureDescriptor_Data_Multi {
128
+ /** bitarray specifies which keys within the multisig are signing */
129
+ bitarray?: CompactBitArray;
130
+ /** signatures is the signatures of the multi-signature */
131
+ signatures: SignatureDescriptor_Data[];
132
+ }
133
+ /** Multi is the signature data for a multisig public key */
134
+ export interface SignatureDescriptor_Data_MultiSDKType {
135
+ bitarray?: CompactBitArraySDKType;
136
+ signatures: SignatureDescriptor_DataSDKType[];
137
+ }
138
+ export declare const SignatureDescriptors: {
139
+ encode(message: SignatureDescriptors, writer?: _m0.Writer): _m0.Writer;
140
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors;
141
+ fromPartial(object: DeepPartial<SignatureDescriptors>): SignatureDescriptors;
142
+ };
143
+ export declare const SignatureDescriptor: {
144
+ encode(message: SignatureDescriptor, writer?: _m0.Writer): _m0.Writer;
145
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor;
146
+ fromPartial(object: DeepPartial<SignatureDescriptor>): SignatureDescriptor;
147
+ };
148
+ export declare const SignatureDescriptor_Data: {
149
+ encode(message: SignatureDescriptor_Data, writer?: _m0.Writer): _m0.Writer;
150
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data;
151
+ fromPartial(object: DeepPartial<SignatureDescriptor_Data>): SignatureDescriptor_Data;
152
+ };
153
+ export declare const SignatureDescriptor_Data_Single: {
154
+ encode(message: SignatureDescriptor_Data_Single, writer?: _m0.Writer): _m0.Writer;
155
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single;
156
+ fromPartial(object: DeepPartial<SignatureDescriptor_Data_Single>): SignatureDescriptor_Data_Single;
157
+ };
158
+ export declare const SignatureDescriptor_Data_Multi: {
159
+ encode(message: SignatureDescriptor_Data_Multi, writer?: _m0.Writer): _m0.Writer;
160
+ decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi;
161
+ fromPartial(object: DeepPartial<SignatureDescriptor_Data_Multi>): SignatureDescriptor_Data_Multi;
162
+ };
@@ -0,0 +1,329 @@
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 { CompactBitArray } from "../../../crypto/multisig/v1beta1/multisig.js";
8
+ import { Any } from "../../../../google/protobuf/any.js";
9
+ import _m0 from "protobufjs/minimal.js";
10
+ import { Long } from "../../../../helpers.js";
11
+ /**
12
+ * SignMode represents a signing mode with its own security guarantees.
13
+ *
14
+ * This enum should be considered a registry of all known sign modes
15
+ * in the Cosmos ecosystem. Apps are not expected to support all known
16
+ * sign modes. Apps that would like to support custom sign modes are
17
+ * encouraged to open a small PR against this file to add a new case
18
+ * to this SignMode enum describing their sign mode so that different
19
+ * apps have a consistent version of this enum.
20
+ */
21
+ export var SignMode;
22
+ (function (SignMode) {
23
+ /**
24
+ * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be
25
+ * rejected.
26
+ */
27
+ SignMode[SignMode["SIGN_MODE_UNSPECIFIED"] = 0] = "SIGN_MODE_UNSPECIFIED";
28
+ /**
29
+ * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is
30
+ * verified with raw bytes from Tx.
31
+ */
32
+ SignMode[SignMode["SIGN_MODE_DIRECT"] = 1] = "SIGN_MODE_DIRECT";
33
+ /**
34
+ * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some
35
+ * human-readable textual representation on top of the binary representation
36
+ * from SIGN_MODE_DIRECT.
37
+ *
38
+ * Since: cosmos-sdk 0.50
39
+ */
40
+ SignMode[SignMode["SIGN_MODE_TEXTUAL"] = 2] = "SIGN_MODE_TEXTUAL";
41
+ /**
42
+ * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses
43
+ * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not
44
+ * require signers signing over other signers' `signer_info`.
45
+ *
46
+ * Since: cosmos-sdk 0.46
47
+ */
48
+ SignMode[SignMode["SIGN_MODE_DIRECT_AUX"] = 3] = "SIGN_MODE_DIRECT_AUX";
49
+ /**
50
+ * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
51
+ * Amino JSON and will be removed in the future.
52
+ */
53
+ SignMode[SignMode["SIGN_MODE_LEGACY_AMINO_JSON"] = 127] = "SIGN_MODE_LEGACY_AMINO_JSON";
54
+ /**
55
+ * SIGN_MODE_EIP_191 - SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
56
+ * SDK. Ref: https://eips.ethereum.org/EIPS/eip-191
57
+ *
58
+ * Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
59
+ * but is not implemented on the SDK by default. To enable EIP-191, you need
60
+ * to pass a custom `TxConfig` that has an implementation of
61
+ * `SignModeHandler` for EIP-191. The SDK may decide to fully support
62
+ * EIP-191 in the future.
63
+ *
64
+ * Since: cosmos-sdk 0.45.2
65
+ */
66
+ SignMode[SignMode["SIGN_MODE_EIP_191"] = 191] = "SIGN_MODE_EIP_191";
67
+ SignMode[SignMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
68
+ })(SignMode || (SignMode = {}));
69
+ export const SignModeSDKType = SignMode;
70
+ export function signModeFromJSON(object) {
71
+ switch (object) {
72
+ case 0:
73
+ case "SIGN_MODE_UNSPECIFIED":
74
+ return SignMode.SIGN_MODE_UNSPECIFIED;
75
+ case 1:
76
+ case "SIGN_MODE_DIRECT":
77
+ return SignMode.SIGN_MODE_DIRECT;
78
+ case 2:
79
+ case "SIGN_MODE_TEXTUAL":
80
+ return SignMode.SIGN_MODE_TEXTUAL;
81
+ case 3:
82
+ case "SIGN_MODE_DIRECT_AUX":
83
+ return SignMode.SIGN_MODE_DIRECT_AUX;
84
+ case 127:
85
+ case "SIGN_MODE_LEGACY_AMINO_JSON":
86
+ return SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
87
+ case 191:
88
+ case "SIGN_MODE_EIP_191":
89
+ return SignMode.SIGN_MODE_EIP_191;
90
+ case -1:
91
+ case "UNRECOGNIZED":
92
+ default:
93
+ return SignMode.UNRECOGNIZED;
94
+ }
95
+ }
96
+ export function signModeToJSON(object) {
97
+ switch (object) {
98
+ case SignMode.SIGN_MODE_UNSPECIFIED:
99
+ return "SIGN_MODE_UNSPECIFIED";
100
+ case SignMode.SIGN_MODE_DIRECT:
101
+ return "SIGN_MODE_DIRECT";
102
+ case SignMode.SIGN_MODE_TEXTUAL:
103
+ return "SIGN_MODE_TEXTUAL";
104
+ case SignMode.SIGN_MODE_DIRECT_AUX:
105
+ return "SIGN_MODE_DIRECT_AUX";
106
+ case SignMode.SIGN_MODE_LEGACY_AMINO_JSON:
107
+ return "SIGN_MODE_LEGACY_AMINO_JSON";
108
+ case SignMode.SIGN_MODE_EIP_191:
109
+ return "SIGN_MODE_EIP_191";
110
+ case SignMode.UNRECOGNIZED:
111
+ default:
112
+ return "UNRECOGNIZED";
113
+ }
114
+ }
115
+ function createBaseSignatureDescriptors() {
116
+ return {
117
+ signatures: []
118
+ };
119
+ }
120
+ export const SignatureDescriptors = {
121
+ encode(message, writer = _m0.Writer.create()) {
122
+ for (const v of message.signatures) {
123
+ SignatureDescriptor.encode(v, writer.uint32(10).fork()).ldelim();
124
+ }
125
+ return writer;
126
+ },
127
+ decode(input, length) {
128
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
129
+ let end = length === undefined ? reader.len : reader.pos + length;
130
+ const message = createBaseSignatureDescriptors();
131
+ while (reader.pos < end) {
132
+ const tag = reader.uint32();
133
+ switch (tag >>> 3) {
134
+ case 1:
135
+ message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32()));
136
+ break;
137
+ default:
138
+ reader.skipType(tag & 7);
139
+ break;
140
+ }
141
+ }
142
+ return message;
143
+ },
144
+ fromPartial(object) {
145
+ const message = createBaseSignatureDescriptors();
146
+ message.signatures = object.signatures?.map(e => SignatureDescriptor.fromPartial(e)) || [];
147
+ return message;
148
+ }
149
+ };
150
+ function createBaseSignatureDescriptor() {
151
+ return {
152
+ publicKey: undefined,
153
+ data: undefined,
154
+ sequence: Long.UZERO
155
+ };
156
+ }
157
+ export const SignatureDescriptor = {
158
+ encode(message, writer = _m0.Writer.create()) {
159
+ if (message.publicKey !== undefined) {
160
+ Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();
161
+ }
162
+ if (message.data !== undefined) {
163
+ SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim();
164
+ }
165
+ if (!message.sequence.isZero()) {
166
+ writer.uint32(24).uint64(message.sequence);
167
+ }
168
+ return writer;
169
+ },
170
+ decode(input, length) {
171
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
172
+ let end = length === undefined ? reader.len : reader.pos + length;
173
+ const message = createBaseSignatureDescriptor();
174
+ while (reader.pos < end) {
175
+ const tag = reader.uint32();
176
+ switch (tag >>> 3) {
177
+ case 1:
178
+ message.publicKey = Any.decode(reader, reader.uint32());
179
+ break;
180
+ case 2:
181
+ message.data = SignatureDescriptor_Data.decode(reader, reader.uint32());
182
+ break;
183
+ case 3:
184
+ message.sequence = reader.uint64();
185
+ break;
186
+ default:
187
+ reader.skipType(tag & 7);
188
+ break;
189
+ }
190
+ }
191
+ return message;
192
+ },
193
+ fromPartial(object) {
194
+ const message = createBaseSignatureDescriptor();
195
+ message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined;
196
+ message.data = object.data !== undefined && object.data !== null ? SignatureDescriptor_Data.fromPartial(object.data) : undefined;
197
+ message.sequence = object.sequence !== undefined && object.sequence !== null ? Long.fromValue(object.sequence) : Long.UZERO;
198
+ return message;
199
+ }
200
+ };
201
+ function createBaseSignatureDescriptor_Data() {
202
+ return {
203
+ single: undefined,
204
+ multi: undefined
205
+ };
206
+ }
207
+ export const SignatureDescriptor_Data = {
208
+ encode(message, writer = _m0.Writer.create()) {
209
+ if (message.single !== undefined) {
210
+ SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim();
211
+ }
212
+ if (message.multi !== undefined) {
213
+ SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim();
214
+ }
215
+ return writer;
216
+ },
217
+ decode(input, length) {
218
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
219
+ let end = length === undefined ? reader.len : reader.pos + length;
220
+ const message = createBaseSignatureDescriptor_Data();
221
+ while (reader.pos < end) {
222
+ const tag = reader.uint32();
223
+ switch (tag >>> 3) {
224
+ case 1:
225
+ message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32());
226
+ break;
227
+ case 2:
228
+ message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32());
229
+ break;
230
+ default:
231
+ reader.skipType(tag & 7);
232
+ break;
233
+ }
234
+ }
235
+ return message;
236
+ },
237
+ fromPartial(object) {
238
+ const message = createBaseSignatureDescriptor_Data();
239
+ message.single = object.single !== undefined && object.single !== null ? SignatureDescriptor_Data_Single.fromPartial(object.single) : undefined;
240
+ message.multi = object.multi !== undefined && object.multi !== null ? SignatureDescriptor_Data_Multi.fromPartial(object.multi) : undefined;
241
+ return message;
242
+ }
243
+ };
244
+ function createBaseSignatureDescriptor_Data_Single() {
245
+ return {
246
+ mode: 0,
247
+ signature: new Uint8Array()
248
+ };
249
+ }
250
+ export const SignatureDescriptor_Data_Single = {
251
+ encode(message, writer = _m0.Writer.create()) {
252
+ if (message.mode !== 0) {
253
+ writer.uint32(8).int32(message.mode);
254
+ }
255
+ if (message.signature.length !== 0) {
256
+ writer.uint32(18).bytes(message.signature);
257
+ }
258
+ return writer;
259
+ },
260
+ decode(input, length) {
261
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
262
+ let end = length === undefined ? reader.len : reader.pos + length;
263
+ const message = createBaseSignatureDescriptor_Data_Single();
264
+ while (reader.pos < end) {
265
+ const tag = reader.uint32();
266
+ switch (tag >>> 3) {
267
+ case 1:
268
+ message.mode = reader.int32();
269
+ break;
270
+ case 2:
271
+ message.signature = reader.bytes();
272
+ break;
273
+ default:
274
+ reader.skipType(tag & 7);
275
+ break;
276
+ }
277
+ }
278
+ return message;
279
+ },
280
+ fromPartial(object) {
281
+ const message = createBaseSignatureDescriptor_Data_Single();
282
+ message.mode = object.mode ?? 0;
283
+ message.signature = object.signature ?? new Uint8Array();
284
+ return message;
285
+ }
286
+ };
287
+ function createBaseSignatureDescriptor_Data_Multi() {
288
+ return {
289
+ bitarray: undefined,
290
+ signatures: []
291
+ };
292
+ }
293
+ export const SignatureDescriptor_Data_Multi = {
294
+ encode(message, writer = _m0.Writer.create()) {
295
+ if (message.bitarray !== undefined) {
296
+ CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim();
297
+ }
298
+ for (const v of message.signatures) {
299
+ SignatureDescriptor_Data.encode(v, writer.uint32(18).fork()).ldelim();
300
+ }
301
+ return writer;
302
+ },
303
+ decode(input, length) {
304
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
305
+ let end = length === undefined ? reader.len : reader.pos + length;
306
+ const message = createBaseSignatureDescriptor_Data_Multi();
307
+ while (reader.pos < end) {
308
+ const tag = reader.uint32();
309
+ switch (tag >>> 3) {
310
+ case 1:
311
+ message.bitarray = CompactBitArray.decode(reader, reader.uint32());
312
+ break;
313
+ case 2:
314
+ message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32()));
315
+ break;
316
+ default:
317
+ reader.skipType(tag & 7);
318
+ break;
319
+ }
320
+ }
321
+ return message;
322
+ },
323
+ fromPartial(object) {
324
+ const message = createBaseSignatureDescriptor_Data_Multi();
325
+ message.bitarray = object.bitarray !== undefined && object.bitarray !== null ? CompactBitArray.fromPartial(object.bitarray) : undefined;
326
+ message.signatures = object.signatures?.map(e => SignatureDescriptor_Data.fromPartial(e)) || [];
327
+ return message;
328
+ }
329
+ };