@qntx/ur 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index-DuVMkXeG.d.mts +236 -0
- package/dist/interop.d.mts +118 -0
- package/dist/interop.mjs +530 -0
- package/dist/registry-BGnkPqkV.mjs +1141 -0
- package/dist/registry.d.mts +2 -199
- package/dist/registry.mjs +2 -900
- package/package.json +13 -4
package/dist/registry.d.mts
CHANGED
|
@@ -1,201 +1,4 @@
|
|
|
1
1
|
import { C as parseUrType, S as isUrType, _ as UrError, b as UrLimit, v as UrErrorCode, x as UrType, y as UrErrorInfo } from "./index-HtwyWL4y.mjs";
|
|
2
2
|
import { a as codecUrTypes, c as fromUrWith, d as Ur, i as codecMap, l as toTagged, n as CodecValue, o as fromTagged, r as UrCodec, s as fromUr, t as CodecMap, u as toUr } from "./index-rxH9gNTp.mjs";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type Seed = {
|
|
6
|
-
readonly payload: Uint8Array;
|
|
7
|
-
readonly creationDate?: Date;
|
|
8
|
-
readonly name?: string;
|
|
9
|
-
readonly note?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const seedCodec: UrCodec<Seed>;
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/registry/psbt.d.ts
|
|
14
|
-
type Psbt = {
|
|
15
|
-
readonly bytes: Uint8Array;
|
|
16
|
-
};
|
|
17
|
-
export declare const psbtCodec: UrCodec<Psbt>;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/registry/keypath.d.ts
|
|
20
|
-
type PathComponent = {
|
|
21
|
-
readonly kind: "index";
|
|
22
|
-
readonly index: number;
|
|
23
|
-
readonly hardened: boolean;
|
|
24
|
-
} | {
|
|
25
|
-
readonly kind: "range";
|
|
26
|
-
readonly low: number;
|
|
27
|
-
readonly high: number;
|
|
28
|
-
readonly hardened: boolean;
|
|
29
|
-
} | {
|
|
30
|
-
readonly kind: "wildcard";
|
|
31
|
-
readonly hardened: boolean;
|
|
32
|
-
} | {
|
|
33
|
-
readonly kind: "pair";
|
|
34
|
-
readonly external: {
|
|
35
|
-
readonly index: number;
|
|
36
|
-
readonly hardened: boolean;
|
|
37
|
-
};
|
|
38
|
-
readonly internal: {
|
|
39
|
-
readonly index: number;
|
|
40
|
-
readonly hardened: boolean;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
type Keypath = {
|
|
44
|
-
readonly components: ReadonlyArray<PathComponent>;
|
|
45
|
-
readonly sourceFingerprint?: number;
|
|
46
|
-
readonly depth?: number;
|
|
47
|
-
};
|
|
48
|
-
export declare const keypathCodec: UrCodec<Keypath>;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/registry/coin-info.d.ts
|
|
51
|
-
export declare const CoinType: {
|
|
52
|
-
readonly btc: 0;
|
|
53
|
-
readonly eth: 0x3c;
|
|
54
|
-
};
|
|
55
|
-
export declare const Network: {
|
|
56
|
-
readonly mainnet: 0;
|
|
57
|
-
readonly btcTestnet: 1;
|
|
58
|
-
};
|
|
59
|
-
type CoinInfo = {
|
|
60
|
-
readonly type?: number;
|
|
61
|
-
readonly network?: number;
|
|
62
|
-
};
|
|
63
|
-
export declare const coinInfoCodec: UrCodec<CoinInfo>;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region src/registry/eckey.d.ts
|
|
66
|
-
type EcKey = {
|
|
67
|
-
readonly curve?: number;
|
|
68
|
-
readonly isPrivate?: boolean;
|
|
69
|
-
readonly data: Uint8Array;
|
|
70
|
-
};
|
|
71
|
-
export declare const ecKeyCodec: UrCodec<EcKey>;
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/registry/address.d.ts
|
|
74
|
-
declare const ADDRESS_TYPES: readonly ["p2pkh", "p2sh", "p2wpkh"];
|
|
75
|
-
type AddressType = (typeof ADDRESS_TYPES)[number];
|
|
76
|
-
type Address = {
|
|
77
|
-
readonly info?: CoinInfo;
|
|
78
|
-
readonly type?: AddressType;
|
|
79
|
-
readonly data: Uint8Array;
|
|
80
|
-
};
|
|
81
|
-
export declare const addressCodec: UrCodec<Address>;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/registry/hdkey.d.ts
|
|
84
|
-
type MasterHdKey = {
|
|
85
|
-
readonly kind: "master";
|
|
86
|
-
readonly keyData: Uint8Array;
|
|
87
|
-
readonly chainCode: Uint8Array;
|
|
88
|
-
};
|
|
89
|
-
type DerivedHdKey = {
|
|
90
|
-
readonly kind: "derived";
|
|
91
|
-
readonly isPrivate?: boolean;
|
|
92
|
-
readonly keyData: Uint8Array;
|
|
93
|
-
readonly chainCode?: Uint8Array;
|
|
94
|
-
readonly useInfo?: CoinInfo;
|
|
95
|
-
readonly origin?: Keypath;
|
|
96
|
-
readonly children?: Keypath;
|
|
97
|
-
readonly parentFingerprint?: number;
|
|
98
|
-
readonly name?: string;
|
|
99
|
-
readonly note?: string;
|
|
100
|
-
};
|
|
101
|
-
type HdKey = MasterHdKey | DerivedHdKey;
|
|
102
|
-
export declare const hdKeyCodec: UrCodec<HdKey>;
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/registry/script-expression.d.ts
|
|
105
|
-
type DescriptorKey = {
|
|
106
|
-
readonly kind: "hdkey";
|
|
107
|
-
readonly key: HdKey;
|
|
108
|
-
} | {
|
|
109
|
-
readonly kind: "eckey";
|
|
110
|
-
readonly key: EcKey;
|
|
111
|
-
} | {
|
|
112
|
-
readonly kind: "address";
|
|
113
|
-
readonly address: Address;
|
|
114
|
-
};
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/registry/output-descriptor.d.ts
|
|
117
|
-
type OutputDescriptor = {
|
|
118
|
-
readonly source: string;
|
|
119
|
-
readonly keys: ReadonlyArray<DescriptorKey>;
|
|
120
|
-
readonly name?: string;
|
|
121
|
-
readonly note?: string;
|
|
122
|
-
};
|
|
123
|
-
export declare const outputDescriptorCodec: UrCodec<OutputDescriptor>;
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/registry/account-descriptor.d.ts
|
|
126
|
-
type AccountDescriptor = {
|
|
127
|
-
readonly masterFingerprint: number;
|
|
128
|
-
readonly outputDescriptors: ReadonlyArray<OutputDescriptor>;
|
|
129
|
-
};
|
|
130
|
-
export declare const accountDescriptorCodec: UrCodec<AccountDescriptor>;
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/registry/sskr.d.ts
|
|
133
|
-
type SskrShare = {
|
|
134
|
-
readonly identifier: number;
|
|
135
|
-
readonly groupThreshold: number;
|
|
136
|
-
readonly groupCount: number;
|
|
137
|
-
readonly groupIndex: number;
|
|
138
|
-
readonly memberThreshold: number;
|
|
139
|
-
readonly memberIndex: number;
|
|
140
|
-
readonly shareValue: Uint8Array;
|
|
141
|
-
};
|
|
142
|
-
export declare const sskrCodec: UrCodec<SskrShare>;
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/registry/envelope.d.ts
|
|
145
|
-
/** Inclusive cap: depth 0..=64 accepted (65 frames). Predicate is `>`, not `>=`. */
|
|
146
|
-
export declare const ENVELOPE_MAX_DEPTH = 64;
|
|
147
|
-
export declare function assertEnvelopeContent(cbor: Cbor, depth?: number): void;
|
|
148
|
-
export declare const envelopeCodec: UrCodec<Cbor>;
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/registry/digest.d.ts
|
|
151
|
-
/** BCR-2021-002: SHA-256 of the raw seed payload, not the CBOR map. */
|
|
152
|
-
export declare function seedDigest(seed: Seed): Uint8Array<ArrayBuffer>;
|
|
153
|
-
/** BCR-2021-002: dCBOR of [keyData, chainCode | null, coinType, network]. */
|
|
154
|
-
export declare function hdKeyDigestSource(key: HdKey): Uint8Array<ArrayBuffer>;
|
|
155
|
-
export declare function hdKeyDigest(key: HdKey): Uint8Array<ArrayBuffer>;
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/registry/tags.d.ts
|
|
158
|
-
/**
|
|
159
|
-
* Codecs that exist in this version. The `crypto-*` entries are the deprecated v1 tags
|
|
160
|
-
* (BCR-2020-006): read-only, never written. `SCRIPT_TAGS` are the BCR-2020-010 script-expression
|
|
161
|
-
* tags embedded inside v1 crypto-output bodies.
|
|
162
|
-
*/
|
|
163
|
-
export declare const TAGS: Readonly<{
|
|
164
|
-
envelope: Tag;
|
|
165
|
-
seed: Tag;
|
|
166
|
-
hdkey: Tag;
|
|
167
|
-
keypath: Tag;
|
|
168
|
-
"coin-info": Tag;
|
|
169
|
-
eckey: Tag;
|
|
170
|
-
address: Tag;
|
|
171
|
-
"output-descriptor": Tag;
|
|
172
|
-
sskr: Tag;
|
|
173
|
-
psbt: Tag;
|
|
174
|
-
"account-descriptor": Tag;
|
|
175
|
-
"crypto-seed": Tag;
|
|
176
|
-
"crypto-hdkey": Tag;
|
|
177
|
-
"crypto-keypath": Tag;
|
|
178
|
-
"crypto-coin-info": Tag;
|
|
179
|
-
"crypto-eckey": Tag;
|
|
180
|
-
"crypto-address": Tag;
|
|
181
|
-
"crypto-output": Tag;
|
|
182
|
-
"crypto-sskr": Tag;
|
|
183
|
-
"crypto-psbt": Tag;
|
|
184
|
-
"crypto-account": Tag;
|
|
185
|
-
}>;
|
|
186
|
-
/** BCR-2020-010 script-expression tags by descriptor function name. */
|
|
187
|
-
export declare const SCRIPT_TAGS: Readonly<{
|
|
188
|
-
sh: Tag;
|
|
189
|
-
wsh: Tag;
|
|
190
|
-
pk: Tag;
|
|
191
|
-
pkh: Tag;
|
|
192
|
-
wpkh: Tag;
|
|
193
|
-
combo: Tag;
|
|
194
|
-
multi: Tag;
|
|
195
|
-
sortedmulti: Tag;
|
|
196
|
-
raw: Tag;
|
|
197
|
-
tr: Tag;
|
|
198
|
-
cosigner: Tag;
|
|
199
|
-
}>;
|
|
200
|
-
//#endregion
|
|
201
|
-
export { type AccountDescriptor, type Address, type AddressType, type CodecMap, type CodecValue, type CoinInfo, type DerivedHdKey, type DescriptorKey, type EcKey, type HdKey, type Keypath, type MasterHdKey, type OutputDescriptor, type PathComponent, type Psbt, type Seed, type SskrShare, Ur, type UrCodec, UrError, type UrErrorCode, type UrErrorInfo, type UrLimit, type UrType, codecMap, codecUrTypes, fromTagged, fromUr, fromUrWith, isUrType, parseUrType, toTagged, toUr };
|
|
3
|
+
import { A as MasterHdKey, B as cryptoKeypathCodec, C as Psbt, D as seedCodec, E as Seed, F as Network, I as coinInfoCodec, L as cryptoCoinInfoCodec, M as hdKeyCodec, N as CoinInfo, O as DerivedHdKey, P as CoinType, R as Keypath, S as ecKeyCodec, T as psbtCodec, V as keypathCodec, _ as DescriptorKey, a as seedDigest, b as addressCodec, c as envelopeCodec, d as AccountDescriptor, f as accountDescriptorCodec, g as outputDescriptorCodec, h as cryptoOutputCodec, i as hdKeyDigestSource, j as cryptoHdKeyCodec, k as HdKey, l as SskrShare, m as OutputDescriptor, n as TAGS, o as ENVELOPE_MAX_DEPTH, p as cryptoAccountCodec, r as hdKeyDigest, s as assertEnvelopeContent, t as SCRIPT_TAGS, u as sskrCodec, v as Address, w as cryptoPsbtCodec, x as EcKey, y as AddressType, z as PathComponent } from "./index-DuVMkXeG.mjs";
|
|
4
|
+
export { type AccountDescriptor, type Address, type AddressType, type CodecMap, type CodecValue, type CoinInfo, CoinType, type DerivedHdKey, type DescriptorKey, ENVELOPE_MAX_DEPTH, type EcKey, type HdKey, type Keypath, type MasterHdKey, Network, type OutputDescriptor, type PathComponent, type Psbt, SCRIPT_TAGS, type Seed, type SskrShare, TAGS, Ur, type UrCodec, UrError, type UrErrorCode, type UrErrorInfo, type UrLimit, type UrType, accountDescriptorCodec, addressCodec, assertEnvelopeContent, codecMap, codecUrTypes, coinInfoCodec, cryptoAccountCodec, cryptoCoinInfoCodec, cryptoHdKeyCodec, cryptoKeypathCodec, cryptoOutputCodec, cryptoPsbtCodec, ecKeyCodec, envelopeCodec, fromTagged, fromUr, fromUrWith, hdKeyCodec, hdKeyDigest, hdKeyDigestSource, isUrType, keypathCodec, outputDescriptorCodec, parseUrType, psbtCodec, seedCodec, seedDigest, sskrCodec, toTagged, toUr };
|