@babylonlabs-io/ts-sdk 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/{BTCVaultRegistry.abi-Cq9-JlqT.js → BTCVaultRegistry.abi-Chs4AFBj.js} +125 -2
- package/dist/BTCVaultRegistry.abi-Chs4AFBj.js.map +1 -0
- package/dist/{BTCVaultRegistry.abi-CHFGevwa.cjs → BTCVaultRegistry.abi-JdeqLz4x.cjs} +2 -2
- package/dist/BTCVaultRegistry.abi-JdeqLz4x.cjs.map +1 -0
- package/dist/{PeginManager-BezsAEDe.js → PeginManager-CFGjwYtC.js} +4 -4
- package/dist/{PeginManager-BezsAEDe.js.map → PeginManager-CFGjwYtC.js.map} +1 -1
- package/dist/{PeginManager-D-8vmqzq.cjs → PeginManager-CL1Esl1c.cjs} +2 -2
- package/dist/{PeginManager-D-8vmqzq.cjs.map → PeginManager-CL1Esl1c.cjs.map} +1 -1
- package/dist/{buildAndBroadcastRefund-37Bs7-V1.js → buildAndBroadcastRefund-CZj2z7PJ.js} +2 -2
- package/dist/{buildAndBroadcastRefund-37Bs7-V1.js.map → buildAndBroadcastRefund-CZj2z7PJ.js.map} +1 -1
- package/dist/{buildAndBroadcastRefund-DbcNEsOv.cjs → buildAndBroadcastRefund-Ux587SFf.cjs} +2 -2
- package/dist/{buildAndBroadcastRefund-DbcNEsOv.cjs.map → buildAndBroadcastRefund-Ux587SFf.cjs.map} +1 -1
- package/dist/{errors-CznAK5NB.js → errors-Blc-JWnI.js} +71 -46
- package/dist/errors-Blc-JWnI.js.map +1 -0
- package/dist/errors-CGcNP0rV.cjs +2 -0
- package/dist/errors-CGcNP0rV.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +106 -107
- package/dist/{mempoolApi-CknccHKg.cjs → mempoolApi-DcHws8jJ.cjs} +2 -2
- package/dist/{mempoolApi-CknccHKg.cjs.map → mempoolApi-DcHws8jJ.cjs.map} +1 -1
- package/dist/{mempoolApi-DI9HISqi.js → mempoolApi-DnP7d084.js} +2 -2
- package/dist/{mempoolApi-DI9HISqi.js.map → mempoolApi-DnP7d084.js.map} +1 -1
- package/dist/primeVpAuth-BihAGyNf.cjs +2 -0
- package/dist/{primeVpAuth-Duds3vAO.cjs.map → primeVpAuth-BihAGyNf.cjs.map} +1 -1
- package/dist/{primeVpAuth-qEC9TTO_.js → primeVpAuth-DXl9wGBR.js} +361 -341
- package/dist/{primeVpAuth-qEC9TTO_.js.map → primeVpAuth-DXl9wGBR.js.map} +1 -1
- package/dist/reservation-BxvKbQH2.js +107 -0
- package/dist/reservation-BxvKbQH2.js.map +1 -0
- package/dist/reservation-xTL2a9Q-.cjs +2 -0
- package/dist/reservation-xTL2a9Q-.cjs.map +1 -0
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts +12 -0
- package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/innerTokenClient.d.ts +8 -0
- package/dist/tbv/core/clients/vault-provider/auth/innerTokenClient.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts +42 -13
- 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.map +1 -1
- package/dist/tbv/core/contracts/__tests__/errors.test.d.ts +2 -0
- package/dist/tbv/core/contracts/__tests__/errors.test.d.ts.map +1 -0
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +292 -0
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- package/dist/tbv/core/contracts/errors.d.ts.map +1 -1
- package/dist/tbv/core/contracts/index.cjs +1 -1
- package/dist/tbv/core/contracts/index.js +2 -2
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +102 -103
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +1 -1
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +32 -33
- package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts +0 -1
- package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts.map +1 -1
- package/dist/tbv/core/utils/utxo/availability.d.ts +22 -1
- package/dist/tbv/core/utils/utxo/availability.d.ts.map +1 -1
- package/dist/tbv/core/utils/utxo/reservation.d.ts +11 -86
- package/dist/tbv/core/utils/utxo/reservation.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +102 -103
- package/dist/tbv/integrations/aave/clients/__tests__/oracle.test.d.ts +2 -0
- package/dist/tbv/integrations/aave/clients/__tests__/oracle.test.d.ts.map +1 -0
- package/dist/tbv/integrations/aave/clients/abis/AaveOracle.abi.json.d.ts +36 -0
- package/dist/tbv/integrations/aave/clients/index.d.ts +1 -0
- package/dist/tbv/integrations/aave/clients/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/clients/oracle.d.ts +14 -0
- package/dist/tbv/integrations/aave/clients/oracle.d.ts.map +1 -0
- package/dist/tbv/integrations/aave/index.cjs +1 -1
- package/dist/tbv/integrations/aave/index.cjs.map +1 -1
- package/dist/tbv/integrations/aave/index.d.ts +1 -1
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +249 -141
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/BTCVaultRegistry.abi-CHFGevwa.cjs.map +0 -1
- package/dist/BTCVaultRegistry.abi-Cq9-JlqT.js.map +0 -1
- package/dist/errors-BP73_stm.cjs +0 -2
- package/dist/errors-BP73_stm.cjs.map +0 -1
- package/dist/errors-CznAK5NB.js.map +0 -1
- package/dist/primeVpAuth-Duds3vAO.cjs +0 -2
- package/dist/reservation-Cwf2u4vu.cjs +0 -2
- package/dist/reservation-Cwf2u4vu.cjs.map +0 -1
- package/dist/reservation-DNOGLBt4.js +0 -143
- package/dist/reservation-DNOGLBt4.js.map +0 -1
|
@@ -1,99 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Handles tracking which UTXOs are already in use by pending deposits
|
|
5
|
-
* and selecting available UTXOs with smart fallback logic.
|
|
6
|
-
*/
|
|
7
|
-
/** A txid:vout pair uniquely identifying a UTXO (outpoint). */
|
|
8
|
-
export interface UtxoRef {
|
|
9
|
-
txid: string;
|
|
10
|
-
vout: number;
|
|
11
|
-
}
|
|
12
|
-
/** Narrow structural type for pending pegin data. */
|
|
1
|
+
import { UtxoRef } from './availability';
|
|
2
|
+
/** Locally-known pending pegin. `id` is the bytes32 vault id. */
|
|
13
3
|
export interface PendingPeginLike {
|
|
14
|
-
/**
|
|
15
|
-
* Optional vault id. When present, used to skip pending pegins that are
|
|
16
|
-
* already indexed on-chain so the canonical vault copy wins over a
|
|
17
|
-
* tamperable off-chain entry.
|
|
18
|
-
*/
|
|
19
4
|
id?: string;
|
|
20
|
-
selectedUTXOs?: Array<{
|
|
21
|
-
txid: string;
|
|
22
|
-
vout: number;
|
|
23
|
-
}>;
|
|
24
5
|
unsignedTxHex?: string;
|
|
25
6
|
}
|
|
26
|
-
/**
|
|
7
|
+
/** On-chain vault row from the indexer. */
|
|
27
8
|
export interface VaultLike {
|
|
28
|
-
/**
|
|
29
|
-
* Optional vault id. When present, enables on-chain correlation with
|
|
30
|
-
* pending pegins sharing the same id.
|
|
31
|
-
*/
|
|
32
9
|
id?: string;
|
|
33
10
|
status: number;
|
|
34
11
|
unsignedPrePeginTx: string;
|
|
35
12
|
}
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}> {
|
|
41
|
-
/** All available UTXOs from the wallet. */
|
|
42
|
-
availableUtxos: T[];
|
|
43
|
-
/** UTXOs that are reserved/in-flight and should be avoided if possible. */
|
|
44
|
-
reservedUtxoRefs: UtxoRef[];
|
|
45
|
-
/** Required deposit amount in satoshis (excluding fees). */
|
|
46
|
-
requiredAmount: bigint;
|
|
47
|
-
/** Fee rate in sat/vB. Used to estimate fee buffer for sufficiency check. */
|
|
48
|
-
feeRate: number;
|
|
49
|
-
}
|
|
50
|
-
/** Narrow structural type for early UTXO reservations (pre-ETH-registration). */
|
|
51
|
-
export interface UtxoReservationLike {
|
|
52
|
-
outpoints: ReadonlyArray<{
|
|
53
|
-
txid: string;
|
|
54
|
-
vout: number;
|
|
55
|
-
}>;
|
|
13
|
+
export interface FindOverlappingPendingVaultsParams {
|
|
14
|
+
selectedOutpoints: ReadonlyArray<UtxoRef>;
|
|
15
|
+
vaults?: ReadonlyArray<VaultLike>;
|
|
16
|
+
pendingPegins?: ReadonlyArray<PendingPeginLike>;
|
|
56
17
|
}
|
|
57
|
-
export interface CollectReservedUtxoRefsParams {
|
|
58
|
-
vaults?: VaultLike[];
|
|
59
|
-
pendingPegins?: PendingPeginLike[];
|
|
60
|
-
utxoReservations?: UtxoReservationLike[];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Collect UTXO refs from in-flight deposits (PENDING/VERIFIED vaults and
|
|
64
|
-
* pending pegins).
|
|
65
|
-
*
|
|
66
|
-
* On-chain vault data is canonical: for any pending pegin whose `id` matches
|
|
67
|
-
* an indexed on-chain vault, the pending-pegin copy is ignored entirely —
|
|
68
|
-
* the `vaults` branch below extracts refs from the indexer-supplied
|
|
69
|
-
* `unsignedPrePeginTx` so tampered off-chain data cannot poison the
|
|
70
|
-
* reservation set once the vault is indexed.
|
|
71
|
-
*
|
|
72
|
-
* For pegins not yet indexed, refs are derived from the stored
|
|
73
|
-
* `unsignedTxHex` only. The `selectedUTXOs` sidecar is NOT used for
|
|
74
|
-
* reservation: if it disagreed with the transaction's inputs (e.g. because
|
|
75
|
-
* the off-chain source was tampered), trusting it would poison the reserved
|
|
76
|
-
* set. The transaction hex must be validated at the source boundary before
|
|
77
|
-
* being handed to this function; parsing and using its inputs is the single
|
|
78
|
-
* source of truth here.
|
|
79
|
-
*/
|
|
80
|
-
export declare function collectReservedUtxoRefs(params: CollectReservedUtxoRefsParams): UtxoRef[];
|
|
81
18
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* 1. Filter out reserved UTXOs from the available pool
|
|
86
|
-
* 2. If unreserved UTXOs are sufficient for the required amount + estimated fee, return them
|
|
87
|
-
* 3. Otherwise, throw — never silently reuse reserved UTXOs, as this risks double-spend
|
|
88
|
-
* failures that strand registered-but-unbroadcastable vaults
|
|
89
|
-
*
|
|
90
|
-
* @param params - Selection parameters
|
|
91
|
-
* @returns Array of unreserved UTXOs to use for the deposit
|
|
92
|
-
* @throws When all UTXOs are reserved or unreserved UTXOs are insufficient
|
|
19
|
+
* Return the ids of pending vaults whose committed Pre-PegIn inputs
|
|
20
|
+
* overlap any of the just-selected outpoints. On-chain `PENDING` vaults
|
|
21
|
+
* take precedence over a same-id local pegin entry.
|
|
93
22
|
*/
|
|
94
|
-
export declare function
|
|
95
|
-
txid: string;
|
|
96
|
-
vout: number;
|
|
97
|
-
value: number;
|
|
98
|
-
}>(params: SelectUtxosForDepositParams<T>): T[];
|
|
23
|
+
export declare function findOverlappingPendingVaults(params: FindOverlappingPendingVaultsParams): string[];
|
|
99
24
|
//# sourceMappingURL=reservation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reservation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/reservation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reservation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/reservation.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kCAAkC;IACjD,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACjD;AAkBD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,kCAAkC,GACzC,MAAM,EAAE,CAkCV"}
|
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../challengeAssert-Cmj_OG6V.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../assertPsbtUnsignedTxMatches-CABhEADu.cjs"),p=require("../peginInput-DH6X4ITS.cjs"),S=require("../noPayout-DliaHuc6.cjs"),t=require("../bitcoin-CHfKAhcI.cjs"),g=require("../signing-Bnsro0hE.cjs"),d=require("../validation-u8W7Lp2x.cjs"),n=require("../PeginManager-D-8vmqzq.cjs"),A=require("../PayoutManager-BwYlPF2C.cjs"),_=require("../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../BTCVaultRegistry.abi-CHFGevwa.cjs"),P=require("../errors-BP73_stm.cjs"),o=require("../waitForTransactionReceiptSmartAware-BFMQFEzj.cjs"),r=require("../fundPeginTransaction-C8qsXxNV.cjs"),c=require("../reservation-Cwf2u4vu.cjs"),a=require("../mempoolApi-CknccHKg.cjs"),i=require("../primeVpAuth-Duds3vAO.cjs"),s=require("../types-eYlq0p1o.cjs"),R=require("../errors-Bu0H-dZD.cjs"),e=require("../buildAndBroadcastRefund-DbcNEsOv.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=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.buildPeginInputPsbt=p.buildPeginInputPsbt;exports.extractPeginInputSignature=p.extractPeginInputSignature;exports.finalizePeginInputPsbt=p.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=S.buildNoPayoutPsbt;exports.buildRefundPsbt=S.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=t.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=t.deriveNativeSegwitAddress;exports.deriveTaprootAddress=t.deriveTaprootAddress;exports.ensureHexPrefix=t.ensureHexPrefix;exports.formatSatoshisToBtc=t.formatSatoshisToBtc;exports.getNetwork=t.getNetwork;exports.getSortedXOnlyPubkeys=t.getSortedXOnlyPubkeys;exports.hexToUint8Array=t.hexToUint8Array;exports.isAddressFromPublicKey=t.isAddressFromPublicKey;exports.isValidHex=t.isValidHex;exports.processPublicKeyToXOnly=t.processPublicKeyToXOnly;exports.stripHexPrefix=t.stripHexPrefix;exports.toXOnly=t.toXOnly;exports.uint8ArrayToHex=t.uint8ArrayToHex;exports.validateWalletPubkey=t.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=g.createTaprootScriptPathSignOptions;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.PeginManager=n.PeginManager;exports.VAULT_APP_NAME=n.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=n.buildFundingOutpointsCommitment;exports.buildVaultContext=n.buildVaultContext;exports.computeWotsBlockPublicKeysHash=n.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=n.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=n.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=n.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=A.PayoutManager;exports.computeHashlock=A.computeHashlock;exports.validateSecretAgainstHashlock=A.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=r.BTC_DUST_SAT;exports.DUST_THRESHOLD=r.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=r.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=r.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=r.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=r.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=r.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=r.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=r.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=r.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=r.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=r.fundPeginTransaction;exports.parseUnfundedWasmTransaction=r.parseUnfundedWasmTransaction;exports.peginOutputCount=r.peginOutputCount;exports.rateBasedTxBufferFee=r.rateBasedTxBufferFee;exports.UtxoNotAvailableError=c.UtxoNotAvailableError;exports.assertUtxosAvailable=c.assertUtxosAvailable;exports.collectReservedUtxoRefs=c.collectReservedUtxoRefs;exports.extractInputsFromTransaction=c.extractInputsFromTransaction;exports.selectUtxosForDeposit=c.selectUtxosForDeposit;exports.validateUtxosAvailable=c.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=R.isWotsMismatchError;exports.parseFundingOutpointsFromTx=R.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-Cmj_OG6V.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../assertPsbtUnsignedTxMatches-CABhEADu.cjs"),p=require("../peginInput-DH6X4ITS.cjs"),S=require("../noPayout-DliaHuc6.cjs"),t=require("../bitcoin-CHfKAhcI.cjs"),R=require("../signing-Bnsro0hE.cjs"),d=require("../validation-u8W7Lp2x.cjs"),n=require("../PeginManager-CL1Esl1c.cjs"),A=require("../PayoutManager-BwYlPF2C.cjs"),g=require("../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../BTCVaultRegistry.abi-JdeqLz4x.cjs"),c=require("../errors-CGcNP0rV.cjs"),o=require("../waitForTransactionReceiptSmartAware-BFMQFEzj.cjs"),r=require("../fundPeginTransaction-C8qsXxNV.cjs"),P=require("../reservation-xTL2a9Q-.cjs"),a=require("../mempoolApi-DcHws8jJ.cjs"),i=require("../primeVpAuth-BihAGyNf.cjs"),s=require("../types-eYlq0p1o.cjs"),_=require("../errors-Bu0H-dZD.cjs"),e=require("../buildAndBroadcastRefund-Ux587SFf.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=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.buildPeginInputPsbt=p.buildPeginInputPsbt;exports.extractPeginInputSignature=p.extractPeginInputSignature;exports.finalizePeginInputPsbt=p.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=S.buildNoPayoutPsbt;exports.buildRefundPsbt=S.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=t.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=t.deriveNativeSegwitAddress;exports.deriveTaprootAddress=t.deriveTaprootAddress;exports.ensureHexPrefix=t.ensureHexPrefix;exports.formatSatoshisToBtc=t.formatSatoshisToBtc;exports.getNetwork=t.getNetwork;exports.getSortedXOnlyPubkeys=t.getSortedXOnlyPubkeys;exports.hexToUint8Array=t.hexToUint8Array;exports.isAddressFromPublicKey=t.isAddressFromPublicKey;exports.isValidHex=t.isValidHex;exports.processPublicKeyToXOnly=t.processPublicKeyToXOnly;exports.stripHexPrefix=t.stripHexPrefix;exports.toXOnly=t.toXOnly;exports.uint8ArrayToHex=t.uint8ArrayToHex;exports.validateWalletPubkey=t.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;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.PeginManager=n.PeginManager;exports.VAULT_APP_NAME=n.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=n.buildFundingOutpointsCommitment;exports.buildVaultContext=n.buildVaultContext;exports.computeWotsBlockPublicKeysHash=n.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=n.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=n.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=n.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=A.PayoutManager;exports.computeHashlock=A.computeHashlock;exports.validateSecretAgainstHashlock=A.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=g.ApplicationRegistryABI;exports.ProtocolParamsABI=g.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=c.CONTRACT_ERRORS;exports.extractErrorData=c.extractErrorData;exports.getContractErrorMessage=c.getContractErrorMessage;exports.handleContractError=c.handleContractError;exports.isKnownContractError=c.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=r.BTC_DUST_SAT;exports.DUST_THRESHOLD=r.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=r.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=r.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=r.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=r.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=r.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=r.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=r.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=r.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=r.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=r.fundPeginTransaction;exports.parseUnfundedWasmTransaction=r.parseUnfundedWasmTransaction;exports.peginOutputCount=r.peginOutputCount;exports.rateBasedTxBufferFee=r.rateBasedTxBufferFee;exports.UtxoNotAvailableError=P.UtxoNotAvailableError;exports.assertUtxosAvailable=P.assertUtxosAvailable;exports.extractInputsFromTransaction=P.extractInputsFromTransaction;exports.findOverlappingPendingVaults=P.findOverlappingPendingVaults;exports.validateUtxosAvailable=P.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=_.isWotsMismatchError;exports.parseFundingOutpointsFromTx=_.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
|
package/dist/tbv/index.js
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
import { a as s, b as t, c as r } from "../challengeAssert-ChqnvtRg.js";
|
|
2
2
|
import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u, expandAuthAnchor as l, expandHashlockSecret as p, expandWotsSeed as d } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
-
import { P as c, d as T, c as E, a as A, b as S, f as
|
|
3
|
+
import { P as c, d as T, c as E, a as A, b as S, f as _, e as g } from "../assertPsbtUnsignedTxMatches-GHobJP-d.js";
|
|
4
4
|
import { b as m, e as x, f } from "../peginInput-BPRB9tUi.js";
|
|
5
|
-
import { a as I, b as
|
|
6
|
-
import { d as
|
|
5
|
+
import { a as I, b as O } from "../noPayout-BtP-R-b-.js";
|
|
6
|
+
import { d as v, a as C, b as F, e as h, f as U, j as y, g as N, h as D, i as B, c as M, p as H, s as L, t as X, u as k, v as W } from "../bitcoin-B5aNKtsk.js";
|
|
7
7
|
import { c as w } from "../signing-DaLvGwQe.js";
|
|
8
8
|
import { B as Y, H as Z, K as J, M as j, T as q } from "../validation-CxqROCno.js";
|
|
9
|
-
import { P as Q, V as $, b as aa, a as ea, c as sa, f as ta, d as ra, e as oa } from "../PeginManager-
|
|
9
|
+
import { P as Q, V as $, b as aa, a as ea, c as sa, f as ta, d as ra, e as oa } from "../PeginManager-CFGjwYtC.js";
|
|
10
10
|
import { P as na, c as ua, v as la } from "../PayoutManager-CXDccwDN.js";
|
|
11
11
|
import { A as da, P as Pa } from "../ApplicationRegistry.abi-Dn2qk6JG.js";
|
|
12
|
-
import { B as Ta } from "../BTCVaultRegistry.abi-
|
|
13
|
-
import { C as Aa, e as Sa, g as
|
|
14
|
-
import { B as xa, a as fa, f as ba, c as Ia, b as
|
|
12
|
+
import { B as Ta } from "../BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
13
|
+
import { C as Aa, e as Sa, g as _a, h as ga, i as Ra } from "../errors-Blc-JWnI.js";
|
|
14
|
+
import { B as xa, a as fa, f as ba, c as Ia, b as Oa, d as Va, g as va, i as Ca, h as Fa, s as ha, e as Ua, w as ya } from "../waitForTransactionReceiptSmartAware-Dt5VcMK0.js";
|
|
15
15
|
import { B as Da, D as Ba, F as Ma, L as Ha, M as La, P as Xa, b as ka, a as Wa, S as Ka, T as wa, W as Ga, f as Ya, c as Za, p as Ja, r as ja } from "../fundPeginTransaction-C11tYf6I.js";
|
|
16
|
-
import { U as za, a as Qa,
|
|
17
|
-
import { M as
|
|
18
|
-
import { O as _e, S as ge, V as
|
|
19
|
-
import { A as
|
|
20
|
-
import { i as
|
|
21
|
-
import { B as
|
|
22
|
-
import { C as
|
|
16
|
+
import { U as za, a as Qa, e as $a, f as ae, v as ee } from "../reservation-BxvKbQH2.js";
|
|
17
|
+
import { M as te, V as re, g as oe, a as ie, b as ne, c as ue, d as le, e as pe, f as de, h as Pe, p as ce, v as Te, i as Ee, j as Ae } from "../mempoolApi-DnP7d084.js";
|
|
18
|
+
import { O as _e, S as ge, V as Re, g as me, h as xe, i as fe, a as be, d as Ie, b as Oe, f as Ve, p as ve, r as Ce, v as Fe, c as he, e as Ue } from "../primeVpAuth-DXl9wGBR.js";
|
|
19
|
+
import { A as Ne, D as De, b as Be, J as Me, a as He, d as Le, P as Xe, R as ke, e as We, c as Ke, V as we } from "../types-BqGAMOZM.js";
|
|
20
|
+
import { i as Ye, p as Ze } from "../errors-9AkghWyk.js";
|
|
21
|
+
import { B as je, C as qe, p as ze, q as Qe, t as $e, u as as, R as es, a as ss, n as ts, o as rs, i as os, m as is, l as ns, j as us, r as ls, b as ps, s as ds, v as Ps, g as cs, h as Ts, d as Es, c as As, e as Ss, f as _s, k as gs, w as Rs } from "../buildAndBroadcastRefund-CZj2z7PJ.js";
|
|
22
|
+
import { C as xs, P as fs, c as bs, g as Is } from "../peginState-CBAlxgXk.js";
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
Ne as AUTH_EXPIRED_DATA_KIND,
|
|
25
25
|
da as ApplicationRegistryABI,
|
|
26
|
-
|
|
26
|
+
je as BIP68NotMatureError,
|
|
27
27
|
Y as BITCOIN_ADDRESS_RE,
|
|
28
28
|
Ta as BTCVaultRegistryABI,
|
|
29
29
|
Da as BTC_DUST_SAT,
|
|
30
30
|
xa as BitcoinScriptType,
|
|
31
31
|
Aa as CONTRACT_ERRORS,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
qe as ClaimerPegoutStatusValue,
|
|
33
|
+
xs as ContractStatus,
|
|
34
34
|
Ba as DUST_THRESHOLD,
|
|
35
|
-
|
|
35
|
+
De as DaemonStatus,
|
|
36
36
|
Ma as FEE_SAFETY_MARGIN,
|
|
37
37
|
Z as HEX_RE,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
Be as JSON_RPC_ERROR_CODES,
|
|
39
|
+
Me as JsonRpcClient,
|
|
40
|
+
He as JsonRpcError,
|
|
41
41
|
J as KNOWN_SCRIPT_PREFIXES,
|
|
42
42
|
Ha as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
43
43
|
La as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
44
44
|
j as MAX_REASONABLE_FEE_SATS,
|
|
45
|
-
|
|
45
|
+
te as MEMPOOL_API_URLS,
|
|
46
46
|
_e as OnChainBtcVaultStatus,
|
|
47
47
|
Xa as P2TR_INPUT_SIZE,
|
|
48
48
|
ka as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
49
49
|
Wa as PEGIN_FIXED_OUTPUTS,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
Le as POST_WOTS_STATUSES,
|
|
51
|
+
Xe as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
52
52
|
na as PayoutManager,
|
|
53
|
-
|
|
53
|
+
fs as PeginAction,
|
|
54
54
|
Q as PeginManager,
|
|
55
55
|
Pa as ProtocolParamsABI,
|
|
56
56
|
c as PsbtSubstitutionError,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
ze as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
58
|
+
Qe as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
59
|
+
$e as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
60
|
+
as as REFUND_VSIZE,
|
|
61
|
+
es as RegisteredVaultVersionMismatchError,
|
|
62
|
+
ke as RpcErrorCode,
|
|
63
63
|
Ka as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
64
64
|
ge as ServerIdentityError,
|
|
65
65
|
q as TXID_RE,
|
|
66
66
|
wa as TX_BUFFER_SIZE_OVERHEAD,
|
|
67
67
|
za as UtxoNotAvailableError,
|
|
68
68
|
$ as VAULT_APP_NAME,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
We as VP_BATCH_MAX_SIZE,
|
|
70
|
+
Ke as VP_TERMINAL_FAILURE_STATUSES,
|
|
71
|
+
we as VP_TRANSIENT_STATUSES,
|
|
72
|
+
Re as VaultProviderRpcClient,
|
|
73
|
+
me as ViemProtocolParamsReader,
|
|
74
|
+
xe as ViemUniversalChallengerReader,
|
|
75
|
+
fe as ViemVaultKeeperReader,
|
|
76
|
+
re as ViemVaultRegistryReader,
|
|
77
|
+
be as VpResponseValidationError,
|
|
78
|
+
Ie as VpTokenRegistry,
|
|
79
79
|
Ga as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
80
|
-
|
|
80
|
+
ss as activateVault,
|
|
81
81
|
fa as applyChangeOutputPolicy,
|
|
82
82
|
T as assertPsbtUnsignedTxMatches,
|
|
83
83
|
Qa as assertUtxosAvailable,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
Oe as batchPollByProvider,
|
|
85
|
+
ts as buildAndBroadcastRefund,
|
|
86
86
|
s as buildChallengeAssertPsbt,
|
|
87
87
|
t as buildDepositorPayoutPsbt,
|
|
88
88
|
aa as buildFundingOutpointsCommitment,
|
|
@@ -91,101 +91,100 @@ export {
|
|
|
91
91
|
m as buildPeginInputPsbt,
|
|
92
92
|
A as buildPeginTxFromFundedPrePegin,
|
|
93
93
|
S as buildPrePeginPsbt,
|
|
94
|
-
|
|
94
|
+
O as buildRefundPsbt,
|
|
95
95
|
ea as buildVaultContext,
|
|
96
96
|
ba as calculateBtcTxHash,
|
|
97
|
-
|
|
98
|
-
$a as collectReservedUtxoRefs,
|
|
97
|
+
bs as canPerformAction,
|
|
99
98
|
Ia as computeChangeOutputFeeSats,
|
|
100
99
|
ua as computeHashlock,
|
|
101
|
-
|
|
100
|
+
Oa as computeMaxDeposit,
|
|
102
101
|
i as computeMinClaimValue,
|
|
103
102
|
n as computeMinPeginFee,
|
|
104
103
|
r as computeNumLocalChallengers,
|
|
105
|
-
|
|
104
|
+
Va as computePeginBaseFeeSats,
|
|
106
105
|
sa as computeWotsBlockPublicKeysHash,
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Ve as createAuthenticatedVpClient,
|
|
107
|
+
_ as createPayoutScript,
|
|
109
108
|
w as createTaprootScriptPathSignOptions,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
v as deriveBip86ScriptPubKeyHex,
|
|
110
|
+
C as deriveNativeSegwitAddress,
|
|
111
|
+
F as deriveTaprootAddress,
|
|
113
112
|
u as deriveVaultId,
|
|
114
113
|
ta as deriveVaultRoot,
|
|
115
114
|
ra as deriveWotsBlocksFromSeed,
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
h as ensureHexPrefix,
|
|
116
|
+
rs as estimateRefundFeeSats,
|
|
118
117
|
oa as estimateSubmitPeginRequestBatchGas,
|
|
119
118
|
l as expandAuthAnchor,
|
|
120
119
|
p as expandHashlockSecret,
|
|
121
120
|
d as expandWotsSeed,
|
|
122
121
|
Sa as extractErrorData,
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
$a as extractInputsFromTransaction,
|
|
123
|
+
g as extractPayoutSignature,
|
|
125
124
|
x as extractPeginInputSignature,
|
|
126
125
|
f as finalizePeginInputPsbt,
|
|
127
|
-
|
|
126
|
+
ae as findOverlappingPendingVaults,
|
|
127
|
+
U as formatSatoshisToBtc,
|
|
128
128
|
Ya as fundPeginTransaction,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
oe as getAddressTxs,
|
|
130
|
+
ie as getAddressUtxos,
|
|
131
|
+
_a as getContractErrorMessage,
|
|
132
|
+
va as getDustThreshold,
|
|
133
|
+
ne as getMempoolApiUrl,
|
|
134
134
|
y as getNetwork,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
ue as getNetworkFees,
|
|
136
|
+
Is as getPeginProtocolState,
|
|
137
|
+
Ca as getPsbtInputFields,
|
|
138
|
+
Fa as getScriptType,
|
|
139
139
|
N as getSortedXOnlyPubkeys,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
le as getTipHeight,
|
|
141
|
+
pe as getTxHex,
|
|
142
|
+
de as getTxInfo,
|
|
143
|
+
Pe as getUtxoInfo,
|
|
144
|
+
ga as handleContractError,
|
|
145
145
|
D as hexToUint8Array,
|
|
146
146
|
B as isAddressFromPublicKey,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
os as isDepositAmountValid,
|
|
148
|
+
Ra as isKnownContractError,
|
|
149
|
+
is as isPegoutTerminalStatus,
|
|
150
|
+
ns as isRecognizedPegoutStatus,
|
|
151
|
+
us as isRegisteredVaultVersionMismatchError,
|
|
152
152
|
M as isValidHex,
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
Ye as isWotsMismatchError,
|
|
154
|
+
Ze as parseFundingOutpointsFromTx,
|
|
155
155
|
Za as parseUnfundedWasmTransaction,
|
|
156
156
|
Ja as peginOutputCount,
|
|
157
|
-
|
|
157
|
+
ve as primeVpTokenRegistry,
|
|
158
158
|
H as processPublicKeyToXOnly,
|
|
159
|
-
|
|
159
|
+
ce as pushTx,
|
|
160
160
|
ja as rateBasedTxBufferFee,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Ua as
|
|
165
|
-
|
|
166
|
-
ds as signDepositorGraph,
|
|
161
|
+
Ce as resolveProtocolAddresses,
|
|
162
|
+
ls as runDepositorPresignFlow,
|
|
163
|
+
ha as selectUtxosForPegin,
|
|
164
|
+
Ua as shouldAddChangeOutput,
|
|
165
|
+
ps as signDepositorGraph,
|
|
167
166
|
L as stripHexPrefix,
|
|
168
|
-
|
|
167
|
+
ds as submitWotsPublicKey,
|
|
169
168
|
X as toXOnly,
|
|
170
169
|
k as uint8ArrayToHex,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
Ps as validateDepositAmount,
|
|
171
|
+
cs as validateMultiVaultDepositInputs,
|
|
172
|
+
Te as validateOffchainParams,
|
|
173
|
+
Ts as validateOnChainParticipantKeys,
|
|
174
|
+
Ee as validatePegInConfiguration,
|
|
175
|
+
Es as validateProviderSelection,
|
|
176
|
+
As as validateRemainingCapacity,
|
|
177
|
+
Fe as validateRequestDepositorClaimerArtifactsResponse,
|
|
179
178
|
la as validateSecretAgainstHashlock,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
Ae as validateTBVProtocolParams,
|
|
180
|
+
ee as validateUtxosAvailable,
|
|
181
|
+
Ss as validateVaultAmounts,
|
|
183
182
|
_s as validateVaultProviderPubkey,
|
|
184
183
|
W as validateWalletPubkey,
|
|
185
184
|
gs as verifyRegisteredVaultVersions,
|
|
186
185
|
he as verifyServerIdentity,
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
Ue as vpTokenRegistry,
|
|
187
|
+
Rs as waitForPeginStatus,
|
|
189
188
|
ya as waitForTransactionReceiptSmartAware
|
|
190
189
|
};
|
|
191
190
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oracle.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/integrations/aave/clients/__tests__/oracle.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare const _default: [
|
|
2
|
+
{
|
|
3
|
+
"inputs": [],
|
|
4
|
+
"name": "decimals",
|
|
5
|
+
"outputs": [{ "name": "", "type": "uint8" }],
|
|
6
|
+
"stateMutability": "view",
|
|
7
|
+
"type": "function"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"inputs": [{ "name": "reserveIds", "type": "uint256[]" }],
|
|
11
|
+
"name": "getReservesPrices",
|
|
12
|
+
"outputs": [{ "name": "", "type": "uint256[]" }],
|
|
13
|
+
"stateMutability": "view",
|
|
14
|
+
"type": "function"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"inputs": [{ "name": "reserveId", "type": "uint256" }],
|
|
18
|
+
"name": "getReserveSource",
|
|
19
|
+
"outputs": [{ "name": "", "type": "address" }],
|
|
20
|
+
"stateMutability": "view",
|
|
21
|
+
"type": "function"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "error",
|
|
25
|
+
"name": "InvalidSource",
|
|
26
|
+
"inputs": [{ "name": "reserveId", "type": "uint256" }]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "error",
|
|
30
|
+
"name": "InvalidPrice",
|
|
31
|
+
"inputs": [{ "name": "reserveId", "type": "uint256" }]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
;
|
|
35
|
+
|
|
36
|
+
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { getPosition, getPositionSizeParams, } from './query.js';
|
|
2
2
|
export { getDynamicReserveConfig, getReserve, getTargetHealthFactor, getUserAccountData, getUserPosition, getUserTotalDebt, hasCollateral, hasDebt, } from './spoke.js';
|
|
3
|
+
export { getOracleAddress, getReservesPrices, getReservesPricesSafe, type ReservePriceResult, } from './oracle.js';
|
|
3
4
|
export { buildBorrowTx, buildReorderVaultsTx, buildRepayTx, buildWithdrawCollateralsTx, } from './transaction.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Address, PublicClient } from 'viem';
|
|
2
|
+
/** `Spoke.ORACLE` is `immutable`; the result is safe to cache forever. */
|
|
3
|
+
export declare function getOracleAddress(publicClient: PublicClient, spokeAddress: Address): Promise<Address>;
|
|
4
|
+
/** Batch read; reverts the WHOLE batch on the first bad reserve. */
|
|
5
|
+
export declare function getReservesPrices(publicClient: PublicClient, oracleAddress: Address, reserveIds: bigint[]): Promise<bigint[]>;
|
|
6
|
+
export interface ReservePriceResult {
|
|
7
|
+
reserveId: bigint;
|
|
8
|
+
/** Raw 1e8 base units, or null on revert. */
|
|
9
|
+
priceRaw: bigint | null;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
}
|
|
12
|
+
/** Per-reserve isolated read for display lists (one bad source ≠ whole list blank). */
|
|
13
|
+
export declare function getReservesPricesSafe(publicClient: PublicClient, oracleAddress: Address, reserveIds: bigint[]): Promise<ReservePriceResult[]>;
|
|
14
|
+
//# sourceMappingURL=oracle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/oracle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAKlD,0EAA0E;AAC1E,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,oEAAoE;AACpE,wBAAsB,iBAAiB,CACrC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,OAAO,EACtB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,uFAAuF;AACvF,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,OAAO,EACtB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAqB/B"}
|