@babylonlabs-io/ts-sdk 0.77.0 → 0.78.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/{BTCVaultRegistry.abi-z7d_eP22.cjs → BTCVaultRegistry.abi-BJnjzEWD.cjs} +2 -2
- package/dist/BTCVaultRegistry.abi-BJnjzEWD.cjs.map +1 -0
- package/dist/{BTCVaultRegistry.abi-CJwWI2EO.js → BTCVaultRegistry.abi-BT3eo60h.js} +279 -2
- package/dist/BTCVaultRegistry.abi-BT3eo60h.js.map +1 -0
- package/dist/{PeginManager-DNimKlmw.js → PeginManager-Cz0Ytdwo.js} +3 -3
- package/dist/{PeginManager-DNimKlmw.js.map → PeginManager-Cz0Ytdwo.js.map} +1 -1
- package/dist/{PeginManager-DEByBX5R.cjs → PeginManager-DE2lTWMl.cjs} +2 -2
- package/dist/{PeginManager-DEByBX5R.cjs.map → PeginManager-DE2lTWMl.cjs.map} +1 -1
- package/dist/{buildAndBroadcastReclaim-Cqc6Jiqk.cjs → buildAndBroadcastReclaim-CB5VPETy.cjs} +2 -2
- package/dist/{buildAndBroadcastReclaim-Cqc6Jiqk.cjs.map → buildAndBroadcastReclaim-CB5VPETy.cjs.map} +1 -1
- package/dist/{buildAndBroadcastReclaim-DCGcupg7.js → buildAndBroadcastReclaim-DD50pVB1.js} +2 -2
- package/dist/{buildAndBroadcastReclaim-DCGcupg7.js.map → buildAndBroadcastReclaim-DD50pVB1.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +188 -186
- package/dist/{pegin-registration-client-CXK3B_D1.js → pegin-registration-client-7Vbtdypu.js} +287 -224
- package/dist/pegin-registration-client-7Vbtdypu.js.map +1 -0
- package/dist/pegin-registration-client-CSe1vOum.cjs +2 -0
- package/dist/pegin-registration-client-CSe1vOum.cjs.map +1 -0
- package/dist/tbv/core/clients/eth/index.cjs +1 -1
- package/dist/tbv/core/clients/eth/index.d.ts +1 -0
- package/dist/tbv/core/clients/eth/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/index.js +14 -12
- package/dist/tbv/core/clients/eth/registration-logs-error.d.ts +20 -0
- package/dist/tbv/core/clients/eth/registration-logs-error.d.ts.map +1 -0
- package/dist/tbv/core/clients/eth/types.d.ts +12 -0
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +19 -0
- 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 +41 -39
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +227 -1
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- package/dist/tbv/core/contracts/index.cjs +1 -1
- package/dist/tbv/core/contracts/index.js +1 -1
- package/dist/tbv/core/deposit-terms/commissionCeiling.d.ts +3 -2
- package/dist/tbv/core/deposit-terms/commissionCeiling.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +186 -184
- 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/index.cjs +1 -1
- package/dist/tbv/index.js +186 -184
- package/dist/{toRefundInputs-meTyor7r.cjs → toRefundInputs-BH3wkNC4.cjs} +2 -2
- package/dist/{toRefundInputs-meTyor7r.cjs.map → toRefundInputs-BH3wkNC4.cjs.map} +1 -1
- package/dist/{toRefundInputs-BNSXIymn.js → toRefundInputs-D708M8MA.js} +2 -2
- package/dist/{toRefundInputs-BNSXIymn.js.map → toRefundInputs-D708M8MA.js.map} +1 -1
- package/dist/{types-BzSOthHH.cjs → types-BN0jOH8K.cjs} +2 -2
- package/dist/{types-BzSOthHH.cjs.map → types-BN0jOH8K.cjs.map} +1 -1
- package/dist/{types-C5DyrC8F.js → types-BwqkOoJ6.js} +3 -3
- package/dist/{types-C5DyrC8F.js.map → types-BwqkOoJ6.js.map} +1 -1
- package/package.json +1 -1
- package/dist/BTCVaultRegistry.abi-CJwWI2EO.js.map +0 -1
- package/dist/BTCVaultRegistry.abi-z7d_eP22.cjs.map +0 -1
- package/dist/pegin-registration-client-CXK3B_D1.js.map +0 -1
- package/dist/pegin-registration-client-DLsMNm8Z.cjs +0 -2
- package/dist/pegin-registration-client-DLsMNm8Z.cjs.map +0 -1
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../verifyScriptPathSchnorrSignature-DaRqvEgW.cjs"),O=require("../secp256k1-DDHQ1_za.cjs"),u=require("./core/wasm/index.cjs"),A=require("../verifyKeyPathSchnorrSignature-BjB8Znly.cjs"),l=require("../noPayout-4RZB2g1e.cjs"),N=require("../challengeAssert-Z7_YULBb.cjs"),r=require("../bitcoin-D-O2GjbC.cjs"),h=require("../abortSignals-msbmbqFe.cjs"),I=require("../signing-BJ3X66b-.cjs"),c=require("../validation-C6XTfZak.cjs"),F=require("./core/utils/eth/index.cjs"),E=require("../PeginManager-DEByBX5R.cjs"),d=require("../signPsbtsWithFallback-DtwzL5AA.cjs"),o=require("./core/clients/mempool/index.cjs"),_=require("../types-BzSOthHH.cjs"),v=require("../onChainBtcPubkey-BbxRrbvg.cjs"),P=require("../pegin-registration-client-DLsMNm8Z.cjs"),C=require("./core/contracts/index.cjs"),b=require("../BTCVaultRegistry.abi-z7d_eP22.cjs"),p=require("../BTCVaultRegistryKeyEpochs.abi-CrQiTLfA.cjs"),R=require("../parseFundingOutpoints-B4iQeX6q.cjs"),n=require("../psbtInputFields-BrV_ZfL_.cjs"),i=require("../fundPeginTransaction-54-Rwb2k.cjs"),T=require("../reservation-Dr2HLCxx.cjs"),m=require("../index-CK1Xvq4K.cjs"),s=require("../json-rpc-client-BiAmg_ho.cjs"),g=require("../primeVpAuth-BOGKniTl.cjs"),t=require("../toRefundInputs-meTyor7r.cjs"),e=require("../buildAndBroadcastReclaim-Cqc6Jiqk.cjs"),S=require("../peginState-eaQ4IO_R.cjs");exports.PEGIN_DEPOSITOR_CLAIM_VOUT=a.PEGIN_DEPOSITOR_CLAIM_VOUT;exports.PsbtSubstitutionError=a.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=a.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=a.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=a.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=a.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=a.buildPrePeginPsbt;exports.computeNumLocalChallengers=a.computeNumLocalChallengers;exports.createPayoutScript=a.createPayoutScript;exports.deriveDepositorClaimDescriptor=a.deriveDepositorClaimDescriptor;exports.deriveDepositorClaimScriptPubKey=a.deriveDepositorClaimScriptPubKey;exports.extractPayoutSignature=a.extractPayoutSignature;exports.assertValidVaultCoreVersion=O.assertValidVaultCoreVersion;exports.computeMinClaimValue=u.computeMinClaimValue;exports.computeMinPeginFee=u.computeMinPeginFee;exports.deriveVaultId=u.deriveVaultId;exports.expandAuthAnchor=u.expandAuthAnchor;exports.expandHashlockSecret=u.expandHashlockSecret;exports.expandWotsSeed=u.expandWotsSeed;exports.peginP2aAnchorOutput=u.peginP2aAnchorOutput;exports.supportedTxGraphVersions=u.supportedTxGraphVersions;exports.validatePeginP2aAnchor=u.validatePeginP2aAnchor;exports.assertKeyPathSchnorrSignature=A.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=A.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=A.buildPeginInputPsbt;exports.extractPeginInputSignature=A.extractPeginInputSignature;exports.finalizePeginInputPsbt=A.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=l.buildNoPayoutPsbt;exports.buildReclaimPsbt=l.buildReclaimPsbt;exports.buildRefundPsbt=l.buildRefundPsbt;exports.estimateReclaimFeeSats=l.estimateReclaimFeeSats;exports.finalizeScriptPathWithSignatures=l.finalizeScriptPathWithSignatures;exports.reclaimVsize=l.reclaimVsize;exports.buildChallengeAssertPsbt=N.buildChallengeAssertPsbt;exports.canonicalizeBtcPubkey=r.canonicalizeBtcPubkey;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.combineAbortSignals=h.combineAbortSignals;exports.calculateBtcTxHash=I.calculateBtcTxHash;exports.createTaprootScriptPathSignOptions=I.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=c.COMPRESSED_PUBKEY_HEX_LEN;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.X_ONLY_PUBKEY_HEX_LEN=c.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=F.waitForTransactionReceiptSmartAware;exports.PeginManager=E.PeginManager;exports.buildDepositTerms=E.buildDepositTerms;exports.computeWotsBlockPublicKeysHash=E.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=E.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=E.ensurePrePeginTermsApproval;exports.estimateSubmitPeginRequestBatchGas=E.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=d.PayoutManager;exports.computeHashlock=d.computeHashlock;exports.forwardDepositApproval=d.forwardDepositApproval;exports.requireChangeAddress=d.requireChangeAddress;exports.supportsDepositApproval=d.supportsDepositApproval;exports.validateSecretAgainstHashlock=d.validateSecretAgainstHashlock;exports.MEMPOOL_API_URLS=o.MEMPOOL_API_URLS;exports.getAddressTxs=o.getAddressTxs;exports.getAddressUtxos=o.getAddressUtxos;exports.getMempoolApiUrl=o.getMempoolApiUrl;exports.getNetworkFees=o.getNetworkFees;exports.getOutspend=o.getOutspend;exports.getTipHeight=o.getTipHeight;exports.getTxHex=o.getTxHex;exports.getTxInfo=o.getTxInfo;exports.getUtxoInfo=o.getUtxoInfo;exports.pushTx=o.pushTx;exports.OnChainBtcVaultStatus=_.OnChainBtcVaultStatus;exports.ViemOperationKeyReader=_.ViemOperationKeyReader;exports.ViemProtocolParamsReader=_.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=_.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=_.ViemVaultKeeperReader;exports.resolveProtocolAddresses=_.resolveProtocolAddresses;exports.assertOnChainBtcPubkey=v.assertOnChainBtcPubkey;exports.COMMISSION_BPS_HEADROOM=P.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=P.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.ViemPeginRegistrationClient=P.ViemPeginRegistrationClient;exports.ViemVaultRegistryReader=P.ViemVaultRegistryReader;exports.capMaxAcceptableCommissionBps=P.capMaxAcceptableCommissionBps;exports.derivePeginVaultId=P.derivePeginVaultId;exports.validateOffchainParams=P.validateOffchainParams;exports.validatePegInConfiguration=P.validatePegInConfiguration;exports.validateTBVProtocolParams=P.validateTBVProtocolParams;exports.ApplicationRegistryABI=C.ApplicationRegistryABI;exports.ProtocolParamsABI=C.ProtocolParamsABI;exports.BTCVaultRegistryABI=b.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=p.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=p.CONTRACT_ERRORS;exports.extractErrorData=p.extractErrorData;exports.getContractErrorMessage=p.getContractErrorMessage;exports.handleContractError=p.handleContractError;exports.isKnownContractError=p.isKnownContractError;exports.VAULT_APP_NAME=R.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=R.buildFundingOutpointsCommitment;exports.buildVaultContext=R.buildVaultContext;exports.deriveVaultRoot=R.deriveVaultRoot;exports.forwardDeriveContextHash=R.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=R.parseFundingOutpointsFromTx;exports.BitcoinScriptType=n.BitcoinScriptType;exports.applyChangeOutputPolicy=n.applyChangeOutputPolicy;exports.computeChangeOutputFeeSats=n.computeChangeOutputFeeSats;exports.computeMaxDeposit=n.computeMaxDeposit;exports.computePeginBaseFeeSats=n.computePeginBaseFeeSats;exports.getDustThreshold=n.getDustThreshold;exports.getPsbtInputFields=n.getPsbtInputFields;exports.getScriptType=n.getScriptType;exports.selectUtxosForPegin=n.selectUtxosForPegin;exports.shouldAddChangeOutput=n.shouldAddChangeOutput;exports.BTC_DUST_SAT=i.BTC_DUST_SAT;exports.DUST_THRESHOLD=i.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=i.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=i.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=i.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=i.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=i.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=i.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=i.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=i.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=i.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=i.fundPeginTransaction;exports.parseUnfundedWasmTransaction=i.parseUnfundedWasmTransaction;exports.peginOutputCount=i.peginOutputCount;exports.rateBasedTxBufferFee=i.rateBasedTxBufferFee;exports.UtxoNotAvailableError=T.UtxoNotAvailableError;exports.assertUtxosAvailable=T.assertUtxosAvailable;exports.extractInputsFromTransaction=T.extractInputsFromTransaction;exports.findOverlappingPendingVaults=T.findOverlappingPendingVaults;exports.validateUtxosAvailable=T.validateUtxosAvailable;exports.VaultProviderRpcClient=m.VaultProviderRpcClient;exports.VpResponseValidationError=m.VpResponseValidationError;exports.batchPollByProvider=m.batchPollByProvider;exports.validateRequestDepositorClaimerArtifactsResponse=m.validateRequestDepositorClaimerArtifactsResponse;exports.AUTH_REJECTED_RPC_CODE=s.AUTH_REJECTED_RPC_CODE;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.isAuthRejectedError=s.isAuthRejectedError;exports.ServerIdentityError=g.ServerIdentityError;exports.VpTokenRegistry=g.VpTokenRegistry;exports.createAuthenticatedVpClient=g.createAuthenticatedVpClient;exports.primeVpTokenRegistry=g.primeVpTokenRegistry;exports.verifyServerIdentity=g.verifyServerIdentity;exports.vpTokenRegistry=g.vpTokenRegistry;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;exports.PEGIN_FINGERPRINT_DOMAIN=t.PEGIN_FINGERPRINT_DOMAIN;exports.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE=t.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE;exports.PeginFingerprintInputError=t.PeginFingerprintInputError;exports.PeginParamsAmbiguousError=t.PeginParamsAmbiguousError;exports.PeginParamsIncompleteSpaceError=t.PeginParamsIncompleteSpaceError;exports.PeginParamsNotFoundError=t.PeginParamsNotFoundError;exports.PeginSizingIntegrityError=t.PeginSizingIntegrityError;exports.UnanchoredPrePeginError=t.UnanchoredPrePeginError;exports.VaultRootMismatchError=t.VaultRootMismatchError;exports.buildPeginParamsCandidates=t.buildPeginParamsCandidates;exports.computePeginFingerprint=t.computePeginFingerprint;exports.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;exports.encodePeginFingerprintPreimage=t.encodePeginFingerprintPreimage;exports.isDepositTermsRejectedError=t.isDepositTermsRejectedError;exports.isWotsMismatchError=t.isWotsMismatchError;exports.rebuildDepositTermsCore=t.rebuildDepositTermsCore;exports.reconstructPeginParams=t.reconstructPeginParams;exports.toRefundInputs=t.toRefundInputs;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.PEGIN_ETH_CONFIRMATIONS=e.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=e.ParticipantKeyDriftError;exports.PeginRegistrationMissingError=e.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=e.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=e.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=e.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=e.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=e.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;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.ReclaimUneconomicalError=e.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=e.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isHintAccepted=e.isHintAccepted;exports.isParticipantKeyDriftError=e.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=e.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=e.isPeginRegistrationNotFinalError;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=e.matchKeyHint;exports.matchKeySetHint=e.matchKeySetHint;exports.resolveCurrentParticipantKeys=e.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=e.resolveParticipantKeysAtEpochs;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.verifyRegisteredParticipantKeys=e.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=e.waitForPeginRegistrationDepth;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=S.ContractStatus;exports.PeginAction=S.PeginAction;exports.canPerformAction=S.canPerformAction;exports.getPeginProtocolState=S.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=S.isActivationDeadlinePassedOnChain;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../verifyScriptPathSchnorrSignature-DaRqvEgW.cjs"),O=require("../secp256k1-DDHQ1_za.cjs"),P=require("./core/wasm/index.cjs"),A=require("../verifyKeyPathSchnorrSignature-BjB8Znly.cjs"),l=require("../noPayout-4RZB2g1e.cjs"),N=require("../challengeAssert-Z7_YULBb.cjs"),r=require("../bitcoin-D-O2GjbC.cjs"),h=require("../abortSignals-msbmbqFe.cjs"),I=require("../signing-BJ3X66b-.cjs"),c=require("../validation-C6XTfZak.cjs"),v=require("./core/utils/eth/index.cjs"),E=require("../PeginManager-DE2lTWMl.cjs"),d=require("../signPsbtsWithFallback-DtwzL5AA.cjs"),s=require("./core/clients/mempool/index.cjs"),_=require("../types-BN0jOH8K.cjs"),b=require("../onChainBtcPubkey-BbxRrbvg.cjs"),n=require("../pegin-registration-client-CSe1vOum.cjs"),C=require("./core/contracts/index.cjs"),F=require("../BTCVaultRegistry.abi-BJnjzEWD.cjs"),p=require("../BTCVaultRegistryKeyEpochs.abi-CrQiTLfA.cjs"),g=require("../parseFundingOutpoints-B4iQeX6q.cjs"),u=require("../psbtInputFields-BrV_ZfL_.cjs"),i=require("../fundPeginTransaction-54-Rwb2k.cjs"),T=require("../reservation-Dr2HLCxx.cjs"),m=require("../index-CK1Xvq4K.cjs"),o=require("../json-rpc-client-BiAmg_ho.cjs"),R=require("../primeVpAuth-BOGKniTl.cjs"),t=require("../toRefundInputs-BH3wkNC4.cjs"),e=require("../buildAndBroadcastReclaim-CB5VPETy.cjs"),S=require("../peginState-eaQ4IO_R.cjs");exports.PEGIN_DEPOSITOR_CLAIM_VOUT=a.PEGIN_DEPOSITOR_CLAIM_VOUT;exports.PsbtSubstitutionError=a.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=a.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=a.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=a.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=a.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=a.buildPrePeginPsbt;exports.computeNumLocalChallengers=a.computeNumLocalChallengers;exports.createPayoutScript=a.createPayoutScript;exports.deriveDepositorClaimDescriptor=a.deriveDepositorClaimDescriptor;exports.deriveDepositorClaimScriptPubKey=a.deriveDepositorClaimScriptPubKey;exports.extractPayoutSignature=a.extractPayoutSignature;exports.assertValidVaultCoreVersion=O.assertValidVaultCoreVersion;exports.computeMinClaimValue=P.computeMinClaimValue;exports.computeMinPeginFee=P.computeMinPeginFee;exports.deriveVaultId=P.deriveVaultId;exports.expandAuthAnchor=P.expandAuthAnchor;exports.expandHashlockSecret=P.expandHashlockSecret;exports.expandWotsSeed=P.expandWotsSeed;exports.peginP2aAnchorOutput=P.peginP2aAnchorOutput;exports.supportedTxGraphVersions=P.supportedTxGraphVersions;exports.validatePeginP2aAnchor=P.validatePeginP2aAnchor;exports.assertKeyPathSchnorrSignature=A.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=A.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=A.buildPeginInputPsbt;exports.extractPeginInputSignature=A.extractPeginInputSignature;exports.finalizePeginInputPsbt=A.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=l.buildNoPayoutPsbt;exports.buildReclaimPsbt=l.buildReclaimPsbt;exports.buildRefundPsbt=l.buildRefundPsbt;exports.estimateReclaimFeeSats=l.estimateReclaimFeeSats;exports.finalizeScriptPathWithSignatures=l.finalizeScriptPathWithSignatures;exports.reclaimVsize=l.reclaimVsize;exports.buildChallengeAssertPsbt=N.buildChallengeAssertPsbt;exports.canonicalizeBtcPubkey=r.canonicalizeBtcPubkey;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.combineAbortSignals=h.combineAbortSignals;exports.calculateBtcTxHash=I.calculateBtcTxHash;exports.createTaprootScriptPathSignOptions=I.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=c.COMPRESSED_PUBKEY_HEX_LEN;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.X_ONLY_PUBKEY_HEX_LEN=c.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=v.waitForTransactionReceiptSmartAware;exports.PeginManager=E.PeginManager;exports.buildDepositTerms=E.buildDepositTerms;exports.computeWotsBlockPublicKeysHash=E.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=E.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=E.ensurePrePeginTermsApproval;exports.estimateSubmitPeginRequestBatchGas=E.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=d.PayoutManager;exports.computeHashlock=d.computeHashlock;exports.forwardDepositApproval=d.forwardDepositApproval;exports.requireChangeAddress=d.requireChangeAddress;exports.supportsDepositApproval=d.supportsDepositApproval;exports.validateSecretAgainstHashlock=d.validateSecretAgainstHashlock;exports.MEMPOOL_API_URLS=s.MEMPOOL_API_URLS;exports.getAddressTxs=s.getAddressTxs;exports.getAddressUtxos=s.getAddressUtxos;exports.getMempoolApiUrl=s.getMempoolApiUrl;exports.getNetworkFees=s.getNetworkFees;exports.getOutspend=s.getOutspend;exports.getTipHeight=s.getTipHeight;exports.getTxHex=s.getTxHex;exports.getTxInfo=s.getTxInfo;exports.getUtxoInfo=s.getUtxoInfo;exports.pushTx=s.pushTx;exports.OnChainBtcVaultStatus=_.OnChainBtcVaultStatus;exports.ViemOperationKeyReader=_.ViemOperationKeyReader;exports.ViemProtocolParamsReader=_.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=_.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=_.ViemVaultKeeperReader;exports.resolveProtocolAddresses=_.resolveProtocolAddresses;exports.assertOnChainBtcPubkey=b.assertOnChainBtcPubkey;exports.COMMISSION_BPS_HEADROOM=n.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=n.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.RegistrationLogsUnavailableError=n.RegistrationLogsUnavailableError;exports.ViemPeginRegistrationClient=n.ViemPeginRegistrationClient;exports.ViemVaultRegistryReader=n.ViemVaultRegistryReader;exports.capMaxAcceptableCommissionBps=n.capMaxAcceptableCommissionBps;exports.derivePeginVaultId=n.derivePeginVaultId;exports.isRegistrationLogsUnavailableError=n.isRegistrationLogsUnavailableError;exports.validateOffchainParams=n.validateOffchainParams;exports.validatePegInConfiguration=n.validatePegInConfiguration;exports.validateTBVProtocolParams=n.validateTBVProtocolParams;exports.ApplicationRegistryABI=C.ApplicationRegistryABI;exports.ProtocolParamsABI=C.ProtocolParamsABI;exports.BTCVaultRegistryABI=F.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=p.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=p.CONTRACT_ERRORS;exports.extractErrorData=p.extractErrorData;exports.getContractErrorMessage=p.getContractErrorMessage;exports.handleContractError=p.handleContractError;exports.isKnownContractError=p.isKnownContractError;exports.VAULT_APP_NAME=g.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=g.buildFundingOutpointsCommitment;exports.buildVaultContext=g.buildVaultContext;exports.deriveVaultRoot=g.deriveVaultRoot;exports.forwardDeriveContextHash=g.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BitcoinScriptType=u.BitcoinScriptType;exports.applyChangeOutputPolicy=u.applyChangeOutputPolicy;exports.computeChangeOutputFeeSats=u.computeChangeOutputFeeSats;exports.computeMaxDeposit=u.computeMaxDeposit;exports.computePeginBaseFeeSats=u.computePeginBaseFeeSats;exports.getDustThreshold=u.getDustThreshold;exports.getPsbtInputFields=u.getPsbtInputFields;exports.getScriptType=u.getScriptType;exports.selectUtxosForPegin=u.selectUtxosForPegin;exports.shouldAddChangeOutput=u.shouldAddChangeOutput;exports.BTC_DUST_SAT=i.BTC_DUST_SAT;exports.DUST_THRESHOLD=i.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=i.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=i.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=i.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=i.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=i.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=i.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=i.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=i.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=i.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=i.fundPeginTransaction;exports.parseUnfundedWasmTransaction=i.parseUnfundedWasmTransaction;exports.peginOutputCount=i.peginOutputCount;exports.rateBasedTxBufferFee=i.rateBasedTxBufferFee;exports.UtxoNotAvailableError=T.UtxoNotAvailableError;exports.assertUtxosAvailable=T.assertUtxosAvailable;exports.extractInputsFromTransaction=T.extractInputsFromTransaction;exports.findOverlappingPendingVaults=T.findOverlappingPendingVaults;exports.validateUtxosAvailable=T.validateUtxosAvailable;exports.VaultProviderRpcClient=m.VaultProviderRpcClient;exports.VpResponseValidationError=m.VpResponseValidationError;exports.batchPollByProvider=m.batchPollByProvider;exports.validateRequestDepositorClaimerArtifactsResponse=m.validateRequestDepositorClaimerArtifactsResponse;exports.AUTH_REJECTED_RPC_CODE=o.AUTH_REJECTED_RPC_CODE;exports.DaemonStatus=o.DaemonStatus;exports.JSON_RPC_ERROR_CODES=o.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=o.JsonRpcClient;exports.JsonRpcError=o.JsonRpcError;exports.POST_WOTS_STATUSES=o.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=o.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=o.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=o.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=o.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=o.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=o.isAuthRejectedError;exports.ServerIdentityError=R.ServerIdentityError;exports.VpTokenRegistry=R.VpTokenRegistry;exports.createAuthenticatedVpClient=R.createAuthenticatedVpClient;exports.primeVpTokenRegistry=R.primeVpTokenRegistry;exports.verifyServerIdentity=R.verifyServerIdentity;exports.vpTokenRegistry=R.vpTokenRegistry;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;exports.PEGIN_FINGERPRINT_DOMAIN=t.PEGIN_FINGERPRINT_DOMAIN;exports.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE=t.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE;exports.PeginFingerprintInputError=t.PeginFingerprintInputError;exports.PeginParamsAmbiguousError=t.PeginParamsAmbiguousError;exports.PeginParamsIncompleteSpaceError=t.PeginParamsIncompleteSpaceError;exports.PeginParamsNotFoundError=t.PeginParamsNotFoundError;exports.PeginSizingIntegrityError=t.PeginSizingIntegrityError;exports.UnanchoredPrePeginError=t.UnanchoredPrePeginError;exports.VaultRootMismatchError=t.VaultRootMismatchError;exports.buildPeginParamsCandidates=t.buildPeginParamsCandidates;exports.computePeginFingerprint=t.computePeginFingerprint;exports.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;exports.encodePeginFingerprintPreimage=t.encodePeginFingerprintPreimage;exports.isDepositTermsRejectedError=t.isDepositTermsRejectedError;exports.isWotsMismatchError=t.isWotsMismatchError;exports.rebuildDepositTermsCore=t.rebuildDepositTermsCore;exports.reconstructPeginParams=t.reconstructPeginParams;exports.toRefundInputs=t.toRefundInputs;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.PEGIN_ETH_CONFIRMATIONS=e.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=e.ParticipantKeyDriftError;exports.PeginRegistrationMissingError=e.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=e.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=e.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=e.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=e.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=e.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;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.ReclaimUneconomicalError=e.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=e.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isHintAccepted=e.isHintAccepted;exports.isParticipantKeyDriftError=e.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=e.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=e.isPeginRegistrationNotFinalError;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=e.matchKeyHint;exports.matchKeySetHint=e.matchKeySetHint;exports.resolveCurrentParticipantKeys=e.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=e.resolveParticipantKeysAtEpochs;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.verifyRegisteredParticipantKeys=e.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=e.waitForPeginRegistrationDepth;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=S.ContractStatus;exports.PeginAction=S.PeginAction;exports.canPerformAction=S.canPerformAction;exports.getPeginProtocolState=S.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=S.isActivationDeadlinePassedOnChain;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/index.js
CHANGED
|
@@ -1,275 +1,277 @@
|
|
|
1
|
-
import { P as s, h as t, i as r, j as i, f as o, b as n, a as P, c as p, k as E, d as c, e as
|
|
1
|
+
import { P as s, h as t, i as r, j as i, f as o, b as n, a as P, c as p, k as E, d as c, e as l, g as u } from "../verifyScriptPathSchnorrSignature-D_epga4j.js";
|
|
2
2
|
import { a as R } from "../secp256k1-D-H9jmd7.js";
|
|
3
|
-
import { computeMinClaimValue as
|
|
4
|
-
import { a as
|
|
3
|
+
import { computeMinClaimValue as A, computeMinPeginFee as _, deriveVaultId as T, expandAuthAnchor as m, expandHashlockSecret as S, expandWotsSeed as I, peginP2aAnchorOutput as C, supportedTxGraphVersions as O, validatePeginP2aAnchor as f } from "./core/wasm/index.js";
|
|
4
|
+
import { a as x, c as N, b as V, e as h, f as v } from "../verifyKeyPathSchnorrSignature-BVtNwgK6.js";
|
|
5
5
|
import { c as F, a as D, b as y, e as U, f as B, r as H } from "../noPayout-DiGr4eas.js";
|
|
6
6
|
import { b as K } from "../challengeAssert-Cp_GeRg8.js";
|
|
7
7
|
import { c as k, d as G, a as W, b as w, e as Y, f as j, k as z, g as J, h as Z, i as q, j as Q, p as $, s as aa, t as ea, u as sa, v as ta } from "../bitcoin-C-TuHb-v.js";
|
|
8
8
|
import { c as ia } from "../abortSignals-BPpAUL1Z.js";
|
|
9
9
|
import { c as na, a as Pa } from "../signing-Cm-McVR2.js";
|
|
10
|
-
import { B as Ea, C as ca, H as
|
|
11
|
-
import { waitForTransactionReceiptSmartAware as
|
|
12
|
-
import { P as ma, b as Sa, c as Ia, d as Ca, a as Oa, e as fa } from "../PeginManager-
|
|
13
|
-
import { P as
|
|
10
|
+
import { B as Ea, C as ca, H as la, K as ua, M as da, T as Ra, X as ga } from "../validation-OSC0xTHB.js";
|
|
11
|
+
import { waitForTransactionReceiptSmartAware as _a } from "./core/utils/eth/index.js";
|
|
12
|
+
import { P as ma, b as Sa, c as Ia, d as Ca, a as Oa, e as fa } from "../PeginManager-Cz0Ytdwo.js";
|
|
13
|
+
import { P as xa, c as Na, f as Va, r as ha, s as va, v as Ma } from "../signPsbtsWithFallback-f7QLp0q8.js";
|
|
14
14
|
import { MEMPOOL_API_URLS as Da, getAddressTxs as ya, getAddressUtxos as Ua, getMempoolApiUrl as Ba, getNetworkFees as Ha, getOutspend as La, getTipHeight as Ka, getTxHex as Xa, getTxInfo as ka, getUtxoInfo as Ga, pushTx as Wa } from "./core/clients/mempool/index.js";
|
|
15
|
-
import { O as Ya, V as ja, a as za, b as Ja, c as Za, r as qa } from "../types-
|
|
15
|
+
import { O as Ya, V as ja, a as za, b as Ja, c as Za, r as qa } from "../types-BwqkOoJ6.js";
|
|
16
16
|
import { a as $a } from "../onChainBtcPubkey-C-6UWpD8.js";
|
|
17
|
-
import { C as ee, M as se,
|
|
18
|
-
import { ApplicationRegistryABI as
|
|
19
|
-
import { B as
|
|
20
|
-
import { B as
|
|
21
|
-
import { V as
|
|
22
|
-
import { B as
|
|
23
|
-
import { B as
|
|
24
|
-
import { U as
|
|
25
|
-
import { V as
|
|
26
|
-
import { A as
|
|
27
|
-
import { S as
|
|
28
|
-
import { D as
|
|
29
|
-
import { H as
|
|
30
|
-
import { C as
|
|
17
|
+
import { C as ee, M as se, R as te, V as re, c as ie, e as oe, d as ne, i as Pe, v as pe, a as Ee, b as ce } from "../pegin-registration-client-7Vbtdypu.js";
|
|
18
|
+
import { ApplicationRegistryABI as ue, ProtocolParamsABI as de } from "./core/contracts/index.js";
|
|
19
|
+
import { B as ge } from "../BTCVaultRegistry.abi-BT3eo60h.js";
|
|
20
|
+
import { B as _e, C as Te, e as me, g as Se, h as Ie, i as Ce } from "../BTCVaultRegistryKeyEpochs.abi-D8cIbMtH.js";
|
|
21
|
+
import { V as fe, b as be, a as xe, d as Ne, f as Ve, p as he } from "../parseFundingOutpoints-BQWvINfm.js";
|
|
22
|
+
import { B as Me, a as Fe, c as De, b as ye, d as Ue, g as Be, h as He, f as Le, s as Ke, e as Xe } from "../psbtInputFields-CCVyaQMi.js";
|
|
23
|
+
import { B as Ge, D as We, L as we, M as Ye, c as je, P as ze, b as Je, a as Ze, S as qe, T as Qe, W as $e, f as as, d as es, p as ss, r as ts } from "../fundPeginTransaction-CwhRbCQC.js";
|
|
24
|
+
import { U as is, a as os, e as ns, f as Ps, v as ps } from "../reservation-Cj9F0rP9.js";
|
|
25
|
+
import { V as cs, a as ls, b as us, v as ds } from "../index-DQ5bfoT3.js";
|
|
26
|
+
import { A as gs, D as As, J as _s, a as Ts, b as ms, d as Ss, P as Is, R as Cs, e as Os, c as fs, V as bs, i as xs } from "../json-rpc-client-DuUARJvV.js";
|
|
27
|
+
import { S as Vs, V as hs, c as vs, p as Ms, v as Fs, a as Ds } from "../primeVpAuth-DdfHSC53.js";
|
|
28
|
+
import { D as Us, d as Bs, P as Hs, a as Ls, b as Ks, n as Xs, o as ks, m as Gs, p as Ws, U as ws, V as Ys, h as js, c as zs, g as Js, k as Zs, j as qs, e as Qs, f as $s, i as at, r as et, l as st, t as tt } from "../toRefundInputs-D708M8MA.js";
|
|
29
|
+
import { H as it, E as ot, P as nt, o as Pt, c as pt, d as Et, S as ct, T as lt, U as ut, V as dt, K as Rt, L as gt, M as At, N as _t, O as Tt, R as mt, a as St, b as It, y as Ct, Q as Ot, I as ft, J as bt, g as xt, z as Nt, p as Vt, i as ht, e as vt, G as Mt, F as Ft, t as Dt, A as yt, B as Ut, C as Bt, D as Ht, r as Lt, s as Kt, f as Xt, h as kt, j as Gt, v as Wt, k as wt, l as Yt, m as jt, n as zt, q as Jt, u as Zt, w as qt, x as Qt } from "../buildAndBroadcastReclaim-DD50pVB1.js";
|
|
30
|
+
import { C as ar, P as er, c as sr, g as tr, i as rr } from "../peginState-CxDiaKuk.js";
|
|
31
31
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
gs as AUTH_REJECTED_RPC_CODE,
|
|
33
|
+
ue as ApplicationRegistryABI,
|
|
34
|
+
it as BIP68NotMatureError,
|
|
35
35
|
Ea as BITCOIN_ADDRESS_RE,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
ge as BTCVaultRegistryABI,
|
|
37
|
+
_e as BTCVaultRegistryKeyEpochsABI,
|
|
38
|
+
Ge as BTC_DUST_SAT,
|
|
39
|
+
Me as BitcoinScriptType,
|
|
40
40
|
ee as COMMISSION_BPS_HEADROOM,
|
|
41
41
|
ca as COMPRESSED_PUBKEY_HEX_LEN,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
Te as CONTRACT_ERRORS,
|
|
43
|
+
ot as ClaimerPegoutStatusValue,
|
|
44
|
+
ar as ContractStatus,
|
|
45
|
+
Us as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
|
|
46
|
+
We as DUST_THRESHOLD,
|
|
47
|
+
As as DaemonStatus,
|
|
48
|
+
Bs as DepositTermsRejectedError,
|
|
49
|
+
la as HEX_RE,
|
|
50
|
+
_s as JSON_RPC_ERROR_CODES,
|
|
51
|
+
Ts as JsonRpcClient,
|
|
52
|
+
ms as JsonRpcError,
|
|
53
|
+
ua as KNOWN_SCRIPT_PREFIXES,
|
|
54
|
+
we as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
55
55
|
se as MAX_ACCEPTABLE_COMMISSION_BPS_CAP,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
Ye as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
57
|
+
da as MAX_REASONABLE_FEE_SATS,
|
|
58
|
+
je as MAX_REASONABLE_PEGIN_VBYTES,
|
|
59
59
|
Da as MEMPOOL_API_URLS,
|
|
60
60
|
Ya as OnChainBtcVaultStatus,
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
ze as P2TR_INPUT_SIZE,
|
|
62
|
+
Je as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
63
63
|
s as PEGIN_DEPOSITOR_CLAIM_VOUT,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
nt as PEGIN_ETH_CONFIRMATIONS,
|
|
65
|
+
Hs as PEGIN_FINGERPRINT_DOMAIN,
|
|
66
|
+
Ls as PEGIN_FINGERPRINT_DOMAIN_PREIMAGE,
|
|
67
|
+
Ze as PEGIN_FIXED_OUTPUTS,
|
|
68
|
+
Ss as POST_WOTS_STATUSES,
|
|
69
|
+
Is as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
70
|
+
Pt as ParticipantKeyDriftError,
|
|
71
|
+
xa as PayoutManager,
|
|
72
|
+
er as PeginAction,
|
|
73
|
+
Ks as PeginFingerprintInputError,
|
|
74
74
|
ma as PeginManager,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
Xs as PeginParamsAmbiguousError,
|
|
76
|
+
ks as PeginParamsIncompleteSpaceError,
|
|
77
|
+
Gs as PeginParamsNotFoundError,
|
|
78
|
+
pt as PeginRegistrationMissingError,
|
|
79
|
+
Et as PeginRegistrationNotFinalError,
|
|
80
|
+
Ws as PeginSizingIntegrityError,
|
|
81
|
+
de as ProtocolParamsABI,
|
|
82
82
|
t as PsbtSubstitutionError,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
ct as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
|
|
84
|
+
lt as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
|
|
85
|
+
ut as RECLAIM_MAX_FEE_RATE_SATS_VB,
|
|
86
|
+
dt as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
|
|
87
|
+
Rt as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
88
|
+
gt as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
89
|
+
At as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
90
|
+
_t as REFUND_VSIZE,
|
|
91
|
+
Tt as ReclaimUneconomicalError,
|
|
92
|
+
mt as RegisteredVaultVersionMismatchError,
|
|
93
|
+
te as RegistrationLogsUnavailableError,
|
|
94
|
+
Cs as RpcErrorCode,
|
|
95
|
+
qe as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
96
|
+
Vs as ServerIdentityError,
|
|
96
97
|
Ra as TXID_RE,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
Qe as TX_BUFFER_SIZE_OVERHEAD,
|
|
99
|
+
ws as UnanchoredPrePeginError,
|
|
100
|
+
is as UtxoNotAvailableError,
|
|
101
|
+
fe as VAULT_APP_NAME,
|
|
102
|
+
Os as VP_BATCH_MAX_SIZE,
|
|
103
|
+
fs as VP_TERMINAL_FAILURE_STATUSES,
|
|
104
|
+
bs as VP_TRANSIENT_STATUSES,
|
|
105
|
+
cs as VaultProviderRpcClient,
|
|
106
|
+
Ys as VaultRootMismatchError,
|
|
106
107
|
ja as ViemOperationKeyReader,
|
|
107
|
-
|
|
108
|
+
re as ViemPeginRegistrationClient,
|
|
108
109
|
za as ViemProtocolParamsReader,
|
|
109
110
|
Ja as ViemUniversalChallengerReader,
|
|
110
111
|
Za as ViemVaultKeeperReader,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
ie as ViemVaultRegistryReader,
|
|
113
|
+
ls as VpResponseValidationError,
|
|
114
|
+
hs as VpTokenRegistry,
|
|
115
|
+
$e as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
116
|
+
ga as X_ONLY_PUBKEY_HEX_LEN,
|
|
117
|
+
St as activateVault,
|
|
118
|
+
It as activateVaultAndRedeem,
|
|
119
|
+
Fe as applyChangeOutputPolicy,
|
|
120
|
+
x as assertKeyPathSchnorrSignature,
|
|
120
121
|
$a as assertOnChainBtcPubkey,
|
|
121
122
|
r as assertPsbtUnsignedTxMatches,
|
|
122
|
-
|
|
123
|
+
N as assertReturnedKeyPathSignatures,
|
|
123
124
|
i as assertScriptPathSchnorrSignature,
|
|
124
|
-
|
|
125
|
+
os as assertUtxosAvailable,
|
|
125
126
|
R as assertValidVaultCoreVersion,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
Ct as assertVaultProviderHintAccepted,
|
|
128
|
+
us as batchPollByProvider,
|
|
129
|
+
Ot as buildAndBroadcastReclaim,
|
|
130
|
+
ft as buildAndBroadcastRefund,
|
|
130
131
|
K as buildChallengeAssertPsbt,
|
|
131
132
|
Sa as buildDepositTerms,
|
|
132
|
-
|
|
133
|
+
be as buildFundingOutpointsCommitment,
|
|
133
134
|
F as buildNoPayoutPsbt,
|
|
134
135
|
o as buildPayoutPsbt,
|
|
135
136
|
V as buildPeginInputPsbt,
|
|
136
|
-
|
|
137
|
+
js as buildPeginParamsCandidates,
|
|
137
138
|
n as buildPeginTxFromFundedPrePegin,
|
|
138
139
|
P as buildPrePeginPsbt,
|
|
139
140
|
D as buildReclaimPsbt,
|
|
140
141
|
y as buildRefundPsbt,
|
|
141
|
-
|
|
142
|
+
xe as buildVaultContext,
|
|
142
143
|
na as calculateBtcTxHash,
|
|
143
|
-
|
|
144
|
+
sr as canPerformAction,
|
|
144
145
|
k as canonicalizeBtcPubkey,
|
|
145
|
-
|
|
146
|
+
oe as capMaxAcceptableCommissionBps,
|
|
146
147
|
ia as combineAbortSignals,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
De as computeChangeOutputFeeSats,
|
|
149
|
+
Na as computeHashlock,
|
|
150
|
+
ye as computeMaxDeposit,
|
|
151
|
+
A as computeMinClaimValue,
|
|
152
|
+
_ as computeMinPeginFee,
|
|
152
153
|
p as computeNumLocalChallengers,
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
Ue as computePeginBaseFeeSats,
|
|
155
|
+
zs as computePeginFingerprint,
|
|
155
156
|
Ia as computeWotsBlockPublicKeysHash,
|
|
156
|
-
|
|
157
|
+
vs as createAuthenticatedVpClient,
|
|
157
158
|
E as createPayoutScript,
|
|
158
159
|
Pa as createTaprootScriptPathSignOptions,
|
|
159
160
|
G as deriveBip86ScriptPubKeyHex,
|
|
160
161
|
c as deriveDepositorClaimDescriptor,
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
l as deriveDepositorClaimScriptPubKey,
|
|
163
|
+
Js as deriveHashlocksFromPrePegin,
|
|
163
164
|
W as deriveNativeSegwitAddress,
|
|
164
|
-
|
|
165
|
+
ne as derivePeginVaultId,
|
|
165
166
|
w as deriveTaprootAddress,
|
|
166
167
|
T as deriveVaultId,
|
|
167
|
-
|
|
168
|
+
Ne as deriveVaultRoot,
|
|
168
169
|
Ca as deriveWotsBlocksFromSeed,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
Zs as describePeginParamsCandidate,
|
|
171
|
+
qs as describeUnresolvedVersion,
|
|
172
|
+
Qs as encodePeginFingerprintPreimage,
|
|
172
173
|
Y as ensureHexPrefix,
|
|
173
174
|
Oa as ensurePrePeginTermsApproval,
|
|
174
175
|
U as estimateReclaimFeeSats,
|
|
175
|
-
|
|
176
|
+
bt as estimateRefundFeeSats,
|
|
176
177
|
fa as estimateSubmitPeginRequestBatchGas,
|
|
177
178
|
m as expandAuthAnchor,
|
|
178
179
|
S as expandHashlockSecret,
|
|
179
180
|
I as expandWotsSeed,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
me as extractErrorData,
|
|
182
|
+
ns as extractInputsFromTransaction,
|
|
183
|
+
u as extractPayoutSignature,
|
|
183
184
|
h as extractPeginInputSignature,
|
|
184
185
|
v as finalizePeginInputPsbt,
|
|
185
186
|
B as finalizeScriptPathWithSignatures,
|
|
186
|
-
|
|
187
|
+
Ps as findOverlappingPendingVaults,
|
|
187
188
|
j as formatSatoshisToBtc,
|
|
188
189
|
Va as forwardDepositApproval,
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
Ve as forwardDeriveContextHash,
|
|
191
|
+
as as fundPeginTransaction,
|
|
191
192
|
ya as getAddressTxs,
|
|
192
193
|
Ua as getAddressUtxos,
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
Se as getContractErrorMessage,
|
|
195
|
+
Be as getDustThreshold,
|
|
195
196
|
Ba as getMempoolApiUrl,
|
|
196
197
|
z as getNetwork,
|
|
197
198
|
Ha as getNetworkFees,
|
|
198
199
|
La as getOutspend,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
tr as getPeginProtocolState,
|
|
201
|
+
He as getPsbtInputFields,
|
|
202
|
+
Le as getScriptType,
|
|
202
203
|
J as getSortedXOnlyPubkeys,
|
|
203
204
|
Ka as getTipHeight,
|
|
204
205
|
Xa as getTxHex,
|
|
205
206
|
ka as getTxInfo,
|
|
206
207
|
Ga as getUtxoInfo,
|
|
207
|
-
|
|
208
|
+
Ie as handleContractError,
|
|
208
209
|
Z as hexToUint8Array,
|
|
209
|
-
|
|
210
|
+
rr as isActivationDeadlinePassedOnChain,
|
|
210
211
|
q as isAddressFromPublicKey,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
xs as isAuthRejectedError,
|
|
213
|
+
xt as isDepositAmountValid,
|
|
214
|
+
$s as isDepositTermsRejectedError,
|
|
215
|
+
Nt as isHintAccepted,
|
|
216
|
+
Ce as isKnownContractError,
|
|
217
|
+
Vt as isParticipantKeyDriftError,
|
|
218
|
+
ht as isPeginRegistrationMissingError,
|
|
219
|
+
vt as isPeginRegistrationNotFinalError,
|
|
220
|
+
Mt as isPegoutTerminalStatus,
|
|
221
|
+
Ft as isRecognizedPegoutStatus,
|
|
222
|
+
Dt as isRegisteredVaultVersionMismatchError,
|
|
223
|
+
Pe as isRegistrationLogsUnavailableError,
|
|
222
224
|
Q as isValidHex,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
at as isWotsMismatchError,
|
|
226
|
+
yt as matchKeyHint,
|
|
227
|
+
Ut as matchKeySetHint,
|
|
228
|
+
he as parseFundingOutpointsFromTx,
|
|
229
|
+
es as parseUnfundedWasmTransaction,
|
|
230
|
+
ss as peginOutputCount,
|
|
229
231
|
C as peginP2aAnchorOutput,
|
|
230
|
-
|
|
232
|
+
Ms as primeVpTokenRegistry,
|
|
231
233
|
$ as processPublicKeyToXOnly,
|
|
232
234
|
Wa as pushTx,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
ts as rateBasedTxBufferFee,
|
|
236
|
+
et as rebuildDepositTermsCore,
|
|
235
237
|
H as reclaimVsize,
|
|
236
|
-
|
|
238
|
+
st as reconstructPeginParams,
|
|
237
239
|
ha as requireChangeAddress,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
Bt as resolveCurrentParticipantKeys,
|
|
241
|
+
Ht as resolveParticipantKeysAtEpochs,
|
|
240
242
|
qa as resolveProtocolAddresses,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
Lt as runDepositorPresignFlow,
|
|
244
|
+
Ke as selectUtxosForPegin,
|
|
245
|
+
Xe as shouldAddChangeOutput,
|
|
246
|
+
Kt as signDepositorGraph,
|
|
245
247
|
aa as stripHexPrefix,
|
|
246
|
-
|
|
248
|
+
Xt as submitWotsPublicKey,
|
|
247
249
|
O as supportedTxGraphVersions,
|
|
248
250
|
va as supportsDepositApproval,
|
|
249
|
-
|
|
251
|
+
tt as toRefundInputs,
|
|
250
252
|
ea as toXOnly,
|
|
251
253
|
sa as uint8ArrayToHex,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
kt as validateDepositAmount,
|
|
255
|
+
Gt as validateMultiVaultDepositInputs,
|
|
256
|
+
pe as validateOffchainParams,
|
|
257
|
+
Wt as validateOnChainParticipantKeys,
|
|
258
|
+
Ee as validatePegInConfiguration,
|
|
257
259
|
f as validatePeginP2aAnchor,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
wt as validateProviderSelection,
|
|
261
|
+
Yt as validateRemainingCapacity,
|
|
262
|
+
ds as validateRequestDepositorClaimerArtifactsResponse,
|
|
261
263
|
Ma as validateSecretAgainstHashlock,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
ce as validateTBVProtocolParams,
|
|
265
|
+
ps as validateUtxosAvailable,
|
|
266
|
+
jt as validateVaultAmounts,
|
|
267
|
+
zt as validateVaultProviderPubkey,
|
|
266
268
|
ta as validateWalletPubkey,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
269
|
+
Jt as verifyRegisteredParticipantKeys,
|
|
270
|
+
Zt as verifyRegisteredVaultVersions,
|
|
271
|
+
Fs as verifyServerIdentity,
|
|
272
|
+
Ds as vpTokenRegistry,
|
|
273
|
+
qt as waitForPeginRegistrationDepth,
|
|
274
|
+
Qt as waitForPeginStatus,
|
|
275
|
+
_a as waitForTransactionReceiptSmartAware
|
|
274
276
|
};
|
|
275
277
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var he=Object.defineProperty;var de=(e,r,t)=>r in e?he(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var U=(e,r,t)=>de(e,typeof r!="symbol"?r+"":r,t);const x=require("viem"),pe=require("./sha2-DI0-0SHr.cjs"),H=require("./signPsbtsWithFallback-DtwzL5AA.cjs"),Q=require("./PeginManager-DEByBX5R.cjs"),m=require("./bitcoin-D-O2GjbC.cjs"),v=require("./tbv/core/wasm/index.cjs"),q=require("./parseFundingOutpoints-B4iQeX6q.cjs"),J=require("bitcoinjs-lib"),S=require("./verifyScriptPathSchnorrSignature-DaRqvEgW.cjs"),G=require("./fundPeginTransaction-54-Rwb2k.cjs"),Y=require("./signing-BJ3X66b-.cjs"),K="DepositTermsRejectedError";class Z extends Error{constructor(t,n="device-envelope"){super(t);U(this,"reason");this.name=K,this.reason=n}}function me(e){if(e instanceof Z)return!0;if(typeof e!="object"||e===null)return!1;const r=e;return r.name===K&&r.reason==="device-envelope"}async function ee(e){const r=e.siblings.length;if(r===0)throw new Error("rebuildDepositTermsCore: at least one sibling is required");for(const[o,E]of e.siblings.entries())if(E.amount<=0n)throw new Error(`rebuildDepositTermsCore: sibling[${o}] has non-positive on-chain pegin amount ${E.amount}; the chain-read vault record is invalid. Resume refused.`);if(e.prepeginMaxFee<=0n)throw new Error(`rebuildDepositTermsCore: prepeginMaxFee must be > 0, got ${e.prepeginMaxFee}`);const t=m.stripHexPrefix(e.prepeginTxid).toLowerCase(),n=m.stripHexPrefix(Y.calculateBtcTxHash(e.fundedPrePeginTxHex)).toLowerCase();if(n!==t)throw new Error(`Funded Pre-PegIn tx hashes to ${n}, expected ${t} (on-chain prepeginTxid). Resume refused.`);const h=H.findAuthAnchorOpReturn(m.stripHexPrefix(e.fundedPrePeginTxHex));if(h===void 0)throw new Error("Funded Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN commitment — it either predates auth anchoring or is malformed. The intent resume path requires the anchor to prove sibling completeness. Resume refused.");if(h.vout!==r)throw new Error(`Auth-anchor OP_RETURN at vout ${h.vout} does not match the discovered sibling count ${r}; the discovered sibling set does not cover this transaction's HTLC outputs (a lagging index can cause this — retry later). Resume refused.`);const c=e.vaultKeeperBtcPubkeys.length,u=e.universalChallengerBtcPubkeys.length,l=await v.computeMinClaimValue(e.vaultCoreVersion,c,u,e.councilQuorum,e.councilSize,e.protocolFeeRate),a=await v.computeMinPeginFee(e.vaultCoreVersion,c,u,e.minPeginFeeRate),d=await v.peginP2aAnchorOutput(e.vaultCoreVersion),s=(d==null?void 0:d.value)??0n;if(l<=0n)throw new Error(`WASM returned non-positive depositorClaimValue ${l}; expected > 0. Resume refused.`);if(a<=0n)throw new Error(`WASM returned non-positive peginMaxFee ${a}; expected > 0. Resume refused.`);if(s<0n)throw new Error(`WASM returned negative P2A anchor value ${s}. Resume refused.`);const i=a+s,b=e.minPeginFeeRate*G.MAX_REASONABLE_PEGIN_VBYTES;if(i<=0n||i>b)throw new Error(`WASM implied PegIn reserve ${i} sat is outside (0, ${b}] (minPeginFeeRate=${e.minPeginFeeRate} × ${G.MAX_REASONABLE_PEGIN_VBYTES} vbytes). Resume refused.`);const w=e.siblings.map(o=>o.amount+l+a+s),C=await Promise.all(e.siblings.map(async o=>(await v.getPrePeginHtlcConnectorInfo({txGraphVersion:e.vaultCoreVersion,depositorPubkey:e.depositorBtcPubkey,vaultProviderPubkey:e.vaultProviderBtcPubkey,vaultKeeperPubkeys:[...e.vaultKeeperBtcPubkeys],universalChallengerPubkeys:[...e.universalChallengerBtcPubkeys],hashlock:m.stripHexPrefix(o.hashlock),timelockRefund:e.timelockRefund,network:e.network})).scriptPubKey)),R=J.Transaction.fromHex(m.stripHexPrefix(e.fundedPrePeginTxHex)).outs.map(o=>({value:o.value,script:o.script}));return S.assertEncodedHtlcOutputsMatch(R,w,C),Q.buildDepositTerms({vaultCoreVersion:e.vaultCoreVersion,protocolFeeRate:e.protocolFeeRate,timelockPegin:e.timelockPegin,timelockAssert:e.timelockAssert,timelockRefund:e.timelockRefund,prepeginTxid:e.prepeginTxid,prepeginMaxFee:e.prepeginMaxFee,vaultProviderBtcPubkey:e.vaultProviderBtcPubkey,vaultKeeperBtcPubkeys:e.vaultKeeperBtcPubkeys,universalChallengerBtcPubkeys:e.universalChallengerBtcPubkeys,maxAcceptableCommissionBps:e.maxAcceptableCommissionBps,peginAmounts:e.siblings.map(o=>o.amount),depositorClaimValue:l,peginMaxFee:a})}function ge(e){const r=(e instanceof Error?e.message:typeof e=="string"?e:"").toLowerCase();return r.includes("wots")&&r.includes("hash")&&r.includes("does not match")}const re="TBV.PeginFingerprint.v1",te=x.keccak256(x.toHex(re)),L=65535,j=2n**64n-1n,Pe=2n**256n-1n,fe=/^0x[0-9a-fA-F]{64}$/,W=1;class f extends Error{constructor(r){super(r),this.name="PeginFingerprintInputError"}}function N(e,r,t,n){if(typeof r!="bigint")throw new f(`${e} must be a bigint (Solidity ${n}), got ${typeof r}`);if(r<0n||r>t)throw new f(`${e} must fit Solidity ${n} (0..${t}), got ${r}`)}function I(e,r){if(!Number.isInteger(r)||r<0||r>L)throw new f(`${e} must be an integer fitting Solidity uint16 (0..${L}), got ${r}`)}function ve(e,r){if(!fe.test(r))throw new f(`${e} must be 32 bytes as 0x-prefixed hex (66 characters), got "${r}"`);return r.toLowerCase()}function be(e){if(!x.isAddress(e,{strict:!1}))throw new f(`registryAddress must be a 20-byte 0x-prefixed address, got "${e}"`);const r=e.toLowerCase();if(r===x.zeroAddress)throw new f("registryAddress must not be the zero address; a zero here means the registry address was never resolved");return r}const Ee=[{name:"domain",type:"bytes32"},{name:"chainId",type:"uint256"},{name:"registry",type:"address"},{name:"vaultProviderBtcKey",type:"bytes32"},{name:"appKeeperKeyEpoch",type:"uint64"},{name:"ucKeyEpoch",type:"uint64"},{name:"appVaultKeepersVersion",type:"uint16"},{name:"universalChallengersVersion",type:"uint16"},{name:"offchainParamsVersion",type:"uint16"},{name:"vaultCoreVersion",type:"uint16"}];function ne(e){if(N("chainId",e.chainId,Pe,"uint256"),e.chainId===0n)throw new f("chainId must not be 0; a zero here means the chain id was never resolved");const r=be(e.registryAddress),t=ve("vaultProviderBtcKey",e.vaultProviderBtcKey);if(N("appKeeperKeyEpoch",e.appKeeperKeyEpoch,j,"uint64"),N("ucKeyEpoch",e.ucKeyEpoch,j,"uint64"),I("appVaultKeepersVersion",e.appVaultKeepersVersion),I("universalChallengersVersion",e.universalChallengersVersion),I("offchainParamsVersion",e.offchainParamsVersion),I("vaultCoreVersion",e.vaultCoreVersion),e.vaultCoreVersion<W)throw new f(`vaultCoreVersion must be at least ${W}; ${e.vaultCoreVersion} means the version was never resolved`);return x.encodeAbiParameters(Ee,[te,e.chainId,r,t,e.appKeeperKeyEpoch,e.ucKeyEpoch,e.appVaultKeepersVersion,e.universalChallengersVersion,e.offchainParamsVersion,e.vaultCoreVersion])}function ye(e){return x.keccak256(ne(e))}class oe extends Error{constructor(r,t){super(`Re-derived vault root does not match this Pre-PegIn: derived auth-anchor hash ${r}, transaction commits to ${t}. Connect the same wallet, on the same account and the same network, that created the deposit.`),this.derivedAuthAnchorHash=r,this.onChainAuthAnchorHash=t,this.name="VaultRootMismatchError"}}class B extends Error{constructor(r){super(r),this.name="UnanchoredPrePeginError"}}class se extends Error{constructor(r,t,n=[]){super(`No candidate parameter set reproduces this Pre-PegIn's HTLC outputs (${r} candidate(s) tried). `+(n.length>0?`${n.length} version(s) could not be resolved and may hold the answer: ${n.join(" | ")}. `:"")+`Sample rejections: ${t.join(" | ")}`),this.candidatesTried=r,this.sampleRejections=t,this.unresolvedLabels=n,this.name="PeginParamsNotFoundError"}}class ie extends Error{constructor(r){super(`${r.length} candidate parameter sets reproduce this Pre-PegIn's HTLC outputs, so the vault's stamped versions cannot be determined: ${r.join(" | ")}. Reconstruction refused.`),this.survivorLabels=r,this.name="PeginParamsAmbiguousError"}}class ae extends Error{constructor(r,t){super(`A candidate matched this Pre-PegIn (${r}), but ${t.length} version(s) could not be resolved, so the search space did not provably contain the true parameters: ${t.join(" | ")}. A version sharing the matched timelockRefund and participants is indistinguishable from the true one, so the match cannot be trusted. Reconstruction refused.`),this.matchedLabel=r,this.unresolvedLabels=t,this.name="PeginParamsIncompleteSpaceError"}}class A extends Error{constructor(r){super(`${r}. Reconstruction refused.`),this.name="PeginSizingIntegrityError"}}async function we(e){const{wallet:r,depositorBtcPubkey:t,fundedPrePeginTxHex:n}=e,h=m.stripHexPrefix(n),c=H.findAuthAnchorOpReturn(h);if(c===void 0)throw new B("Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN, so the number of HTLC outputs it funds cannot be determined. Legacy pre-anchor deposits are not recoverable by this path.");const u=c.vout;if(u===0)throw new B("Pre-PegIn's auth-anchor OP_RETURN is at vout 0, implying zero HTLC outputs; there is nothing to recover.");const l=q.parseFundingOutpointsFromTx(h),a=await q.deriveVaultRoot(r,{depositorBtcPubkey:m.hexToUint8Array(m.processPublicKeyToXOnly(t)),fundingOutpoints:l});try{const s=await v.expandAuthAnchor(a);let i;try{i=m.uint8ArrayToHex(pe.sha256(s))}finally{s.fill(0)}if(i!==c.hash)throw new oe(i,c.hash)}catch(s){throw a.fill(0),s}const{hashlocks:d}=await Q.expandPerVaultSecrets(a,u);return{vaultCount:u,hashlocks:d,authAnchorHash:c.hash}}function Re(e){const{vaultCoreVersion:r,offchainParams:t,participantKeySets:n}=e;if(!Number.isInteger(r)||r<1)throw new Error(`buildPeginParamsCandidates: vaultCoreVersion must be a positive integer, got ${r}`);if(t.length===0)throw new Error("buildPeginParamsCandidates: at least one offchain-params version is required");if(n.length===0)throw new Error("buildPeginParamsCandidates: at least one participant key set is required");const h=[];for(const c of t)for(const u of n)h.push({vaultCoreVersion:r,offchainParams:c,participants:u});return h}function ce(e){return`${e.axis} v${e.version} (${e.reason})`}function F(e){const{participants:r}=e;return`core=${e.vaultCoreVersion} offchain=${e.offchainParams.version} keepers=${r.appVaultKeepersVersion} challengers=${r.universalChallengersVersion} vp=${r.vaultProvider}`}const X=5;function xe(e,r){return JSON.stringify({terms:e,peginAmounts:r},(t,n)=>typeof n=="bigint"?`${n}`:n)}function Ce(e){const{offchainParams:r,participants:t}=e;return[e.vaultCoreVersion,t.vaultKeeperBtcPubkeys.length,t.universalChallengerBtcPubkeys.length,r.councilQuorum,r.councilSize,r.protocolFeeRate,r.minPeginFeeRate].join("|")}async function ke(e){const{offchainParams:r,participants:t}=e,n=t.vaultKeeperBtcPubkeys.length,h=t.universalChallengerBtcPubkeys.length,[c,u,l]=await Promise.all([v.computeMinClaimValue(e.vaultCoreVersion,n,h,r.councilQuorum,r.councilSize,r.protocolFeeRate),v.computeMinPeginFee(e.vaultCoreVersion,n,h,r.minPeginFeeRate),v.peginP2aAnchorOutput(e.vaultCoreVersion)]),a=(l==null?void 0:l.value)??0n;if(c<=0n)throw new A(`WASM returned non-positive depositorClaimValue ${c} for graph version ${e.vaultCoreVersion}`);if(u<=0n)throw new A(`WASM returned non-positive peginMaxFee ${u} for graph version ${e.vaultCoreVersion}`);if(a<0n)throw new A(`WASM returned negative P2A anchor value ${a} for graph version ${e.vaultCoreVersion}`);return{depositorClaimValue:c,peginMaxFee:u,p2aAnchorValue:a}}async function Ve(e){const{hashlocks:r,fundedPrePeginTxHex:t,depositorBtcPubkey:n,prepeginMaxFee:h,maxAcceptableCommissionBps:c,network:u,candidates:l,unresolvedVersions:a}=e;if(r.length===0)throw new Error("reconstructPeginParams: at least one hashlock is required");if(l.length===0)throw new Error("reconstructPeginParams: candidate space is empty");const d=m.processPublicKeyToXOnly(n),s=m.stripHexPrefix(t),i=H.findAuthAnchorOpReturn(s);if(i===void 0)throw new B("Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN; the sibling set cannot be proven complete. Reconstruction refused.");if(i.vout!==r.length)throw new Error(`reconstructPeginParams: ${r.length} hashlock(s) supplied but the auth-anchor OP_RETURN sits at vout ${i.vout}, so the transaction funds ${i.vout} HTLC output(s). Reconstruction refused.`);const b=J.Transaction.fromHex(s).outs,w=r.map((p,g)=>BigInt(b[g].value)),C=m.stripHexPrefix(Y.calculateBtcTxHash(s)).toLowerCase(),R=new Map,o=[],E=[],M=[];let O=0;for(const p of l)try{const g=Ce(p);let P=R.get(g);P===void 0&&(P=await ke(p),R.set(g,P));const k=P.depositorClaimValue+P.peginMaxFee+P.p2aAnchorValue,V=w.map(T=>T-k),$=V.findIndex(T=>T<=0n);if($!==-1)throw new S.HtlcOutputMismatchError(`HTLC output[${$}] value ${w[$]} is not above this candidate's reserve ${k}, so it implies a non-positive pegin amount ${V[$]}.`);const{offchainParams:y,participants:_}=p,D=await ee({vaultCoreVersion:p.vaultCoreVersion,siblings:r.map((T,le)=>({hashlock:T,amount:V[le]})),fundedPrePeginTxHex:s,depositorBtcPubkey:d,vaultProviderBtcPubkey:_.vaultProviderBtcPubkey,vaultKeeperBtcPubkeys:_.vaultKeeperBtcPubkeys,universalChallengerBtcPubkeys:_.universalChallengerBtcPubkeys,protocolFeeRate:y.protocolFeeRate,minPeginFeeRate:y.minPeginFeeRate,councilQuorum:y.councilQuorum,councilSize:y.councilSize,timelockPegin:y.timelockPegin,timelockAssert:y.timelockAssert,timelockRefund:y.timelockRefund,prepeginTxid:C,prepeginMaxFee:h,maxAcceptableCommissionBps:c,network:u});o.push({candidate:p,terms:D,peginAmounts:V,fingerprint:xe(D,V)})}catch(g){if(g instanceof A)throw g;const P=F(p),k=g instanceof Error?g.message:String(g);g instanceof S.HtlcOutputMismatchError?E.length<X&&E.push(`[${P}] ${k}`):(O++,M.length<X&&M.push(`${P} (${k})`))}const ue=a.length+O,z=[...a.map(ce),...M];if(o.length===0)throw new se(l.length,E,z);if(new Set(o.map(p=>p.fingerprint)).size>1)throw new ie(o.map(p=>F(p.candidate)));if(ue>0)throw new ae(F(o[0].candidate),z);return{candidate:o[0].candidate,terms:o[0].terms,peginAmounts:o[0].peginAmounts,authAnchorHash:i.hash,candidatesTried:l.length,matchedCandidates:o.map(p=>p.candidate)}}function Te(e,r){const{htlcVout:t,depositorBtcPubkey:n,applicationEntryPoint:h,fundedPrePeginTxHex:c,hashlocks:u,network:l}=r,{candidate:a,peginAmounts:d}=e,{offchainParams:s,participants:i}=a;if(u.length!==d.length)throw new Error(`toRefundInputs: ${u.length} hashlock(s) but ${d.length} reconstructed amount(s); the reconstruction and the hashlock vector describe different transactions.`);if(!Number.isInteger(t)||t<0||t>=d.length)throw new Error(`toRefundInputs: htlcVout ${t} is outside the reconstructed batch of ${d.length} vault(s).`);const b=d.map((R,o)=>({hashlock:m.ensureHexPrefix(u[o]),amount:R,htlcVout:o})),w={vaultCoreVersion:a.vaultCoreVersion,hashlock:b[t].hashlock,htlcVout:t,offchainParamsVersion:s.version,appVaultKeepersVersion:i.appVaultKeepersVersion,universalChallengersVersion:i.universalChallengersVersion,vaultProvider:i.vaultProvider,applicationEntryPoint:h,amount:d[t],unsignedPrePeginTxHex:c,depositorBtcPubkey:n,batch:b},C={vaultProviderPubkey:i.vaultProviderBtcPubkey,vaultKeeperPubkeys:i.vaultKeeperBtcPubkeys,universalChallengerPubkeys:i.universalChallengerBtcPubkeys,timelockRefund:s.timelockRefund,feeRate:s.protocolFeeRate,minPeginFeeRate:s.minPeginFeeRate,numLocalChallengers:i.vaultKeeperBtcPubkeys.length,councilQuorum:s.councilQuorum,councilSize:s.councilSize,network:l};return{vault:w,context:C}}exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=K;exports.DepositTermsRejectedError=Z;exports.PEGIN_FINGERPRINT_DOMAIN=te;exports.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE=re;exports.PeginFingerprintInputError=f;exports.PeginParamsAmbiguousError=ie;exports.PeginParamsIncompleteSpaceError=ae;exports.PeginParamsNotFoundError=se;exports.PeginSizingIntegrityError=A;exports.UnanchoredPrePeginError=B;exports.VaultRootMismatchError=oe;exports.buildPeginParamsCandidates=Re;exports.computePeginFingerprint=ye;exports.deriveHashlocksFromPrePegin=we;exports.describePeginParamsCandidate=F;exports.describeUnresolvedVersion=ce;exports.encodePeginFingerprintPreimage=ne;exports.isDepositTermsRejectedError=me;exports.isWotsMismatchError=ge;exports.rebuildDepositTermsCore=ee;exports.reconstructPeginParams=Ve;exports.toRefundInputs=Te;
|
|
2
|
-
//# sourceMappingURL=toRefundInputs-
|
|
1
|
+
"use strict";var he=Object.defineProperty;var de=(e,r,t)=>r in e?he(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var U=(e,r,t)=>de(e,typeof r!="symbol"?r+"":r,t);const x=require("viem"),pe=require("./sha2-DI0-0SHr.cjs"),H=require("./signPsbtsWithFallback-DtwzL5AA.cjs"),Q=require("./PeginManager-DE2lTWMl.cjs"),m=require("./bitcoin-D-O2GjbC.cjs"),v=require("./tbv/core/wasm/index.cjs"),q=require("./parseFundingOutpoints-B4iQeX6q.cjs"),J=require("bitcoinjs-lib"),S=require("./verifyScriptPathSchnorrSignature-DaRqvEgW.cjs"),G=require("./fundPeginTransaction-54-Rwb2k.cjs"),Y=require("./signing-BJ3X66b-.cjs"),K="DepositTermsRejectedError";class Z extends Error{constructor(t,n="device-envelope"){super(t);U(this,"reason");this.name=K,this.reason=n}}function me(e){if(e instanceof Z)return!0;if(typeof e!="object"||e===null)return!1;const r=e;return r.name===K&&r.reason==="device-envelope"}async function ee(e){const r=e.siblings.length;if(r===0)throw new Error("rebuildDepositTermsCore: at least one sibling is required");for(const[o,E]of e.siblings.entries())if(E.amount<=0n)throw new Error(`rebuildDepositTermsCore: sibling[${o}] has non-positive on-chain pegin amount ${E.amount}; the chain-read vault record is invalid. Resume refused.`);if(e.prepeginMaxFee<=0n)throw new Error(`rebuildDepositTermsCore: prepeginMaxFee must be > 0, got ${e.prepeginMaxFee}`);const t=m.stripHexPrefix(e.prepeginTxid).toLowerCase(),n=m.stripHexPrefix(Y.calculateBtcTxHash(e.fundedPrePeginTxHex)).toLowerCase();if(n!==t)throw new Error(`Funded Pre-PegIn tx hashes to ${n}, expected ${t} (on-chain prepeginTxid). Resume refused.`);const h=H.findAuthAnchorOpReturn(m.stripHexPrefix(e.fundedPrePeginTxHex));if(h===void 0)throw new Error("Funded Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN commitment — it either predates auth anchoring or is malformed. The intent resume path requires the anchor to prove sibling completeness. Resume refused.");if(h.vout!==r)throw new Error(`Auth-anchor OP_RETURN at vout ${h.vout} does not match the discovered sibling count ${r}; the discovered sibling set does not cover this transaction's HTLC outputs (a lagging index can cause this — retry later). Resume refused.`);const c=e.vaultKeeperBtcPubkeys.length,u=e.universalChallengerBtcPubkeys.length,l=await v.computeMinClaimValue(e.vaultCoreVersion,c,u,e.councilQuorum,e.councilSize,e.protocolFeeRate),a=await v.computeMinPeginFee(e.vaultCoreVersion,c,u,e.minPeginFeeRate),d=await v.peginP2aAnchorOutput(e.vaultCoreVersion),s=(d==null?void 0:d.value)??0n;if(l<=0n)throw new Error(`WASM returned non-positive depositorClaimValue ${l}; expected > 0. Resume refused.`);if(a<=0n)throw new Error(`WASM returned non-positive peginMaxFee ${a}; expected > 0. Resume refused.`);if(s<0n)throw new Error(`WASM returned negative P2A anchor value ${s}. Resume refused.`);const i=a+s,b=e.minPeginFeeRate*G.MAX_REASONABLE_PEGIN_VBYTES;if(i<=0n||i>b)throw new Error(`WASM implied PegIn reserve ${i} sat is outside (0, ${b}] (minPeginFeeRate=${e.minPeginFeeRate} × ${G.MAX_REASONABLE_PEGIN_VBYTES} vbytes). Resume refused.`);const w=e.siblings.map(o=>o.amount+l+a+s),C=await Promise.all(e.siblings.map(async o=>(await v.getPrePeginHtlcConnectorInfo({txGraphVersion:e.vaultCoreVersion,depositorPubkey:e.depositorBtcPubkey,vaultProviderPubkey:e.vaultProviderBtcPubkey,vaultKeeperPubkeys:[...e.vaultKeeperBtcPubkeys],universalChallengerPubkeys:[...e.universalChallengerBtcPubkeys],hashlock:m.stripHexPrefix(o.hashlock),timelockRefund:e.timelockRefund,network:e.network})).scriptPubKey)),R=J.Transaction.fromHex(m.stripHexPrefix(e.fundedPrePeginTxHex)).outs.map(o=>({value:o.value,script:o.script}));return S.assertEncodedHtlcOutputsMatch(R,w,C),Q.buildDepositTerms({vaultCoreVersion:e.vaultCoreVersion,protocolFeeRate:e.protocolFeeRate,timelockPegin:e.timelockPegin,timelockAssert:e.timelockAssert,timelockRefund:e.timelockRefund,prepeginTxid:e.prepeginTxid,prepeginMaxFee:e.prepeginMaxFee,vaultProviderBtcPubkey:e.vaultProviderBtcPubkey,vaultKeeperBtcPubkeys:e.vaultKeeperBtcPubkeys,universalChallengerBtcPubkeys:e.universalChallengerBtcPubkeys,maxAcceptableCommissionBps:e.maxAcceptableCommissionBps,peginAmounts:e.siblings.map(o=>o.amount),depositorClaimValue:l,peginMaxFee:a})}function ge(e){const r=(e instanceof Error?e.message:typeof e=="string"?e:"").toLowerCase();return r.includes("wots")&&r.includes("hash")&&r.includes("does not match")}const re="TBV.PeginFingerprint.v1",te=x.keccak256(x.toHex(re)),L=65535,j=2n**64n-1n,Pe=2n**256n-1n,fe=/^0x[0-9a-fA-F]{64}$/,W=1;class f extends Error{constructor(r){super(r),this.name="PeginFingerprintInputError"}}function N(e,r,t,n){if(typeof r!="bigint")throw new f(`${e} must be a bigint (Solidity ${n}), got ${typeof r}`);if(r<0n||r>t)throw new f(`${e} must fit Solidity ${n} (0..${t}), got ${r}`)}function I(e,r){if(!Number.isInteger(r)||r<0||r>L)throw new f(`${e} must be an integer fitting Solidity uint16 (0..${L}), got ${r}`)}function ve(e,r){if(!fe.test(r))throw new f(`${e} must be 32 bytes as 0x-prefixed hex (66 characters), got "${r}"`);return r.toLowerCase()}function be(e){if(!x.isAddress(e,{strict:!1}))throw new f(`registryAddress must be a 20-byte 0x-prefixed address, got "${e}"`);const r=e.toLowerCase();if(r===x.zeroAddress)throw new f("registryAddress must not be the zero address; a zero here means the registry address was never resolved");return r}const Ee=[{name:"domain",type:"bytes32"},{name:"chainId",type:"uint256"},{name:"registry",type:"address"},{name:"vaultProviderBtcKey",type:"bytes32"},{name:"appKeeperKeyEpoch",type:"uint64"},{name:"ucKeyEpoch",type:"uint64"},{name:"appVaultKeepersVersion",type:"uint16"},{name:"universalChallengersVersion",type:"uint16"},{name:"offchainParamsVersion",type:"uint16"},{name:"vaultCoreVersion",type:"uint16"}];function ne(e){if(N("chainId",e.chainId,Pe,"uint256"),e.chainId===0n)throw new f("chainId must not be 0; a zero here means the chain id was never resolved");const r=be(e.registryAddress),t=ve("vaultProviderBtcKey",e.vaultProviderBtcKey);if(N("appKeeperKeyEpoch",e.appKeeperKeyEpoch,j,"uint64"),N("ucKeyEpoch",e.ucKeyEpoch,j,"uint64"),I("appVaultKeepersVersion",e.appVaultKeepersVersion),I("universalChallengersVersion",e.universalChallengersVersion),I("offchainParamsVersion",e.offchainParamsVersion),I("vaultCoreVersion",e.vaultCoreVersion),e.vaultCoreVersion<W)throw new f(`vaultCoreVersion must be at least ${W}; ${e.vaultCoreVersion} means the version was never resolved`);return x.encodeAbiParameters(Ee,[te,e.chainId,r,t,e.appKeeperKeyEpoch,e.ucKeyEpoch,e.appVaultKeepersVersion,e.universalChallengersVersion,e.offchainParamsVersion,e.vaultCoreVersion])}function ye(e){return x.keccak256(ne(e))}class oe extends Error{constructor(r,t){super(`Re-derived vault root does not match this Pre-PegIn: derived auth-anchor hash ${r}, transaction commits to ${t}. Connect the same wallet, on the same account and the same network, that created the deposit.`),this.derivedAuthAnchorHash=r,this.onChainAuthAnchorHash=t,this.name="VaultRootMismatchError"}}class B extends Error{constructor(r){super(r),this.name="UnanchoredPrePeginError"}}class se extends Error{constructor(r,t,n=[]){super(`No candidate parameter set reproduces this Pre-PegIn's HTLC outputs (${r} candidate(s) tried). `+(n.length>0?`${n.length} version(s) could not be resolved and may hold the answer: ${n.join(" | ")}. `:"")+`Sample rejections: ${t.join(" | ")}`),this.candidatesTried=r,this.sampleRejections=t,this.unresolvedLabels=n,this.name="PeginParamsNotFoundError"}}class ie extends Error{constructor(r){super(`${r.length} candidate parameter sets reproduce this Pre-PegIn's HTLC outputs, so the vault's stamped versions cannot be determined: ${r.join(" | ")}. Reconstruction refused.`),this.survivorLabels=r,this.name="PeginParamsAmbiguousError"}}class ae extends Error{constructor(r,t){super(`A candidate matched this Pre-PegIn (${r}), but ${t.length} version(s) could not be resolved, so the search space did not provably contain the true parameters: ${t.join(" | ")}. A version sharing the matched timelockRefund and participants is indistinguishable from the true one, so the match cannot be trusted. Reconstruction refused.`),this.matchedLabel=r,this.unresolvedLabels=t,this.name="PeginParamsIncompleteSpaceError"}}class A extends Error{constructor(r){super(`${r}. Reconstruction refused.`),this.name="PeginSizingIntegrityError"}}async function we(e){const{wallet:r,depositorBtcPubkey:t,fundedPrePeginTxHex:n}=e,h=m.stripHexPrefix(n),c=H.findAuthAnchorOpReturn(h);if(c===void 0)throw new B("Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN, so the number of HTLC outputs it funds cannot be determined. Legacy pre-anchor deposits are not recoverable by this path.");const u=c.vout;if(u===0)throw new B("Pre-PegIn's auth-anchor OP_RETURN is at vout 0, implying zero HTLC outputs; there is nothing to recover.");const l=q.parseFundingOutpointsFromTx(h),a=await q.deriveVaultRoot(r,{depositorBtcPubkey:m.hexToUint8Array(m.processPublicKeyToXOnly(t)),fundingOutpoints:l});try{const s=await v.expandAuthAnchor(a);let i;try{i=m.uint8ArrayToHex(pe.sha256(s))}finally{s.fill(0)}if(i!==c.hash)throw new oe(i,c.hash)}catch(s){throw a.fill(0),s}const{hashlocks:d}=await Q.expandPerVaultSecrets(a,u);return{vaultCount:u,hashlocks:d,authAnchorHash:c.hash}}function Re(e){const{vaultCoreVersion:r,offchainParams:t,participantKeySets:n}=e;if(!Number.isInteger(r)||r<1)throw new Error(`buildPeginParamsCandidates: vaultCoreVersion must be a positive integer, got ${r}`);if(t.length===0)throw new Error("buildPeginParamsCandidates: at least one offchain-params version is required");if(n.length===0)throw new Error("buildPeginParamsCandidates: at least one participant key set is required");const h=[];for(const c of t)for(const u of n)h.push({vaultCoreVersion:r,offchainParams:c,participants:u});return h}function ce(e){return`${e.axis} v${e.version} (${e.reason})`}function F(e){const{participants:r}=e;return`core=${e.vaultCoreVersion} offchain=${e.offchainParams.version} keepers=${r.appVaultKeepersVersion} challengers=${r.universalChallengersVersion} vp=${r.vaultProvider}`}const X=5;function xe(e,r){return JSON.stringify({terms:e,peginAmounts:r},(t,n)=>typeof n=="bigint"?`${n}`:n)}function Ce(e){const{offchainParams:r,participants:t}=e;return[e.vaultCoreVersion,t.vaultKeeperBtcPubkeys.length,t.universalChallengerBtcPubkeys.length,r.councilQuorum,r.councilSize,r.protocolFeeRate,r.minPeginFeeRate].join("|")}async function ke(e){const{offchainParams:r,participants:t}=e,n=t.vaultKeeperBtcPubkeys.length,h=t.universalChallengerBtcPubkeys.length,[c,u,l]=await Promise.all([v.computeMinClaimValue(e.vaultCoreVersion,n,h,r.councilQuorum,r.councilSize,r.protocolFeeRate),v.computeMinPeginFee(e.vaultCoreVersion,n,h,r.minPeginFeeRate),v.peginP2aAnchorOutput(e.vaultCoreVersion)]),a=(l==null?void 0:l.value)??0n;if(c<=0n)throw new A(`WASM returned non-positive depositorClaimValue ${c} for graph version ${e.vaultCoreVersion}`);if(u<=0n)throw new A(`WASM returned non-positive peginMaxFee ${u} for graph version ${e.vaultCoreVersion}`);if(a<0n)throw new A(`WASM returned negative P2A anchor value ${a} for graph version ${e.vaultCoreVersion}`);return{depositorClaimValue:c,peginMaxFee:u,p2aAnchorValue:a}}async function Ve(e){const{hashlocks:r,fundedPrePeginTxHex:t,depositorBtcPubkey:n,prepeginMaxFee:h,maxAcceptableCommissionBps:c,network:u,candidates:l,unresolvedVersions:a}=e;if(r.length===0)throw new Error("reconstructPeginParams: at least one hashlock is required");if(l.length===0)throw new Error("reconstructPeginParams: candidate space is empty");const d=m.processPublicKeyToXOnly(n),s=m.stripHexPrefix(t),i=H.findAuthAnchorOpReturn(s);if(i===void 0)throw new B("Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN; the sibling set cannot be proven complete. Reconstruction refused.");if(i.vout!==r.length)throw new Error(`reconstructPeginParams: ${r.length} hashlock(s) supplied but the auth-anchor OP_RETURN sits at vout ${i.vout}, so the transaction funds ${i.vout} HTLC output(s). Reconstruction refused.`);const b=J.Transaction.fromHex(s).outs,w=r.map((p,g)=>BigInt(b[g].value)),C=m.stripHexPrefix(Y.calculateBtcTxHash(s)).toLowerCase(),R=new Map,o=[],E=[],M=[];let O=0;for(const p of l)try{const g=Ce(p);let P=R.get(g);P===void 0&&(P=await ke(p),R.set(g,P));const k=P.depositorClaimValue+P.peginMaxFee+P.p2aAnchorValue,V=w.map(T=>T-k),$=V.findIndex(T=>T<=0n);if($!==-1)throw new S.HtlcOutputMismatchError(`HTLC output[${$}] value ${w[$]} is not above this candidate's reserve ${k}, so it implies a non-positive pegin amount ${V[$]}.`);const{offchainParams:y,participants:_}=p,D=await ee({vaultCoreVersion:p.vaultCoreVersion,siblings:r.map((T,le)=>({hashlock:T,amount:V[le]})),fundedPrePeginTxHex:s,depositorBtcPubkey:d,vaultProviderBtcPubkey:_.vaultProviderBtcPubkey,vaultKeeperBtcPubkeys:_.vaultKeeperBtcPubkeys,universalChallengerBtcPubkeys:_.universalChallengerBtcPubkeys,protocolFeeRate:y.protocolFeeRate,minPeginFeeRate:y.minPeginFeeRate,councilQuorum:y.councilQuorum,councilSize:y.councilSize,timelockPegin:y.timelockPegin,timelockAssert:y.timelockAssert,timelockRefund:y.timelockRefund,prepeginTxid:C,prepeginMaxFee:h,maxAcceptableCommissionBps:c,network:u});o.push({candidate:p,terms:D,peginAmounts:V,fingerprint:xe(D,V)})}catch(g){if(g instanceof A)throw g;const P=F(p),k=g instanceof Error?g.message:String(g);g instanceof S.HtlcOutputMismatchError?E.length<X&&E.push(`[${P}] ${k}`):(O++,M.length<X&&M.push(`${P} (${k})`))}const ue=a.length+O,z=[...a.map(ce),...M];if(o.length===0)throw new se(l.length,E,z);if(new Set(o.map(p=>p.fingerprint)).size>1)throw new ie(o.map(p=>F(p.candidate)));if(ue>0)throw new ae(F(o[0].candidate),z);return{candidate:o[0].candidate,terms:o[0].terms,peginAmounts:o[0].peginAmounts,authAnchorHash:i.hash,candidatesTried:l.length,matchedCandidates:o.map(p=>p.candidate)}}function Te(e,r){const{htlcVout:t,depositorBtcPubkey:n,applicationEntryPoint:h,fundedPrePeginTxHex:c,hashlocks:u,network:l}=r,{candidate:a,peginAmounts:d}=e,{offchainParams:s,participants:i}=a;if(u.length!==d.length)throw new Error(`toRefundInputs: ${u.length} hashlock(s) but ${d.length} reconstructed amount(s); the reconstruction and the hashlock vector describe different transactions.`);if(!Number.isInteger(t)||t<0||t>=d.length)throw new Error(`toRefundInputs: htlcVout ${t} is outside the reconstructed batch of ${d.length} vault(s).`);const b=d.map((R,o)=>({hashlock:m.ensureHexPrefix(u[o]),amount:R,htlcVout:o})),w={vaultCoreVersion:a.vaultCoreVersion,hashlock:b[t].hashlock,htlcVout:t,offchainParamsVersion:s.version,appVaultKeepersVersion:i.appVaultKeepersVersion,universalChallengersVersion:i.universalChallengersVersion,vaultProvider:i.vaultProvider,applicationEntryPoint:h,amount:d[t],unsignedPrePeginTxHex:c,depositorBtcPubkey:n,batch:b},C={vaultProviderPubkey:i.vaultProviderBtcPubkey,vaultKeeperPubkeys:i.vaultKeeperBtcPubkeys,universalChallengerPubkeys:i.universalChallengerBtcPubkeys,timelockRefund:s.timelockRefund,feeRate:s.protocolFeeRate,minPeginFeeRate:s.minPeginFeeRate,numLocalChallengers:i.vaultKeeperBtcPubkeys.length,councilQuorum:s.councilQuorum,councilSize:s.councilSize,network:l};return{vault:w,context:C}}exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=K;exports.DepositTermsRejectedError=Z;exports.PEGIN_FINGERPRINT_DOMAIN=te;exports.PEGIN_FINGERPRINT_DOMAIN_PREIMAGE=re;exports.PeginFingerprintInputError=f;exports.PeginParamsAmbiguousError=ie;exports.PeginParamsIncompleteSpaceError=ae;exports.PeginParamsNotFoundError=se;exports.PeginSizingIntegrityError=A;exports.UnanchoredPrePeginError=B;exports.VaultRootMismatchError=oe;exports.buildPeginParamsCandidates=Re;exports.computePeginFingerprint=ye;exports.deriveHashlocksFromPrePegin=we;exports.describePeginParamsCandidate=F;exports.describeUnresolvedVersion=ce;exports.encodePeginFingerprintPreimage=ne;exports.isDepositTermsRejectedError=me;exports.isWotsMismatchError=ge;exports.rebuildDepositTermsCore=ee;exports.reconstructPeginParams=Ve;exports.toRefundInputs=Te;
|
|
2
|
+
//# sourceMappingURL=toRefundInputs-BH3wkNC4.cjs.map
|