@babylonlabs-io/ts-sdk 0.32.0 → 0.33.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-DUR1BTKM.js → PeginManager-BMrWtTji.js} +136 -124
- package/dist/PeginManager-BMrWtTji.js.map +1 -0
- package/dist/PeginManager-DUMF84XK.cjs +2 -0
- package/dist/PeginManager-DUMF84XK.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-CIHhUmRv.cjs → buildAndBroadcastRefund-6pR681fI.cjs} +2 -2
- package/dist/buildAndBroadcastRefund-6pR681fI.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-DwrX_IBf.js → buildAndBroadcastRefund-Ba56IKL7.js} +38 -38
- package/dist/buildAndBroadcastRefund-Ba56IKL7.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +74 -70
- package/dist/tbv/core/clients/eth/index.d.ts +1 -1
- package/dist/tbv/core/clients/eth/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/types.d.ts +13 -0
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +8 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +30 -27
- package/dist/tbv/core/clients/vault-provider/api.d.ts +13 -2
- package/dist/tbv/core/clients/vault-provider/api.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/createAuthenticatedVpClient.test.d.ts +11 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/createAuthenticatedVpClient.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/tokenRegistry.test.d.ts +2 -0
- package/dist/tbv/core/clients/vault-provider/auth/__tests__/tokenRegistry.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts +16 -0
- package/dist/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts +10 -0
- package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/index.d.ts +5 -2
- package/dist/tbv/core/clients/vault-provider/auth/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/innerTokenClient.d.ts +4 -0
- package/dist/tbv/core/clients/vault-provider/auth/innerTokenClient.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts +11 -0
- package/dist/tbv/core/clients/vault-provider/auth/primeVpAuth.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts +18 -23
- 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 +48 -0
- package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts +8 -12
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts.map +1 -1
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +14 -0
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +65 -61
- package/dist/tbv/core/managers/index.d.ts +1 -1
- package/dist/tbv/core/services/deposit/__tests__/runDepositorPresignFlow.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/runDepositorPresignFlow.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/index.d.ts +2 -2
- package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/{signAndSubmitPayouts.d.ts → runDepositorPresignFlow.d.ts} +3 -3
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +11 -11
- package/dist/tbv/core/vault-secrets/__tests__/parseFundingOutpoints.test.d.ts +2 -0
- package/dist/tbv/core/vault-secrets/__tests__/parseFundingOutpoints.test.d.ts.map +1 -0
- package/dist/tbv/core/vault-secrets/index.d.ts +1 -0
- package/dist/tbv/core/vault-secrets/index.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/parseFundingOutpoints.d.ts +3 -0
- package/dist/tbv/core/vault-secrets/parseFundingOutpoints.d.ts.map +1 -0
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +65 -61
- package/dist/{types-jmEyzzhY.cjs → types-C2IUB0Jd.cjs} +2 -2
- package/dist/types-C2IUB0Jd.cjs.map +1 -0
- package/dist/{types-CnG3JsRs.js → types-D1o_3Q__.js} +20 -9
- package/dist/types-D1o_3Q__.js.map +1 -0
- package/dist/{vault-registry-reader-CG6bea1S.js → vault-registry-reader-BeIEh62N.js} +436 -292
- package/dist/vault-registry-reader-BeIEh62N.js.map +1 -0
- package/dist/vault-registry-reader-DdUgC5IF.cjs +2 -0
- package/dist/vault-registry-reader-DdUgC5IF.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/PeginManager-CTRPJo8m.cjs +0 -2
- package/dist/PeginManager-CTRPJo8m.cjs.map +0 -1
- package/dist/PeginManager-DUR1BTKM.js.map +0 -1
- package/dist/buildAndBroadcastRefund-CIHhUmRv.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-DwrX_IBf.js.map +0 -1
- package/dist/tbv/core/services/deposit/__tests__/signAndSubmitPayouts.test.d.ts +0 -2
- package/dist/tbv/core/services/deposit/__tests__/signAndSubmitPayouts.test.d.ts.map +0 -1
- package/dist/tbv/core/services/deposit/signAndSubmitPayouts.d.ts.map +0 -1
- package/dist/types-CnG3JsRs.js.map +0 -1
- package/dist/types-jmEyzzhY.cjs.map +0 -1
- package/dist/vault-registry-reader-BBS1_AON.cjs +0 -2
- package/dist/vault-registry-reader-BBS1_AON.cjs.map +0 -1
- package/dist/vault-registry-reader-CG6bea1S.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, Hex, PublicClient } from 'viem';
|
|
2
|
-
import { VaultBasicInfo, VaultData, VaultProtocolInfo, VaultRegistryReader } from './types';
|
|
2
|
+
import { OnChainBtcPubkey, VaultBasicInfo, VaultData, VaultProtocolInfo, VaultRegistryReader } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Concrete vault registry reader using viem.
|
|
5
5
|
*
|
|
@@ -13,6 +13,13 @@ export declare class ViemVaultRegistryReader implements VaultRegistryReader {
|
|
|
13
13
|
private publicClient;
|
|
14
14
|
private contractAddress;
|
|
15
15
|
constructor(publicClient: PublicClient, contractAddress: Address);
|
|
16
|
+
/**
|
|
17
|
+
* Read the VP's persistent x-only BTC pubkey from the on-chain
|
|
18
|
+
* registry. Validates length, hex form, and secp256k1 curve
|
|
19
|
+
* membership before minting the brand. Returns 64-char lowercase
|
|
20
|
+
* hex without the `0x` prefix.
|
|
21
|
+
*/
|
|
22
|
+
getVaultProviderBtcPubKey(vpAddress: Address): Promise<OnChainBtcPubkey>;
|
|
16
23
|
getVaultBasicInfo(vaultId: Hex): Promise<VaultBasicInfo>;
|
|
17
24
|
getVaultProtocolInfo(vaultId: Hex): Promise<VaultProtocolInfo>;
|
|
18
25
|
getVaultData(vaultId: Hex): Promise<VaultData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vault-registry-reader.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/eth/vault-registry-reader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"vault-registry-reader.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/eth/vault-registry-reader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIvD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,YAAW,mBAAmB;IAE/D,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,eAAe;gBADf,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,OAAO;IAGlC;;;;;OAKG;IACG,yBAAyB,CAC7B,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,gBAAgB,CAAC;IAsBtB,iBAAiB,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;IA2BxD,oBAAoB,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAmC9D,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC;CAiBrD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../vault-registry-reader-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../vault-registry-reader-DdUgC5IF.cjs"),r=require("../../../types-C2IUB0Jd.cjs");exports.MEMPOOL_API_URLS=e.MEMPOOL_API_URLS;exports.ServerIdentityError=e.ServerIdentityError;exports.VaultProviderRpcClient=e.VaultProviderRpcClient;exports.ViemProtocolParamsReader=e.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=e.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=e.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.VpResponseValidationError=e.VpResponseValidationError;exports.VpTokenRegistry=e.VpTokenRegistry;exports.createAuthenticatedVpClient=e.createAuthenticatedVpClient;exports.getAddressTxs=e.getAddressTxs;exports.getAddressUtxos=e.getAddressUtxos;exports.getMempoolApiUrl=e.getMempoolApiUrl;exports.getNetworkFees=e.getNetworkFees;exports.getTxHex=e.getTxHex;exports.getTxInfo=e.getTxInfo;exports.getUtxoInfo=e.getUtxoInfo;exports.primeVpTokenRegistry=e.primeVpTokenRegistry;exports.pushTx=e.pushTx;exports.resolveProtocolAddresses=e.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=e.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=e.verifyServerIdentity;exports.vpTokenRegistry=e.vpTokenRegistry;exports.DaemonStatus=r.DaemonStatus;exports.JSON_RPC_ERROR_CODES=r.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=r.JsonRpcClient;exports.JsonRpcError=r.JsonRpcError;exports.POST_WOTS_STATUSES=r.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=r.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=r.RpcErrorCode;exports.VP_TERMINAL_STATUSES=r.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=r.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { M as a, S as r, V as
|
|
2
|
-
import { D as
|
|
1
|
+
import { M as a, S as r, V as t, n as o, o as i, q as R, s as S, h as T, j as n, l as p, g as d, a as l, b as E, c as V, d as A, e as _, f as g, m as P, p as m, r as c, v, i as x, k as I } from "../../../vault-registry-reader-BeIEh62N.js";
|
|
2
|
+
import { D as U, b as C, J as f, a as u, d as y, P as N, R as k, c as D, V as M } from "../../../types-D1o_3Q__.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
U as DaemonStatus,
|
|
5
|
+
C as JSON_RPC_ERROR_CODES,
|
|
6
|
+
f as JsonRpcClient,
|
|
7
|
+
u as JsonRpcError,
|
|
8
8
|
a as MEMPOOL_API_URLS,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
y as POST_WOTS_STATUSES,
|
|
10
|
+
N as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
11
|
+
k as RpcErrorCode,
|
|
12
12
|
r as ServerIdentityError,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
D as VP_TERMINAL_STATUSES,
|
|
14
|
+
M as VP_TRANSIENT_STATUSES,
|
|
15
|
+
t as VaultProviderRpcClient,
|
|
16
|
+
o as ViemProtocolParamsReader,
|
|
17
|
+
i as ViemUniversalChallengerReader,
|
|
18
18
|
R as ViemVaultKeeperReader,
|
|
19
|
-
|
|
19
|
+
S as ViemVaultRegistryReader,
|
|
20
20
|
T as VpResponseValidationError,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
E as
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_ as
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
c as
|
|
21
|
+
n as VpTokenRegistry,
|
|
22
|
+
p as createAuthenticatedVpClient,
|
|
23
|
+
d as getAddressTxs,
|
|
24
|
+
l as getAddressUtxos,
|
|
25
|
+
E as getMempoolApiUrl,
|
|
26
|
+
V as getNetworkFees,
|
|
27
|
+
A as getTxHex,
|
|
28
|
+
_ as getTxInfo,
|
|
29
|
+
g as getUtxoInfo,
|
|
30
|
+
P as primeVpTokenRegistry,
|
|
31
|
+
m as pushTx,
|
|
32
|
+
c as resolveProtocolAddresses,
|
|
33
|
+
v as validateRequestDepositorClaimerArtifactsResponse,
|
|
34
|
+
x as verifyServerIdentity,
|
|
35
|
+
I as vpTokenRegistry
|
|
33
36
|
};
|
|
34
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PeginStatusReader, WotsKeySubmitter, PresignClient, ClaimerArtifactsReader } from '../../services/deposit/interfaces';
|
|
2
|
+
import { BearerTokenProvider } from './json-rpc-client';
|
|
2
3
|
import { GetPeginStatusParams, GetPeginStatusResponse, GetPegoutStatusParams, GetPegoutStatusResponse, RequestDepositorClaimerArtifactsParams, RequestDepositorClaimerArtifactsResponse, RequestDepositorPresignTransactionsParams, RequestDepositorPresignTransactionsResponse, SubmitDepositorPresignaturesParams, SubmitDepositorWotsKeyParams } from './types';
|
|
3
4
|
export interface VaultProviderRpcClientOptions {
|
|
4
5
|
/** Timeout in milliseconds per request (default: 60000) */
|
|
@@ -7,10 +8,20 @@ export interface VaultProviderRpcClientOptions {
|
|
|
7
8
|
retries?: number;
|
|
8
9
|
/** Initial retry delay in milliseconds (default: 1000) */
|
|
9
10
|
retryDelay?: number;
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Custom retry predicate. Default retries only the idempotent read
|
|
13
|
+
* methods: `getPeginStatus`, `getPegoutStatus`,
|
|
14
|
+
* `requestDepositorPresignTransactions`.
|
|
15
|
+
*/
|
|
11
16
|
retryableFor?: (method: string) => boolean;
|
|
12
|
-
/** Custom headers */
|
|
17
|
+
/** Custom headers. */
|
|
13
18
|
headers?: Record<string, string>;
|
|
19
|
+
/**
|
|
20
|
+
* Per-request bearer-token source. A non-null return attaches
|
|
21
|
+
* `Authorization: Bearer <token>`; `null` skips auth. Wire a
|
|
22
|
+
* {@link VpTokenProvider} for depositor-gated methods.
|
|
23
|
+
*/
|
|
24
|
+
tokenProvider?: BearerTokenProvider;
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
16
27
|
* Concrete VP RPC client implementing all service interfaces.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/vault-provider/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/vault-provider/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEpI,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,sCAAsC,EACtC,wCAAwC,EACxC,yCAAyC,EACzC,2CAA2C,EAC3C,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAQjB,MAAM,WAAW,6BAA6B;IAC5C,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAID;;;;;;;;GAQG;AACH,qBAAa,sBACX,YAAW,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,sBAAsB;IAErF,OAAO,CAAC,MAAM,CAAgB;gBAElB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,6BAA6B;IAapE;;;OAGG;IACG,mCAAmC,CACvC,MAAM,EAAE,yCAAyC,EACjD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,2CAA2C,CAAC;IASvD;;;OAGG;IACG,4BAA4B,CAChC,MAAM,EAAE,kCAAkC,EAC1C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;OAIG;IACG,sBAAsB,CAC1B,MAAM,EAAE,4BAA4B,EACpC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC;IAQhB;;;OAGG;IACG,gCAAgC,CACpC,MAAM,EAAE,sCAAsC,EAC9C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,wCAAwC,CAAC;IASpD,mEAAmE;IAC7D,cAAc,CAClB,MAAM,EAAE,oBAAoB,EAC5B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,sBAAsB,CAAC;IAUlC,oEAAoE;IAC9D,eAAe,CACnB,MAAM,EAAE,qBAAqB,EAC7B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,uBAAuB,CAAC;CASpC"}
|
package/dist/tbv/core/clients/vault-provider/auth/__tests__/createAuthenticatedVpClient.test.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wiring test for `createAuthenticatedVpClient`.
|
|
3
|
+
*
|
|
4
|
+
* 1. Constructs a `VaultProviderRpcClient` whose tokenProvider
|
|
5
|
+
* points at the registry-cached `VpTokenProvider` for the given
|
|
6
|
+
* `peginTxid`.
|
|
7
|
+
* 2. `AUTH_GATED_METHODS` matches the canonical protocol set so the
|
|
8
|
+
* provider doesn't hand out null for a method the server gates.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=createAuthenticatedVpClient.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAuthenticatedVpClient.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/createAuthenticatedVpClient.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenRegistry.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/tbv/core/clients/vault-provider/auth/__tests__/tokenRegistry.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnChainBtcPubkey } from '../../eth/types';
|
|
2
|
+
import { VaultProviderRpcClient, VaultProviderRpcClientOptions } from '../api';
|
|
3
|
+
export interface AuthenticatedVpClientConfig {
|
|
4
|
+
/** Base URL of the VP RPC endpoint (already proxied if applicable). */
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/** Per-vault depositor-signed PegIn tx id (registry cache key). */
|
|
7
|
+
peginTxid: string;
|
|
8
|
+
/** Already-derived 32-byte auth-anchor preimage (64-char hex, no `0x`). */
|
|
9
|
+
authAnchorHex: string;
|
|
10
|
+
/** On-chain VP pubkey, branded so it can only come from the registry reader. */
|
|
11
|
+
pinnedServerPubkey: OnChainBtcPubkey;
|
|
12
|
+
/** Optional outer-client tunables (timeout, retries, headers, etc.). */
|
|
13
|
+
options?: VaultProviderRpcClientOptions;
|
|
14
|
+
}
|
|
15
|
+
export declare function createAuthenticatedVpClient(config: AuthenticatedVpClientConfig): VaultProviderRpcClient;
|
|
16
|
+
//# sourceMappingURL=createAuthenticatedVpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAuthenticatedVpClient.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/createAuthenticatedVpClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,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,wEAAwE;IACxE,OAAO,CAAC,EAAE,6BAA6B,CAAC;CACzC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,2BAA2B,GAClC,sBAAsB,CAiBxB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VP RPC methods that require `Authorization: Bearer <token>`.
|
|
3
|
+
* Protocol invariant — must be kept in sync with the VP server.
|
|
4
|
+
*
|
|
5
|
+
* @stability frozen
|
|
6
|
+
*
|
|
7
|
+
* @module tbv/core/clients/vault-provider/auth/gatedMethods
|
|
8
|
+
*/
|
|
9
|
+
export declare const AUTH_GATED_METHODS: ReadonlySet<string>;
|
|
10
|
+
//# sourceMappingURL=gatedMethods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gatedMethods.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/gatedMethods.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAIjD,CAAC"}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { ServerIdentityError, verifyServerIdentity } from './serverIdentity';
|
|
7
7
|
export type { ServerIdentityResponse, VerifyServerIdentityInput, } from './serverIdentity';
|
|
8
|
-
export {
|
|
9
|
-
export
|
|
8
|
+
export { VpTokenRegistry, vpTokenRegistry, type VpTokenRegistryInput, } from './tokenRegistry';
|
|
9
|
+
export { createAuthenticatedVpClient } from './createAuthenticatedVpClient';
|
|
10
|
+
export type { AuthenticatedVpClientConfig } from './createAuthenticatedVpClient';
|
|
11
|
+
export { primeVpTokenRegistry } from './primeVpAuth';
|
|
12
|
+
export type { PrimeVpAuthInput } from './primeVpAuth';
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JsonRpcClient } from '../json-rpc-client';
|
|
2
|
+
export declare const TOKEN_ISSUE_METHOD = "auth_createDepositorToken";
|
|
3
|
+
export declare function buildInnerTokenClient(baseUrl: string, headers?: Record<string, string>): JsonRpcClient;
|
|
4
|
+
//# sourceMappingURL=innerTokenClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"innerTokenClient.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/innerTokenClient.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B,aAAa,CAOf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnChainBtcPubkey } from '../../eth/types';
|
|
2
|
+
export interface PrimeVpAuthInput {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
peginTxid: string;
|
|
5
|
+
authAnchorHex: string;
|
|
6
|
+
pinnedServerPubkey: OnChainBtcPubkey;
|
|
7
|
+
/** Optional headers forwarded to the inner token client (e.g. gateway auth). */
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export declare function primeVpTokenRegistry(input: PrimeVpAuthInput): void;
|
|
11
|
+
//# sourceMappingURL=primeVpAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primeVpAuth.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/clients/vault-provider/auth/primeVpAuth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,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,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAOlE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OnChainBtcPubkey } from '../../eth/types';
|
|
1
2
|
import { BearerTokenProvider, JsonRpcClient } from '../json-rpc-client';
|
|
2
3
|
import { ServerIdentityResponse } from './serverIdentity';
|
|
3
4
|
/**
|
|
@@ -12,33 +13,18 @@ export interface CreateDepositorTokenResponse {
|
|
|
12
13
|
server_identity: ServerIdentityResponse;
|
|
13
14
|
}
|
|
14
15
|
export interface VpTokenProviderConfig {
|
|
15
|
-
/** VP JSON-RPC client to use for `auth_createDepositorToken` calls. */
|
|
16
16
|
client: JsonRpcClient;
|
|
17
|
-
/**
|
|
17
|
+
/** Per-vault depositor-signed PegIn tx id. NOT shared across sibling vaults in a batch. */
|
|
18
18
|
peginTxid: string;
|
|
19
|
-
/**
|
|
20
|
-
* 64-char lowercase hex encoding of the 32-byte `auth_anchor`
|
|
21
|
-
* preimage committed in the Pre-PegIn OP_RETURN. Presenting this
|
|
22
|
-
* preimage is what lets the VP issue the token (the "fast path").
|
|
23
|
-
*/
|
|
19
|
+
/** 64-char hex of the 32-byte OP_RETURN auth-anchor preimage. */
|
|
24
20
|
authAnchorHex: string;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* on-chain `VaultProvider.btcPubKey` via the vault-registry reader.
|
|
29
|
-
*/
|
|
30
|
-
pinnedServerPubkey: string;
|
|
31
|
-
/**
|
|
32
|
-
* Set of method names that require authentication. `getToken()`
|
|
33
|
-
* returns `null` for any method not in this set.
|
|
34
|
-
*/
|
|
21
|
+
/** Pinned VP pubkey from the on-chain registry; branded so indexer mirrors can't substitute. */
|
|
22
|
+
pinnedServerPubkey: OnChainBtcPubkey;
|
|
23
|
+
/** Methods that require a bearer; `getToken` returns `null` for anything outside this set. */
|
|
35
24
|
authGatedMethods: ReadonlySet<string>;
|
|
36
|
-
/**
|
|
37
|
-
* Seconds before `expires_at` to treat a cached token as expired.
|
|
38
|
-
* Default: {@link DEFAULT_REFRESH_SKEW_SECS}.
|
|
39
|
-
*/
|
|
25
|
+
/** Default {@link DEFAULT_REFRESH_SKEW_SECS}. */
|
|
40
26
|
refreshSkewSecs?: number;
|
|
41
|
-
/** Clock source
|
|
27
|
+
/** Clock source for testability. */
|
|
42
28
|
now?: () => number;
|
|
43
29
|
}
|
|
44
30
|
/**
|
|
@@ -48,7 +34,7 @@ export interface VpTokenProviderConfig {
|
|
|
48
34
|
* `JsonRpcClient` as `tokenProvider`.
|
|
49
35
|
*/
|
|
50
36
|
export declare class VpTokenProvider implements BearerTokenProvider {
|
|
51
|
-
private
|
|
37
|
+
private client;
|
|
52
38
|
private readonly peginTxid;
|
|
53
39
|
private readonly authAnchorHex;
|
|
54
40
|
private readonly pinnedServerPubkey;
|
|
@@ -76,6 +62,15 @@ export declare class VpTokenProvider implements BearerTokenProvider {
|
|
|
76
62
|
* Called by `JsonRpcClient` on wire `auth_expired` responses.
|
|
77
63
|
*/
|
|
78
64
|
invalidate(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Swap in a different transport for subsequent token-issuing calls.
|
|
67
|
+
* Used by the registry when a later caller registers the same
|
|
68
|
+
* `peginTxid` against a different `baseUrl` — the cached token
|
|
69
|
+
* (bound to identity, not transport) stays valid, but future
|
|
70
|
+
* refreshes hit the new URL. An in-flight acquire keeps using the
|
|
71
|
+
* old client (it captured the reference); next call uses the new.
|
|
72
|
+
*/
|
|
73
|
+
setClient(client: JsonRpcClient): void;
|
|
79
74
|
private acquireSingleFlight;
|
|
80
75
|
}
|
|
81
76
|
//# sourceMappingURL=tokenProvider.d.ts.map
|
|
@@ -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,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,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;AAE7E,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,kBAAkB,CAAC;AAgB1B;;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,8FAA8F;IAC9F,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,gBAAgB,CAAsB;IACvD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IAEnC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,QAAQ,CAAqC;gBAEzC,MAAM,EAAE,qBAAqB;IAUzC;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAatD;;;OAGG;IACH,UAAU,IAAI,IAAI;IAQlB;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAItC,OAAO,CAAC,mBAAmB;CAqD5B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { OnChainBtcPubkey } from '../../eth/types';
|
|
2
|
+
import { JsonRpcClient } from '../json-rpc-client';
|
|
3
|
+
import { VpTokenProvider } from './tokenProvider';
|
|
4
|
+
export interface VpTokenRegistryInput {
|
|
5
|
+
client: JsonRpcClient;
|
|
6
|
+
peginTxid: string;
|
|
7
|
+
authAnchorHex: string;
|
|
8
|
+
pinnedServerPubkey: OnChainBtcPubkey;
|
|
9
|
+
}
|
|
10
|
+
export declare class VpTokenRegistry {
|
|
11
|
+
private readonly entries;
|
|
12
|
+
/**
|
|
13
|
+
* Return the cached `VpTokenProvider` for `peginTxid` if one exists
|
|
14
|
+
* with matching `authAnchorHex` and `pinnedServerPubkey`, otherwise
|
|
15
|
+
* construct and cache a fresh provider. A mismatch on either field
|
|
16
|
+
* throws — silent overwrite would mask derivation drift or VP
|
|
17
|
+
* pubkey rotation.
|
|
18
|
+
*/
|
|
19
|
+
getOrCreate(input: VpTokenRegistryInput): VpTokenProvider;
|
|
20
|
+
/** Return the cached provider, or `undefined` if none. */
|
|
21
|
+
peek(peginTxid: string): VpTokenProvider | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Evict the entry for `peginTxid`. Idempotent. Called on terminal
|
|
24
|
+
* paths — activation success, user-cancel, or component unmount —
|
|
25
|
+
* so `authAnchorHex` doesn't outlive the deposit session.
|
|
26
|
+
*/
|
|
27
|
+
release(peginTxid: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Wipe every cached entry. Test-only escape hatch — not exposed on
|
|
30
|
+
* the public {@link VpTokenRegistryPublic} singleton type.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
clear(): void;
|
|
35
|
+
get size(): number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Public surface of the singleton — excludes the test-only `clear`
|
|
39
|
+
* method.
|
|
40
|
+
*/
|
|
41
|
+
export interface VpTokenRegistryPublic {
|
|
42
|
+
getOrCreate(input: VpTokenRegistryInput): VpTokenProvider;
|
|
43
|
+
peek(peginTxid: string): VpTokenProvider | undefined;
|
|
44
|
+
release(peginTxid: string): void;
|
|
45
|
+
readonly size: number;
|
|
46
|
+
}
|
|
47
|
+
export declare const vpTokenRegistry: VpTokenRegistryPublic;
|
|
48
|
+
//# sourceMappingURL=tokenRegistry.d.ts.map
|
|
@@ -0,0 +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;CACtC;AAQD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAE5D;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;IAmCzD,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"}
|
|
@@ -58,21 +58,17 @@ export interface JsonRpcClientConfig {
|
|
|
58
58
|
/** Initial retry delay in milliseconds (default: 1000) */
|
|
59
59
|
retryDelay?: number;
|
|
60
60
|
/**
|
|
61
|
-
* Predicate
|
|
62
|
-
* Default
|
|
63
|
-
* Write
|
|
61
|
+
* Predicate that decides which methods retry on transient errors.
|
|
62
|
+
* Default retries only `getPeginStatus`, `getPegoutStatus`, and
|
|
63
|
+
* `requestDepositorPresignTransactions`. Write methods are not
|
|
64
|
+
* retried by default.
|
|
64
65
|
*/
|
|
65
66
|
retryableFor?: (method: string) => boolean;
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
-
* `Authorization: Bearer <token
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* `call` also performs a one-shot reactive refresh when a wire-origin
|
|
72
|
-
* JSON-RPC error carries `error.data.kind === "auth_expired"` —
|
|
73
|
-
* it calls `invalidate()`, fetches a fresh token, and retries the
|
|
74
|
-
* request once. `callRaw` does NOT perform reactive refresh (its
|
|
75
|
-
* body may be unbounded; we don't parse it).
|
|
68
|
+
* Per-request bearer-token source. A non-null return attaches
|
|
69
|
+
* `Authorization: Bearer <token>`; `null` skips auth. `call`
|
|
70
|
+
* additionally retries once on wire `auth_expired` (invalidate +
|
|
71
|
+
* refetch + retry). `callRaw` skips reactive refresh.
|
|
76
72
|
*/
|
|
77
73
|
tokenProvider?: BearerTokenProvider;
|
|
78
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-rpc-client.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/vault-provider/json-rpc-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;IACV,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC,GAAG,OAAO;IACjD,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,CAAC,CAAC;IACV,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IACnC,sBAAsB,CAAC,CAAC,CAAC,GACzB,oBAAoB,CAAC;AAEzB;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjD;;;OAGG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB
|
|
1
|
+
{"version":3,"file":"json-rpc-client.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/vault-provider/json-rpc-client.ts"],"names":[],"mappings":"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"}
|
|
@@ -205,6 +205,20 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
205
205
|
readonly internalType: "uint256";
|
|
206
206
|
}];
|
|
207
207
|
readonly stateMutability: "view";
|
|
208
|
+
}, {
|
|
209
|
+
readonly type: "function";
|
|
210
|
+
readonly name: "getVaultProviderBTCKey";
|
|
211
|
+
readonly inputs: readonly [{
|
|
212
|
+
readonly name: "vpAddr";
|
|
213
|
+
readonly type: "address";
|
|
214
|
+
readonly internalType: "address";
|
|
215
|
+
}];
|
|
216
|
+
readonly outputs: readonly [{
|
|
217
|
+
readonly name: "";
|
|
218
|
+
readonly type: "bytes32";
|
|
219
|
+
readonly internalType: "bytes32";
|
|
220
|
+
}];
|
|
221
|
+
readonly stateMutability: "view";
|
|
208
222
|
}, {
|
|
209
223
|
readonly type: "function";
|
|
210
224
|
readonly name: "getBtcVaultBasicInfo";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BTCVaultRegistry.abi.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"BTCVaultRegistry.abi.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6ZtB,CAAC"}
|
package/dist/tbv/core/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../challengeAssert-DuhkzZG-.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../../noPayout-CDhbGn_B.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../challengeAssert-DuhkzZG-.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../../noPayout-CDhbGn_B.cjs"),i=require("../../bitcoin-EYBKDtEW.cjs"),l=require("../../signing-DHSXjhLM.cjs"),d=require("../../validation-u8W7Lp2x.cjs"),t=require("../../buildAndBroadcastRefund-6pR681fI.cjs"),a=require("../../fundPeginTransaction-DaWoYCgO.cjs"),o=require("../../psbtInputFields-BLi7Ta-T.cjs"),r=require("../../PeginManager-DUMF84XK.cjs"),e=require("../../vault-registry-reader-DdUgC5IF.cjs"),s=require("../../types-C2IUB0Jd.cjs");exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=n.buildDepositorPayoutPsbt;exports.buildPeginInputPsbt=n.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.computeNumLocalChallengers=n.computeNumLocalChallengers;exports.extractPeginInputSignature=n.extractPeginInputSignature;exports.finalizePeginInputPsbt=n.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>P.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>P.deriveVaultId});exports.assertPayoutOutputMatchesRegistered=u.assertPayoutOutputMatchesRegistered;exports.buildNoPayoutPsbt=u.buildNoPayoutPsbt;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildRefundPsbt=u.buildRefundPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.deriveNativeSegwitAddress=i.deriveNativeSegwitAddress;exports.deriveTaprootAddress=i.deriveTaprootAddress;exports.ensureHexPrefix=i.ensureHexPrefix;exports.formatSatoshisToBtc=i.formatSatoshisToBtc;exports.getNetwork=i.getNetwork;exports.hexToUint8Array=i.hexToUint8Array;exports.isAddressFromPublicKey=i.isAddressFromPublicKey;exports.isValidHex=i.isValidHex;exports.processPublicKeyToXOnly=i.processPublicKeyToXOnly;exports.stripHexPrefix=i.stripHexPrefix;exports.toXOnly=i.toXOnly;exports.uint8ArrayToHex=i.uint8ArrayToHex;exports.validateWalletPubkey=i.validateWalletPubkey;exports.ContractStatus=l.ContractStatus;exports.PeginAction=l.PeginAction;exports.canPerformAction=l.canPerformAction;exports.createTaprootScriptPathSignOptions=l.createTaprootScriptPathSignOptions;exports.getPeginProtocolState=l.getPeginProtocolState;exports.BITCOIN_ADDRESS_RE=d.BITCOIN_ADDRESS_RE;exports.HEX_RE=d.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=d.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=d.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=d.TXID_RE;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.PayoutManager=t.PayoutManager;exports.REFUND_VSIZE=t.REFUND_VSIZE;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.computeHashlock=t.computeHashlock;exports.estimateRefundFeeSats=t.estimateRefundFeeSats;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.runDepositorPresignFlow=t.runDepositorPresignFlow;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateSecretAgainstHashlock=t.validateSecretAgainstHashlock;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.waitForPeginStatus=t.waitForPeginStatus;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=a.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.BitcoinScriptType=o.BitcoinScriptType;exports.UtxoNotAvailableError=o.UtxoNotAvailableError;exports.assertUtxosAvailable=o.assertUtxosAvailable;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.collectReservedUtxoRefs=o.collectReservedUtxoRefs;exports.extractInputsFromTransaction=o.extractInputsFromTransaction;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForDeposit=o.selectUtxosForDeposit;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.validateUtxosAvailable=o.validateUtxosAvailable;exports.CONTRACT_ERRORS=r.CONTRACT_ERRORS;exports.PeginManager=r.PeginManager;exports.VAULT_APP_NAME=r.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=r.buildFundingOutpointsCommitment;exports.buildVaultContext=r.buildVaultContext;exports.computeWotsBlockPublicKeysHash=r.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=r.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=r.deriveWotsBlocksFromSeed;exports.expandAuthAnchor=r.expandAuthAnchor;exports.expandHashlockSecret=r.expandHashlockSecret;exports.expandWotsSeed=r.expandWotsSeed;exports.extractErrorData=r.extractErrorData;exports.getContractErrorMessage=r.getContractErrorMessage;exports.handleContractError=r.handleContractError;exports.isKnownContractError=r.isKnownContractError;exports.isWotsMismatchError=r.isWotsMismatchError;exports.parseFundingOutpointsFromTx=r.parseFundingOutpointsFromTx;exports.ApplicationRegistryABI=e.ApplicationRegistryABI;exports.MEMPOOL_API_URLS=e.MEMPOOL_API_URLS;exports.ProtocolParamsABI=e.ProtocolParamsABI;exports.ServerIdentityError=e.ServerIdentityError;exports.VaultProviderRpcClient=e.VaultProviderRpcClient;exports.ViemProtocolParamsReader=e.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=e.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=e.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.VpResponseValidationError=e.VpResponseValidationError;exports.VpTokenRegistry=e.VpTokenRegistry;exports.createAuthenticatedVpClient=e.createAuthenticatedVpClient;exports.getAddressTxs=e.getAddressTxs;exports.getAddressUtxos=e.getAddressUtxos;exports.getMempoolApiUrl=e.getMempoolApiUrl;exports.getNetworkFees=e.getNetworkFees;exports.getTxHex=e.getTxHex;exports.getTxInfo=e.getTxInfo;exports.getUtxoInfo=e.getUtxoInfo;exports.primeVpTokenRegistry=e.primeVpTokenRegistry;exports.pushTx=e.pushTx;exports.resolveProtocolAddresses=e.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=e.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=e.verifyServerIdentity;exports.vpTokenRegistry=e.vpTokenRegistry;exports.BTCVaultRegistryABI=s.BTCVaultRegistryABI;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_TERMINAL_STATUSES=s.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|