@vultisig/core-chain 1.4.2 → 1.4.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vultisig/core-chain
2
2
 
3
+ ## 1.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#360](https://github.com/vultisig/vultisig-sdk/pull/360) [`e52914b`](https://github.com/vultisig/vultisig-sdk/commit/e52914ba87f2d740847fc0de3a49827b0da3e0ba) Thanks [@NeOMakinG](https://github.com/NeOMakinG)! - `@vultisig/core-chain`: lift the qbtc protobuf wire-format helpers to a shared `chains/cosmos/protoEncoding` module (extending it with lower-level `varintBig` / `protoField` primitives that don't apply proto3 default-elision, alongside the existing default-eliding `protoVarint` / `protoBytes` / `protoString`), and add `chains/cosmos/terraClassicTax` with LCD fetchers (`getTerraClassicTaxRate`, `getTerraClassicTaxCap`) plus the pure `applyTerraClassicTax` helper for the cosmos-sdk Dec-fixed-point math. Tax rate is `0` on the live chain today (governance-paused) but the helpers are ready for callers that need to be correct when it reactivates. The previous `qbtc/protoEncoding` package export is replaced by `cosmos/protoEncoding`; the qbtc consumers were updated in lockstep, no behavior change.
8
+
3
9
  ## 1.4.2
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Manual protobuf wire-format encoding for cosmos-sdk transactions.
3
+ *
4
+ * Required because WalletCore cannot handle every proto message we need to
5
+ * sign — MLDSA-keyed QBTC, and React-Native paths that intentionally avoid
6
+ * the WalletCore IBC-transfer encoder so they can run without the native
7
+ * dependency.
8
+ *
9
+ * Two layers:
10
+ *
11
+ * Lower-level (`varintBig`, `protoField`) — primitives that do NOT apply
12
+ * proto3 default-elision. Callers handle the "skip on zero / empty string"
13
+ * contract themselves at message-build time. Useful when the caller already
14
+ * knows which fields are present (e.g. cosmjs-types-style encoders, IBC
15
+ * `MsgTransfer` where `timeout_height` is always emitted even when zeroed).
16
+ *
17
+ * Higher-level (`protoVarint`, `protoBytes`, `protoString`) — apply proto3
18
+ * default-elision automatically (skip 0n / empty bytes / empty string).
19
+ * Used by QBTC's claim message builder where the call sites are exhaustive
20
+ * and shorter to write without per-field guards.
21
+ *
22
+ * Both layers share `concatBytes`.
23
+ */
24
+ /**
25
+ * Protobuf wire-type tags. We only encode wire types 0 (varint) and 2
26
+ * (length-delimited) — every cosmos-sdk + IBC message we sign is composed of
27
+ * these two. Wire types 1/5 (fixed64/fixed32) and 3/4 (deprecated groups) are
28
+ * not used.
29
+ *
30
+ * @see https://protobuf.dev/programming-guides/encoding/#structure
31
+ */
32
+ export declare const WireType: {
33
+ readonly Varint: 0;
34
+ readonly LengthDelimited: 2;
35
+ };
36
+ export type WireType = (typeof WireType)[keyof typeof WireType];
37
+ /**
38
+ * Encodes a UInt64 as a protobuf base-128 varint.
39
+ *
40
+ * Bigint-only: callers like IBC `MsgTransfer.timeout_timestamp` carry UNIX
41
+ * nanoseconds, which crossed 2^53 in 2022 — a JS `number` shift-based varint
42
+ * silently corrupts those values. The full 64-bit unsigned range
43
+ * (`0n .. 2^64 - 1`) is supported and validated.
44
+ */
45
+ export declare const varintBig: (value: bigint) => Uint8Array;
46
+ /**
47
+ * Lower-level field encoder. Emits a tag followed by the field payload — the
48
+ * payload is treated as opaque bytes (you must already have encoded it
49
+ * correctly for the wire type). Does NOT apply proto3 default-elision.
50
+ *
51
+ * For varint fields (wireType 0), pass `varintBig(value)` as the data. For
52
+ * length-delimited fields (wireType 2), the caller is responsible for the
53
+ * length prefix only when payload is provided pre-length-prefixed; this
54
+ * function adds the length prefix automatically for wire type 2.
55
+ *
56
+ * Used by IBC-transfer encoders (`MsgTransfer`, the inner `Height` submessage)
57
+ * where some fields must be emitted even at the proto3 default value.
58
+ */
59
+ export declare const protoField: (fieldNumber: number, wireType: WireType, data: Uint8Array) => Uint8Array;
60
+ /** Appends a varint field (wire type 0). Skips if value is 0 (proto3 default). */
61
+ export declare const protoVarint: (fieldNumber: number, value: bigint) => Uint8Array;
62
+ /** Appends a length-delimited field (wire type 2) for raw bytes. */
63
+ export declare const protoBytes: (fieldNumber: number, data: Uint8Array) => Uint8Array;
64
+ /** Appends a length-delimited field (wire type 2) for a UTF-8 string. */
65
+ export declare const protoString: (fieldNumber: number, value: string) => Uint8Array;
66
+ /** Concatenates multiple Uint8Arrays. */
67
+ export declare const concatBytes: (...arrays: Uint8Array[]) => Uint8Array;
68
+ //# sourceMappingURL=protoEncoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protoEncoding.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/protoEncoding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;;CAGX,CAAA;AAEV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;AAM/D;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,UAazC,CAAA;AA2BD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,GACrB,aAAa,MAAM,EACnB,UAAU,QAAQ,EAClB,MAAM,UAAU,KACf,UAQF,CAAA;AAMD,kFAAkF;AAClF,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,OAAO,MAAM,KAAG,UAGhE,CAAA;AAED,oEAAoE;AACpE,eAAO,MAAM,UAAU,GACrB,aAAa,MAAM,EACnB,MAAM,UAAU,KACf,UAGF,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,OAAO,MAAM,KAAG,UAGhE,CAAA;AAMD,yCAAyC;AACzC,eAAO,MAAM,WAAW,GAAI,GAAG,QAAQ,UAAU,EAAE,KAAG,UASrD,CAAA"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Manual protobuf wire-format encoding for cosmos-sdk transactions.
3
+ *
4
+ * Required because WalletCore cannot handle every proto message we need to
5
+ * sign — MLDSA-keyed QBTC, and React-Native paths that intentionally avoid
6
+ * the WalletCore IBC-transfer encoder so they can run without the native
7
+ * dependency.
8
+ *
9
+ * Two layers:
10
+ *
11
+ * Lower-level (`varintBig`, `protoField`) — primitives that do NOT apply
12
+ * proto3 default-elision. Callers handle the "skip on zero / empty string"
13
+ * contract themselves at message-build time. Useful when the caller already
14
+ * knows which fields are present (e.g. cosmjs-types-style encoders, IBC
15
+ * `MsgTransfer` where `timeout_height` is always emitted even when zeroed).
16
+ *
17
+ * Higher-level (`protoVarint`, `protoBytes`, `protoString`) — apply proto3
18
+ * default-elision automatically (skip 0n / empty bytes / empty string).
19
+ * Used by QBTC's claim message builder where the call sites are exhaustive
20
+ * and shorter to write without per-field guards.
21
+ *
22
+ * Both layers share `concatBytes`.
23
+ */
24
+ // ---------------------------------------------------------------------------
25
+ // Wire type constants
26
+ // ---------------------------------------------------------------------------
27
+ /**
28
+ * Protobuf wire-type tags. We only encode wire types 0 (varint) and 2
29
+ * (length-delimited) — every cosmos-sdk + IBC message we sign is composed of
30
+ * these two. Wire types 1/5 (fixed64/fixed32) and 3/4 (deprecated groups) are
31
+ * not used.
32
+ *
33
+ * @see https://protobuf.dev/programming-guides/encoding/#structure
34
+ */
35
+ export const WireType = {
36
+ Varint: 0,
37
+ LengthDelimited: 2,
38
+ };
39
+ // ---------------------------------------------------------------------------
40
+ // Primitive encoders
41
+ // ---------------------------------------------------------------------------
42
+ /**
43
+ * Encodes a UInt64 as a protobuf base-128 varint.
44
+ *
45
+ * Bigint-only: callers like IBC `MsgTransfer.timeout_timestamp` carry UNIX
46
+ * nanoseconds, which crossed 2^53 in 2022 — a JS `number` shift-based varint
47
+ * silently corrupts those values. The full 64-bit unsigned range
48
+ * (`0n .. 2^64 - 1`) is supported and validated.
49
+ */
50
+ export const varintBig = (value) => {
51
+ if (value < 0n || value > 0xffffffffffffffffn) {
52
+ throw new RangeError('varintBig expects an unsigned 64-bit integer');
53
+ }
54
+ const bytes = [];
55
+ let v = value;
56
+ while (v > 0x7fn) {
57
+ bytes.push(Number(v & 0x7fn) | 0x80);
58
+ v >>= 7n;
59
+ }
60
+ bytes.push(Number(v));
61
+ return new Uint8Array(bytes);
62
+ };
63
+ /**
64
+ * Encodes a (fieldNumber, wireType) pair as a single varint tag.
65
+ *
66
+ * Tag layout: `(fieldNumber << 3) | wireType`. `fieldNumber` must fit in
67
+ * 29 bits (proto spec MAX_FIELD_NUMBER = 2^29 - 1).
68
+ */
69
+ const encodeFieldTag = (fieldNumber, wireType) => {
70
+ // The legal proto field-number range is [1, 2^29 - 1]. JS bitwise ops
71
+ // operate on signed 32-bit integers, so `fieldNumber << 3` overflows
72
+ // the signed lane once fieldNumber >= 2^28 — the resulting tag would
73
+ // be wrong (or negative) for the upper half of the legal range.
74
+ // Compute in bigint space to keep the full range correct, even though
75
+ // the only current call sites use low field numbers.
76
+ if (!Number.isInteger(fieldNumber) ||
77
+ fieldNumber < 1 ||
78
+ fieldNumber >= 2 ** 29) {
79
+ throw new RangeError(`encodeFieldTag: fieldNumber must be in [1, 2^29 - 1], got ${fieldNumber}`);
80
+ }
81
+ return varintBig((BigInt(fieldNumber) << 3n) | BigInt(wireType));
82
+ };
83
+ /**
84
+ * Lower-level field encoder. Emits a tag followed by the field payload — the
85
+ * payload is treated as opaque bytes (you must already have encoded it
86
+ * correctly for the wire type). Does NOT apply proto3 default-elision.
87
+ *
88
+ * For varint fields (wireType 0), pass `varintBig(value)` as the data. For
89
+ * length-delimited fields (wireType 2), the caller is responsible for the
90
+ * length prefix only when payload is provided pre-length-prefixed; this
91
+ * function adds the length prefix automatically for wire type 2.
92
+ *
93
+ * Used by IBC-transfer encoders (`MsgTransfer`, the inner `Height` submessage)
94
+ * where some fields must be emitted even at the proto3 default value.
95
+ */
96
+ export const protoField = (fieldNumber, wireType, data) => {
97
+ const tag = encodeFieldTag(fieldNumber, wireType);
98
+ if (wireType === WireType.LengthDelimited) {
99
+ const length = varintBig(BigInt(data.length));
100
+ return concatBytes(tag, length, data);
101
+ }
102
+ // Varint: data is already the encoded varint bytes.
103
+ return concatBytes(tag, data);
104
+ };
105
+ // ---------------------------------------------------------------------------
106
+ // Default-eliding higher-level encoders
107
+ // ---------------------------------------------------------------------------
108
+ /** Appends a varint field (wire type 0). Skips if value is 0 (proto3 default). */
109
+ export const protoVarint = (fieldNumber, value) => {
110
+ if (value === 0n)
111
+ return new Uint8Array(0);
112
+ return protoField(fieldNumber, WireType.Varint, varintBig(value));
113
+ };
114
+ /** Appends a length-delimited field (wire type 2) for raw bytes. */
115
+ export const protoBytes = (fieldNumber, data) => {
116
+ if (data.length === 0)
117
+ return new Uint8Array(0);
118
+ return protoField(fieldNumber, WireType.LengthDelimited, data);
119
+ };
120
+ /** Appends a length-delimited field (wire type 2) for a UTF-8 string. */
121
+ export const protoString = (fieldNumber, value) => {
122
+ if (value.length === 0)
123
+ return new Uint8Array(0);
124
+ return protoBytes(fieldNumber, new TextEncoder().encode(value));
125
+ };
126
+ // ---------------------------------------------------------------------------
127
+ // Utilities
128
+ // ---------------------------------------------------------------------------
129
+ /** Concatenates multiple Uint8Arrays. */
130
+ export const concatBytes = (...arrays) => {
131
+ const totalLength = arrays.reduce((sum, arr) => sum + arr.length, 0);
132
+ const result = new Uint8Array(totalLength);
133
+ let offset = 0;
134
+ for (const arr of arrays) {
135
+ result.set(arr, offset);
136
+ offset += arr.length;
137
+ }
138
+ return result;
139
+ };
140
+ //# sourceMappingURL=protoEncoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protoEncoding.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/protoEncoding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;I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AAU,CAAC,WAAW,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACjE,CAAC,CAAA;AAED,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,MAAoB,EAAc,EAAE;IACjE,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IACpE,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IAC1C,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACvB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAA;IACtB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { concatBytes, protoBytes, protoString, protoVarint, } from '@vultisig/core-chain/chains/cosmos/qbtc/protoEncoding';
1
+ import { concatBytes, protoBytes, protoString, protoVarint, } from '@vultisig/core-chain/chains/cosmos/protoEncoding';
2
2
  const msgClaimWithProofTypeURL = '/qbtc.qbtc.v1.MsgClaimWithProof';
3
3
  const isHex = (value) => /^[0-9a-f]+$/i.test(value);
4
4
  const assertHex = (value, name, expectedLength) => {
@@ -1 +1 @@
1
- {"version":3,"file":"buildClaimTx.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/cosmos/qbtc/claim/buildClaimTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,GACZ,MAAM,uDAAuD,CAAA;AAE9D,MAAM,wBAAwB,GAAG,iCAAiC,CAAA;AAsBlE,MAAM,KAAK,G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AK,CAAC,KAAK,CAAC,EAC3B,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EACjC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EACjC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CACtC,CAAA;AACH,CAAC,CAAA;AAED,uDAAuD;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,KAAkC,EACtB,EAAE;IACd,kBAAkB,CAAC,KAAK,CAAC,CAAA;IACzB,MAAM,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;IACzC,OAAO,WAAW,CAChB,WAAW,CAAC,CAAC,EAAE,wBAAwB,CAAC,EACxC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CACnB,CAAA;AACH,CAAC,CAAA;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,KAAkC,EACtB,EAAE;IACd,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;IAC5C,OAAO,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAC9B,CAAC,CAAA"}
1
+ {"version":3,"file":"buildClaimTx.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/cosmos/qbtc/claim/buildClaimTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,GACZ,MAAM,kDAAkD,CAAA;AAEzD,MAAM,wBAAwB,GAAG,iCAAiC,CAAA;AAsBlE,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAE3D,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,cAAsB,EAAE,EAAE;IACxE,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACr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MAAM,sBAAsB,GAAG,CACpC,KAAkC,EACtB,EAAE;IACd,kBAAkB,CAAC,KAAK,CAAC,CAAA;IACzB,MAAM,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;IACzC,OAAO,WAAW,CAChB,WAAW,CAAC,CAAC,EAAE,wBAAwB,CAAC,EACxC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CACnB,CAAA;AACH,CAAC,CAAA;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,KAAkC,EACtB,EAAE;IACd,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;IAC5C,OAAO,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;AAC9B,CAAC,CAAA"}
@@ -1,13 +1,14 @@
1
1
  /**
2
- * Manual protobuf wire-format encoding for QBTC transactions.
3
- * Required because WalletCore cannot handle MLDSA keys.
2
+ * @deprecated Import from `@vultisig/core-chain/chains/cosmos/protoEncoding`.
3
+ *
4
+ * This subpath used to host the QBTC-specific manual protobuf encoders. The
5
+ * helpers were lifted to the shared `cosmos/protoEncoding` module so non-QBTC
6
+ * cosmos message builders (e.g. IBC `MsgTransfer` in vultiagent-app#303) can
7
+ * consume the same canonical primitives. This shim preserves the old import
8
+ * path so external consumers don't break — the wire bytes are unchanged.
9
+ *
10
+ * Removing this shim would be a breaking package-export change and must wait
11
+ * until a major version bump.
4
12
  */
5
- /** Appends a varint field (wire type 0). Skips if value is 0 (proto3 default). */
6
- export declare const protoVarint: (fieldNumber: number, value: bigint) => Uint8Array;
7
- /** Appends a length-delimited field (wire type 2) for raw bytes. */
8
- export declare const protoBytes: (fieldNumber: number, data: Uint8Array) => Uint8Array;
9
- /** Appends a length-delimited field (wire type 2) for a UTF-8 string. */
10
- export declare const protoString: (fieldNumber: number, value: string) => Uint8Array;
11
- /** Concatenates multiple Uint8Arrays. */
12
- export declare const concatBytes: (...arrays: Uint8Array[]) => Uint8Array;
13
+ export { concatBytes, protoBytes, protoString, protoVarint, } from '../protoEncoding.js';
13
14
  //# sourceMappingURL=protoEncoding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protoEncoding.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/qbtc/protoEncoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,kFAAkF;AAClF,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,OAAO,MAAM,KAAG,UAKhE,CAAA;AAED,oEAAoE;AACpE,eAAO,MAAM,UAAU,GACrB,aAAa,MAAM,EACnB,MAAM,UAAU,KACf,UAKF,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,EAAE,OAAO,MAAM,KAAG,UAGhE,CAAA;AAED,yCAAyC;AACzC,eAAO,MAAM,WAAW,GAAI,GAAG,QAAQ,UAAU,EAAE,KAAG,UASrD,CAAA"}
1
+ {"version":3,"file":"protoEncoding.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/qbtc/protoEncoding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAA"}
@@ -1,52 +1,14 @@
1
1
  /**
2
- * Manual protobuf wire-format encoding for QBTC transactions.
3
- * Required because WalletCore cannot handle MLDSA keys.
2
+ * @deprecated Import from `@vultisig/core-chain/chains/cosmos/protoEncoding`.
3
+ *
4
+ * This subpath used to host the QBTC-specific manual protobuf encoders. The
5
+ * helpers were lifted to the shared `cosmos/protoEncoding` module so non-QBTC
6
+ * cosmos message builders (e.g. IBC `MsgTransfer` in vultiagent-app#303) can
7
+ * consume the same canonical primitives. This shim preserves the old import
8
+ * path so external consumers don't break — the wire bytes are unchanged.
9
+ *
10
+ * Removing this shim would be a breaking package-export change and must wait
11
+ * until a major version bump.
4
12
  */
5
- /** Encodes a UInt64 as a protobuf base-128 varint. */
6
- const encodeVarint = (value) => {
7
- if (value < 0n || value > 0xffffffffffffffffn) {
8
- throw new RangeError('encodeVarint expects an unsigned 64-bit integer');
9
- }
10
- const bytes = [];
11
- let v = value;
12
- while (v > 0x7fn) {
13
- bytes.push(Number(v & 0x7fn) | 0x80);
14
- v >>= 7n;
15
- }
16
- bytes.push(Number(v));
17
- return new Uint8Array(bytes);
18
- };
19
- /** Appends a varint field (wire type 0). Skips if value is 0 (proto3 default). */
20
- export const protoVarint = (fieldNumber, value) => {
21
- if (value === 0n)
22
- return new Uint8Array(0);
23
- const tag = encodeVarint(BigInt((fieldNumber << 3) | 0));
24
- const data = encodeVarint(value);
25
- return concatBytes(tag, data);
26
- };
27
- /** Appends a length-delimited field (wire type 2) for raw bytes. */
28
- export const protoBytes = (fieldNumber, data) => {
29
- if (data.length === 0)
30
- return new Uint8Array(0);
31
- const tag = encodeVarint(BigInt((fieldNumber << 3) | 2));
32
- const length = encodeVarint(BigInt(data.length));
33
- return concatBytes(tag, length, data);
34
- };
35
- /** Appends a length-delimited field (wire type 2) for a UTF-8 string. */
36
- export const protoString = (fieldNumber, value) => {
37
- if (value.length === 0)
38
- return new Uint8Array(0);
39
- return protoBytes(fieldNumber, new TextEncoder().encode(value));
40
- };
41
- /** Concatenates multiple Uint8Arrays. */
42
- export const concatBytes = (...arrays) => {
43
- const totalLength = arrays.reduce((sum, arr) => sum + arr.length, 0);
44
- const result = new Uint8Array(totalLength);
45
- let offset = 0;
46
- for (const arr of arrays) {
47
- result.set(arr, offset);
48
- offset += arr.length;
49
- }
50
- return result;
51
- };
13
+ export { concatBytes, protoBytes, protoString, protoVarint, } from '../protoEncoding.js';
52
14
  //# sourceMappingURL=protoEncoding.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protoEncoding.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/qbtc/protoEncoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sDAAsD;AACtD,M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CAAA;IACxD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAChD,OAAO,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;AACvC,CAAC,CAAA;AAED,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,KAAa,EAAc,EAAE;IAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;IAChD,OAAO,UAAU,CAAC,WAAW,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACjE,CAAC,CAAA;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,MAAoB,EAAc,EAAE;IACjE,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IACpE,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IAC1C,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACvB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAA;IACtB,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
1
+ {"version":3,"file":"protoEncoding.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/qbtc/protoEncoding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Terra Classic stability-tax queries + math.
3
+ *
4
+ * Background: Terra Classic (chain-id `columbus-5`) inherits the original
5
+ * Terra "treasury" module from cosmos-sdk Terra v1, which charges a
6
+ * stability tax on `MsgSend` / `MsgMultiSend` for every native denom
7
+ * EXCEPT `uluna` (LUNC itself is fee-exempt). The tax is a fraction of
8
+ * the transferred amount (governance-controlled, fixed-point 18-decimal),
9
+ * and is capped per-denom by a separate per-denom ceiling.
10
+ *
11
+ * As of this lift the live `tax_rate` is `0` (governance has effectively
12
+ * paused the tax post-UST-collapse), but the treasury module still exists
13
+ * and the rate is queryable — historically it was 1.2% with caps that
14
+ * mostly came into play for large `uusd` transfers. If governance ever
15
+ * re-enables the tax, signing paths that ignore it produce txs that get
16
+ * rejected by the chain's ante handler ("insufficient fee").
17
+ *
18
+ * Terra v2 (`phoenix-1`) does NOT have a treasury module — the same
19
+ * endpoints return HTTP 501 — so callers should only invoke these for
20
+ * `Chain.TerraClassic`.
21
+ *
22
+ * Consumers should query the rate AT SIGN-TIME (not cached across
23
+ * sessions), because governance rate changes propagate immediately.
24
+ * Within a single signing call, both `getTerraClassicTaxRate` and any
25
+ * `getTerraClassicTaxCaps(denom)` calls are safe to memoize — the rate
26
+ * does not change mid-tx.
27
+ */
28
+ /**
29
+ * `cosmosRpcUrl` for Terra Classic actually points at the LCD root (despite
30
+ * the dict name) — the same convention as `staking/lcdQueries`. Keep both
31
+ * URL builders side-by-side here so it's obvious where the tax module
32
+ * lives.
33
+ *
34
+ * Reference: terra-money/classic-core, x/treasury REST routes.
35
+ */
36
+ export declare const getTerraClassicTaxRateUrl: () => string;
37
+ export declare const getTerraClassicTaxCapsUrl: (denom: string) => string;
38
+ /**
39
+ * cosmos-sdk `Dec` is fixed-point with 18 decimals — the on-the-wire
40
+ * representation of `0.012` (1.2%) is the integer `12000000000000000`.
41
+ * Multiplying an amount by `rate` and dividing by `DEC_SCALE` gives the
42
+ * tax in base units of the same denom.
43
+ */
44
+ export declare const TERRA_CLASSIC_TAX_DEC_SCALE: bigint;
45
+ type FetchOpts = {
46
+ fetchImpl?: typeof fetch;
47
+ signal?: AbortSignal;
48
+ };
49
+ /**
50
+ * Fetches the current Terra Classic stability tax rate as an 18-decimal
51
+ * fixed-point bigint (e.g. `0n` if paused, `12_000_000_000_000_000n` if
52
+ * 1.2%). Throws when the LCD response is HTTP 200 but missing `tax_rate` —
53
+ * fail-closed, because silently treating "missing" as `0n` would
54
+ * undercalculate fees if a flaky LCD started returning `{}` after the chain
55
+ * un-pauses the tax (causing post-sign "insufficient fee" rejections).
56
+ */
57
+ export declare function getTerraClassicTaxRate(opts?: FetchOpts): Promise<bigint>;
58
+ /**
59
+ * Fetches the per-denom tax cap as a base-unit bigint (e.g.
60
+ * `60_000_000_000_000_000n` for `uluna`). The cap is the maximum tax that
61
+ * can be levied on a single transfer regardless of the rate-derived
62
+ * amount — when the chain re-enables the tax, large `uusd` transfers in
63
+ * particular hit the cap rather than the rate.
64
+ *
65
+ * Returns `null` ONLY for HTTP 404 ("no entry for this denom") — the
66
+ * caller treats `null` as "no per-denom cap" (the math helper interprets
67
+ * a missing cap as `+∞`).
68
+ *
69
+ * Fails closed (throws) on any other shape we don't recognize — including
70
+ * a `200` response with the `tax_cap` field missing or null. A flaky or
71
+ * tampered LCD that drops the field would otherwise turn a capped denom
72
+ * into an uncapped one and overcharge the user. Codex round-1 P1.
73
+ */
74
+ export declare function getTerraClassicTaxCap(denom: string, opts?: FetchOpts): Promise<bigint | null>;
75
+ /**
76
+ * Pure helper: given a transfer `amount`, its `denom`, the current 18-decimal
77
+ * `rate`, and a per-denom `caps` map, returns the stability tax in base
78
+ * units of `denom`.
79
+ *
80
+ * Rules (mirroring x/treasury's ante handler):
81
+ * - `denom === 'uluna'` is fee-exempt → returns `0n`.
82
+ * - `rate === 0n` → returns `0n` (the most common case today; lets callers
83
+ * skip the cap fetch entirely and avoid spurious LCD load).
84
+ * - Otherwise, `tax = floor(amount * rate / 10^18)`, then clamp to
85
+ * `caps[denom]` if present (cap of `null`/missing = uncapped).
86
+ *
87
+ * `floor` matches the cosmos-sdk Dec.MulInt rounding for positive values.
88
+ */
89
+ export declare const applyTerraClassicTax: (amount: bigint, denom: string, rate: bigint, caps: Record<string, bigint | null | undefined>) => bigint;
90
+ export {};
91
+ //# sourceMappingURL=terraClassicTax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terraClassicTax.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/terraClassicTax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAUH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAO,MAC0B,CAAA;AAEvE,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,KAAG,MAK0C,CAAA;AAMpG;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAa,CAAA;AAMrD,KAAK,SAAS,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAoDnE;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,GAAE,SAAc,GACnB,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAc,GACnB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmBxB;AAMD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,KAC9C,MAiBF,CAAA"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Terra Classic stability-tax queries + math.
3
+ *
4
+ * Background: Terra Classic (chain-id `columbus-5`) inherits the original
5
+ * Terra "treasury" module from cosmos-sdk Terra v1, which charges a
6
+ * stability tax on `MsgSend` / `MsgMultiSend` for every native denom
7
+ * EXCEPT `uluna` (LUNC itself is fee-exempt). The tax is a fraction of
8
+ * the transferred amount (governance-controlled, fixed-point 18-decimal),
9
+ * and is capped per-denom by a separate per-denom ceiling.
10
+ *
11
+ * As of this lift the live `tax_rate` is `0` (governance has effectively
12
+ * paused the tax post-UST-collapse), but the treasury module still exists
13
+ * and the rate is queryable — historically it was 1.2% with caps that
14
+ * mostly came into play for large `uusd` transfers. If governance ever
15
+ * re-enables the tax, signing paths that ignore it produce txs that get
16
+ * rejected by the chain's ante handler ("insufficient fee").
17
+ *
18
+ * Terra v2 (`phoenix-1`) does NOT have a treasury module — the same
19
+ * endpoints return HTTP 501 — so callers should only invoke these for
20
+ * `Chain.TerraClassic`.
21
+ *
22
+ * Consumers should query the rate AT SIGN-TIME (not cached across
23
+ * sessions), because governance rate changes propagate immediately.
24
+ * Within a single signing call, both `getTerraClassicTaxRate` and any
25
+ * `getTerraClassicTaxCaps(denom)` calls are safe to memoize — the rate
26
+ * does not change mid-tx.
27
+ */
28
+ import { Chain } from '../../Chain.js';
29
+ import { cosmosRpcUrl } from './cosmosRpcUrl.js';
30
+ // ---------------------------------------------------------------------------
31
+ // LCD endpoints
32
+ // ---------------------------------------------------------------------------
33
+ /**
34
+ * `cosmosRpcUrl` for Terra Classic actually points at the LCD root (despite
35
+ * the dict name) — the same convention as `staking/lcdQueries`. Keep both
36
+ * URL builders side-by-side here so it's obvious where the tax module
37
+ * lives.
38
+ *
39
+ * Reference: terra-money/classic-core, x/treasury REST routes.
40
+ */
41
+ export const getTerraClassicTaxRateUrl = () => `${cosmosRpcUrl[Chain.TerraClassic]}/terra/treasury/v1beta1/tax_rate`;
42
+ export const getTerraClassicTaxCapsUrl = (denom) =>
43
+ // URL-encode the denom: `ibc/<HASH>` and `factory/<addr>/<subdenom>` carry
44
+ // forward-slashes that would otherwise become extra path segments and the
45
+ // LCD would 404 (silently undertaxing those denoms once the rate is
46
+ // nonzero).
47
+ `${cosmosRpcUrl[Chain.TerraClassic]}/terra/treasury/v1beta1/tax_caps/${encodeURIComponent(denom)}`;
48
+ // ---------------------------------------------------------------------------
49
+ // Constants
50
+ // ---------------------------------------------------------------------------
51
+ /**
52
+ * cosmos-sdk `Dec` is fixed-point with 18 decimals — the on-the-wire
53
+ * representation of `0.012` (1.2%) is the integer `12000000000000000`.
54
+ * Multiplying an amount by `rate` and dividing by `DEC_SCALE` gives the
55
+ * tax in base units of the same denom.
56
+ */
57
+ export const TERRA_CLASSIC_TAX_DEC_SCALE = 10n ** 18n;
58
+ async function lcdGetJson(url, opts) {
59
+ const f = opts.fetchImpl ?? fetch;
60
+ const res = await f(url, { signal: opts.signal });
61
+ if (!res.ok)
62
+ throw new Error(`LCD ${res.status}: ${url}`);
63
+ return (await res.json());
64
+ }
65
+ /**
66
+ * Parses a cosmos-sdk `Dec` string ("0.012000000000000000") into the
67
+ * 18-decimal fixed-point integer representation (`12000000000000000n`).
68
+ * Accepts the integer-string form too ("12000000000000000") for callers
69
+ * that already pre-multiplied. Throws on negative values or NaN.
70
+ */
71
+ const parseDecToFixed18 = (s) => {
72
+ if (typeof s !== 'string') {
73
+ throw new Error(`tax_rate: expected string Dec, got ${typeof s}`);
74
+ }
75
+ const trimmed = s.trim();
76
+ if (trimmed.length === 0)
77
+ throw new Error('tax_rate: empty Dec string');
78
+ // Bigint-safe Dec parse: split on the decimal point if present, then
79
+ // pad/truncate the fractional part to exactly 18 digits.
80
+ const negative = trimmed.startsWith('-');
81
+ if (negative)
82
+ throw new Error(`tax_rate: negative Dec rejected (${trimmed})`);
83
+ // Validate strict Dec shape — single decimal point at most, and
84
+ // reject 19+ fractional digits outright. Truncating past 18 digits
85
+ // would let `1.0000000000000000001` (semantically > 100%) parse as
86
+ // exactly `10^18` and pass the cap guard below — fail-closed instead.
87
+ // Codex round-1 P1.
88
+ if (!/^[0-9]+(\.[0-9]{1,18})?$/.test(trimmed)) {
89
+ throw new Error(`tax_rate: malformed Dec "${trimmed}" (expected digits with at most 18 fractional digits)`);
90
+ }
91
+ const [intPart, fracPart = ''] = trimmed.split('.');
92
+ // intPart is guaranteed non-empty by the regex; fracPart is in [0, 18]
93
+ // digits so no truncation is needed (it's exactly representable).
94
+ const fracPadded = fracPart.padEnd(18, '0');
95
+ const value = BigInt(intPart) * TERRA_CLASSIC_TAX_DEC_SCALE + BigInt(fracPadded);
96
+ // Cap at 100% (Dec value `1.0` on the 18-decimal scale = `10^18`). A
97
+ // hostile or buggy LCD returning `tax_rate: '1000.0'` would otherwise
98
+ // drain the user — real Terra rates are < 5%.
99
+ if (value > TERRA_CLASSIC_TAX_DEC_SCALE) {
100
+ throw new Error(`tax_rate: rate above 100% rejected (${trimmed})`);
101
+ }
102
+ return value;
103
+ };
104
+ /**
105
+ * Fetches the current Terra Classic stability tax rate as an 18-decimal
106
+ * fixed-point bigint (e.g. `0n` if paused, `12_000_000_000_000_000n` if
107
+ * 1.2%). Throws when the LCD response is HTTP 200 but missing `tax_rate` —
108
+ * fail-closed, because silently treating "missing" as `0n` would
109
+ * undercalculate fees if a flaky LCD started returning `{}` after the chain
110
+ * un-pauses the tax (causing post-sign "insufficient fee" rejections).
111
+ */
112
+ export async function getTerraClassicTaxRate(opts = {}) {
113
+ const raw = await lcdGetJson(getTerraClassicTaxRateUrl(), opts);
114
+ if (raw.tax_rate === undefined || raw.tax_rate === null) {
115
+ throw new Error('tax_rate: missing field on 200 response');
116
+ }
117
+ return parseDecToFixed18(raw.tax_rate);
118
+ }
119
+ /**
120
+ * Fetches the per-denom tax cap as a base-unit bigint (e.g.
121
+ * `60_000_000_000_000_000n` for `uluna`). The cap is the maximum tax that
122
+ * can be levied on a single transfer regardless of the rate-derived
123
+ * amount — when the chain re-enables the tax, large `uusd` transfers in
124
+ * particular hit the cap rather than the rate.
125
+ *
126
+ * Returns `null` ONLY for HTTP 404 ("no entry for this denom") — the
127
+ * caller treats `null` as "no per-denom cap" (the math helper interprets
128
+ * a missing cap as `+∞`).
129
+ *
130
+ * Fails closed (throws) on any other shape we don't recognize — including
131
+ * a `200` response with the `tax_cap` field missing or null. A flaky or
132
+ * tampered LCD that drops the field would otherwise turn a capped denom
133
+ * into an uncapped one and overcharge the user. Codex round-1 P1.
134
+ */
135
+ export async function getTerraClassicTaxCap(denom, opts = {}) {
136
+ let raw;
137
+ try {
138
+ raw = await lcdGetJson(getTerraClassicTaxCapsUrl(denom), opts);
139
+ }
140
+ catch (e) {
141
+ // 404 ⇒ "no entry for this denom" (semantically uncapped).
142
+ if (e instanceof Error && e.message.startsWith('LCD 404'))
143
+ return null;
144
+ throw e;
145
+ }
146
+ if (raw.tax_cap === undefined || raw.tax_cap === null) {
147
+ throw new Error(`tax_cap: 200 response missing tax_cap for ${denom} — refusing to fail-open and overcharge`);
148
+ }
149
+ if (!/^[0-9]+$/.test(raw.tax_cap)) {
150
+ throw new Error(`tax_cap: malformed bigint "${raw.tax_cap}"`);
151
+ }
152
+ return BigInt(raw.tax_cap);
153
+ }
154
+ // ---------------------------------------------------------------------------
155
+ // Pure math
156
+ // ---------------------------------------------------------------------------
157
+ /**
158
+ * Pure helper: given a transfer `amount`, its `denom`, the current 18-decimal
159
+ * `rate`, and a per-denom `caps` map, returns the stability tax in base
160
+ * units of `denom`.
161
+ *
162
+ * Rules (mirroring x/treasury's ante handler):
163
+ * - `denom === 'uluna'` is fee-exempt → returns `0n`.
164
+ * - `rate === 0n` → returns `0n` (the most common case today; lets callers
165
+ * skip the cap fetch entirely and avoid spurious LCD load).
166
+ * - Otherwise, `tax = floor(amount * rate / 10^18)`, then clamp to
167
+ * `caps[denom]` if present (cap of `null`/missing = uncapped).
168
+ *
169
+ * `floor` matches the cosmos-sdk Dec.MulInt rounding for positive values.
170
+ */
171
+ export const applyTerraClassicTax = (amount, denom, rate, caps) => {
172
+ if (amount < 0n) {
173
+ throw new Error('applyTerraClassicTax: amount must be non-negative');
174
+ }
175
+ if (rate < 0n) {
176
+ throw new Error('applyTerraClassicTax: rate must be non-negative');
177
+ }
178
+ if (denom === 'uluna')
179
+ return 0n;
180
+ if (rate === 0n)
181
+ return 0n;
182
+ const raw = (amount * rate) / TERRA_CLASSIC_TAX_DEC_SCALE;
183
+ const cap = caps[denom];
184
+ if (cap === undefined || cap === null)
185
+ return raw;
186
+ if (cap < 0n) {
187
+ throw new Error(`applyTerraClassicTax: negative cap for ${denom}`);
188
+ }
189
+ return raw < cap ? raw : cap;
190
+ };
191
+ //# sourceMappingURL=terraClassicTax.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terraClassicTax.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/terraClassicTax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAW,EAAE,CACpD,GAAG,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,kCAAkC,CAAA;AAEvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAa,EAAU,EAAE;AACjE,2EAA2E;AAC3E,0EAA0E;AAC1E,oEAAoE;AACpE,YAAY;AACZ,GAAG,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,oCAAoC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAA;AAEpG,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,IAAI,GAAG,CAAA;AAQrD,KAAK,UAAU,UAAU,CAAI,GAAW,EAAE,IAAe;IACvD,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,KAAK,CAAA;IACjC,MAAM,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
  "name": "@vultisig/core-chain",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Blockchain chain logic shared across Vultisig clients",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -224,6 +224,11 @@
224
224
  "import": "./dist/chains/cosmos/gas.js",
225
225
  "default": "./dist/chains/cosmos/gas.js"
226
226
  },
227
+ "./chains/cosmos/protoEncoding": {
228
+ "types": "./dist/chains/cosmos/protoEncoding.d.ts",
229
+ "import": "./dist/chains/cosmos/protoEncoding.js",
230
+ "default": "./dist/chains/cosmos/protoEncoding.js"
231
+ },
227
232
  "./chains/cosmos/qbtc/claim/broadcastClaimTx": {
228
233
  "types": "./dist/chains/cosmos/qbtc/claim/broadcastClaimTx.d.ts",
229
234
  "import": "./dist/chains/cosmos/qbtc/claim/broadcastClaimTx.js",
@@ -299,6 +304,11 @@
299
304
  "import": "./dist/chains/cosmos/tendermintRpcUrl.js",
300
305
  "default": "./dist/chains/cosmos/tendermintRpcUrl.js"
301
306
  },
307
+ "./chains/cosmos/terraClassicTax": {
308
+ "types": "./dist/chains/cosmos/terraClassicTax.d.ts",
309
+ "import": "./dist/chains/cosmos/terraClassicTax.js",
310
+ "default": "./dist/chains/cosmos/terraClassicTax.js"
311
+ },
302
312
  "./chains/cosmos/thor/getThorchainInboundAddress": {
303
313
  "types": "./dist/chains/cosmos/thor/getThorchainInboundAddress.d.ts",
304
314
  "import": "./dist/chains/cosmos/thor/getThorchainInboundAddress.js",