@babylonlabs-io/ts-sdk 0.48.4 → 0.49.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/dist/{PeginManager-NfDjKQGV.cjs → PeginManager-BvxfSwsr.cjs} +2 -2
- package/dist/{PeginManager-NfDjKQGV.cjs.map → PeginManager-BvxfSwsr.cjs.map} +1 -1
- package/dist/{PeginManager-CNhDl1eC.js → PeginManager-COxRVrxa.js} +2 -2
- package/dist/{PeginManager-CNhDl1eC.js.map → PeginManager-COxRVrxa.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +79 -78
- package/dist/{mempoolApi-BxT89SAq.js → mempoolApi-Dc1KSVNI.js} +61 -54
- package/dist/mempoolApi-Dc1KSVNI.js.map +1 -0
- package/dist/{mempoolApi-C_9JhjCI.cjs → mempoolApi-NMiYQAXI.cjs} +2 -2
- package/dist/mempoolApi-NMiYQAXI.cjs.map +1 -0
- package/dist/{primeVpAuth-Dzxxy0-F.js → primeVpAuth-BdrwraAe.js} +767 -381
- package/dist/primeVpAuth-BdrwraAe.js.map +1 -0
- package/dist/primeVpAuth-Brl_bnBH.cjs +2 -0
- package/dist/primeVpAuth-Brl_bnBH.cjs.map +1 -0
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +33 -32
- package/dist/tbv/core/clients/mempool/index.d.ts +2 -2
- package/dist/tbv/core/clients/mempool/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts +15 -1
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts.map +1 -1
- package/dist/tbv/core/clients/mempool/types.d.ts +20 -0
- package/dist/tbv/core/clients/mempool/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/cborDecode.test.d.ts +2 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/cborDecode.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/goldenVectors.d.ts +14 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/goldenVectors.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/mintTestCwt.d.ts +43 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/mintTestCwt.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/verifyDepositorCwt.test.d.ts +2 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/verifyDepositorCwt.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/cborDecode.d.ts +80 -0
- package/dist/tbv/core/clients/vault-provider/auth/cborDecode.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts +5 -0
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts +5 -0
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts +8 -0
- package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts +2 -0
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/verifyDepositorCwt.d.ts +80 -0
- package/dist/tbv/core/clients/vault-provider/auth/verifyDepositorCwt.d.ts.map +1 -0
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +76 -75
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +76 -75
- package/package.json +1 -1
- package/dist/mempoolApi-BxT89SAq.js.map +0 -1
- package/dist/mempoolApi-C_9JhjCI.cjs.map +0 -1
- package/dist/primeVpAuth-Dzxxy0-F.js.map +0 -1
- package/dist/primeVpAuth-wKbRw0m4.cjs +0 -2
- package/dist/primeVpAuth-wKbRw0m4.cjs.map +0 -1
|
@@ -53,6 +53,26 @@ export interface TxStatus {
|
|
|
53
53
|
block_hash?: string;
|
|
54
54
|
block_time?: number;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Spend status of a single transaction output, from the esplora-compatible
|
|
58
|
+
* `GET /tx/{txid}/outspend/{vout}` endpoint served by the mempool.space
|
|
59
|
+
* backend.
|
|
60
|
+
*
|
|
61
|
+
* Source: mempool/electrs `src/rest.rs` `SpendingValue` — an unspent output
|
|
62
|
+
* serializes as `{ "spent": false }` (the optional fields use
|
|
63
|
+
* `skip_serializing_if`); a spent output serializes as
|
|
64
|
+
* `{ "spent": true, "txid", "vin", "status" }`.
|
|
65
|
+
*/
|
|
66
|
+
export interface OutspendStatus {
|
|
67
|
+
/** True when the output has been spent (mempool or a block). */
|
|
68
|
+
spent: boolean;
|
|
69
|
+
/** Spending transaction id; present only when `spent`. */
|
|
70
|
+
txid?: string;
|
|
71
|
+
/** Input index within the spending tx; present only when `spent`. */
|
|
72
|
+
vin?: number;
|
|
73
|
+
/** Confirmation status of the spending tx; present only when `spent`. */
|
|
74
|
+
status?: TxStatus;
|
|
75
|
+
}
|
|
56
76
|
/**
|
|
57
77
|
* Full transaction info from mempool API.
|
|
58
78
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/mempool/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,EAAE,CAAC;IACf,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/mempool/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,EAAE,CAAC;IACf,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cborDecode.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/cborDecode.test.ts"],"names":[],"mappings":""}
|
|
@@ -41,4 +41,18 @@ export declare const GOLDEN_EXPIRES_AT = 1700000000;
|
|
|
41
41
|
export declare const GOLDEN_PAYLOAD_HEX = "83981b186218741863182d1861187518741868182e187318651872187618651872182d186918641865186e1874186918741879182e1876183198210218f018a118c7183e18c9186018611202187b1888161856181907187218b7187018f518b8181b18bf188618840d18bb18881877189d18e315188f1a6553f100";
|
|
42
42
|
/** 64-byte BIP-322 Schnorr signature for the above payload + signing key. */
|
|
43
43
|
export declare const GOLDEN_SIGNATURE_HEX = "89c7473a2b4128f7c015272d535c535d7508b8ca9d9a06e4863d7da4cea8feb99fc20f9cbbb49f67594a81fdd31406f9654e4964b9176e8d47259a0fbc322fdf";
|
|
44
|
+
/** Depositor x-only pubkey carried in the `aud` claim (seed 99). */
|
|
45
|
+
export declare const GOLDEN_CWT_AUDIENCE_XONLY = "4f401063cc0f559467937a3fad43929058922478886f70505e7d29569af2ab5e";
|
|
46
|
+
/** `iat`/`nbf` of every CWT golden token. */
|
|
47
|
+
export declare const GOLDEN_CWT_NBF = 1699996000;
|
|
48
|
+
/** `exp` of the normal-lifetime tokens. ≤ GOLDEN_EXPIRES_AT (server-identity expiry). */
|
|
49
|
+
export declare const GOLDEN_CWT_EXP = 1699999000;
|
|
50
|
+
/** `exp` of the short-lifetime token used to exercise refresh-on-skew. */
|
|
51
|
+
export declare const GOLDEN_CWT_SHORT_EXP = 1699996440;
|
|
52
|
+
/** JSON-RPC-subject token (`sub` = "vaultd-jsonrpc"), exp = GOLDEN_CWT_EXP. */
|
|
53
|
+
export declare const GOLDEN_CWT_TOKEN_JSONRPC = "0oREoQE4LqBYu6cBeEA0OTE2NGEwMmFjODFiNDJjYzRkY2RlN2E4MzExYmVjZjU2ODg2ODUwZjA2M2E4NmM2NmFmZWY1YzhhZTA3NzhjAm52YXVsdGQtanNvbnJwYwN4QDRmNDAxMDYzY2MwZjU1OTQ2NzkzN2EzZmFkNDM5MjkwNTg5MjI0Nzg4ODZmNzA1MDVlN2QyOTU2OWFmMmFiNWUEGmVT7RgFGmVT4WAGGmVT4WAHUKurq6urq6urq6urq6urq6tYQFYf_JPwc-IvtuwABdhlKk78PWG0KS2u30pRQ2U1CE4GHGrfmcLIrhZsoDifabPwgtcMLTuDEUHLGJM5dOC_Bi8";
|
|
54
|
+
/** Same issuance shape but short-lived (exp = GOLDEN_CWT_SHORT_EXP). */
|
|
55
|
+
export declare const GOLDEN_CWT_TOKEN_JSONRPC_SHORT = "0oREoQE4LqBYu6cBeEA0OTE2NGEwMmFjODFiNDJjYzRkY2RlN2E4MzExYmVjZjU2ODg2ODUwZjA2M2E4NmM2NmFmZWY1YzhhZTA3NzhjAm52YXVsdGQtanNvbnJwYwN4QDRmNDAxMDYzY2MwZjU1OTQ2NzkzN2EzZmFkNDM5MjkwNTg5MjI0Nzg4ODZmNzA1MDVlN2QyOTU2OWFmMmFiNWUEGmVT4xgFGmVT4WAGGmVT4WAHUM3Nzc3Nzc3Nzc3Nzc3Nzc1YQDayqqB4bTlHAaFOwyNcAMIEpiBW5GrgnkarO0yJ7bnkHjsmHlFcA9XDFupahH9wIQMGN8R6FVDax52MdYdg3Wc";
|
|
56
|
+
/** gRPC-subject token (`sub` = "vaultd-grpc"), exp = GOLDEN_CWT_EXP. */
|
|
57
|
+
export declare const GOLDEN_CWT_TOKEN_GRPC = "0oREoQE4LqBYuKcBeEA0OTE2NGEwMmFjODFiNDJjYzRkY2RlN2E4MzExYmVjZjU2ODg2ODUwZjA2M2E4NmM2NmFmZWY1YzhhZTA3NzhjAmt2YXVsdGQtZ3JwYwN4QDRmNDAxMDYzY2MwZjU1OTQ2NzkzN2EzZmFkNDM5MjkwNTg5MjI0Nzg4ODZmNzA1MDVlN2QyOTU2OWFmMmFiNWUEGmVT7RgFGmVT4WAGGmVT4WAHUO_v7-_v7-_v7-_v7-_v7-9YQJhF3CJH5sFKdi7jwGeqVxErk95edujMvMVF6JiU-Io6cbBBbcJtHWZPF_Cc3_SIlAO6s6Oi9N6u0XUOPQf5ZW8";
|
|
44
58
|
//# sourceMappingURL=goldenVectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goldenVectors.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/goldenVectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC,uEACuB,CAAC;AAEvE,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,qEAC+B,CAAC;AAErE,2BAA2B;AAC3B,eAAO,MAAM,iBAAiB,aAAgB,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,2PAC2N,CAAC;AAE3P,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,qIACmG,CAAC"}
|
|
1
|
+
{"version":3,"file":"goldenVectors.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/goldenVectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,kCAAkC,uEACuB,CAAC;AAEvE,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,qEAC+B,CAAC;AAErE,2BAA2B;AAC3B,eAAO,MAAM,iBAAiB,aAAgB,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,2PAC2N,CAAC;AAE3P,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,qIACmG,CAAC;AAwBrI,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,qEAC8B,CAAC;AAErE,6CAA6C;AAC7C,eAAO,MAAM,cAAc,aAAgB,CAAC;AAC5C,yFAAyF;AACzF,eAAO,MAAM,cAAc,aAAgB,CAAC;AAC5C,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,aAAgB,CAAC;AAElD,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,oWAC8T,CAAC;AAEpW,wEAAwE;AACxE,eAAO,MAAM,8BAA8B,oWACwT,CAAC;AAEpW,wEAAwE;AACxE,eAAO,MAAM,qBAAqB,gWAC6T,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only minter for ES256K COSE Sign1 CWT bearer tokens.
|
|
3
|
+
*
|
|
4
|
+
* The genuine golden vectors in {@link ./goldenVectors} are signed by the
|
|
5
|
+
* Rust issuer's key, so they can only exercise the *happy* path and the
|
|
6
|
+
* checks that run before signature verification. The claim-rejection
|
|
7
|
+
* paths (`invalid_claims` for a malformed `aud`, `iat > exp`, an empty
|
|
8
|
+
* `cti`, …) run only *after* the COSE signature verifies, so reaching
|
|
9
|
+
* them needs a token signed over deliberately-bad claims.
|
|
10
|
+
*
|
|
11
|
+
* This helper signs tokens with a test-controlled key and hands the
|
|
12
|
+
* matching ephemeral pubkey to the verifier, so any claim combination can
|
|
13
|
+
* be minted with a signature that genuinely verifies. It builds the same
|
|
14
|
+
* COSE_Sign1 byte layout the verifier reads — tag(18), 4-element array,
|
|
15
|
+
* protected-header byte string, empty unprotected map, payload byte
|
|
16
|
+
* string, and the 64-byte compact signature.
|
|
17
|
+
*
|
|
18
|
+
* @module tbv/core/clients/vault-provider/auth/__tests__/mintTestCwt
|
|
19
|
+
*/
|
|
20
|
+
/** Compressed ephemeral pubkey matching {@link TEST_PRIVATE_KEY}. */
|
|
21
|
+
export declare const MINT_EPHEMERAL_PUBKEY_COMPRESSED: string;
|
|
22
|
+
/** COSE algorithm id for ES256K (the value the verifier requires). */
|
|
23
|
+
export declare const ALG_ES256K = -47;
|
|
24
|
+
export interface MintCwtOptions {
|
|
25
|
+
alg?: number;
|
|
26
|
+
iss: string;
|
|
27
|
+
sub: string;
|
|
28
|
+
aud: string;
|
|
29
|
+
exp: number;
|
|
30
|
+
nbf: number;
|
|
31
|
+
iat: number;
|
|
32
|
+
/** `cti` bytes; defaults to a single non-zero byte. */
|
|
33
|
+
cti?: Uint8Array;
|
|
34
|
+
/**
|
|
35
|
+
* Override the signature length. The genuine signature is always
|
|
36
|
+
* computed; when set, it is truncated/padded to this length so the
|
|
37
|
+
* verifier's structural length check can be exercised.
|
|
38
|
+
*/
|
|
39
|
+
sigLenOverride?: number;
|
|
40
|
+
}
|
|
41
|
+
/** Build a base64url COSE Sign1 CWT signed with the test ephemeral key. */
|
|
42
|
+
export declare function mintTestCwt(opts: MintCwtOptions): string;
|
|
43
|
+
//# sourceMappingURL=mintTestCwt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintTestCwt.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/mintTestCwt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,qEAAqE;AACrE,eAAO,MAAM,gCAAgC,QAIzC,CAAC;AAEL,sEAAsE;AACtE,eAAO,MAAM,UAAU,MAAM,CAAC;AAwD9B,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAuDxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyDepositorCwt.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/verifyDepositorCwt.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal CBOR decoder — the read-side counterpart to {@link ./cbor}.
|
|
3
|
+
*
|
|
4
|
+
* Decodes only the subset needed to verify a vault-provider CWT bearer
|
|
5
|
+
* token (RFC 8392) wrapped in a COSE Sign1 envelope (RFC 8152): tagged
|
|
6
|
+
* values, definite-length arrays and maps, byte/text strings, and
|
|
7
|
+
* unsigned/negative integers. Indefinite-length items, floats, and
|
|
8
|
+
* big-number tags are intentionally rejected — the issuer
|
|
9
|
+
* (btc-vault's `coset`/`ciborium` stack) never emits them for this
|
|
10
|
+
* shape, so accepting them would only widen the parser's attack
|
|
11
|
+
* surface.
|
|
12
|
+
*
|
|
13
|
+
* The decoder is a cursor over a single buffer. {@link CborReader.pos}
|
|
14
|
+
* is public so callers can slice the exact encoded byte range of an
|
|
15
|
+
* item (head + content) — required to reconstruct the COSE
|
|
16
|
+
* `Sig_structure` byte-for-byte from the token's own protected-header
|
|
17
|
+
* and payload byte strings.
|
|
18
|
+
*
|
|
19
|
+
* @module tbv/core/clients/vault-provider/auth/cborDecode
|
|
20
|
+
*/
|
|
21
|
+
/** A decoded CBOR data item. Maps preserve key insertion order. */
|
|
22
|
+
export type CborValue = number | bigint | string | Uint8Array | boolean | null | CborValue[] | Map<CborValue, CborValue> | CborTagged;
|
|
23
|
+
/** A CBOR tagged value (major type 6). */
|
|
24
|
+
export interface CborTagged {
|
|
25
|
+
tag: number;
|
|
26
|
+
value: CborValue;
|
|
27
|
+
}
|
|
28
|
+
/** Parsed initial-byte header: major type plus its decoded argument. */
|
|
29
|
+
export interface CborHead {
|
|
30
|
+
major: number;
|
|
31
|
+
/** The header argument (length, value, tag number, …) as a number. */
|
|
32
|
+
arg: number;
|
|
33
|
+
}
|
|
34
|
+
export declare class CborDecodeError extends Error {
|
|
35
|
+
constructor(message: string);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Cursor-based reader over a CBOR buffer. Not reusable across buffers —
|
|
39
|
+
* construct one per decode.
|
|
40
|
+
*/
|
|
41
|
+
export declare class CborReader {
|
|
42
|
+
readonly buf: Uint8Array;
|
|
43
|
+
/** Current read offset. Public so callers can slice encoded sub-ranges. */
|
|
44
|
+
pos: number;
|
|
45
|
+
constructor(buf: Uint8Array);
|
|
46
|
+
private nextByte;
|
|
47
|
+
/**
|
|
48
|
+
* Read an initial byte and its argument. Rejects indefinite-length
|
|
49
|
+
* and reserved additional-info encodings. Arguments wider than
|
|
50
|
+
* {@link Number.MAX_SAFE_INTEGER} are rejected — none of the token's
|
|
51
|
+
* lengths, tags, or timestamps approach that bound.
|
|
52
|
+
*/
|
|
53
|
+
readHead(): CborHead;
|
|
54
|
+
/** Read `length` raw bytes as a sub-array view into the backing buffer. */
|
|
55
|
+
private readBytes;
|
|
56
|
+
/**
|
|
57
|
+
* Read a byte string (major type 2), returning its content bytes.
|
|
58
|
+
* Throws if the next item is not a byte string.
|
|
59
|
+
*/
|
|
60
|
+
readByteString(): Uint8Array;
|
|
61
|
+
/**
|
|
62
|
+
* Read the next complete data item as a decoded {@link CborValue}.
|
|
63
|
+
*
|
|
64
|
+
* `depth` tracks the current nesting level so a deeply-nested blob is
|
|
65
|
+
* rejected with a {@link CborDecodeError} rather than overflowing the
|
|
66
|
+
* native call stack (see {@link MAX_NESTING_DEPTH}).
|
|
67
|
+
*/
|
|
68
|
+
readValue(depth?: number): CborValue;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Decode a single CBOR item from `bytes`, rejecting any trailing bytes.
|
|
72
|
+
*
|
|
73
|
+
* Used to parse the COSE protected header and CWT claims set — both are
|
|
74
|
+
* exactly one top-level item, so a valid prefix followed by extra bytes
|
|
75
|
+
* is a malformed structure, not a benign tail. Strict consumption keeps
|
|
76
|
+
* the parser from silently accepting a token a stricter CWT/COSE
|
|
77
|
+
* consumer would interpret differently.
|
|
78
|
+
*/
|
|
79
|
+
export declare function decodeCbor(bytes: Uint8Array): CborValue;
|
|
80
|
+
//# sourceMappingURL=cborDecode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cborDecode.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/cborDecode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAmCH,mEAAmE;AACnE,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,GACzB,UAAU,CAAC;AAEf,0CAA0C;AAC1C,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,wEAAwE;AACxE,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,2EAA2E;IAC3E,GAAG,SAAK;gBAEI,GAAG,EAAE,UAAU;IAI3B,OAAO,CAAC,QAAQ;IAOhB;;;;;OAKG;IACH,QAAQ,IAAI,QAAQ;IA0BpB,2EAA2E;IAC3E,OAAO,CAAC,SAAS;IASjB;;;OAGG;IACH,cAAc,IAAI,UAAU;IAU5B;;;;;;OAMG;IACH,SAAS,CAAC,KAAK,SAAI,GAAG,SAAS;CAgDhC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAOvD"}
|
|
@@ -9,6 +9,11 @@ export interface AuthenticatedVpClientConfig {
|
|
|
9
9
|
authAnchorHex: string;
|
|
10
10
|
/** On-chain VP pubkey, branded so it can only come from the registry reader. */
|
|
11
11
|
pinnedServerPubkey: OnChainBtcPubkey;
|
|
12
|
+
/**
|
|
13
|
+
* Depositor BTC pubkey (x-only or compressed hex). Normalized to
|
|
14
|
+
* x-only and asserted against every issued token's CWT `aud` claim.
|
|
15
|
+
*/
|
|
16
|
+
depositorBtcPubkey: string;
|
|
12
17
|
/**
|
|
13
18
|
* Opt into gRPC-subject auth for the artifact stream. Defaults to
|
|
14
19
|
* `false` (JSON-RPC bearer). Only enable against a proxy running with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAuthenticatedVpClient.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"createAuthenticatedVpClient.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,EACnC,MAAM,QAAQ,CAAC;AAKhB,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,aAAa,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,wEAAwE;IACxE,OAAO,CAAC,EAAE,6BAA6B,CAAC;CACzC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,GAClC,sBAAsB,CAqBxB"}
|
|
@@ -4,6 +4,11 @@ export interface PrimeVpAuthInput {
|
|
|
4
4
|
peginTxid: string;
|
|
5
5
|
authAnchorHex: string;
|
|
6
6
|
pinnedServerPubkey: OnChainBtcPubkey;
|
|
7
|
+
/**
|
|
8
|
+
* Depositor BTC pubkey (x-only or compressed hex). Normalized to
|
|
9
|
+
* x-only and asserted against every issued token's CWT `aud` claim.
|
|
10
|
+
*/
|
|
11
|
+
depositorBtcPubkey: string;
|
|
7
12
|
/** Optional headers forwarded to the inner token client (e.g. gateway auth). */
|
|
8
13
|
headers?: Record<string, string>;
|
|
9
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primeVpAuth.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/primeVpAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"primeVpAuth.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/primeVpAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKxD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAWlE"}
|
|
@@ -20,6 +20,13 @@ export interface VpTokenProviderConfig {
|
|
|
20
20
|
authAnchorHex: string;
|
|
21
21
|
/** Pinned VP pubkey from the on-chain registry; branded so indexer mirrors can't substitute. */
|
|
22
22
|
pinnedServerPubkey: OnChainBtcPubkey;
|
|
23
|
+
/**
|
|
24
|
+
* Depositor x-only pubkey (32-byte hex). Asserted against every
|
|
25
|
+
* issued token's CWT `aud` claim so a token minted for a different
|
|
26
|
+
* depositor — or mis-issued by a buggy/compromised VP — is rejected
|
|
27
|
+
* before it can authenticate a mutation.
|
|
28
|
+
*/
|
|
29
|
+
expectedAudienceXOnlyPubkey: string;
|
|
23
30
|
/**
|
|
24
31
|
* Methods that need a JSON-RPC-subject bearer (minted via
|
|
25
32
|
* `auth_createDepositorToken`). Forwarded over plain HTTP JSON-RPC by
|
|
@@ -50,6 +57,7 @@ export declare class VpTokenProvider implements BearerTokenProvider {
|
|
|
50
57
|
private readonly peginTxid;
|
|
51
58
|
private readonly authAnchorHex;
|
|
52
59
|
private readonly pinnedServerPubkey;
|
|
60
|
+
private readonly expectedAudienceXOnlyPubkey;
|
|
53
61
|
private readonly authGatedMethods;
|
|
54
62
|
private readonly grpcGatedMethods;
|
|
55
63
|
private readonly refreshSkewSecs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/tokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK7E,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"tokenProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/tokenProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK7E,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,kBAAkB,CAAC;AAqB1B;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,eAAe,EAAE,sBAAsB,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,2FAA2F;IAC3F,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;;;OAKG;IACH,2BAA2B,EAAE,MAAM,CAAC;IACpC;;;;;OAKG;IACH,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC;;;;;OAKG;IACH,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAOD;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,mBAAmB;IAKzD,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAmB;IACtD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAS;IACrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IACvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsB;IACvD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IAEnC,kEAAkE;IAClE,OAAO,CAAC,aAAa,CAA4B;IACjD,OAAO,CAAC,eAAe,CAAqC;IAC5D,kEAAkE;IAClE,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,YAAY,CAAqC;gBAE7C,MAAM,EAAE,qBAAqB;IAYzC;;;;;;;;;;;;;;;;OAgBG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IActD;;;;;;;;;OASG;IACH,UAAU,IAAI,IAAI;YASJ,kBAAkB;IAYhC;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAItC,OAAO,CAAC,mBAAmB;CAyF5B"}
|
|
@@ -6,6 +6,8 @@ export interface VpTokenRegistryInput {
|
|
|
6
6
|
peginTxid: string;
|
|
7
7
|
authAnchorHex: string;
|
|
8
8
|
pinnedServerPubkey: OnChainBtcPubkey;
|
|
9
|
+
/** Depositor x-only pubkey (32-byte hex), asserted against each token's CWT `aud`. */
|
|
10
|
+
expectedAudienceXOnlyPubkey: string;
|
|
9
11
|
/**
|
|
10
12
|
* Opt into gRPC-subject auth for {@link GRPC_AUTH_GATED_METHODS}
|
|
11
13
|
* (currently the artifact stream). Defaults to `false`: those methods
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/tokenRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"tokenRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/tokenRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,sFAAsF;IACtF,2BAA2B,EAAE,MAAM,CAAC;IACpC;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAWD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAE5D;;;;;;;OAOG;IACH,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;IAkEzD,0DAA0D;IAC1D,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIpD;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIhC;;;;;OAKG;IACH,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAAC;IAC1D,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;IACrD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,qBAA6C,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verify a vault-provider CWT bearer token (RFC 8392) wrapped in a
|
|
3
|
+
* COSE Sign1 envelope (RFC 8152), signed with ES256K by the VP's
|
|
4
|
+
* ephemeral token-signing key.
|
|
5
|
+
*
|
|
6
|
+
* This is the TypeScript port of the btc-vault Rust client verifier
|
|
7
|
+
* (`crates/btc-auth/src/client.rs::validate_token_with_public_key_at_time`
|
|
8
|
+
* plus the response cross-checks from `verify_token_response_at_time`).
|
|
9
|
+
* The FE previously verified only the server-identity proof
|
|
10
|
+
* ({@link ./serverIdentity}) and treated the token itself as an opaque
|
|
11
|
+
* blob; this closes that gap by cryptographically verifying the token
|
|
12
|
+
* and binding its claims to the expected issuer, subject, and depositor.
|
|
13
|
+
*
|
|
14
|
+
* Trust chain: {@link ./serverIdentity} first proves the
|
|
15
|
+
* `ephemeral_pubkey` is attested by the on-chain-pinned server key.
|
|
16
|
+
* This function then verifies the token's COSE signature against that
|
|
17
|
+
* same ephemeral key, so a token that decodes and verifies here is one
|
|
18
|
+
* the pinned VP actually issued.
|
|
19
|
+
*
|
|
20
|
+
* The byte-level expectations (COSE tag, ES256K alg id, Sig_structure
|
|
21
|
+
* layout, CWT registered-claim keys) mirror the issuer's `coset` stack
|
|
22
|
+
* and are pinned by the golden-vector test against a real Rust-issued
|
|
23
|
+
* token.
|
|
24
|
+
*
|
|
25
|
+
* @module tbv/core/clients/vault-provider/auth/verifyDepositorCwt
|
|
26
|
+
*/
|
|
27
|
+
/** CWT `sub` value for JSON-RPC-subject tokens (`auth_createDepositorToken`). */
|
|
28
|
+
export declare const CWT_SUBJECT_JSONRPC = "vaultd-jsonrpc";
|
|
29
|
+
/** CWT `sub` value for gRPC-subject tokens (`auth_createDepositorTokenGrpc`). */
|
|
30
|
+
export declare const CWT_SUBJECT_GRPC = "vaultd-grpc";
|
|
31
|
+
export type CwtVerificationReason = "invalid_input" | "invalid_token_structure" | "unexpected_algorithm" | "signature_verification_failed" | "invalid_claims" | "issuer_mismatch" | "subject_mismatch" | "audience_mismatch" | "token_not_yet_valid" | "token_expired" | "expiry_mismatch" | "server_identity_expires_before_token";
|
|
32
|
+
export declare class CwtVerificationError extends Error {
|
|
33
|
+
readonly reason: CwtVerificationReason;
|
|
34
|
+
constructor(message: string, reason: CwtVerificationReason);
|
|
35
|
+
}
|
|
36
|
+
export interface VerifyDepositorCwtInput {
|
|
37
|
+
/** Base64url (no padding) COSE Sign1 token from `auth_createDepositorToken`. */
|
|
38
|
+
token: string;
|
|
39
|
+
/**
|
|
40
|
+
* VP ephemeral token-signing pubkey (33-byte compressed hex) from the
|
|
41
|
+
* bundled `server_identity` proof — MUST already be verified by
|
|
42
|
+
* {@link verifyServerIdentity} before being passed here.
|
|
43
|
+
*/
|
|
44
|
+
ephemeralPubkeyHex: string;
|
|
45
|
+
/** Pinned VP persistent x-only pubkey (on-chain). Asserted against the token `iss`. */
|
|
46
|
+
expectedIssuerXOnlyPubkey: string;
|
|
47
|
+
/** Expected `sub` — {@link CWT_SUBJECT_JSONRPC} or {@link CWT_SUBJECT_GRPC}. */
|
|
48
|
+
expectedSubject: string;
|
|
49
|
+
/** Depositor x-only pubkey. Asserted against the token `aud`. */
|
|
50
|
+
expectedAudienceXOnlyPubkey: string;
|
|
51
|
+
/** Outer wire `expires_at`. Must equal the token's `exp` exactly. */
|
|
52
|
+
responseExpiresAt: number;
|
|
53
|
+
/** `server_identity.expires_at`. Must be ≥ the token's `exp`. */
|
|
54
|
+
serverIdentityExpiresAt: number;
|
|
55
|
+
/** Current Unix time (seconds). Injected for testability. */
|
|
56
|
+
now: number;
|
|
57
|
+
}
|
|
58
|
+
export interface VerifiedCwtClaims {
|
|
59
|
+
issuer: string;
|
|
60
|
+
subject: string;
|
|
61
|
+
audience: string;
|
|
62
|
+
expiresAt: number;
|
|
63
|
+
notBefore: number;
|
|
64
|
+
issuedAt: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Verify a depositor CWT and return its claims, or throw
|
|
68
|
+
* {@link CwtVerificationError}.
|
|
69
|
+
*
|
|
70
|
+
* Steps (matching the Rust reference):
|
|
71
|
+
* 1. Decode the COSE Sign1 envelope and assert the protected header
|
|
72
|
+
* pins ES256K.
|
|
73
|
+
* 2. Verify the ECDSA signature over the reconstructed Sig_structure
|
|
74
|
+
* against the (already server-identity-verified) ephemeral key.
|
|
75
|
+
* 3. Decode the CWT claims and assert `iss`/`sub`/`aud` bindings,
|
|
76
|
+
* `nbf`/`exp` validity, `cti` presence, and the outer-vs-inner
|
|
77
|
+
* expiry cross-checks.
|
|
78
|
+
*/
|
|
79
|
+
export declare function verifyDepositorCwt(input: VerifyDepositorCwtInput): VerifiedCwtClaims;
|
|
80
|
+
//# sourceMappingURL=verifyDepositorCwt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyDepositorCwt.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/verifyDepositorCwt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAeH,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAmC9C,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,+BAA+B,GAC/B,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,eAAe,GACf,iBAAiB,GACjB,sCAAsC,CAAC;AAE3C,qBAAa,oBAAqB,SAAQ,KAAK;aAG3B,MAAM,EAAE,qBAAqB;gBAD7C,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,qBAAqB;CAKhD;AAED,MAAM,WAAW,uBAAuB;IACtC,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,yBAAyB,EAAE,MAAM,CAAC;IAClC,gFAAgF;IAChF,eAAe,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,2BAA2B,EAAE,MAAM,CAAC;IACpC,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,uBAAuB,EAAE,MAAM,CAAC;IAChC,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,iBAAiB,CAgKnB"}
|
package/dist/tbv/core/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../challengeAssert-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../../verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("../../peginInput-DH6X4ITS.cjs"),A=require("../../noPayout-lyIRiUyG.cjs"),r=require("../../bitcoin-CHfKAhcI.cjs"),R=require("../../signing-Bnsro0hE.cjs"),c=require("../../validation-u8W7Lp2x.cjs"),u=require("../../PeginManager-NfDjKQGV.cjs"),p=require("../../PayoutManager-BZVEyi10.cjs"),_=require("../../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../../BTCVaultRegistry.abi-JdeqLz4x.cjs"),P=require("../../errors-CGcNP0rV.cjs"),o=require("../../waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("../../fundPeginTransaction-DuMwnytD.cjs"),d=require("../../reservation-xTL2a9Q-.cjs"),a=require("../../mempoolApi-C_9JhjCI.cjs"),i=require("../../primeVpAuth-wKbRw0m4.cjs"),s=require("../../types-WA0LrDk1.cjs"),g=require("../../errors-Bu0H-dZD.cjs"),e=require("../../buildAndBroadcastRefund-BOtxUi05.cjs"),T=require("../../peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=n.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=n.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=n.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=n.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.createPayoutScript=n.createPayoutScript;exports.extractPayoutSignature=n.extractPayoutSignature;exports.buildPeginInputPsbt=S.buildPeginInputPsbt;exports.extractPeginInputSignature=S.extractPeginInputSignature;exports.finalizePeginInputPsbt=S.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=A.buildNoPayoutPsbt;exports.buildRefundPsbt=A.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.HEX_RE=c.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=c.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=c.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=c.TXID_RE;exports.PeginManager=u.PeginManager;exports.VAULT_APP_NAME=u.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=u.buildFundingOutpointsCommitment;exports.buildVaultContext=u.buildVaultContext;exports.computeWotsBlockPublicKeysHash=u.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=u.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=u.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=u.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=P.CONTRACT_ERRORS;exports.extractErrorData=P.extractErrorData;exports.getContractErrorMessage=P.getContractErrorMessage;exports.handleContractError=P.handleContractError;exports.isKnownContractError=P.isKnownContractError;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=t.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=d.UtxoNotAvailableError;exports.assertUtxosAvailable=d.assertUtxosAvailable;exports.extractInputsFromTransaction=d.extractInputsFromTransaction;exports.findOverlappingPendingVaults=d.findOverlappingPendingVaults;exports.validateUtxosAvailable=d.validateUtxosAvailable;exports.MEMPOOL_API_URLS=a.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=a.ViemVaultRegistryReader;exports.getAddressTxs=a.getAddressTxs;exports.getAddressUtxos=a.getAddressUtxos;exports.getMempoolApiUrl=a.getMempoolApiUrl;exports.getNetworkFees=a.getNetworkFees;exports.getTipHeight=a.getTipHeight;exports.getTxHex=a.getTxHex;exports.getTxInfo=a.getTxInfo;exports.getUtxoInfo=a.getUtxoInfo;exports.pushTx=a.pushTx;exports.validateOffchainParams=a.validateOffchainParams;exports.validatePegInConfiguration=a.validatePegInConfiguration;exports.validateTBVProtocolParams=a.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=g.isWotsMismatchError;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../challengeAssert-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("../../verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("../../peginInput-DH6X4ITS.cjs"),A=require("../../noPayout-lyIRiUyG.cjs"),r=require("../../bitcoin-CHfKAhcI.cjs"),R=require("../../signing-Bnsro0hE.cjs"),c=require("../../validation-u8W7Lp2x.cjs"),u=require("../../PeginManager-BvxfSwsr.cjs"),p=require("../../PayoutManager-BZVEyi10.cjs"),_=require("../../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../../BTCVaultRegistry.abi-JdeqLz4x.cjs"),P=require("../../errors-CGcNP0rV.cjs"),o=require("../../waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("../../fundPeginTransaction-DuMwnytD.cjs"),d=require("../../reservation-xTL2a9Q-.cjs"),i=require("../../mempoolApi-NMiYQAXI.cjs"),a=require("../../primeVpAuth-Brl_bnBH.cjs"),s=require("../../types-WA0LrDk1.cjs"),g=require("../../errors-Bu0H-dZD.cjs"),e=require("../../buildAndBroadcastRefund-BOtxUi05.cjs"),T=require("../../peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=n.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=n.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=n.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=n.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.createPayoutScript=n.createPayoutScript;exports.extractPayoutSignature=n.extractPayoutSignature;exports.buildPeginInputPsbt=S.buildPeginInputPsbt;exports.extractPeginInputSignature=S.extractPeginInputSignature;exports.finalizePeginInputPsbt=S.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=A.buildNoPayoutPsbt;exports.buildRefundPsbt=A.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.HEX_RE=c.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=c.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=c.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=c.TXID_RE;exports.PeginManager=u.PeginManager;exports.VAULT_APP_NAME=u.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=u.buildFundingOutpointsCommitment;exports.buildVaultContext=u.buildVaultContext;exports.computeWotsBlockPublicKeysHash=u.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=u.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=u.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=u.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=P.CONTRACT_ERRORS;exports.extractErrorData=P.extractErrorData;exports.getContractErrorMessage=P.getContractErrorMessage;exports.handleContractError=P.handleContractError;exports.isKnownContractError=P.isKnownContractError;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=t.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=d.UtxoNotAvailableError;exports.assertUtxosAvailable=d.assertUtxosAvailable;exports.extractInputsFromTransaction=d.extractInputsFromTransaction;exports.findOverlappingPendingVaults=d.findOverlappingPendingVaults;exports.validateUtxosAvailable=d.validateUtxosAvailable;exports.MEMPOOL_API_URLS=i.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=i.ViemVaultRegistryReader;exports.getAddressTxs=i.getAddressTxs;exports.getAddressUtxos=i.getAddressUtxos;exports.getMempoolApiUrl=i.getMempoolApiUrl;exports.getNetworkFees=i.getNetworkFees;exports.getOutspend=i.getOutspend;exports.getTipHeight=i.getTipHeight;exports.getTxHex=i.getTxHex;exports.getTxInfo=i.getTxInfo;exports.getUtxoInfo=i.getUtxoInfo;exports.pushTx=i.pushTx;exports.validateOffchainParams=i.validateOffchainParams;exports.validatePegInConfiguration=i.validatePegInConfiguration;exports.validateTBVProtocolParams=i.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ServerIdentityError=a.ServerIdentityError;exports.VaultProviderRpcClient=a.VaultProviderRpcClient;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.VpResponseValidationError=a.VpResponseValidationError;exports.VpTokenRegistry=a.VpTokenRegistry;exports.batchPollByProvider=a.batchPollByProvider;exports.createAuthenticatedVpClient=a.createAuthenticatedVpClient;exports.primeVpTokenRegistry=a.primeVpTokenRegistry;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=a.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=a.verifyServerIdentity;exports.vpTokenRegistry=a.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=g.isWotsMismatchError;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|