@babylonlabs-io/ts-sdk 0.48.4 → 0.48.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PeginManager-NfDjKQGV.cjs → PeginManager-BvxfSwsr.cjs} +2 -2
- package/dist/{PeginManager-NfDjKQGV.cjs.map → PeginManager-BvxfSwsr.cjs.map} +1 -1
- package/dist/{PeginManager-CNhDl1eC.js → PeginManager-COxRVrxa.js} +2 -2
- package/dist/{PeginManager-CNhDl1eC.js.map → PeginManager-COxRVrxa.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +79 -78
- package/dist/{mempoolApi-BxT89SAq.js → mempoolApi-Dc1KSVNI.js} +61 -54
- package/dist/mempoolApi-Dc1KSVNI.js.map +1 -0
- package/dist/{mempoolApi-C_9JhjCI.cjs → mempoolApi-NMiYQAXI.cjs} +2 -2
- package/dist/mempoolApi-NMiYQAXI.cjs.map +1 -0
- package/dist/{primeVpAuth-Dzxxy0-F.js → primeVpAuth-CZsFLrHX.js} +2 -2
- package/dist/{primeVpAuth-Dzxxy0-F.js.map → primeVpAuth-CZsFLrHX.js.map} +1 -1
- package/dist/{primeVpAuth-wKbRw0m4.cjs → primeVpAuth-DhbTaCKm.cjs} +2 -2
- package/dist/{primeVpAuth-wKbRw0m4.cjs.map → primeVpAuth-DhbTaCKm.cjs.map} +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +33 -32
- package/dist/tbv/core/clients/mempool/index.d.ts +2 -2
- package/dist/tbv/core/clients/mempool/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts +15 -1
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts.map +1 -1
- package/dist/tbv/core/clients/mempool/types.d.ts +20 -0
- package/dist/tbv/core/clients/mempool/types.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +76 -75
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +76 -75
- package/package.json +1 -1
- package/dist/mempoolApi-BxT89SAq.js.map +0 -1
- package/dist/mempoolApi-C_9JhjCI.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./challengeAssert-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("./verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("./peginInput-DH6X4ITS.cjs"),A=require("./noPayout-lyIRiUyG.cjs"),r=require("./bitcoin-CHfKAhcI.cjs"),R=require("./signing-Bnsro0hE.cjs"),c=require("./validation-u8W7Lp2x.cjs"),u=require("./PeginManager-NfDjKQGV.cjs"),p=require("./PayoutManager-BZVEyi10.cjs"),_=require("./ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("./BTCVaultRegistry.abi-JdeqLz4x.cjs"),P=require("./errors-CGcNP0rV.cjs"),I=require("./shared/index.cjs"),o=require("./waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("./fundPeginTransaction-DuMwnytD.cjs"),d=require("./reservation-xTL2a9Q-.cjs"),a=require("./mempoolApi-C_9JhjCI.cjs"),i=require("./primeVpAuth-wKbRw0m4.cjs"),s=require("./types-WA0LrDk1.cjs"),g=require("./errors-Bu0H-dZD.cjs"),e=require("./buildAndBroadcastRefund-BOtxUi05.cjs"),T=require("./peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=n.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=n.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=n.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=n.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.createPayoutScript=n.createPayoutScript;exports.extractPayoutSignature=n.extractPayoutSignature;exports.buildPeginInputPsbt=S.buildPeginInputPsbt;exports.extractPeginInputSignature=S.extractPeginInputSignature;exports.finalizePeginInputPsbt=S.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=A.buildNoPayoutPsbt;exports.buildRefundPsbt=A.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.HEX_RE=c.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=c.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=c.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=c.TXID_RE;exports.PeginManager=u.PeginManager;exports.VAULT_APP_NAME=u.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=u.buildFundingOutpointsCommitment;exports.buildVaultContext=u.buildVaultContext;exports.computeWotsBlockPublicKeysHash=u.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=u.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=u.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=u.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=P.CONTRACT_ERRORS;exports.extractErrorData=P.extractErrorData;exports.getContractErrorMessage=P.getContractErrorMessage;exports.handleContractError=P.handleContractError;exports.isKnownContractError=P.isKnownContractError;exports.BitcoinNetworks=I.BitcoinNetworks;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=t.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=d.UtxoNotAvailableError;exports.assertUtxosAvailable=d.assertUtxosAvailable;exports.extractInputsFromTransaction=d.extractInputsFromTransaction;exports.findOverlappingPendingVaults=d.findOverlappingPendingVaults;exports.validateUtxosAvailable=d.validateUtxosAvailable;exports.MEMPOOL_API_URLS=a.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=a.ViemVaultRegistryReader;exports.getAddressTxs=a.getAddressTxs;exports.getAddressUtxos=a.getAddressUtxos;exports.getMempoolApiUrl=a.getMempoolApiUrl;exports.getNetworkFees=a.getNetworkFees;exports.getTipHeight=a.getTipHeight;exports.getTxHex=a.getTxHex;exports.getTxInfo=a.getTxInfo;exports.getUtxoInfo=a.getUtxoInfo;exports.pushTx=a.pushTx;exports.validateOffchainParams=a.validateOffchainParams;exports.validatePegInConfiguration=a.validatePegInConfiguration;exports.validateTBVProtocolParams=a.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=g.isWotsMismatchError;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./challengeAssert-HNbugpqL.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),n=require("./verifyScriptPathSchnorrSignature-Cl7tu77P.cjs"),S=require("./peginInput-DH6X4ITS.cjs"),A=require("./noPayout-lyIRiUyG.cjs"),r=require("./bitcoin-CHfKAhcI.cjs"),R=require("./signing-Bnsro0hE.cjs"),c=require("./validation-u8W7Lp2x.cjs"),u=require("./PeginManager-BvxfSwsr.cjs"),p=require("./PayoutManager-BZVEyi10.cjs"),_=require("./ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("./BTCVaultRegistry.abi-JdeqLz4x.cjs"),d=require("./errors-CGcNP0rV.cjs"),I=require("./shared/index.cjs"),o=require("./waitForTransactionReceiptSmartAware-U706oKTc.cjs"),t=require("./fundPeginTransaction-DuMwnytD.cjs"),P=require("./reservation-xTL2a9Q-.cjs"),i=require("./mempoolApi-NMiYQAXI.cjs"),a=require("./primeVpAuth-DhbTaCKm.cjs"),s=require("./types-WA0LrDk1.cjs"),g=require("./errors-Bu0H-dZD.cjs"),e=require("./buildAndBroadcastRefund-BOtxUi05.cjs"),T=require("./peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=n.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=n.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=n.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=n.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.createPayoutScript=n.createPayoutScript;exports.extractPayoutSignature=n.extractPayoutSignature;exports.buildPeginInputPsbt=S.buildPeginInputPsbt;exports.extractPeginInputSignature=S.extractPeginInputSignature;exports.finalizePeginInputPsbt=S.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=A.buildNoPayoutPsbt;exports.buildRefundPsbt=A.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=c.BITCOIN_ADDRESS_RE;exports.HEX_RE=c.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=c.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=c.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=c.TXID_RE;exports.PeginManager=u.PeginManager;exports.VAULT_APP_NAME=u.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=u.buildFundingOutpointsCommitment;exports.buildVaultContext=u.buildVaultContext;exports.computeWotsBlockPublicKeysHash=u.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=u.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=u.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=u.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=d.CONTRACT_ERRORS;exports.extractErrorData=d.extractErrorData;exports.getContractErrorMessage=d.getContractErrorMessage;exports.handleContractError=d.handleContractError;exports.isKnownContractError=d.isKnownContractError;exports.BitcoinNetworks=I.BitcoinNetworks;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=t.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=P.UtxoNotAvailableError;exports.assertUtxosAvailable=P.assertUtxosAvailable;exports.extractInputsFromTransaction=P.extractInputsFromTransaction;exports.findOverlappingPendingVaults=P.findOverlappingPendingVaults;exports.validateUtxosAvailable=P.validateUtxosAvailable;exports.MEMPOOL_API_URLS=i.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=i.ViemVaultRegistryReader;exports.getAddressTxs=i.getAddressTxs;exports.getAddressUtxos=i.getAddressUtxos;exports.getMempoolApiUrl=i.getMempoolApiUrl;exports.getNetworkFees=i.getNetworkFees;exports.getOutspend=i.getOutspend;exports.getTipHeight=i.getTipHeight;exports.getTxHex=i.getTxHex;exports.getTxInfo=i.getTxInfo;exports.getUtxoInfo=i.getUtxoInfo;exports.pushTx=i.pushTx;exports.validateOffchainParams=i.validateOffchainParams;exports.validatePegInConfiguration=i.validatePegInConfiguration;exports.validateTBVProtocolParams=i.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=a.OnChainBtcVaultStatus;exports.ServerIdentityError=a.ServerIdentityError;exports.VaultProviderRpcClient=a.VaultProviderRpcClient;exports.ViemProtocolParamsReader=a.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=a.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=a.ViemVaultKeeperReader;exports.VpResponseValidationError=a.VpResponseValidationError;exports.VpTokenRegistry=a.VpTokenRegistry;exports.batchPollByProvider=a.batchPollByProvider;exports.createAuthenticatedVpClient=a.createAuthenticatedVpClient;exports.primeVpTokenRegistry=a.primeVpTokenRegistry;exports.resolveProtocolAddresses=a.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=a.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=a.verifyServerIdentity;exports.vpTokenRegistry=a.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=g.isWotsMismatchError;exports.parseFundingOutpointsFromTx=g.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
import { a as s, b as t, c as r } from "./challengeAssert-csvYXBJB.js";
|
|
2
|
-
import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u, expandAuthAnchor as l, expandHashlockSecret as p, expandWotsSeed as
|
|
2
|
+
import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u, expandAuthAnchor as l, expandHashlockSecret as p, expandWotsSeed as d } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
3
|
import { P as c, d as T, f as E, c as S, b as A, a as _, g, e as R } from "./verifyScriptPathSchnorrSignature-CeZp6tMw.js";
|
|
4
4
|
import { b as x, e as f, f as b } from "./peginInput-BPRB9tUi.js";
|
|
5
5
|
import { a as O, b as V } from "./noPayout-C1WCsqfd.js";
|
|
6
6
|
import { d as C, a as F, b as h, e as N, f as U, j as y, g as B, h as D, i as M, c as H, p as L, s as X, t as k, u as W, v as w } from "./bitcoin-B5aNKtsk.js";
|
|
7
7
|
import { c as G } from "./signing-DaLvGwQe.js";
|
|
8
8
|
import { B as Z, H as J, K as j, M as q, T as z } from "./validation-CxqROCno.js";
|
|
9
|
-
import { P as $, V as aa, b as ea, a as sa, c as ta, f as ra, d as oa, e as ia } from "./PeginManager-
|
|
9
|
+
import { P as $, V as aa, b as ea, a as sa, c as ta, f as ra, d as oa, e as ia } from "./PeginManager-COxRVrxa.js";
|
|
10
10
|
import { P as ua, c as la, v as pa } from "./PayoutManager-D26nGR-e.js";
|
|
11
|
-
import { A as
|
|
11
|
+
import { A as Pa, P as ca } from "./ApplicationRegistry.abi-Dn2qk6JG.js";
|
|
12
12
|
import { B as Ea } from "./BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
13
13
|
import { C as Aa, e as _a, g as ga, h as Ra, i as ma } from "./errors-Blc-JWnI.js";
|
|
14
14
|
import { BitcoinNetworks as fa } from "./shared/index.js";
|
|
15
15
|
import { B as Ia, a as Oa, f as Va, c as va, b as Ca, d as Fa, g as ha, i as Na, h as Ua, s as ya, e as Ba, w as Da } from "./waitForTransactionReceiptSmartAware-Ckg_oZAo.js";
|
|
16
16
|
import { B as Ha, D as La, F as Xa, L as ka, M as Wa, c as wa, P as Ka, b as Ga, a as Ya, S as Za, T as Ja, W as ja, f as qa, d as za, p as Qa, r as $a } from "./fundPeginTransaction-96FxwYYJ.js";
|
|
17
17
|
import { U as ee, a as se, e as te, f as re, v as oe } from "./reservation-BxvKbQH2.js";
|
|
18
|
-
import { M as ne, V as ue, g as le, a as pe, b as
|
|
19
|
-
import { O as
|
|
20
|
-
import { A as
|
|
21
|
-
import { i as
|
|
22
|
-
import { B as
|
|
23
|
-
import { C as
|
|
18
|
+
import { M as ne, V as ue, g as le, a as pe, b as de, c as Pe, d as ce, e as Te, f as Ee, h as Se, i as Ae, p as _e, v as ge, j as Re, k as me } from "./mempoolApi-Dc1KSVNI.js";
|
|
19
|
+
import { O as fe, S as be, V as Ie, g as Oe, h as Ve, i as ve, a as Ce, d as Fe, b as he, f as Ne, p as Ue, r as ye, v as Be, c as De, e as Me } from "./primeVpAuth-CZsFLrHX.js";
|
|
20
|
+
import { A as Le, D as Xe, b as ke, J as We, a as we, d as Ke, P as Ge, R as Ye, e as Ze, c as Je, V as je } from "./types-CQDRQvV-.js";
|
|
21
|
+
import { i as ze, p as Qe } from "./errors-9AkghWyk.js";
|
|
22
|
+
import { B as as, C as es, p as ss, q as ts, t as rs, u as os, R as is, a as ns, n as us, o as ls, i as ps, m as ds, l as Ps, j as cs, r as Ts, b as Es, s as Ss, v as As, g as _s, h as gs, d as Rs, c as ms, e as xs, f as fs, k as bs, w as Is } from "./buildAndBroadcastRefund-o9Byvkut.js";
|
|
23
|
+
import { C as Vs, P as vs, c as Cs, g as Fs } from "./peginState-CBAlxgXk.js";
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
Le as AUTH_EXPIRED_DATA_KIND,
|
|
26
|
+
Pa as ApplicationRegistryABI,
|
|
27
|
+
as as BIP68NotMatureError,
|
|
28
28
|
Z as BITCOIN_ADDRESS_RE,
|
|
29
29
|
Ea as BTCVaultRegistryABI,
|
|
30
30
|
Ha as BTC_DUST_SAT,
|
|
31
31
|
fa as BitcoinNetworks,
|
|
32
32
|
Ia as BitcoinScriptType,
|
|
33
33
|
Aa as CONTRACT_ERRORS,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
es as ClaimerPegoutStatusValue,
|
|
35
|
+
Vs as ContractStatus,
|
|
36
36
|
La as DUST_THRESHOLD,
|
|
37
|
-
|
|
37
|
+
Xe as DaemonStatus,
|
|
38
38
|
Xa as FEE_SAFETY_MARGIN,
|
|
39
39
|
J as HEX_RE,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
ke as JSON_RPC_ERROR_CODES,
|
|
41
|
+
We as JsonRpcClient,
|
|
42
|
+
we as JsonRpcError,
|
|
43
43
|
j as KNOWN_SCRIPT_PREFIXES,
|
|
44
44
|
ka as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
45
45
|
Wa as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
46
46
|
q as MAX_REASONABLE_FEE_SATS,
|
|
47
47
|
wa as MAX_REASONABLE_PEGIN_VBYTES,
|
|
48
48
|
ne as MEMPOOL_API_URLS,
|
|
49
|
-
|
|
49
|
+
fe as OnChainBtcVaultStatus,
|
|
50
50
|
Ka as P2TR_INPUT_SIZE,
|
|
51
51
|
Ga as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
52
52
|
Ya as PEGIN_FIXED_OUTPUTS,
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
Ke as POST_WOTS_STATUSES,
|
|
54
|
+
Ge as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
55
55
|
ua as PayoutManager,
|
|
56
|
-
|
|
56
|
+
vs as PeginAction,
|
|
57
57
|
$ as PeginManager,
|
|
58
58
|
ca as ProtocolParamsABI,
|
|
59
59
|
c as PsbtSubstitutionError,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
ss as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
61
|
+
ts as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
62
|
+
rs as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
63
|
+
os as REFUND_VSIZE,
|
|
64
|
+
is as RegisteredVaultVersionMismatchError,
|
|
65
|
+
Ye as RpcErrorCode,
|
|
66
66
|
Za as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
67
|
-
|
|
67
|
+
be as ServerIdentityError,
|
|
68
68
|
z as TXID_RE,
|
|
69
69
|
Ja as TX_BUFFER_SIZE_OVERHEAD,
|
|
70
70
|
ee as UtxoNotAvailableError,
|
|
71
71
|
aa as VAULT_APP_NAME,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
Ze as VP_BATCH_MAX_SIZE,
|
|
73
|
+
Je as VP_TERMINAL_FAILURE_STATUSES,
|
|
74
|
+
je as VP_TRANSIENT_STATUSES,
|
|
75
|
+
Ie as VaultProviderRpcClient,
|
|
76
|
+
Oe as ViemProtocolParamsReader,
|
|
77
|
+
Ve as ViemUniversalChallengerReader,
|
|
78
|
+
ve as ViemVaultKeeperReader,
|
|
79
79
|
ue as ViemVaultRegistryReader,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
Ce as VpResponseValidationError,
|
|
81
|
+
Fe as VpTokenRegistry,
|
|
82
82
|
ja as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
83
|
-
|
|
83
|
+
ns as activateVault,
|
|
84
84
|
Oa as applyChangeOutputPolicy,
|
|
85
85
|
T as assertPsbtUnsignedTxMatches,
|
|
86
86
|
E as assertScriptPathSchnorrSignature,
|
|
87
87
|
se as assertUtxosAvailable,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
he as batchPollByProvider,
|
|
89
|
+
us as buildAndBroadcastRefund,
|
|
90
90
|
s as buildChallengeAssertPsbt,
|
|
91
91
|
t as buildDepositorPayoutPsbt,
|
|
92
92
|
ea as buildFundingOutpointsCommitment,
|
|
@@ -98,7 +98,7 @@ export {
|
|
|
98
98
|
V as buildRefundPsbt,
|
|
99
99
|
sa as buildVaultContext,
|
|
100
100
|
Va as calculateBtcTxHash,
|
|
101
|
-
|
|
101
|
+
Cs as canPerformAction,
|
|
102
102
|
va as computeChangeOutputFeeSats,
|
|
103
103
|
la as computeHashlock,
|
|
104
104
|
Ca as computeMaxDeposit,
|
|
@@ -107,7 +107,7 @@ export {
|
|
|
107
107
|
r as computeNumLocalChallengers,
|
|
108
108
|
Fa as computePeginBaseFeeSats,
|
|
109
109
|
ta as computeWotsBlockPublicKeysHash,
|
|
110
|
-
|
|
110
|
+
Ne as createAuthenticatedVpClient,
|
|
111
111
|
g as createPayoutScript,
|
|
112
112
|
G as createTaprootScriptPathSignOptions,
|
|
113
113
|
C as deriveBip86ScriptPubKeyHex,
|
|
@@ -117,11 +117,11 @@ export {
|
|
|
117
117
|
ra as deriveVaultRoot,
|
|
118
118
|
oa as deriveWotsBlocksFromSeed,
|
|
119
119
|
N as ensureHexPrefix,
|
|
120
|
-
|
|
120
|
+
ls as estimateRefundFeeSats,
|
|
121
121
|
ia as estimateSubmitPeginRequestBatchGas,
|
|
122
122
|
l as expandAuthAnchor,
|
|
123
123
|
p as expandHashlockSecret,
|
|
124
|
-
|
|
124
|
+
d as expandWotsSeed,
|
|
125
125
|
_a as extractErrorData,
|
|
126
126
|
te as extractInputsFromTransaction,
|
|
127
127
|
R as extractPayoutSignature,
|
|
@@ -134,61 +134,62 @@ export {
|
|
|
134
134
|
pe as getAddressUtxos,
|
|
135
135
|
ga as getContractErrorMessage,
|
|
136
136
|
ha as getDustThreshold,
|
|
137
|
-
|
|
137
|
+
de as getMempoolApiUrl,
|
|
138
138
|
y as getNetwork,
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
Pe as getNetworkFees,
|
|
140
|
+
ce as getOutspend,
|
|
141
|
+
Fs as getPeginProtocolState,
|
|
141
142
|
Na as getPsbtInputFields,
|
|
142
143
|
Ua as getScriptType,
|
|
143
144
|
B as getSortedXOnlyPubkeys,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
Te as getTipHeight,
|
|
146
|
+
Ee as getTxHex,
|
|
147
|
+
Se as getTxInfo,
|
|
148
|
+
Ae as getUtxoInfo,
|
|
148
149
|
Ra as handleContractError,
|
|
149
150
|
D as hexToUint8Array,
|
|
150
151
|
M as isAddressFromPublicKey,
|
|
151
|
-
|
|
152
|
+
ps as isDepositAmountValid,
|
|
152
153
|
ma as isKnownContractError,
|
|
153
|
-
|
|
154
|
+
ds as isPegoutTerminalStatus,
|
|
154
155
|
Ps as isRecognizedPegoutStatus,
|
|
155
|
-
|
|
156
|
+
cs as isRegisteredVaultVersionMismatchError,
|
|
156
157
|
H as isValidHex,
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
ze as isWotsMismatchError,
|
|
159
|
+
Qe as parseFundingOutpointsFromTx,
|
|
159
160
|
za as parseUnfundedWasmTransaction,
|
|
160
161
|
Qa as peginOutputCount,
|
|
161
|
-
|
|
162
|
+
Ue as primeVpTokenRegistry,
|
|
162
163
|
L as processPublicKeyToXOnly,
|
|
163
|
-
|
|
164
|
+
_e as pushTx,
|
|
164
165
|
$a as rateBasedTxBufferFee,
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
ye as resolveProtocolAddresses,
|
|
167
|
+
Ts as runDepositorPresignFlow,
|
|
167
168
|
ya as selectUtxosForPegin,
|
|
168
169
|
Ba as shouldAddChangeOutput,
|
|
169
|
-
|
|
170
|
+
Es as signDepositorGraph,
|
|
170
171
|
X as stripHexPrefix,
|
|
171
|
-
|
|
172
|
+
Ss as submitWotsPublicKey,
|
|
172
173
|
k as toXOnly,
|
|
173
174
|
W as uint8ArrayToHex,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
As as validateDepositAmount,
|
|
176
|
+
_s as validateMultiVaultDepositInputs,
|
|
177
|
+
ge as validateOffchainParams,
|
|
178
|
+
gs as validateOnChainParticipantKeys,
|
|
179
|
+
Re as validatePegInConfiguration,
|
|
180
|
+
Rs as validateProviderSelection,
|
|
181
|
+
ms as validateRemainingCapacity,
|
|
182
|
+
Be as validateRequestDepositorClaimerArtifactsResponse,
|
|
182
183
|
pa as validateSecretAgainstHashlock,
|
|
183
|
-
|
|
184
|
+
me as validateTBVProtocolParams,
|
|
184
185
|
oe as validateUtxosAvailable,
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
xs as validateVaultAmounts,
|
|
187
|
+
fs as validateVaultProviderPubkey,
|
|
187
188
|
w as validateWalletPubkey,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
bs as verifyRegisteredVaultVersions,
|
|
190
|
+
De as verifyServerIdentity,
|
|
191
|
+
Me as vpTokenRegistry,
|
|
192
|
+
Is as waitForPeginStatus,
|
|
192
193
|
Da as waitForTransactionReceiptSmartAware
|
|
193
194
|
};
|
|
194
195
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,9 +2,9 @@ import * as x from "@bitcoin-js/tiny-secp256k1-asmjs";
|
|
|
2
2
|
import { h as y } from "./bitcoin-B5aNKtsk.js";
|
|
3
3
|
import { B as s } from "./BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
4
4
|
import { B as A, H as C, K as E, T as F } from "./validation-CxqROCno.js";
|
|
5
|
-
const h = 65535,
|
|
5
|
+
const h = 65535, g = 1e4, l = 4294967295, p = 255;
|
|
6
6
|
function m(e) {
|
|
7
|
-
if (!Number.isInteger(e) || e < 0 || e >
|
|
7
|
+
if (!Number.isInteger(e) || e < 0 || e > l)
|
|
8
8
|
throw new Error(
|
|
9
9
|
`Invalid offchainParamsVersion from contract: must be a uint32, got ${e}`
|
|
10
10
|
);
|
|
@@ -23,16 +23,16 @@ function B(e) {
|
|
|
23
23
|
`minPeginFeeRate must be positive, got ${e.minPeginFeeRate}`
|
|
24
24
|
), (!Number.isInteger(e.proverCircuitVersion) || e.proverCircuitVersion < 0 || e.proverCircuitVersion > h) && t.push(
|
|
25
25
|
`proverCircuitVersion must be a uint16, got ${e.proverCircuitVersion}`
|
|
26
|
-
), (!Number.isInteger(e.minPrepeginDepth) || e.minPrepeginDepth <= 0 || e.minPrepeginDepth >
|
|
27
|
-
`minPrepeginDepth must be a uint32 in [1, ${
|
|
26
|
+
), (!Number.isInteger(e.minPrepeginDepth) || e.minPrepeginDepth <= 0 || e.minPrepeginDepth > l) && t.push(
|
|
27
|
+
`minPrepeginDepth must be a uint32 in [1, ${l}], got ${e.minPrepeginDepth}`
|
|
28
28
|
), e.babeTotalInstances <= 0 && t.push(
|
|
29
29
|
`babeTotalInstances must be positive, got ${e.babeTotalInstances}`
|
|
30
30
|
), e.babeInstancesToFinalize <= 0 && t.push(
|
|
31
31
|
`babeInstancesToFinalize must be positive, got ${e.babeInstancesToFinalize}`
|
|
32
32
|
), e.babeInstancesToFinalize > e.babeTotalInstances && t.push(
|
|
33
33
|
`babeInstancesToFinalize (${e.babeInstancesToFinalize}) exceeds babeTotalInstances (${e.babeTotalInstances})`
|
|
34
|
-
), (e.minVpCommissionBps < 0 || e.minVpCommissionBps >
|
|
35
|
-
`minVpCommissionBps must be in [0, ${
|
|
34
|
+
), (e.minVpCommissionBps < 0 || e.minVpCommissionBps > g) && t.push(
|
|
35
|
+
`minVpCommissionBps must be in [0, ${g}], got ${e.minVpCommissionBps}`
|
|
36
36
|
), t.length > 0)
|
|
37
37
|
throw new Error(
|
|
38
38
|
`Invalid offchain protocol parameters: ${t.join("; ")}`
|
|
@@ -48,21 +48,21 @@ function k(e) {
|
|
|
48
48
|
`pegInAckTimeout must be positive, got ${e.pegInAckTimeout}`
|
|
49
49
|
), e.pegInActivationTimeout <= 0n && t.push(
|
|
50
50
|
`pegInActivationTimeout must be positive, got ${e.pegInActivationTimeout}`
|
|
51
|
-
), (!Number.isInteger(e.maxHtlcOutputCount) || e.maxHtlcOutputCount <= 0 || e.maxHtlcOutputCount >
|
|
52
|
-
`maxHtlcOutputCount must be an integer in [1, ${
|
|
51
|
+
), (!Number.isInteger(e.maxHtlcOutputCount) || e.maxHtlcOutputCount <= 0 || e.maxHtlcOutputCount > p) && t.push(
|
|
52
|
+
`maxHtlcOutputCount must be an integer in [1, ${p}], got ${e.maxHtlcOutputCount}`
|
|
53
53
|
), (typeof e.expiredPegInGraceBlocks != "bigint" || e.expiredPegInGraceBlocks <= 0n) && t.push(
|
|
54
54
|
`expiredPegInGraceBlocks must be a positive bigint, got ${e.expiredPegInGraceBlocks}`
|
|
55
55
|
), t.length > 0)
|
|
56
56
|
throw new Error(`Invalid TBV protocol parameters: ${t.join("; ")}`);
|
|
57
57
|
}
|
|
58
58
|
function M(e) {
|
|
59
|
-
if (k(e), B(e.offchainParams), !Number.isInteger(e.offchainParamsVersion) || e.offchainParamsVersion < 0 || e.offchainParamsVersion >
|
|
59
|
+
if (k(e), B(e.offchainParams), !Number.isInteger(e.offchainParamsVersion) || e.offchainParamsVersion < 0 || e.offchainParamsVersion > l)
|
|
60
60
|
throw new Error(
|
|
61
61
|
`Invalid peg-in configuration: offchainParamsVersion must be a uint32, got ${e.offchainParamsVersion}`
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
function
|
|
64
|
+
const w = 9999;
|
|
65
|
+
function P(e) {
|
|
66
66
|
return {
|
|
67
67
|
depositor: e.depositor,
|
|
68
68
|
depositorBtcPubKey: e.depositorBtcPubKey,
|
|
@@ -73,7 +73,7 @@ function w(e) {
|
|
|
73
73
|
createdAt: e.createdAt
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function $(e) {
|
|
77
77
|
const t = Number(e.offchainParamsVersion);
|
|
78
78
|
return m(t), {
|
|
79
79
|
depositorSignedPeginTx: e.depositorSignedPeginTx,
|
|
@@ -126,7 +126,7 @@ class _ {
|
|
|
126
126
|
functionName: "getBtcVaultBasicInfo",
|
|
127
127
|
args: [t]
|
|
128
128
|
});
|
|
129
|
-
return
|
|
129
|
+
return P(o);
|
|
130
130
|
}
|
|
131
131
|
async getVaultProtocolInfo(t) {
|
|
132
132
|
const o = await this.publicClient.readContract({
|
|
@@ -135,7 +135,7 @@ class _ {
|
|
|
135
135
|
functionName: "getBtcVaultProtocolInfo",
|
|
136
136
|
args: [t]
|
|
137
137
|
});
|
|
138
|
-
return
|
|
138
|
+
return $(o);
|
|
139
139
|
}
|
|
140
140
|
async getProtocolInfoBatch(t) {
|
|
141
141
|
return t.length === 0 ? [] : (await this.publicClient.multicall({
|
|
@@ -196,9 +196,9 @@ class _ {
|
|
|
196
196
|
functionName: "getVaultProviderCommission",
|
|
197
197
|
args: [t]
|
|
198
198
|
});
|
|
199
|
-
if (!Number.isInteger(o) || o < 0 || o >
|
|
199
|
+
if (!Number.isInteger(o) || o < 0 || o > w)
|
|
200
200
|
throw new Error(
|
|
201
|
-
`getVaultProviderCommission returned ${o} bps for ${t}, outside the protocol range [0, ${
|
|
201
|
+
`getVaultProviderCommission returned ${o} bps for ${t}, outside the protocol range [0, ${w}]`
|
|
202
202
|
);
|
|
203
203
|
return o;
|
|
204
204
|
}
|
|
@@ -219,7 +219,7 @@ class _ {
|
|
|
219
219
|
}
|
|
220
220
|
],
|
|
221
221
|
allowFailure: !1
|
|
222
|
-
}), r =
|
|
222
|
+
}), r = P(o), n = $(i);
|
|
223
223
|
if (!n.depositorSignedPeginTx || n.depositorSignedPeginTx === "0x")
|
|
224
224
|
throw new Error(
|
|
225
225
|
`Vault ${t} not found on-chain or has no pegin transaction`
|
|
@@ -252,7 +252,7 @@ class _ {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
const S = 21e6 * 1e8, b = 3e4;
|
|
255
|
-
async function
|
|
255
|
+
async function f(e, t) {
|
|
256
256
|
const o = new AbortController(), i = setTimeout(
|
|
257
257
|
() => o.abort(),
|
|
258
258
|
b
|
|
@@ -270,17 +270,17 @@ async function l(e, t) {
|
|
|
270
270
|
) : n;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
function
|
|
273
|
+
const I = 1e4;
|
|
274
|
+
function v(e) {
|
|
275
275
|
return Number.isInteger(e) && e > 0 && e <= S;
|
|
276
276
|
}
|
|
277
277
|
function N(e) {
|
|
278
|
-
return Number.isInteger(e) && e > 0 && e <=
|
|
278
|
+
return Number.isInteger(e) && e > 0 && e <= I;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function d(e, t) {
|
|
281
281
|
return !Number.isInteger(e) || e < 0 ? !1 : t === void 0 || e < t;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function u(e) {
|
|
284
284
|
if (!F.test(e))
|
|
285
285
|
throw new Error(`Invalid transaction ID format: ${e}`);
|
|
286
286
|
}
|
|
@@ -307,7 +307,7 @@ const O = {
|
|
|
307
307
|
};
|
|
308
308
|
async function c(e, t) {
|
|
309
309
|
try {
|
|
310
|
-
const o = await
|
|
310
|
+
const o = await f(e, t);
|
|
311
311
|
if (!o.ok) {
|
|
312
312
|
const r = await o.text();
|
|
313
313
|
throw new Error(
|
|
@@ -322,7 +322,7 @@ async function c(e, t) {
|
|
|
322
322
|
}
|
|
323
323
|
async function X(e, t) {
|
|
324
324
|
try {
|
|
325
|
-
const o = await
|
|
325
|
+
const o = await f(`${t}/tx`, {
|
|
326
326
|
method: "POST",
|
|
327
327
|
body: e,
|
|
328
328
|
headers: {
|
|
@@ -333,7 +333,8 @@ async function X(e, t) {
|
|
|
333
333
|
const r = await o.text();
|
|
334
334
|
let n;
|
|
335
335
|
try {
|
|
336
|
-
|
|
336
|
+
const a = JSON.parse(r);
|
|
337
|
+
n = a.message ?? a.error;
|
|
337
338
|
} catch {
|
|
338
339
|
n = r;
|
|
339
340
|
}
|
|
@@ -347,7 +348,7 @@ async function X(e, t) {
|
|
|
347
348
|
}
|
|
348
349
|
}
|
|
349
350
|
async function K(e, t) {
|
|
350
|
-
return
|
|
351
|
+
return u(e), c(`${t}/tx/${e}`);
|
|
351
352
|
}
|
|
352
353
|
async function D(e) {
|
|
353
354
|
const t = await c(`${e}/blocks/tip/height`), o = t.trim();
|
|
@@ -357,10 +358,15 @@ async function D(e) {
|
|
|
357
358
|
);
|
|
358
359
|
return Number.parseInt(o, 10);
|
|
359
360
|
}
|
|
360
|
-
async function j(e, t) {
|
|
361
|
-
|
|
361
|
+
async function j(e, t, o) {
|
|
362
|
+
if (u(e), !d(t))
|
|
363
|
+
throw new Error(`Invalid vout ${t} for transaction ${e}`);
|
|
364
|
+
return c(`${o}/tx/${e}/outspend/${t}`);
|
|
365
|
+
}
|
|
366
|
+
async function z(e, t) {
|
|
367
|
+
u(e);
|
|
362
368
|
try {
|
|
363
|
-
const o = await
|
|
369
|
+
const o = await f(`${t}/tx/${e}/hex`);
|
|
364
370
|
if (!o.ok) {
|
|
365
371
|
const i = await o.text();
|
|
366
372
|
throw new Error(
|
|
@@ -372,15 +378,15 @@ async function j(e, t) {
|
|
|
372
378
|
throw o instanceof Error ? new Error(`Failed to get transaction hex for ${e}: ${o.message}`) : new Error(`Failed to get transaction hex for ${e}: Unknown error`);
|
|
373
379
|
}
|
|
374
380
|
}
|
|
375
|
-
async function
|
|
376
|
-
|
|
381
|
+
async function Q(e, t, o) {
|
|
382
|
+
u(e);
|
|
377
383
|
const i = await K(e, o);
|
|
378
|
-
if (!
|
|
384
|
+
if (!d(t, i.vout.length))
|
|
379
385
|
throw new Error(
|
|
380
386
|
`Invalid vout ${t} for transaction ${e} (has ${i.vout.length} outputs)`
|
|
381
387
|
);
|
|
382
388
|
const r = i.vout[t];
|
|
383
|
-
if (!
|
|
389
|
+
if (!v(r.value))
|
|
384
390
|
throw new Error(`Invalid UTXO value ${r.value} for ${e}:${t}`);
|
|
385
391
|
return T(r.scriptpubkey, `${e}:${t}`), {
|
|
386
392
|
txid: e,
|
|
@@ -389,7 +395,7 @@ async function z(e, t, o) {
|
|
|
389
395
|
scriptPubKey: r.scriptpubkey
|
|
390
396
|
};
|
|
391
397
|
}
|
|
392
|
-
async function
|
|
398
|
+
async function W(e, t) {
|
|
393
399
|
V(e);
|
|
394
400
|
try {
|
|
395
401
|
const o = await c(`${t}/address/${e}/utxo`), i = await c(`${t}/v1/validate-address/${e}`);
|
|
@@ -399,9 +405,9 @@ async function Q(e, t) {
|
|
|
399
405
|
);
|
|
400
406
|
T(i.scriptPubKey, e);
|
|
401
407
|
for (const n of o) {
|
|
402
|
-
if (
|
|
408
|
+
if (u(n.txid), !d(n.vout))
|
|
403
409
|
throw new Error(`Invalid vout ${n.vout} for ${n.txid}`);
|
|
404
|
-
if (!
|
|
410
|
+
if (!v(n.value))
|
|
405
411
|
throw new Error(
|
|
406
412
|
`Invalid UTXO value ${n.value} for ${n.txid}:${n.vout}`
|
|
407
413
|
);
|
|
@@ -421,14 +427,14 @@ async function Q(e, t) {
|
|
|
421
427
|
);
|
|
422
428
|
}
|
|
423
429
|
}
|
|
424
|
-
function
|
|
430
|
+
function L(e) {
|
|
425
431
|
return O[e];
|
|
426
432
|
}
|
|
427
|
-
async function
|
|
433
|
+
async function G(e, t) {
|
|
428
434
|
return V(e), c(`${t}/address/${e}/txs`);
|
|
429
435
|
}
|
|
430
|
-
async function
|
|
431
|
-
const t = await
|
|
436
|
+
async function J(e) {
|
|
437
|
+
const t = await f(`${e}/v1/fees/recommended`);
|
|
432
438
|
if (!t.ok)
|
|
433
439
|
throw new Error(
|
|
434
440
|
`Failed to fetch network fees: ${t.status} ${t.statusText}`
|
|
@@ -443,7 +449,7 @@ async function G(e) {
|
|
|
443
449
|
for (const r of i)
|
|
444
450
|
if (!N(o[r]))
|
|
445
451
|
throw new Error(
|
|
446
|
-
`Invalid fee rate ${r}=${o[r]} from mempool API: expected a positive number ≤ ${
|
|
452
|
+
`Invalid fee rate ${r}=${o[r]} from mempool API: expected a positive number ≤ ${I}`
|
|
447
453
|
);
|
|
448
454
|
if (o.minimumFee > o.economyFee || o.economyFee > o.hourFee || o.hourFee > o.halfHourFee || o.halfHourFee > o.fastestFee)
|
|
449
455
|
throw new Error(
|
|
@@ -454,18 +460,19 @@ async function G(e) {
|
|
|
454
460
|
export {
|
|
455
461
|
O as M,
|
|
456
462
|
_ as V,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
463
|
+
W as a,
|
|
464
|
+
L as b,
|
|
465
|
+
J as c,
|
|
466
|
+
j as d,
|
|
467
|
+
D as e,
|
|
468
|
+
z as f,
|
|
469
|
+
G as g,
|
|
470
|
+
K as h,
|
|
471
|
+
Q as i,
|
|
472
|
+
M as j,
|
|
473
|
+
k,
|
|
474
|
+
m as l,
|
|
468
475
|
X as p,
|
|
469
476
|
B as v
|
|
470
477
|
};
|
|
471
|
-
//# sourceMappingURL=mempoolApi-
|
|
478
|
+
//# sourceMappingURL=mempoolApi-Dc1KSVNI.js.map
|