@babylonlabs-io/ts-sdk 0.68.0 → 0.68.1

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.
Files changed (55) hide show
  1. package/dist/{PeginManager--2R3T2S8.js → PeginManager-Bsv6caG3.js} +371 -363
  2. package/dist/PeginManager-Bsv6caG3.js.map +1 -0
  3. package/dist/PeginManager-C5NWzGT7.cjs +2 -0
  4. package/dist/PeginManager-C5NWzGT7.cjs.map +1 -0
  5. package/dist/{batchPoll-Cjj1du0i.js → batchPoll-Bc_UKaTz.js} +2 -2
  6. package/dist/{batchPoll-Cjj1du0i.js.map → batchPoll-Bc_UKaTz.js.map} +1 -1
  7. package/dist/{batchPoll-REVZiE-M.cjs → batchPoll-C9cZ5usJ.cjs} +2 -2
  8. package/dist/{batchPoll-REVZiE-M.cjs.map → batchPoll-C9cZ5usJ.cjs.map} +1 -1
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.js +5 -5
  11. package/dist/{mempoolApi-_D-jvtj_.js → mempoolApi-71R_CNZa.js} +71 -69
  12. package/dist/mempoolApi-71R_CNZa.js.map +1 -0
  13. package/dist/mempoolApi-BJN9fGEd.cjs +2 -0
  14. package/dist/mempoolApi-BJN9fGEd.cjs.map +1 -0
  15. package/dist/tbv/core/clients/index.cjs +1 -1
  16. package/dist/tbv/core/clients/index.js +2 -2
  17. package/dist/tbv/core/clients/vault-provider/auth/bip322Verify.d.ts +9 -0
  18. package/dist/tbv/core/clients/vault-provider/auth/bip322Verify.d.ts.map +1 -1
  19. package/dist/tbv/core/index.cjs +1 -1
  20. package/dist/tbv/core/index.js +5 -5
  21. package/dist/tbv/core/managers/index.cjs +1 -1
  22. package/dist/tbv/core/managers/index.js +1 -1
  23. package/dist/tbv/core/managers/pegin/verifyPopWitness.d.ts.map +1 -1
  24. package/dist/tbv/core/primitives/index.cjs +1 -1
  25. package/dist/tbv/core/primitives/index.js +1 -1
  26. package/dist/tbv/core/primitives/psbt/verifyKeyPathSchnorrSignature.d.ts +6 -5
  27. package/dist/tbv/core/primitives/psbt/verifyKeyPathSchnorrSignature.d.ts.map +1 -1
  28. package/dist/tbv/index.cjs +1 -1
  29. package/dist/tbv/index.js +5 -5
  30. package/dist/testing/MockBitcoinWallet.d.ts +1 -1
  31. package/dist/testing/MockBitcoinWallet.d.ts.map +1 -1
  32. package/dist/testing/index.cjs +1 -1
  33. package/dist/testing/index.cjs.map +1 -1
  34. package/dist/testing/index.js +66 -62
  35. package/dist/testing/index.js.map +1 -1
  36. package/dist/testing/signBip322P2wpkhWitness.d.ts +5 -0
  37. package/dist/testing/signBip322P2wpkhWitness.d.ts.map +1 -1
  38. package/dist/{toRefundInputs-9hv_6k0E.js → toRefundInputs-4UJfSVEz.js} +2 -2
  39. package/dist/{toRefundInputs-9hv_6k0E.js.map → toRefundInputs-4UJfSVEz.js.map} +1 -1
  40. package/dist/{toRefundInputs-D8sFs44p.cjs → toRefundInputs-DgDhx_Ut.cjs} +2 -2
  41. package/dist/{toRefundInputs-D8sFs44p.cjs.map → toRefundInputs-DgDhx_Ut.cjs.map} +1 -1
  42. package/dist/{verifyKeyPathSchnorrSignature-oGCUbjjZ.js → verifyKeyPathSchnorrSignature-C6Cmk0R1.js} +137 -128
  43. package/dist/verifyKeyPathSchnorrSignature-C6Cmk0R1.js.map +1 -0
  44. package/dist/verifyKeyPathSchnorrSignature-Cr5T4Aym.cjs +2 -0
  45. package/dist/verifyKeyPathSchnorrSignature-Cr5T4Aym.cjs.map +1 -0
  46. package/package.json +1 -1
  47. package/dist/PeginManager--2R3T2S8.js.map +0 -1
  48. package/dist/PeginManager-CKWq8ouZ.cjs +0 -2
  49. package/dist/PeginManager-CKWq8ouZ.cjs.map +0 -1
  50. package/dist/mempoolApi-EU1La9wk.cjs +0 -2
  51. package/dist/mempoolApi-EU1La9wk.cjs.map +0 -1
  52. package/dist/mempoolApi-_D-jvtj_.js.map +0 -1
  53. package/dist/verifyKeyPathSchnorrSignature-DCOzQkDf.cjs +0 -2
  54. package/dist/verifyKeyPathSchnorrSignature-DCOzQkDf.cjs.map +0 -1
  55. package/dist/verifyKeyPathSchnorrSignature-oGCUbjjZ.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./verifyScriptPathSchnorrSignature-la8XOAFm.cjs"),_=require("./constants-DU5CGcqO.cjs"),c=require("@babylonlabs-io/babylon-tbv-rust-wasm"),E=require("./verifyKeyPathSchnorrSignature-DCOzQkDf.cjs"),T=require("./noPayout-Ox27Td9x.cjs"),m=require("./challengeAssert-BrpC3-cQ.cjs"),r=require("./bitcoin-m84N5a8o.cjs"),l=require("./validation-CDbOaDj7.cjs"),O=require("./signing-Bnsro0hE.cjs"),P=require("./PeginManager-CKWq8ouZ.cjs"),d=require("./signPsbtsWithFallback-DJ4kE9UI.cjs"),R=require("./ProtocolParams.abi-CYZoV2EI.cjs"),C=require("./BTCVaultRegistry.abi-z7d_eP22.cjs"),b=require("./BTCVaultRegistryKeyEpochs.abi-_NERAdc5.cjs"),g=require("./errors-CGcNP0rV.cjs"),p=require("./parseFundingOutpoints-CIO9Ok1L.cjs"),y=require("./shared/index.cjs"),s=require("./waitForTransactionReceiptSmartAware-AgZ-3WV_.cjs"),a=require("./fundPeginTransaction-BLD8FRL9.cjs"),S=require("./reservation-CDbInVw0.cjs"),o=require("./mempoolApi-EU1La9wk.cjs"),i=require("./batchPoll-REVZiE-M.cjs"),n=require("./json-rpc-client-BiAmg_ho.cjs"),h=require("./onChainBtcPubkey-C_a2L3kL.cjs"),t=require("./toRefundInputs-D8sFs44p.cjs"),e=require("./buildAndBroadcastRefund-DrXwxrW1.cjs"),A=require("./peginState-eaQ4IO_R.cjs");exports.PsbtSubstitutionError=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=u.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.computeNumLocalChallengers=u.computeNumLocalChallengers;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.assertValidVaultCoreVersion=_.assertValidVaultCoreVersion;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>c.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>c.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>c.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>c.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>c.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>c.expandWotsSeed});Object.defineProperty(exports,"peginP2aAnchorOutput",{enumerable:!0,get:()=>c.peginP2aAnchorOutput});Object.defineProperty(exports,"supportedTxGraphVersions",{enumerable:!0,get:()=>c.supportedTxGraphVersions});Object.defineProperty(exports,"validatePeginP2aAnchor",{enumerable:!0,get:()=>c.validatePeginP2aAnchor});exports.assertKeyPathSchnorrSignature=E.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=E.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=E.buildPeginInputPsbt;exports.extractPeginInputSignature=E.extractPeginInputSignature;exports.finalizePeginInputPsbt=E.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=T.buildNoPayoutPsbt;exports.buildRefundPsbt=T.buildRefundPsbt;exports.buildChallengeAssertPsbt=m.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.BITCOIN_ADDRESS_RE=l.BITCOIN_ADDRESS_RE;exports.HEX_RE=l.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=l.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=l.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=l.TXID_RE;exports.combineAbortSignals=l.combineAbortSignals;exports.createTaprootScriptPathSignOptions=O.createTaprootScriptPathSignOptions;exports.COMMISSION_BPS_HEADROOM=P.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=P.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.PeginManager=P.PeginManager;exports.buildDepositTerms=P.buildDepositTerms;exports.capMaxAcceptableCommissionBps=P.capMaxAcceptableCommissionBps;exports.computeWotsBlockPublicKeysHash=P.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=P.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=P.ensurePrePeginTermsApproval;exports.estimateSubmitPeginRequestBatchGas=P.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.ApplicationRegistryABI=R.ApplicationRegistryABI;exports.ProtocolParamsABI=R.ProtocolParamsABI;exports.BTCVaultRegistryABI=C.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=b.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=g.CONTRACT_ERRORS;exports.extractErrorData=g.extractErrorData;exports.getContractErrorMessage=g.getContractErrorMessage;exports.handleContractError=g.handleContractError;exports.isKnownContractError=g.isKnownContractError;exports.VAULT_APP_NAME=p.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=p.buildFundingOutpointsCommitment;exports.buildVaultContext=p.buildVaultContext;exports.deriveVaultRoot=p.deriveVaultRoot;exports.forwardDeriveContextHash=p.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=p.parseFundingOutpointsFromTx;exports.BitcoinNetworks=y.BitcoinNetworks;exports.BitcoinScriptType=s.BitcoinScriptType;exports.applyChangeOutputPolicy=s.applyChangeOutputPolicy;exports.calculateBtcTxHash=s.calculateBtcTxHash;exports.computeChangeOutputFeeSats=s.computeChangeOutputFeeSats;exports.computeMaxDeposit=s.computeMaxDeposit;exports.computePeginBaseFeeSats=s.computePeginBaseFeeSats;exports.getDustThreshold=s.getDustThreshold;exports.getPsbtInputFields=s.getPsbtInputFields;exports.getScriptType=s.getScriptType;exports.selectUtxosForPegin=s.selectUtxosForPegin;exports.shouldAddChangeOutput=s.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=s.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=a.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.UtxoNotAvailableError=S.UtxoNotAvailableError;exports.assertUtxosAvailable=S.assertUtxosAvailable;exports.extractInputsFromTransaction=S.extractInputsFromTransaction;exports.findOverlappingPendingVaults=S.findOverlappingPendingVaults;exports.validateUtxosAvailable=S.validateUtxosAvailable;exports.MEMPOOL_API_URLS=o.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=o.ViemVaultRegistryReader;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.validateOffchainParams=o.validateOffchainParams;exports.validatePegInConfiguration=o.validatePegInConfiguration;exports.validateTBVProtocolParams=o.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemOperationKeyReader=i.ViemOperationKeyReader;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_REJECTED_RPC_CODE=n.AUTH_REJECTED_RPC_CODE;exports.DaemonStatus=n.DaemonStatus;exports.JSON_RPC_ERROR_CODES=n.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=n.JsonRpcClient;exports.JsonRpcError=n.JsonRpcError;exports.POST_WOTS_STATUSES=n.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=n.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=n.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=n.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=n.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=n.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=n.isAuthRejectedError;exports.assertOnChainBtcPubkey=h.assertOnChainBtcPubkey;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;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.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;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.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.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;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=A.ContractStatus;exports.PeginAction=A.PeginAction;exports.canPerformAction=A.canPerformAction;exports.getPeginProtocolState=A.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=A.isActivationDeadlinePassedOnChain;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./verifyScriptPathSchnorrSignature-la8XOAFm.cjs"),_=require("./constants-DU5CGcqO.cjs"),c=require("@babylonlabs-io/babylon-tbv-rust-wasm"),E=require("./verifyKeyPathSchnorrSignature-Cr5T4Aym.cjs"),T=require("./noPayout-Ox27Td9x.cjs"),m=require("./challengeAssert-BrpC3-cQ.cjs"),r=require("./bitcoin-m84N5a8o.cjs"),l=require("./validation-CDbOaDj7.cjs"),O=require("./signing-Bnsro0hE.cjs"),P=require("./PeginManager-C5NWzGT7.cjs"),d=require("./signPsbtsWithFallback-DJ4kE9UI.cjs"),R=require("./ProtocolParams.abi-CYZoV2EI.cjs"),C=require("./BTCVaultRegistry.abi-z7d_eP22.cjs"),b=require("./BTCVaultRegistryKeyEpochs.abi-_NERAdc5.cjs"),g=require("./errors-CGcNP0rV.cjs"),p=require("./parseFundingOutpoints-CIO9Ok1L.cjs"),y=require("./shared/index.cjs"),s=require("./waitForTransactionReceiptSmartAware-AgZ-3WV_.cjs"),a=require("./fundPeginTransaction-BLD8FRL9.cjs"),S=require("./reservation-CDbInVw0.cjs"),o=require("./mempoolApi-BJN9fGEd.cjs"),i=require("./batchPoll-C9cZ5usJ.cjs"),n=require("./json-rpc-client-BiAmg_ho.cjs"),h=require("./onChainBtcPubkey-C_a2L3kL.cjs"),t=require("./toRefundInputs-DgDhx_Ut.cjs"),e=require("./buildAndBroadcastRefund-DrXwxrW1.cjs"),A=require("./peginState-eaQ4IO_R.cjs");exports.PsbtSubstitutionError=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=u.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.computeNumLocalChallengers=u.computeNumLocalChallengers;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.assertValidVaultCoreVersion=_.assertValidVaultCoreVersion;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>c.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>c.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>c.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>c.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>c.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>c.expandWotsSeed});Object.defineProperty(exports,"peginP2aAnchorOutput",{enumerable:!0,get:()=>c.peginP2aAnchorOutput});Object.defineProperty(exports,"supportedTxGraphVersions",{enumerable:!0,get:()=>c.supportedTxGraphVersions});Object.defineProperty(exports,"validatePeginP2aAnchor",{enumerable:!0,get:()=>c.validatePeginP2aAnchor});exports.assertKeyPathSchnorrSignature=E.assertKeyPathSchnorrSignature;exports.assertReturnedKeyPathSignatures=E.assertReturnedKeyPathSignatures;exports.buildPeginInputPsbt=E.buildPeginInputPsbt;exports.extractPeginInputSignature=E.extractPeginInputSignature;exports.finalizePeginInputPsbt=E.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=T.buildNoPayoutPsbt;exports.buildRefundPsbt=T.buildRefundPsbt;exports.buildChallengeAssertPsbt=m.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.BITCOIN_ADDRESS_RE=l.BITCOIN_ADDRESS_RE;exports.HEX_RE=l.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=l.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=l.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=l.TXID_RE;exports.combineAbortSignals=l.combineAbortSignals;exports.createTaprootScriptPathSignOptions=O.createTaprootScriptPathSignOptions;exports.COMMISSION_BPS_HEADROOM=P.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=P.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.PeginManager=P.PeginManager;exports.buildDepositTerms=P.buildDepositTerms;exports.capMaxAcceptableCommissionBps=P.capMaxAcceptableCommissionBps;exports.computeWotsBlockPublicKeysHash=P.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=P.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=P.ensurePrePeginTermsApproval;exports.estimateSubmitPeginRequestBatchGas=P.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.ApplicationRegistryABI=R.ApplicationRegistryABI;exports.ProtocolParamsABI=R.ProtocolParamsABI;exports.BTCVaultRegistryABI=C.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=b.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=g.CONTRACT_ERRORS;exports.extractErrorData=g.extractErrorData;exports.getContractErrorMessage=g.getContractErrorMessage;exports.handleContractError=g.handleContractError;exports.isKnownContractError=g.isKnownContractError;exports.VAULT_APP_NAME=p.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=p.buildFundingOutpointsCommitment;exports.buildVaultContext=p.buildVaultContext;exports.deriveVaultRoot=p.deriveVaultRoot;exports.forwardDeriveContextHash=p.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=p.parseFundingOutpointsFromTx;exports.BitcoinNetworks=y.BitcoinNetworks;exports.BitcoinScriptType=s.BitcoinScriptType;exports.applyChangeOutputPolicy=s.applyChangeOutputPolicy;exports.calculateBtcTxHash=s.calculateBtcTxHash;exports.computeChangeOutputFeeSats=s.computeChangeOutputFeeSats;exports.computeMaxDeposit=s.computeMaxDeposit;exports.computePeginBaseFeeSats=s.computePeginBaseFeeSats;exports.getDustThreshold=s.getDustThreshold;exports.getPsbtInputFields=s.getPsbtInputFields;exports.getScriptType=s.getScriptType;exports.selectUtxosForPegin=s.selectUtxosForPegin;exports.shouldAddChangeOutput=s.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=s.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=a.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.UtxoNotAvailableError=S.UtxoNotAvailableError;exports.assertUtxosAvailable=S.assertUtxosAvailable;exports.extractInputsFromTransaction=S.extractInputsFromTransaction;exports.findOverlappingPendingVaults=S.findOverlappingPendingVaults;exports.validateUtxosAvailable=S.validateUtxosAvailable;exports.MEMPOOL_API_URLS=o.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=o.ViemVaultRegistryReader;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.validateOffchainParams=o.validateOffchainParams;exports.validatePegInConfiguration=o.validatePegInConfiguration;exports.validateTBVProtocolParams=o.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemOperationKeyReader=i.ViemOperationKeyReader;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_REJECTED_RPC_CODE=n.AUTH_REJECTED_RPC_CODE;exports.DaemonStatus=n.DaemonStatus;exports.JSON_RPC_ERROR_CODES=n.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=n.JsonRpcClient;exports.JsonRpcError=n.JsonRpcError;exports.POST_WOTS_STATUSES=n.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=n.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=n.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=n.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=n.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=n.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=n.isAuthRejectedError;exports.assertOnChainBtcPubkey=h.assertOnChainBtcPubkey;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;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.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;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.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.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;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=A.ContractStatus;exports.PeginAction=A.PeginAction;exports.canPerformAction=A.canPerformAction;exports.getPeginProtocolState=A.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=A.isActivationDeadlinePassedOnChain;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { P as s, f as t, g as r, d as i, b as o, a as n, c as P, h as p, e as u } from "./verifyScriptPathSchnorrSignature-Dy9gF5RF.js";
2
2
  import { a as c } from "./constants-GjWXdaqV.js";
3
3
  import { computeMinClaimValue as E, computeMinPeginFee as g, deriveVaultId as A, expandAuthAnchor as T, expandHashlockSecret as S, expandWotsSeed as R, peginP2aAnchorOutput as m, supportedTxGraphVersions as _, validatePeginP2aAnchor as f } from "@babylonlabs-io/babylon-tbv-rust-wasm";
4
- import { a as x, c as h, b as O, e as b, f as I } from "./verifyKeyPathSchnorrSignature-oGCUbjjZ.js";
4
+ import { a as x, c as h, b as O, e as b, f as I } from "./verifyKeyPathSchnorrSignature-C6Cmk0R1.js";
5
5
  import { a as V, b as y } from "./noPayout-CXn-geIS.js";
6
6
  import { b as D } from "./challengeAssert-BNQ8sToz.js";
7
7
  import { c as M, d as B, a as U, b as H, e as K, f as k, k as L, g as X, h as w, i as W, j as G, p as j, s as J, t as z, u as Y, v as Z } from "./bitcoin-Ch_jxnDa.js";
8
8
  import { B as Q, H as $, K as aa, M as ea, T as sa, c as ta } from "./validation-Dj3dqYtl.js";
9
9
  import { c as ia } from "./signing-DaLvGwQe.js";
10
- import { C as na, M as Pa, P as pa, b as ua, a as da, c as ca, d as la, f as Ea, e as ga } from "./PeginManager--2R3T2S8.js";
10
+ import { C as na, M as Pa, P as pa, b as ua, a as da, c as ca, d as la, f as Ea, e as ga } from "./PeginManager-Bsv6caG3.js";
11
11
  import { P as Ta, c as Sa, f as Ra, r as ma, s as _a, v as fa } from "./signPsbtsWithFallback-Bv79gLFe.js";
12
12
  import { A as xa, P as ha } from "./ProtocolParams.abi-C0TSRaHV.js";
13
13
  import { B as ba } from "./BTCVaultRegistry.abi-CJwWI2EO.js";
@@ -18,11 +18,11 @@ import { BitcoinNetworks as Wa } from "./shared/index.js";
18
18
  import { B as ja, a as Ja, f as za, c as Ya, b as Za, d as qa, g as Qa, i as $a, h as ae, s as ee, e as se, w as te } from "./waitForTransactionReceiptSmartAware-lobLm0q0.js";
19
19
  import { B as ie, D as oe, L as ne, M as Pe, c as pe, P as ue, b as de, a as ce, S as le, T as Ee, W as ge, f as Ae, d as Te, p as Se, r as Re } from "./fundPeginTransaction-B2wyjqp0.js";
20
20
  import { U as _e, a as fe, e as Ce, f as xe, v as he } from "./reservation-CBAvoF3U.js";
21
- import { M as be, V as Ie, g as ve, a as Ve, b as ye, c as Ne, d as De, e as Fe, f as Me, h as Be, i as Ue, p as He, v as Ke, j as ke, k as Le } from "./mempoolApi-_D-jvtj_.js";
22
- import { O as we, S as We, V as Ge, g as je, h as Je, i as ze, j as Ye, a as Ze, d as qe, b as Qe, f as $e, p as as, r as es, v as ss, c as ts, e as rs } from "./batchPoll-Cjj1du0i.js";
21
+ import { M as be, V as Ie, g as ve, a as Ve, b as ye, c as Ne, d as De, e as Fe, f as Me, h as Be, i as Ue, p as He, v as Ke, j as ke, k as Le } from "./mempoolApi-71R_CNZa.js";
22
+ import { O as we, S as We, V as Ge, g as je, h as Je, i as ze, j as Ye, a as Ze, d as qe, b as Qe, f as $e, p as as, r as es, v as ss, c as ts, e as rs } from "./batchPoll-Bc_UKaTz.js";
23
23
  import { A as os, D as ns, J as Ps, a as ps, b as us, d as ds, P as cs, R as ls, e as Es, c as gs, V as As, i as Ts } from "./json-rpc-client-DuUARJvV.js";
24
24
  import { a as Rs } from "./onChainBtcPubkey-BAHZyKQL.js";
25
- import { D as _s, a as fs, h as Cs, j as xs, P as hs, k as Os, U as bs, V as Is, c as vs, d as Vs, f as ys, e as Ns, b as Ds, i as Fs, r as Ms, g as Bs, t as Us } from "./toRefundInputs-9hv_6k0E.js";
25
+ import { D as _s, a as fs, h as Cs, j as xs, P as hs, k as Os, U as bs, V as Is, c as vs, d as Vs, f as ys, e as Ns, b as Ds, i as Fs, r as Ms, g as Bs, t as Us } from "./toRefundInputs-4UJfSVEz.js";
26
26
  import { H as Ks, E as ks, P as Ls, o as Xs, c as ws, d as Ws, K as Gs, L as js, M as Js, N as zs, R as Ys, a as Zs, b as qs, y as Qs, I as $s, J as at, g as et, z as st, p as tt, i as rt, e as it, G as ot, F as nt, t as Pt, A as pt, B as ut, C as dt, D as ct, r as lt, s as Et, f as gt, h as At, j as Tt, v as St, k as Rt, l as mt, m as _t, n as ft, q as Ct, u as xt, w as ht, x as Ot } from "./buildAndBroadcastRefund-CpMDJ8up.js";
27
27
  import { C as It, P as vt, c as Vt, g as yt, i as Nt } from "./peginState-CxDiaKuk.js";
28
28
  export {
@@ -1,25 +1,25 @@
1
1
  import * as p from "@bitcoin-js/tiny-secp256k1-asmjs";
2
- import { Transaction as u, payments as b, script as D } from "bitcoinjs-lib";
3
- import { s as T } from "./sha2-BYVxyZzX.js";
2
+ import { Transaction as u, payments as b, script as T } from "bitcoinjs-lib";
3
+ import { s as y } from "./sha2-BYVxyZzX.js";
4
4
  import { Buffer as c } from "buffer";
5
5
  import { B as a } from "./BTCVaultRegistry.abi-CJwWI2EO.js";
6
- import { B as y } from "./BTCVaultRegistryKeyEpochs.abi-CXjhRZbm.js";
7
- import { a as A } from "./onChainBtcPubkey-BAHZyKQL.js";
6
+ import { B as A } from "./BTCVaultRegistryKeyEpochs.abi-CXjhRZbm.js";
7
+ import { a as V } from "./onChainBtcPubkey-BAHZyKQL.js";
8
8
  import { a as G } from "./constants-GjWXdaqV.js";
9
9
  import { B as L, H as W, K as Q, T as j, c as z } from "./validation-Dj3dqYtl.js";
10
- const Y = "BIP0322-signed-message", Z = "TapTweak", N = 32, J = 64, q = 33, tt = 71, et = 72, g = 0, V = 0, C = 0, v = 0, ot = 32, nt = 4294967295, rt = 0, it = 0, st = 32, at = 106;
11
- function k(t, e) {
12
- const o = new TextEncoder().encode(t), n = T(o), i = new Uint8Array(n.length * 2 + e.length);
13
- return i.set(n, 0), i.set(n, n.length), i.set(e, n.length * 2), T(i);
10
+ const Y = "BIP0322-signed-message", Z = "TapTweak", k = 32, q = 64, J = 33, tt = 71, et = 72, g = 0, C = 0, v = 0, S = 0, ot = 32, nt = 4294967295, rt = 0, it = 0, st = 32, at = 106;
11
+ function U(t, e) {
12
+ const o = new TextEncoder().encode(t), n = y(o), i = new Uint8Array(n.length * 2 + e.length);
13
+ return i.set(n, 0), i.set(n, n.length), i.set(e, n.length * 2), y(i);
14
14
  }
15
15
  function ct(t) {
16
- if (t.length !== N) return null;
17
- const e = k(Z, t), o = p.xOnlyPointAddTweak(t, e);
16
+ if (t.length !== k) return null;
17
+ const e = U(Z, t), o = p.xOnlyPointAddTweak(t, e);
18
18
  return o ? o.xOnlyPubkey : null;
19
19
  }
20
- function U(t, e) {
21
- const o = k(Y, t), n = new u();
22
- n.version = V, n.locktime = C;
20
+ function R(t, e) {
21
+ const o = U(Y, t), n = new u();
22
+ n.version = C, n.locktime = v;
23
23
  const i = c.concat([
24
24
  c.from([it, st]),
25
25
  c.from(o)
@@ -27,25 +27,25 @@ function U(t, e) {
27
27
  n.addInput(
28
28
  c.alloc(ot, 0),
29
29
  nt,
30
- v,
30
+ S,
31
31
  i
32
32
  ), n.addOutput(e, g);
33
33
  const r = new u();
34
- return r.version = V, r.locktime = C, r.addInput(
34
+ return r.version = C, r.locktime = v, r.addInput(
35
35
  n.getHash(),
36
36
  rt,
37
- v
37
+ S
38
38
  ), r.addOutput(c.from([at]), g), r;
39
39
  }
40
40
  function At(t, e, o, n = u.SIGHASH_DEFAULT) {
41
- if (e.length !== N || o.length !== J || n !== u.SIGHASH_DEFAULT && n !== u.SIGHASH_ALL)
41
+ if (e.length !== k || o.length !== q || n !== u.SIGHASH_DEFAULT && n !== u.SIGHASH_ALL)
42
42
  return !1;
43
43
  try {
44
44
  const i = b.p2tr({
45
45
  internalPubkey: c.from(e)
46
46
  });
47
47
  if (!i.output) return !1;
48
- const r = i.output, h = U(t, r).hashForWitnessV1(
48
+ const r = i.output, h = R(t, r).hashForWitnessV1(
49
49
  0,
50
50
  [r],
51
51
  [g],
@@ -57,17 +57,17 @@ function At(t, e, o, n = u.SIGHASH_DEFAULT) {
57
57
  }
58
58
  }
59
59
  function Vt(t, e, o) {
60
- if (e.length !== q || o.length < tt || o.length > et)
60
+ if (e.length !== J || o.length < tt || o.length > et)
61
61
  return !1;
62
62
  try {
63
63
  if (!p.isPointCompressed(e)) return !1;
64
- const { signature: n, hashType: i } = D.signature.decode(
64
+ const { signature: n, hashType: i } = T.signature.decode(
65
65
  c.from(o)
66
66
  );
67
- if (i !== u.SIGHASH_ALL) return !1;
67
+ if (!T.signature.encode(n, i).equals(c.from(o)) || i !== u.SIGHASH_ALL) return !1;
68
68
  const r = b.p2wpkh({ pubkey: c.from(e) });
69
69
  if (!r.output || !r.hash) return !1;
70
- const s = U(t, r.output), h = b.p2pkh({ hash: r.hash }).output;
70
+ const s = R(t, r.output), h = b.p2pkh({ hash: r.hash }).output;
71
71
  if (!h) return !1;
72
72
  const m = s.hashForWitnessV0(0, h, g, i);
73
73
  return p.verify(m, e, n, !0);
@@ -75,7 +75,7 @@ function Vt(t, e, o) {
75
75
  return !1;
76
76
  }
77
77
  }
78
- const P = 65535, S = 1e4, d = 4294967295, _ = 255;
78
+ const w = 65535, _ = 1e4, d = 4294967295, B = 255;
79
79
  function ut(t) {
80
80
  if (!Number.isInteger(t) || t < 0 || t > d)
81
81
  throw new Error(
@@ -86,15 +86,15 @@ function lt(t) {
86
86
  const e = [];
87
87
  if (t.timelockAssert <= 0n && e.push(
88
88
  `timelockAssert must be positive, got ${t.timelockAssert}`
89
- ), t.timelockAssert > BigInt(P) && e.push(
90
- `timelockAssert ${t.timelockAssert} exceeds uint16 max (${P})`
89
+ ), t.timelockAssert > BigInt(w) && e.push(
90
+ `timelockAssert ${t.timelockAssert} exceeds uint16 max (${w})`
91
91
  ), t.timelockChallengeAssert <= 0n && e.push(
92
92
  `timelockChallengeAssert must be positive, got ${t.timelockChallengeAssert}`
93
93
  ), t.tRefund <= 0 && e.push(`tRefund must be positive, got ${t.tRefund}`), t.tStale <= 0 && e.push(`tStale must be positive, got ${t.tStale}`), t.securityCouncilKeys.length === 0 && e.push("securityCouncilKeys must not be empty"), t.councilQuorum <= 0 && e.push(`councilQuorum must be positive, got ${t.councilQuorum}`), t.councilQuorum > t.securityCouncilKeys.length && e.push(
94
94
  `councilQuorum (${t.councilQuorum}) exceeds securityCouncilKeys count (${t.securityCouncilKeys.length})`
95
95
  ), t.feeRate <= 0n && e.push(`feeRate must be positive, got ${t.feeRate}`), t.minPeginFeeRate <= 0n && e.push(
96
96
  `minPeginFeeRate must be positive, got ${t.minPeginFeeRate}`
97
- ), (!Number.isInteger(t.proverCircuitVersion) || t.proverCircuitVersion < 0 || t.proverCircuitVersion > P) && e.push(
97
+ ), (!Number.isInteger(t.proverCircuitVersion) || t.proverCircuitVersion < 0 || t.proverCircuitVersion > w) && e.push(
98
98
  `proverCircuitVersion must be a uint16, got ${t.proverCircuitVersion}`
99
99
  ), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth > d) && e.push(
100
100
  `minPrepeginDepth must be a uint32 in [1, ${d}], got ${t.minPrepeginDepth}`
@@ -104,8 +104,8 @@ function lt(t) {
104
104
  `babeInstancesToFinalize must be positive, got ${t.babeInstancesToFinalize}`
105
105
  ), t.babeInstancesToFinalize > t.babeTotalInstances && e.push(
106
106
  `babeInstancesToFinalize (${t.babeInstancesToFinalize}) exceeds babeTotalInstances (${t.babeTotalInstances})`
107
- ), (t.minVpCommissionBps < 0 || t.minVpCommissionBps > S) && e.push(
108
- `minVpCommissionBps must be in [0, ${S}], got ${t.minVpCommissionBps}`
107
+ ), (t.minVpCommissionBps < 0 || t.minVpCommissionBps > _) && e.push(
108
+ `minVpCommissionBps must be in [0, ${_}], got ${t.minVpCommissionBps}`
109
109
  ), e.length > 0)
110
110
  throw new Error(
111
111
  `Invalid offchain protocol parameters: ${e.join("; ")}`
@@ -121,8 +121,8 @@ function ft(t) {
121
121
  `pegInAckTimeout must be positive, got ${t.pegInAckTimeout}`
122
122
  ), t.pegInActivationTimeout <= 0n && e.push(
123
123
  `pegInActivationTimeout must be positive, got ${t.pegInActivationTimeout}`
124
- ), (!Number.isInteger(t.maxHtlcOutputCount) || t.maxHtlcOutputCount <= 0 || t.maxHtlcOutputCount > _) && e.push(
125
- `maxHtlcOutputCount must be an integer in [1, ${_}], got ${t.maxHtlcOutputCount}`
124
+ ), (!Number.isInteger(t.maxHtlcOutputCount) || t.maxHtlcOutputCount <= 0 || t.maxHtlcOutputCount > B) && e.push(
125
+ `maxHtlcOutputCount must be an integer in [1, ${B}], got ${t.maxHtlcOutputCount}`
126
126
  ), (typeof t.expiredPegInGraceBlocks != "bigint" || t.expiredPegInGraceBlocks <= 0n) && e.push(
127
127
  `expiredPegInGraceBlocks must be a positive bigint, got ${t.expiredPegInGraceBlocks}`
128
128
  ), e.length > 0)
@@ -138,8 +138,8 @@ function Ct(t) {
138
138
  "ProtocolParams.activeVaultCoreVersion()"
139
139
  );
140
140
  }
141
- const B = 9999;
142
- function F(t) {
141
+ const F = 9999;
142
+ function x(t) {
143
143
  return {
144
144
  depositor: t.depositor,
145
145
  depositorBtcPubKey: t.depositorBtcPubKey,
@@ -168,7 +168,7 @@ function I(t) {
168
168
  vaultCoreVersion: t.vaultCoreVersion
169
169
  };
170
170
  }
171
- const ht = 1n << 64n, x = 0n;
171
+ const ht = 1n << 64n, O = 0n;
172
172
  function E(t, e, o) {
173
173
  if (t < 0n || t >= ht)
174
174
  throw new Error(
@@ -176,7 +176,7 @@ function E(t, e, o) {
176
176
  );
177
177
  return t;
178
178
  }
179
- function O(t, e) {
179
+ function K(t, e) {
180
180
  return {
181
181
  vpKeyEpoch: E(t.vpKeyEpoch, "vpKeyEpoch", e),
182
182
  appKeeperKeyEpoch: E(
@@ -219,11 +219,11 @@ class vt {
219
219
  address: this.contractAddress,
220
220
  abi: a,
221
221
  functionName: "getOperationBtcKeyAtEpoch",
222
- args: [e, x]
222
+ args: [e, O]
223
223
  });
224
- return A(
224
+ return V(
225
225
  o,
226
- `getOperationBtcKeyAtEpoch (vp=${e}, epoch=${x})`
226
+ `getOperationBtcKeyAtEpoch (vp=${e}, epoch=${O})`
227
227
  );
228
228
  }
229
229
  /**
@@ -244,7 +244,7 @@ class vt {
244
244
  functionName: "getCurrentOperationBtcKey",
245
245
  args: [e]
246
246
  });
247
- return A(
247
+ return V(
248
248
  o,
249
249
  `getCurrentOperationBtcKey (vp=${e})`
250
250
  );
@@ -268,23 +268,23 @@ class vt {
268
268
  async getVaultKeyEpochs(e) {
269
269
  const o = await this.publicClient.readContract({
270
270
  address: this.contractAddress,
271
- abi: y,
271
+ abi: A,
272
272
  functionName: "getBtcVaultProtocolInfo",
273
273
  args: [e]
274
274
  });
275
- return O(o, e);
275
+ return K(o, e);
276
276
  }
277
277
  async getVaultKeyEpochsBatch(e) {
278
278
  return e.length === 0 ? [] : (await this.publicClient.multicall({
279
279
  contracts: e.map((n) => ({
280
280
  address: this.contractAddress,
281
- abi: y,
281
+ abi: A,
282
282
  functionName: "getBtcVaultProtocolInfo",
283
283
  args: [n]
284
284
  })),
285
285
  allowFailure: !1
286
286
  })).map(
287
- (n, i) => O(n, e[i])
287
+ (n, i) => K(n, e[i])
288
288
  );
289
289
  }
290
290
  async getVaultBasicInfo(e) {
@@ -294,7 +294,7 @@ class vt {
294
294
  functionName: "getBtcVaultBasicInfo",
295
295
  args: [e]
296
296
  });
297
- return F(o);
297
+ return x(o);
298
298
  }
299
299
  async getVaultProtocolInfo(e) {
300
300
  const o = await this.publicClient.readContract({
@@ -349,9 +349,9 @@ class vt {
349
349
  functionName: "getVaultProviderCommission",
350
350
  args: [e]
351
351
  });
352
- if (!Number.isInteger(o) || o < 0 || o > B)
352
+ if (!Number.isInteger(o) || o < 0 || o > F)
353
353
  throw new Error(
354
- `getVaultProviderCommission returned ${o} bps for ${e}, outside the protocol range [0, ${B}]`
354
+ `getVaultProviderCommission returned ${o} bps for ${e}, outside the protocol range [0, ${F}]`
355
355
  );
356
356
  return o;
357
357
  }
@@ -372,7 +372,7 @@ class vt {
372
372
  }
373
373
  ],
374
374
  allowFailure: !1
375
- }), i = F(o), r = I(n);
375
+ }), i = x(o), r = I(n);
376
376
  if (!r.depositorSignedPeginTx || r.depositorSignedPeginTx === "0x")
377
377
  throw new Error(
378
378
  `Vault ${e} not found on-chain or has no pegin transaction`
@@ -380,11 +380,11 @@ class vt {
380
380
  return { basic: i, protocol: r };
381
381
  }
382
382
  }
383
- const mt = 21e6 * 1e8, K = 3e4;
384
- async function w(t, e) {
383
+ const mt = 21e6 * 1e8, N = 3e4;
384
+ async function P(t, e) {
385
385
  const o = new AbortController(), n = setTimeout(
386
386
  () => o.abort(),
387
- K
387
+ N
388
388
  ), i = [o.signal, e == null ? void 0 : e.signal].filter(
389
389
  Boolean
390
390
  ), r = z(i);
@@ -395,16 +395,16 @@ async function w(t, e) {
395
395
  });
396
396
  } catch (s) {
397
397
  throw clearTimeout(n), r.cleanup(), s != null && typeof s == "object" && "name" in s && s.name === "AbortError" ? new Error(
398
- `Mempool API request timed out after ${K}ms: ${t}`
398
+ `Mempool API request timed out after ${N}ms: ${t}`
399
399
  ) : s;
400
400
  }
401
401
  }
402
- const R = 1e4;
403
- function H(t) {
402
+ const H = 1e4;
403
+ function M(t) {
404
404
  return Number.isInteger(t) && t > 0 && t <= mt;
405
405
  }
406
406
  function pt(t) {
407
- return Number.isInteger(t) && t > 0 && t <= R;
407
+ return Number.isInteger(t) && t > 0 && t <= H;
408
408
  }
409
409
  function $(t, e) {
410
410
  return !Number.isInteger(t) || t < 0 ? !1 : e === void 0 || t < e;
@@ -413,11 +413,11 @@ function f(t) {
413
413
  if (!j.test(t))
414
414
  throw new Error(`Invalid transaction ID format: ${t}`);
415
415
  }
416
- function M(t) {
416
+ function X(t) {
417
417
  if (!L.test(t))
418
418
  throw new Error(`Invalid Bitcoin address format: ${t}`);
419
419
  }
420
- function X(t, e) {
420
+ function D(t, e) {
421
421
  if (!W.test(t))
422
422
  throw new Error(
423
423
  `Invalid scriptPubKey: not valid hex for ${e}`
@@ -436,7 +436,7 @@ const gt = {
436
436
  };
437
437
  async function l(t, e) {
438
438
  try {
439
- const o = await w(t, e);
439
+ const o = await P(t, e);
440
440
  if (!o.ok) {
441
441
  const i = await o.text();
442
442
  throw new Error(
@@ -451,7 +451,7 @@ async function l(t, e) {
451
451
  }
452
452
  async function St(t, e) {
453
453
  try {
454
- const o = await w(`${e}/tx`, {
454
+ const o = await P(`${e}/tx`, {
455
455
  method: "POST",
456
456
  body: t,
457
457
  headers: {
@@ -495,7 +495,7 @@ async function Bt(t, e, o) {
495
495
  async function Ft(t, e) {
496
496
  f(t);
497
497
  try {
498
- const o = await w(`${e}/tx/${t}/hex`);
498
+ const o = await P(`${e}/tx/${t}/hex`);
499
499
  if (!o.ok) {
500
500
  const n = await o.text();
501
501
  throw new Error(
@@ -515,9 +515,9 @@ async function xt(t, e, o) {
515
515
  `Invalid vout ${e} for transaction ${t} (has ${n.vout.length} outputs)`
516
516
  );
517
517
  const i = n.vout[e];
518
- if (!H(i.value))
518
+ if (!M(i.value))
519
519
  throw new Error(`Invalid UTXO value ${i.value} for ${t}:${e}`);
520
- return X(i.scriptpubkey, `${t}:${e}`), {
520
+ return D(i.scriptpubkey, `${t}:${e}`), {
521
521
  txid: t,
522
522
  vout: e,
523
523
  value: i.value,
@@ -525,18 +525,18 @@ async function xt(t, e, o) {
525
525
  };
526
526
  }
527
527
  async function Ot(t, e) {
528
- M(t);
528
+ X(t);
529
529
  try {
530
530
  const o = await l(`${e}/address/${t}/utxo`), n = await l(`${e}/v1/validate-address/${t}`);
531
531
  if (!n.isvalid)
532
532
  throw new Error(
533
533
  `Invalid Bitcoin address: ${t}. Mempool API validation failed.`
534
534
  );
535
- X(n.scriptPubKey, t);
535
+ D(n.scriptPubKey, t);
536
536
  for (const r of o) {
537
537
  if (f(r.txid), !$(r.vout))
538
538
  throw new Error(`Invalid vout ${r.vout} for ${r.txid}`);
539
- if (!H(r.value))
539
+ if (!M(r.value))
540
540
  throw new Error(
541
541
  `Invalid UTXO value ${r.value} for ${r.txid}:${r.vout}`
542
542
  );
@@ -560,10 +560,10 @@ function Kt(t) {
560
560
  return gt[t];
561
561
  }
562
562
  async function Nt(t, e) {
563
- return M(t), l(`${e}/address/${t}/txs`);
563
+ return X(t), l(`${e}/address/${t}/txs`);
564
564
  }
565
565
  async function kt(t) {
566
- const e = await w(`${t}/v1/fees/recommended`);
566
+ const e = await P(`${t}/v1/fees/recommended`);
567
567
  if (!e.ok)
568
568
  throw new Error(
569
569
  `Failed to fetch network fees: ${e.status} ${e.statusText}`
@@ -578,7 +578,7 @@ async function kt(t) {
578
578
  for (const i of n)
579
579
  if (!pt(o[i]))
580
580
  throw new Error(
581
- `Invalid fee rate ${i}=${o[i]} from mempool API: expected a positive number ≤ ${R}`
581
+ `Invalid fee rate ${i}=${o[i]} from mempool API: expected a positive number ≤ ${H}`
582
582
  );
583
583
  if (o.minimumFee > o.economyFee || o.economyFee > o.hourFee || o.hourFee > o.halfHourFee || o.halfHourFee > o.fastestFee)
584
584
  throw new Error(
@@ -588,6 +588,7 @@ async function kt(t) {
588
588
  }
589
589
  export {
590
590
  gt as M,
591
+ tt as P,
591
592
  vt as V,
592
593
  Ot as a,
593
594
  Kt as b,
@@ -601,9 +602,10 @@ export {
601
602
  Ct as j,
602
603
  ft as k,
603
604
  At as l,
604
- Vt as m,
605
- ut as n,
605
+ et as m,
606
+ Vt as n,
607
+ ut as o,
606
608
  St as p,
607
609
  lt as v
608
610
  };
609
- //# sourceMappingURL=mempoolApi-_D-jvtj_.js.map
611
+ //# sourceMappingURL=mempoolApi-71R_CNZa.js.map