@vultisig/core-chain 1.4.1 → 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 +13 -0
- package/dist/chains/cosmos/cosmosMsgTypes.d.ts +5 -1
- package/dist/chains/cosmos/cosmosMsgTypes.d.ts.map +1 -1
- package/dist/chains/cosmos/cosmosMsgTypes.js +5 -0
- package/dist/chains/cosmos/cosmosMsgTypes.js.map +1 -1
- package/dist/chains/cosmos/protoEncoding.d.ts +68 -0
- package/dist/chains/cosmos/protoEncoding.d.ts.map +1 -0
- package/dist/chains/cosmos/protoEncoding.js +140 -0
- package/dist/chains/cosmos/protoEncoding.js.map +1 -0
- package/dist/chains/cosmos/qbtc/claim/buildClaimTx.js +1 -1
- package/dist/chains/cosmos/qbtc/claim/buildClaimTx.js.map +1 -1
- package/dist/chains/cosmos/qbtc/claim/computeClaimHashes.d.ts +4 -2
- package/dist/chains/cosmos/qbtc/claim/computeClaimHashes.d.ts.map +1 -1
- package/dist/chains/cosmos/qbtc/claim/computeClaimHashes.js +17 -6
- package/dist/chains/cosmos/qbtc/claim/computeClaimHashes.js.map +1 -1
- package/dist/chains/cosmos/qbtc/protoEncoding.d.ts +11 -10
- package/dist/chains/cosmos/qbtc/protoEncoding.d.ts.map +1 -1
- package/dist/chains/cosmos/qbtc/protoEncoding.js +11 -49
- package/dist/chains/cosmos/qbtc/protoEncoding.js.map +1 -1
- package/dist/chains/cosmos/staking/lcdQueries.d.ts +117 -0
- package/dist/chains/cosmos/staking/lcdQueries.d.ts.map +1 -0
- package/dist/chains/cosmos/staking/lcdQueries.js +80 -0
- package/dist/chains/cosmos/staking/lcdQueries.js.map +1 -0
- package/dist/chains/cosmos/terraClassicTax.d.ts +91 -0
- package/dist/chains/cosmos/terraClassicTax.d.ts.map +1 -0
- package/dist/chains/cosmos/terraClassicTax.js +191 -0
- package/dist/chains/cosmos/terraClassicTax.js.map +1 -0
- package/dist/chains/cosmos/thor/lp/pools.d.ts +1 -1
- package/dist/chains/cosmos/thor/lp/pools.d.ts.map +1 -1
- package/dist/chains/cosmos/thor/lp/pools.js +1 -1
- package/dist/chains/cosmos/thor/lp/pools.js.map +1 -1
- package/dist/chains/ton/messageBody/decode.d.ts +42 -0
- package/dist/chains/ton/messageBody/decode.d.ts.map +1 -0
- package/dist/chains/ton/messageBody/decode.js +337 -0
- package/dist/chains/ton/messageBody/decode.js.map +1 -0
- package/dist/chains/ton/messageBody/knownRouters.d.ts +19 -0
- package/dist/chains/ton/messageBody/knownRouters.d.ts.map +1 -0
- package/dist/chains/ton/messageBody/knownRouters.js +179 -0
- package/dist/chains/ton/messageBody/knownRouters.js.map +1 -0
- package/dist/chains/ton/messageBody/opcodes.d.ts +23 -0
- package/dist/chains/ton/messageBody/opcodes.d.ts.map +1 -0
- package/dist/chains/ton/messageBody/opcodes.js +22 -0
- package/dist/chains/ton/messageBody/opcodes.js.map +1 -0
- package/dist/chains/ton/messageBody/types.d.ts +50 -0
- package/dist/chains/ton/messageBody/types.d.ts.map +1 -0
- package/dist/chains/ton/messageBody/types.js +2 -0
- package/dist/chains/ton/messageBody/types.js.map +1 -0
- package/dist/coin/balance/resolvers/polkadot.d.ts.map +1 -1
- package/dist/coin/balance/resolvers/polkadot.js +72 -6
- package/dist/coin/balance/resolvers/polkadot.js.map +1 -1
- package/package.json +41 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
|
|
9
|
+
## 1.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`a3a331a`](https://github.com/vultisig/vultisig-sdk/commit/a3a331a875ebc6868b11c6901c8ed99dde51a4ff)]:
|
|
14
|
+
- @vultisig/lib-utils@0.10.0
|
|
15
|
+
|
|
3
16
|
## 1.4.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -9,6 +9,10 @@ export declare enum CosmosMsgType {
|
|
|
9
9
|
THORCHAIN_MSG_DEPOSIT_URL = "/types.MsgDeposit",
|
|
10
10
|
THORCHAIN_MSG_LEAVE_POOL = "thorchain/MsgLeavePool",
|
|
11
11
|
THORCHAIN_MSG_LEAVE_POOL_URL = "/thorchain.v1.MsgLeavePool",
|
|
12
|
-
THORCHAIN_MSG_SEND_URL = "/types.MsgSend"
|
|
12
|
+
THORCHAIN_MSG_SEND_URL = "/types.MsgSend",
|
|
13
|
+
MSG_DELEGATE_URL = "/cosmos.staking.v1beta1.MsgDelegate",
|
|
14
|
+
MSG_UNDELEGATE_URL = "/cosmos.staking.v1beta1.MsgUndelegate",
|
|
15
|
+
MSG_BEGIN_REDELEGATE_URL = "/cosmos.staking.v1beta1.MsgBeginRedelegate",
|
|
16
|
+
MSG_WITHDRAW_DELEGATOR_REWARD_URL = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"
|
|
13
17
|
}
|
|
14
18
|
//# sourceMappingURL=cosmosMsgTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosMsgTypes.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosMsgTypes.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,QAAQ,uBAAuB;IAC/B,kBAAkB,sBAAsB;IACxC,oBAAoB,4BAA4B;IAChD,wBAAwB,yCAAyC;IACjE,gBAAgB,8CAA8C;IAC9D,YAAY,iCAAiC;IAC7C,qBAAqB,yBAAyB;IAC9C,yBAAyB,sBAAsB;IAC/C,wBAAwB,2BAA2B;IACnD,4BAA4B,+BAA+B;IAC3D,sBAAsB,mBAAmB;
|
|
1
|
+
{"version":3,"file":"cosmosMsgTypes.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosMsgTypes.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,QAAQ,uBAAuB;IAC/B,kBAAkB,sBAAsB;IACxC,oBAAoB,4BAA4B;IAChD,wBAAwB,yCAAyC;IACjE,gBAAgB,8CAA8C;IAC9D,YAAY,iCAAiC;IAC7C,qBAAqB,yBAAyB;IAC9C,yBAAyB,sBAAsB;IAC/C,wBAAwB,2BAA2B;IACnD,4BAA4B,+BAA+B;IAC3D,sBAAsB,mBAAmB;IAEzC,gBAAgB,wCAAwC;IACxD,kBAAkB,0CAA0C;IAC5D,wBAAwB,+CAA+C;IACvE,iCAAiC,4DAA4D;CAC9F"}
|
|
@@ -11,5 +11,10 @@ export var CosmosMsgType;
|
|
|
11
11
|
CosmosMsgType["THORCHAIN_MSG_LEAVE_POOL"] = "thorchain/MsgLeavePool";
|
|
12
12
|
CosmosMsgType["THORCHAIN_MSG_LEAVE_POOL_URL"] = "/thorchain.v1.MsgLeavePool";
|
|
13
13
|
CosmosMsgType["THORCHAIN_MSG_SEND_URL"] = "/types.MsgSend";
|
|
14
|
+
// cosmos-sdk staking + distribution module (proto direct-sign)
|
|
15
|
+
CosmosMsgType["MSG_DELEGATE_URL"] = "/cosmos.staking.v1beta1.MsgDelegate";
|
|
16
|
+
CosmosMsgType["MSG_UNDELEGATE_URL"] = "/cosmos.staking.v1beta1.MsgUndelegate";
|
|
17
|
+
CosmosMsgType["MSG_BEGIN_REDELEGATE_URL"] = "/cosmos.staking.v1beta1.MsgBeginRedelegate";
|
|
18
|
+
CosmosMsgType["MSG_WITHDRAW_DELEGATOR_REWARD_URL"] = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
|
|
14
19
|
})(CosmosMsgType || (CosmosMsgType = {}));
|
|
15
20
|
//# sourceMappingURL=cosmosMsgTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosMsgTypes.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosMsgTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"cosmosMsgTypes.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosMsgTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAiBX;AAjBD,WAAY,aAAa;IACvB,gDAA+B,CAAA;IAC/B,yDAAwC,CAAA;IACxC,iEAAgD,CAAA;IAChD,kFAAiE,CAAA;IACjE,+EAA8D,CAAA;IAC9D,8DAA6C,CAAA;IAC7C,+DAA8C,CAAA;IAC9C,gEAA+C,CAAA;IAC/C,oEAAmD,CAAA;IACnD,4EAA2D,CAAA;IAC3D,0DAAyC,CAAA;IACzC,+DAA+D;IAC/D,yEAAwD,CAAA;IACxD,6EAA4D,CAAA;IAC5D,wFAAuE,CAAA;IACvE,8GAA6F,CAAA;AAC/F,CAAC,EAjBW,aAAa,KAAb,aAAa,QAiBxB"}
|
|
@@ -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;IACtB,MAAM,EAAE,CAAC;IACT,eAAe,EAAE,CAAC;CACV,CAAA;AAIV,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAc,EAAE;IACrD,IAAI,KAAK,GAAG,EAAE,IAAI,KAAK,GAAG,mBAAsB,EAAE,CAAC;QACjD,MAAM,IAAI,UAAU,CAAC,8CAA8C,CAAC,CAAA;IACtE,CAAC;IAED,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,CAAC,GAAG,KAAK,CAAA;IACb,OAAO,CAAC,GAAG,KAAK,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QACpC,CAAC,KAAK,EAAE,CAAA;IACV,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,M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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/
|
|
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,
|
|
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;QACrD,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,YAAY,cAAc,mBAAmB,KAAK,CAAC,MAAM,EAAE,CACnE,CAAA;IACH,CAAC;AACH,CA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sB,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"}
|
|
@@ -22,10 +22,12 @@ type ComputeClaimMessageHashInput = {
|
|
|
22
22
|
* Computes the final MessageHash for the QBTC claim.
|
|
23
23
|
*
|
|
24
24
|
* ```
|
|
25
|
-
* MessageHash = SHA256(
|
|
25
|
+
* MessageHash = SHA256("ecdsa-hash160:" + addressHash + qbtcAddressHash + chainIdHash + "qbtc-claim-v1")
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
|
-
*
|
|
28
|
+
* The domain-separation prefix must match `ClaimTagECDSAHash160` on the
|
|
29
|
+
* chain (`x/qbtc/zk/message.go`). Schnorr/Taproot claims will use a
|
|
30
|
+
* distinct tag once the chain defines one — see btcq-org/qbtc#148.
|
|
29
31
|
*/
|
|
30
32
|
export declare const computeClaimMessageHash: ({ addressHash, qbtcAddressHash, chainIdHash, circuit, }: ComputeClaimMessageHashInput) => Uint8Array;
|
|
31
33
|
type ComputeAllClaimHashesInput = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeClaimHashes.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/cosmos/qbtc/claim/computeClaimHashes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"computeClaimHashes.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/cosmos/qbtc/claim/computeClaimHashes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAgB1E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,gCAGhC;IACD,gBAAgB,EAAE,UAAU,CAAA;IAC5B,OAAO,EAAE,gBAAgB,CAAA;CAC1B,KAAG,UAcH,CAAA;AAED,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,KAAG,UACd,CAAA;AAE/C,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,UACE,CAAA;AAEvD,KAAK,4BAA4B,GAAG;IAClC,WAAW,EAAE,UAAU,CAAA;IACvB,eAAe,EAAE,UAAU,CAAA;IAC3B,WAAW,EAAE,UAAU,CAAA;IACvB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAAI,yDAKrC,4BAA4B,KAAG,UAyCjC,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,UAAU,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAA;IACvB,WAAW,EAAE,UAAU,CAAA;IACvB,eAAe,EAAE,UAAU,CAAA;IAC3B,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,yDAKnC,0BAA0B,KAAG,WAgB/B,CAAA"}
|
|
@@ -3,6 +3,13 @@ import { sha256 } from '@noble/hashes/sha256';
|
|
|
3
3
|
import { btcAddressTypeCircuit } from './BtcAddressType.js';
|
|
4
4
|
import { detectBtcAddressType } from './detectBtcAddressType.js';
|
|
5
5
|
const claimSuffix = 'qbtc-claim-v1';
|
|
6
|
+
/**
|
|
7
|
+
* Domain-separation prefix for the ECDSA + Hash160 claim circuit
|
|
8
|
+
* (`BTCPubKeyOwnershipCircuit` post btcq-org/qbtc#148). Covers P2PKH,
|
|
9
|
+
* P2WPKH, P2SH-P2WPKH, and P2WSH. Must match `ClaimTagECDSAHash160` on the
|
|
10
|
+
* chain side (`x/qbtc/zk/message.go`).
|
|
11
|
+
*/
|
|
12
|
+
const ecdsaHash160Tag = 'ecdsa-hash160:';
|
|
6
13
|
/** Hash160 = RIPEMD160(SHA256(data)), the standard Bitcoin hash. */
|
|
7
14
|
const hash160 = (data) => ripemd160(sha256(data));
|
|
8
15
|
/**
|
|
@@ -28,15 +35,19 @@ export const computeChainIdHash = (chainId) => sha256(new TextEncoder().encode(c
|
|
|
28
35
|
* Computes the final MessageHash for the QBTC claim.
|
|
29
36
|
*
|
|
30
37
|
* ```
|
|
31
|
-
* MessageHash = SHA256(
|
|
38
|
+
* MessageHash = SHA256("ecdsa-hash160:" + addressHash + qbtcAddressHash + chainIdHash + "qbtc-claim-v1")
|
|
32
39
|
* ```
|
|
33
40
|
*
|
|
34
|
-
*
|
|
41
|
+
* The domain-separation prefix must match `ClaimTagECDSAHash160` on the
|
|
42
|
+
* chain (`x/qbtc/zk/message.go`). Schnorr/Taproot claims will use a
|
|
43
|
+
* distinct tag once the chain defines one — see btcq-org/qbtc#148.
|
|
35
44
|
*/
|
|
36
45
|
export const computeClaimMessageHash = ({ addressHash, qbtcAddressHash, chainIdHash, circuit, }) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
if (circuit === 'schnorr') {
|
|
47
|
+
throw new Error('Schnorr / Taproot claim circuit is not yet supported on the QBTC chain');
|
|
48
|
+
}
|
|
49
|
+
if (addressHash.length !== 20) {
|
|
50
|
+
throw new Error('addressHash must be 20 bytes for ecdsa-hash160');
|
|
40
51
|
}
|
|
41
52
|
if (qbtcAddressHash.length !== 32) {
|
|
42
53
|
throw new Error('qbtcAddressHash must be 32 bytes');
|
|
@@ -45,7 +56,7 @@ export const computeClaimMessageHash = ({ addressHash, qbtcAddressHash, chainIdH
|
|
|
45
56
|
throw new Error('chainIdHash must be 8 bytes');
|
|
46
57
|
}
|
|
47
58
|
const encoder = new TextEncoder();
|
|
48
|
-
const prefix = encoder.encode(
|
|
59
|
+
const prefix = encoder.encode(ecdsaHash160Tag);
|
|
49
60
|
const suffix = encoder.encode(claimSuffix);
|
|
50
61
|
const message = new Uint8Array(prefix.length +
|
|
51
62
|
addressHash.length +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeClaimHashes.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/cosmos/qbtc/claim/computeClaimHashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,OAAO,EAAE,qBAAqB,EAAoB,MAAM,kBAAkB,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,WAAW,GAAG,eAAe,CAAA;AAEnC,oEAAoE;AACpE,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAc,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,gBAAgB,EAChB,OAAO,GAIR,EAAc,EAAE;IACf,IACE,gBAAgB,CAAC,MAAM,KAAK,EAAE;QAC9B,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EAC9D,CAAC;QACD,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAA;IACH,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,yDAAyD;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAc,EAAE,CACxE,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAA;AAE/C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAc,EAAE,CAChE,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AASvD
|
|
1
|
+
{"version":3,"file":"computeClaimHashes.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/cosmos/qbtc/claim/computeClaimHashes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,OAAO,EAAE,qBAAqB,EAAoB,MAAM,kBAAkB,CAAA;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D,MAAM,WAAW,GAAG,eAAe,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,eAAe,GAAG,gBAAgB,CAAA;AAExC,oEAAoE;AACpE,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAc,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,gBAAgB,EAChB,OAAO,GAIR,EAAc,EAAE;IACf,IACE,gBAAgB,CAAC,MAAM,KAAK,EAAE;QAC9B,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,gBAAgB,CAAC,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;IACrE,MAAM,eAAe,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAA;IAC3D,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE/C,MAAM,WAAW,GAAG,uBAAuB,CAAC;QAC1C,WAAW;QACX,eAAe;QACf,WAAW;QACX,OAAO;KACR,CAAC,CAAA;IAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,CAAA;AAC/D,CAAC,CAAA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
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
|
-
|
|
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
|
|
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
|
-
*
|
|
3
|
-
*
|
|
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
|
-
|
|
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
|
|
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,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LCD query helpers for the cosmos-sdk staking + distribution modules.
|
|
3
|
+
*
|
|
4
|
+
* Read-only HTTP fetches against the per-chain `cosmosRpcUrl` (which actually
|
|
5
|
+
* points at the LCD/REST endpoint, despite the dict name). All endpoints are
|
|
6
|
+
* unauthenticated, public, and rate-limited at most by the upstream provider.
|
|
7
|
+
*
|
|
8
|
+
* Generic across every cosmos-sdk chain we support — same paths, just
|
|
9
|
+
* different LCD root. No chain-specific branching.
|
|
10
|
+
*/
|
|
11
|
+
import { IbcEnabledCosmosChain } from '@vultisig/core-chain/Chain';
|
|
12
|
+
export type Coin = {
|
|
13
|
+
denom: string;
|
|
14
|
+
amount: string;
|
|
15
|
+
};
|
|
16
|
+
export type Delegation = {
|
|
17
|
+
/** valoper bech32, e.g. `cosmosvaloper1...` */
|
|
18
|
+
validatorAddress: string;
|
|
19
|
+
/** Current liquid balance currently delegated to this validator */
|
|
20
|
+
balance: Coin;
|
|
21
|
+
/** Raw shares (NOT 1:1 with balance after slashing). String to preserve precision. */
|
|
22
|
+
shares: string;
|
|
23
|
+
};
|
|
24
|
+
export type UnbondingEntry = {
|
|
25
|
+
/** Block height at which the unbonding was initiated */
|
|
26
|
+
creationHeight: string;
|
|
27
|
+
/** ISO-8601 string when this entry completes (becomes spendable) */
|
|
28
|
+
completionTime: string;
|
|
29
|
+
/** Amount in stake denom base units that will be returned */
|
|
30
|
+
initialBalance: string;
|
|
31
|
+
/** Amount remaining after any slashing during the unbonding window */
|
|
32
|
+
balance: string;
|
|
33
|
+
};
|
|
34
|
+
export type UnbondingDelegation = {
|
|
35
|
+
validatorAddress: string;
|
|
36
|
+
entries: UnbondingEntry[];
|
|
37
|
+
};
|
|
38
|
+
export type DelegatorReward = {
|
|
39
|
+
validatorAddress: string;
|
|
40
|
+
/** Per-denom reward (some chains have multi-asset rewards) */
|
|
41
|
+
reward: Coin[];
|
|
42
|
+
};
|
|
43
|
+
export type DelegatorRewardsResponse = {
|
|
44
|
+
rewards: DelegatorReward[];
|
|
45
|
+
total: Coin[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Discriminated by `@type` on the auth/accounts response. We only surface
|
|
49
|
+
* vesting variants the staking module cares about; non-vesting addresses
|
|
50
|
+
* return `null` from `getCosmosVestingAccount`.
|
|
51
|
+
*/
|
|
52
|
+
export type PeriodicVestingAccount = {
|
|
53
|
+
'@type': '/cosmos.vesting.v1beta1.PeriodicVestingAccount';
|
|
54
|
+
base_vesting_account: {
|
|
55
|
+
base_account: {
|
|
56
|
+
address: string;
|
|
57
|
+
account_number: string;
|
|
58
|
+
sequence: string;
|
|
59
|
+
pub_key?: {
|
|
60
|
+
'@type': string;
|
|
61
|
+
key: string;
|
|
62
|
+
} | null;
|
|
63
|
+
};
|
|
64
|
+
original_vesting: Coin[];
|
|
65
|
+
delegated_free: Coin[];
|
|
66
|
+
delegated_vesting: Coin[];
|
|
67
|
+
end_time: string;
|
|
68
|
+
};
|
|
69
|
+
start_time: string;
|
|
70
|
+
vesting_periods: Array<{
|
|
71
|
+
length: string;
|
|
72
|
+
amount: Coin[];
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
export type ContinuousVestingAccount = {
|
|
76
|
+
'@type': '/cosmos.vesting.v1beta1.ContinuousVestingAccount';
|
|
77
|
+
base_vesting_account: PeriodicVestingAccount['base_vesting_account'];
|
|
78
|
+
start_time: string;
|
|
79
|
+
};
|
|
80
|
+
export type DelayedVestingAccount = {
|
|
81
|
+
'@type': '/cosmos.vesting.v1beta1.DelayedVestingAccount';
|
|
82
|
+
base_vesting_account: PeriodicVestingAccount['base_vesting_account'];
|
|
83
|
+
};
|
|
84
|
+
export type VestingAccount = PeriodicVestingAccount | ContinuousVestingAccount | DelayedVestingAccount;
|
|
85
|
+
/**
|
|
86
|
+
* `cosmosRpcUrl` covers all CosmosChain entries (incl THORChain/MayaChain
|
|
87
|
+
* vault-based variants) but the cosmos-sdk staking module endpoints only
|
|
88
|
+
* make sense on `IbcEnabledCosmosChain`. Tighten the type at the boundary
|
|
89
|
+
* so callers can't accidentally hit `/cosmos/staking/...` against a
|
|
90
|
+
* THORChain LCD that doesn't serve it.
|
|
91
|
+
*/
|
|
92
|
+
type StakingChain = (typeof IbcEnabledCosmosChain)[keyof typeof IbcEnabledCosmosChain];
|
|
93
|
+
export declare const getDelegationsUrl: (chain: StakingChain, delegatorAddress: string) => string;
|
|
94
|
+
export declare const getUnbondingDelegationsUrl: (chain: StakingChain, delegatorAddress: string) => string;
|
|
95
|
+
export declare const getDelegatorRewardsUrl: (chain: StakingChain, delegatorAddress: string) => string;
|
|
96
|
+
export declare const getAuthAccountUrl: (chain: StakingChain, address: string) => string;
|
|
97
|
+
type FetchOpts = {
|
|
98
|
+
fetchImpl?: typeof fetch;
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
};
|
|
101
|
+
export declare function getCosmosDelegations(chain: StakingChain, delegatorAddress: string, opts?: FetchOpts): Promise<Delegation[]>;
|
|
102
|
+
export declare function getCosmosUnbondingDelegations(chain: StakingChain, delegatorAddress: string, opts?: FetchOpts): Promise<UnbondingDelegation[]>;
|
|
103
|
+
export declare function getCosmosDelegatorRewards(chain: StakingChain, delegatorAddress: string, opts?: FetchOpts): Promise<DelegatorRewardsResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the wrapped vesting account if the address is a vesting account,
|
|
106
|
+
* otherwise null. The auth endpoint always wraps in `BaseAccount` for
|
|
107
|
+
* non-vesting addresses, so we filter by `@type`.
|
|
108
|
+
*
|
|
109
|
+
* Used by callers that need to surface vesting state to the user (e.g.
|
|
110
|
+
* "X LUNA still locked, vesting until 2024-05-26"). NOT used by the staking
|
|
111
|
+
* msg builders — undelegate works on any delegated balance regardless of
|
|
112
|
+
* vesting state, the contract just controls when the unbonded coins become
|
|
113
|
+
* spendable post-21-day window.
|
|
114
|
+
*/
|
|
115
|
+
export declare function getCosmosVestingAccount(chain: StakingChain, address: string, opts?: FetchOpts): Promise<VestingAccount | null>;
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=lcdQueries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lcdQueries.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/staking/lcdQueries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAQlE,MAAM,MAAM,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD,MAAM,MAAM,UAAU,GAAG;IACvB,+CAA+C;IAC/C,gBAAgB,EAAE,MAAM,CAAA;IACxB,mEAAmE;IACnE,OAAO,EAAE,IAAI,CAAA;IACb,sFAAsF;IACtF,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAA;IACtB,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAA;IACtB,6DAA6D;IAC7D,cAAc,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,cAAc,EAAE,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,gBAAgB,EAAE,MAAM,CAAA;IACxB,8DAA8D;IAC9D,MAAM,EAAE,IA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