@babylonlabs-io/ts-sdk 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/BTCVaultRegistry.abi-BH2-LHxN.cjs +2 -0
  2. package/dist/BTCVaultRegistry.abi-BH2-LHxN.cjs.map +1 -0
  3. package/dist/{BTCVaultRegistry.abi-BmHpMUWD.js → BTCVaultRegistry.abi-BzNTa_EU.js} +19 -1
  4. package/dist/BTCVaultRegistry.abi-BzNTa_EU.js.map +1 -0
  5. package/dist/{PeginManager-PyKbfy5q.cjs → PeginManager-BHplS4dM.cjs} +2 -2
  6. package/dist/{PeginManager-PyKbfy5q.cjs.map → PeginManager-BHplS4dM.cjs.map} +1 -1
  7. package/dist/{PeginManager-Dfr5Qe1g.js → PeginManager-DcwGom01.js} +2 -2
  8. package/dist/{PeginManager-Dfr5Qe1g.js.map → PeginManager-DcwGom01.js.map} +1 -1
  9. package/dist/buildAndBroadcastReclaim-C7bq5wNM.cjs +2 -0
  10. package/dist/buildAndBroadcastReclaim-C7bq5wNM.cjs.map +1 -0
  11. package/dist/{buildAndBroadcastReclaim-R0HNpLMD.js → buildAndBroadcastReclaim-CcQ0b1be.js} +466 -456
  12. package/dist/buildAndBroadcastReclaim-CcQ0b1be.js.map +1 -0
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +74 -74
  15. package/dist/pegin-registration-client-BogzOk8B.cjs +2 -0
  16. package/dist/pegin-registration-client-BogzOk8B.cjs.map +1 -0
  17. package/dist/{pegin-registration-client-kdz4fT5_.js → pegin-registration-client-DvyrUNku.js} +44 -43
  18. package/dist/pegin-registration-client-DvyrUNku.js.map +1 -0
  19. package/dist/peginState-CIibG9S_.js +75 -0
  20. package/dist/peginState-CIibG9S_.js.map +1 -0
  21. package/dist/peginState-IyE22wWh.cjs +2 -0
  22. package/dist/peginState-IyE22wWh.cjs.map +1 -0
  23. package/dist/{reservation-DOAHVT3B.js → reservation-BZQABu4g.js} +2 -2
  24. package/dist/{reservation-DOAHVT3B.js.map → reservation-BZQABu4g.js.map} +1 -1
  25. package/dist/{reservation-ECxjZi5t.cjs → reservation-CA5knoQ0.cjs} +2 -2
  26. package/dist/{reservation-ECxjZi5t.cjs.map → reservation-CA5knoQ0.cjs.map} +1 -1
  27. package/dist/{signer-set-reader-DFAu6I-v.cjs → signer-set-reader-D-CyIYR5.cjs} +2 -2
  28. package/dist/{signer-set-reader-DFAu6I-v.cjs.map → signer-set-reader-D-CyIYR5.cjs.map} +1 -1
  29. package/dist/{signer-set-reader-BCtmSKUM.js → signer-set-reader-DFF9MgQN.js} +2 -2
  30. package/dist/{signer-set-reader-BCtmSKUM.js.map → signer-set-reader-DFF9MgQN.js.map} +1 -1
  31. package/dist/tbv/core/clients/eth/index.cjs +1 -1
  32. package/dist/tbv/core/clients/eth/index.js +2 -2
  33. package/dist/tbv/core/clients/eth/types.d.ts +8 -0
  34. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  35. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
  36. package/dist/tbv/core/clients/index.cjs +1 -1
  37. package/dist/tbv/core/clients/index.js +2 -2
  38. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +14 -0
  39. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  40. package/dist/tbv/core/contracts/index.cjs +1 -1
  41. package/dist/tbv/core/contracts/index.js +1 -1
  42. package/dist/tbv/core/index.cjs +1 -1
  43. package/dist/tbv/core/index.js +84 -84
  44. package/dist/tbv/core/managers/index.cjs +1 -1
  45. package/dist/tbv/core/managers/index.js +1 -1
  46. package/dist/tbv/core/services/activation/activateVault.d.ts +50 -0
  47. package/dist/tbv/core/services/activation/activateVault.d.ts.map +1 -1
  48. package/dist/tbv/core/services/activation/index.d.ts +1 -1
  49. package/dist/tbv/core/services/activation/index.d.ts.map +1 -1
  50. package/dist/tbv/core/services/delegated-claim/__tests__/realWasmWatchtowerArtifacts.test.d.ts +9 -0
  51. package/dist/tbv/core/services/delegated-claim/__tests__/realWasmWatchtowerArtifacts.test.d.ts.map +1 -0
  52. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +5 -7
  53. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -1
  54. package/dist/tbv/core/services/delegated-claim/index.d.ts +3 -4
  55. package/dist/tbv/core/services/delegated-claim/index.d.ts.map +1 -1
  56. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts.map +1 -1
  57. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +14 -8
  58. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -1
  59. package/dist/tbv/core/services/delegated-claim/types.d.ts +32 -19
  60. package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -1
  61. package/dist/tbv/core/services/deposit/peginState.d.ts +20 -1
  62. package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -1
  63. package/dist/tbv/core/services/index.cjs +1 -1
  64. package/dist/tbv/core/services/index.js +58 -58
  65. package/dist/tbv/core/utils/index.cjs +1 -1
  66. package/dist/tbv/core/utils/index.js +1 -1
  67. package/dist/tbv/index.cjs +1 -1
  68. package/dist/tbv/index.js +84 -84
  69. package/dist/{toRefundInputs-BbAOOUg6.cjs → toRefundInputs-8DgBT_Bg.cjs} +2 -2
  70. package/dist/{toRefundInputs-BbAOOUg6.cjs.map → toRefundInputs-8DgBT_Bg.cjs.map} +1 -1
  71. package/dist/{toRefundInputs-DW14g6wH.js → toRefundInputs-CCMNAoRx.js} +2 -2
  72. package/dist/{toRefundInputs-DW14g6wH.js.map → toRefundInputs-CCMNAoRx.js.map} +1 -1
  73. package/dist/types-Bda75Od0.cjs.map +1 -1
  74. package/dist/types-C5jj3Cc-.js.map +1 -1
  75. package/package.json +1 -1
  76. package/dist/BTCVaultRegistry.abi-BmHpMUWD.js.map +0 -1
  77. package/dist/BTCVaultRegistry.abi-DffWFdpA.cjs +0 -2
  78. package/dist/BTCVaultRegistry.abi-DffWFdpA.cjs.map +0 -1
  79. package/dist/buildAndBroadcastReclaim-Da8rD5Z7.cjs +0 -2
  80. package/dist/buildAndBroadcastReclaim-Da8rD5Z7.cjs.map +0 -1
  81. package/dist/buildAndBroadcastReclaim-R0HNpLMD.js.map +0 -1
  82. package/dist/pegin-registration-client-C-abxMWq.cjs +0 -2
  83. package/dist/pegin-registration-client-C-abxMWq.cjs.map +0 -1
  84. package/dist/pegin-registration-client-kdz4fT5_.js.map +0 -1
  85. package/dist/peginState-BU2ONFXF.js +0 -68
  86. package/dist/peginState-BU2ONFXF.js.map +0 -1
  87. package/dist/peginState-DUv10EJR.cjs +0 -2
  88. package/dist/peginState-DUv10EJR.cjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";const e=[{type:"function",name:"submitPeginRequest",inputs:[{name:"depositor",type:"address",internalType:"address"},{name:"depositorBtcPubKey",type:"bytes32",internalType:"bytes32"},{name:"btcPopSignature",type:"bytes",internalType:"bytes"},{name:"unsignedPrePeginTx",type:"bytes",internalType:"bytes"},{name:"depositorSignedPeginTx",type:"bytes",internalType:"bytes"},{name:"vaultProvider",type:"address",internalType:"address"},{name:"maxAcceptableCommissionBps",type:"uint16",internalType:"uint16"},{name:"hashlock",type:"bytes32",internalType:"bytes32"},{name:"htlcVout",type:"uint8",internalType:"uint8"},{name:"depositorPayoutBtcAddress",type:"bytes",internalType:"bytes"},{name:"depositorWotsPkHash",type:"bytes32",internalType:"bytes32"},{name:"expectedFingerprint",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"payable"},{type:"function",name:"submitPeginRequest",inputs:[{name:"depositor",type:"address",internalType:"address"},{name:"depositorBtcPubKey",type:"bytes32",internalType:"bytes32"},{name:"btcPopSignature",type:"bytes",internalType:"bytes"},{name:"unsignedPrePeginTx",type:"bytes",internalType:"bytes"},{name:"depositorSignedPeginTx",type:"bytes",internalType:"bytes"},{name:"vaultProvider",type:"address",internalType:"address"},{name:"maxAcceptableCommissionBps",type:"uint16",internalType:"uint16"},{name:"hashlock",type:"bytes32",internalType:"bytes32"},{name:"htlcVout",type:"uint8",internalType:"uint8"},{name:"referralCode",type:"uint32",internalType:"uint32"},{name:"depositorPayoutBtcAddress",type:"bytes",internalType:"bytes"},{name:"depositorWotsPkHash",type:"bytes32",internalType:"bytes32"},{name:"expectedFingerprint",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"payable"},{type:"function",name:"submitPeginRequestBatch",inputs:[{name:"depositor",type:"address",internalType:"address"},{name:"vaultProvider",type:"address",internalType:"address"},{name:"maxAcceptableCommissionBps",type:"uint16",internalType:"uint16"},{name:"expectedFingerprint",type:"bytes32",internalType:"bytes32"},{name:"requests",type:"tuple[]",internalType:"struct BTCVaultRegistryTypes.BatchPeginRequest[]",components:[{name:"depositorBtcPubKey",type:"bytes32",internalType:"bytes32"},{name:"btcPopSignature",type:"bytes",internalType:"bytes"},{name:"unsignedPrePeginTx",type:"bytes",internalType:"bytes"},{name:"depositorSignedPeginTx",type:"bytes",internalType:"bytes"},{name:"hashlock",type:"bytes32",internalType:"bytes32"},{name:"htlcVout",type:"uint8",internalType:"uint8"},{name:"referralCode",type:"uint32",internalType:"uint32"},{name:"depositorPayoutBtcAddress",type:"bytes",internalType:"bytes"},{name:"depositorWotsPkHash",type:"bytes32",internalType:"bytes32"}]}],outputs:[{name:"vaultIds",type:"bytes32[]",internalType:"bytes32[]"}],stateMutability:"payable"},{type:"function",name:"activateVaultWithSecret",inputs:[{name:"vaultId",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"},{name:"activationMetadata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"activateVaultWithSecretAndRedeem",inputs:[{name:"vaultId",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimExpiredVault",inputs:[{name:"vaultId",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"getPegInFee",inputs:[{name:"vaultProvider",type:"address",internalType:"address"}],outputs:[{name:"totalFee",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentOperationBtcKey",inputs:[{name:"provider",type:"address",internalType:"address"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"getOperationBtcKeyAtEpoch",inputs:[{name:"provider",type:"address",internalType:"address"},{name:"epoch",type:"uint64",internalType:"uint64"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"getPayoutScriptAtEpoch",inputs:[{name:"provider",type:"address",internalType:"address"},{name:"epoch",type:"uint64",internalType:"uint64"}],outputs:[{name:"",type:"bytes",internalType:"bytes"}],stateMutability:"view"},{type:"function",name:"getVaultProviderCommission",inputs:[{name:"vpAddr",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"getVaultProviderApplication",inputs:[{name:"vpAddr",type:"address",internalType:"address"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getBtcVaultBasicInfo",inputs:[{name:"vaultId",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"vBasic",type:"tuple",internalType:"struct BTCVaultTypes.BTCVaultBasicInfo",components:[{name:"depositor",type:"address",internalType:"address"},{name:"depositorBtcPubKey",type:"bytes32",internalType:"bytes32"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"vaultProvider",type:"address",internalType:"address"},{name:"status",type:"uint8",internalType:"enum IBTCVaultRegistry.BTCVaultStatus"},{name:"applicationEntryPoint",type:"address",internalType:"address"},{name:"createdAt",type:"uint256",internalType:"uint256"}]}],stateMutability:"view"},{type:"function",name:"getBtcVaultProtocolInfo",inputs:[{name:"vaultId",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"vProtocol",type:"tuple",internalType:"struct BTCVaultRegistryTypes.BTCVaultProtocolInfo",components:[{name:"depositorSignedPeginTx",type:"bytes",internalType:"bytes"},{name:"universalChallengersVersion",type:"uint16",internalType:"uint16"},{name:"appVaultKeepersVersion",type:"uint16",internalType:"uint16"},{name:"offchainParamsVersion",type:"uint16",internalType:"uint16"},{name:"verifiedAt",type:"uint256",internalType:"uint256"},{name:"depositorWotsPkHash",type:"bytes32",internalType:"bytes32"},{name:"hashlock",type:"bytes32",internalType:"bytes32"},{name:"htlcVout",type:"uint8",internalType:"uint8"},{name:"depositorPopSignature",type:"bytes",internalType:"bytes"},{name:"prePeginTxHash",type:"bytes32",internalType:"bytes32"},{name:"vaultProviderCommissionBps",type:"uint16",internalType:"uint16"},{name:"claimExpiredUntil",type:"uint256",internalType:"uint256"},{name:"vaultCoreVersion",type:"uint16",internalType:"uint16"}]}],stateMutability:"view"},{type:"function",name:"protocolParams",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IProtocolParams"}],stateMutability:"view"},{type:"function",name:"applicationRegistry",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IApplicationRegistry"}],stateMutability:"view"},{type:"error",name:"ZeroAddress",inputs:[]},{type:"error",name:"Unauthorized",inputs:[]},{type:"error",name:"InvalidAmount",inputs:[]},{type:"error",name:"TransferFailed",inputs:[]},{type:"error",name:"InvalidTransaction",inputs:[]},{type:"error",name:"EmptyPayoutAddress",inputs:[]},{type:"error",name:"PayoutAddressTooLong",inputs:[]},{type:"error",name:"VaultAlreadyExists",inputs:[]},{type:"error",name:"VaultFeeAlreadyEscrowed",inputs:[]},{type:"error",name:"NoEscrowedFees",inputs:[]},{type:"error",name:"BTCVaultNotFound",inputs:[]},{type:"error",name:"InvalidBTCVaultStatus",inputs:[]},{type:"error",name:"PeginNotExpired",inputs:[]},{type:"error",name:"InvalidParticipantsList",inputs:[]},{type:"error",name:"DuplicateParticipant",inputs:[]},{type:"error",name:"ParticipantRoleOverlap",inputs:[]},{type:"error",name:"NotAuthorizedToACK",inputs:[]},{type:"error",name:"UnauthorizedVaultKeeper",inputs:[]},{type:"error",name:"BlocklistedVaultKeeper",inputs:[]},{type:"error",name:"PeginTransactionExpired",inputs:[]},{type:"error",name:"PrePeginOutputAlreadyUsed",inputs:[]},{type:"error",name:"PeginTransactionAlreadyUsed",inputs:[]},{type:"error",name:"InvalidPeginFee",inputs:[{name:"provided",type:"uint256",internalType:"uint256"},{name:"required",type:"uint256",internalType:"uint256"}]},{type:"error",name:"AmountBelowMinimumThreshold",inputs:[{name:"actual",type:"uint256",internalType:"uint256"},{name:"minimum",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidOutputIndex",inputs:[{name:"provided",type:"uint256",internalType:"uint256"},{name:"maxValid",type:"uint256",internalType:"uint256"}]},{type:"error",name:"TooManyHtlcOutputs",inputs:[{name:"outputCount",type:"uint256",internalType:"uint256"},{name:"maxAllowed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"VaultBelowMinimum",inputs:[{name:"actual",type:"uint256",internalType:"uint256"},{name:"minimum",type:"uint256",internalType:"uint256"}]},{type:"error",name:"VaultAboveMaximum",inputs:[{name:"actual",type:"uint256",internalType:"uint256"},{name:"maximum",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidBTCPublicKey",inputs:[]},{type:"error",name:"InvalidDepositorWotsPkHash",inputs:[]},{type:"error",name:"InvalidBTCProofOfPossession",inputs:[]},{type:"error",name:"EthKeyAlreadyRegistered",inputs:[]},{type:"error",name:"BtcKeyAlreadyRegistered",inputs:[]},{type:"error",name:"InvalidRegistrationFee",inputs:[]},{type:"error",name:"CommissionBelowMinimum",inputs:[{name:"provided",type:"uint16",internalType:"uint16"},{name:"minimum",type:"uint16",internalType:"uint16"}]},{type:"error",name:"CommissionAboveMaximum",inputs:[{name:"provided",type:"uint16",internalType:"uint16"}]},{type:"error",name:"CommissionUnchanged",inputs:[]},{type:"error",name:"VaultProviderCommissionExceeded",inputs:[{name:"maxAcceptable",type:"uint16",internalType:"uint16"},{name:"actual",type:"uint16",internalType:"uint16"}]},{type:"error",name:"PeginFingerprintChanged",inputs:[{name:"expected",type:"bytes32",internalType:"bytes32"},{name:"actual",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"VaultProviderNotRegistered",inputs:[]},{type:"error",name:"ApplicationAlreadyRegistered",inputs:[]},{type:"error",name:"ApplicationNotRegistered",inputs:[]},{type:"error",name:"ApplicationNotActive",inputs:[]},{type:"error",name:"InvalidApplicationStatus",inputs:[]},{type:"error",name:"OnlyApplicationEntryPoint",inputs:[]},{type:"error",name:"EmptyVaultKeepers",inputs:[]},{type:"error",name:"NoUniversalChallengersConfigured",inputs:[]},{type:"error",name:"NoAppVaultKeepersConfigured",inputs:[]},{type:"error",name:"PeginSignaturesIncomplete",inputs:[]},{type:"error",name:"InvalidSignatureLength",inputs:[]},{type:"error",name:"PeginInputSignatureAlreadySubmitted",inputs:[]},{type:"error",name:"InvalidHashlock",inputs:[]},{type:"error",name:"DuplicateHashlock",inputs:[]},{type:"error",name:"InvalidSecret",inputs:[]},{type:"error",name:"ActivationDeadlineExpired",inputs:[]},{type:"error",name:"ActivationDelayNotElapsed",inputs:[]},{type:"error",name:"PostExpiryGraceWindowElapsed",inputs:[]},{type:"error",name:"CapExceeded",inputs:[]},{type:"event",name:"PegInSubmitted",inputs:[{name:"vaultId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"peginTxHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"depositor",type:"address",indexed:!0,internalType:"address"},{name:"vaultProvider",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"vaultCoreVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"universalChallengersVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"appVaultKeepersVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"proverCircuitVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"offchainParamsVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"referralCode",type:"uint32",indexed:!1,internalType:"uint32"},{name:"depositorPayoutBtcAddress",type:"bytes",indexed:!1,internalType:"bytes"},{name:"depositorWotsPkHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"hashlock",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"btcPopSignature",type:"bytes",indexed:!1,internalType:"bytes"},{name:"htlcVout",type:"uint8",indexed:!1,internalType:"uint8"},{name:"unsignedPrePeginTx",type:"bytes",indexed:!1,internalType:"bytes"},{name:"depositorSignedPeginTx",type:"bytes",indexed:!1,internalType:"bytes"},{name:"vpKeyEpoch",type:"uint64",indexed:!1,internalType:"uint64"},{name:"appKeeperKeyEpoch",type:"uint64",indexed:!1,internalType:"uint64"},{name:"ucKeyEpoch",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"PegInSubmittedV2",inputs:[{name:"vaultId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"peginTxHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"depositor",type:"address",indexed:!0,internalType:"address"},{name:"vaultProvider",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"vaultCoreVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"universalChallengersVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"appVaultKeepersVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"proverCircuitVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"offchainParamsVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"referralCode",type:"uint32",indexed:!1,internalType:"uint32"},{name:"depositorPayoutBtcAddress",type:"bytes",indexed:!1,internalType:"bytes"},{name:"depositorWotsPkHash",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"hashlock",type:"bytes32",indexed:!1,internalType:"bytes32"},{name:"btcPopSignature",type:"bytes",indexed:!1,internalType:"bytes"},{name:"htlcVout",type:"uint8",indexed:!1,internalType:"uint8"},{name:"unsignedPrePeginTx",type:"bytes",indexed:!1,internalType:"bytes"},{name:"depositorSignedPeginTx",type:"bytes",indexed:!1,internalType:"bytes"},{name:"vpKeyEpoch",type:"uint64",indexed:!1,internalType:"uint64"},{name:"appKeeperKeyEpoch",type:"uint64",indexed:!1,internalType:"uint64"},{name:"ucKeyEpoch",type:"uint64",indexed:!1,internalType:"uint64"},{name:"maxAcceptableCommissionBps",type:"uint16",indexed:!1,internalType:"uint16"}],anonymous:!1},{type:"event",name:"VaultClaimableBy",inputs:[{name:"vaultId",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"peginTxHash",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"claimerPK",type:"bytes32",indexed:!0,internalType:"bytes32"},{name:"vaultCoreVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"proverCircuitVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"offchainParamsVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"universalChallengersVersion",type:"uint16",indexed:!1,internalType:"uint16"},{name:"appVaultKeepersVersion",type:"uint16",indexed:!1,internalType:"uint16"}],anonymous:!1}];exports.BTCVaultRegistryABI=e;
2
+ //# sourceMappingURL=BTCVaultRegistry.abi-BH2-LHxN.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BTCVaultRegistry.abi-BH2-LHxN.cjs","sources":["../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"sourcesContent":["/**\n * BTCVaultRegistry Contract ABI\n *\n * Minimal ABI containing only the functions needed by the SDK.\n * Full ABI is available in the vault service package.\n *\n * @module contracts/abis/BTCVaultRegistry\n */\n\n/**\n * Minimal ABI for BTCVaultRegistry contract.\n * Contains submitPeginRequest, submitPeginRequestBatch, activateVaultWithSecret, getPegInFee, getBtcVaultBasicInfo, getVaultProviderCommission,\n * and the PegInSubmitted / PegInSubmittedV2 events.\n */\nexport const BTCVaultRegistryABI = [\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n // Appended last on both singular overloads, unlike the batch entry where\n // it sits before `requests`. Order is the signature, so it is the ABI.\n {\n name: \"expectedFingerprint\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"expectedFingerprint\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequestBatch\",\n inputs: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n { name: \"vaultProvider\", type: \"address\", internalType: \"address\" },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n // The fingerprint is argument 4, BEFORE `requests` — not appended, as it\n // is on the two singular overloads. It takes no per-request input and the\n // batch fixes one vault provider, so one value covers every entry.\n {\n name: \"expectedFingerprint\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"requests\",\n type: \"tuple[]\",\n internalType: \"struct BTCVaultRegistryTypes.BatchPeginRequest[]\",\n components: [\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n { name: \"btcPopSignature\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"unsignedPrePeginTx\", type: \"bytes\", internalType: \"bytes\" },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n { name: \"hashlock\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"htlcVout\", type: \"uint8\", internalType: \"uint8\" },\n { name: \"referralCode\", type: \"uint32\", internalType: \"uint32\" },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n },\n ],\n outputs: [\n { name: \"vaultIds\", type: \"bytes32[]\", internalType: \"bytes32[]\" },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"activateVaultWithSecret\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"activationMetadata\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"activateVaultWithSecretAndRedeem\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"claimExpiredVault\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"getPegInFee\",\n inputs: [\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n ],\n outputs: [\n {\n name: \"totalFee\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n },\n // --- RFC-006 operation-key resolution ---------------------------------\n // A vault provider's BTC key is not a fixed registration key: it is an\n // append-only history of *operation* keys, rotated by the provider's cold ETH\n // admin key. Each vault freezes a `vpKeyEpoch` at `submitPeginRequest` and\n // resolves the key bonded at that epoch, so a later rotation never\n // invalidates a live vault.\n //\n // The dedicated `getVaultProviderBTCKey` / `getVaultProviderKeyPair` getters\n // are deliberately absent: vault-contracts-aave-v4#539 removes them, and\n // keeping them here would let a call compile against a selector the registry\n // no longer exposes. The registration key is read as the operation key at\n // epoch 0 instead — see `getVaultProviderGenesisBtcPubKey`.\n //\n // `getCurrentOperationBtcKey` falls back on-chain to the registration key at\n // version 0, so adopting it is a no-op for a provider that never rotated.\n //\n // `getPayoutScriptAtEpoch` does NOT behave that way, and assuming it did was\n // wrong in an earlier revision of this comment. A payout script is mandatory\n // at registration and stored as version 1, so on an RFC-006 registry this\n // returns the operator's own registered script from the very first epoch —\n // not a BIP-86 derivation of its key. The contract's BIP-86 branch is a\n // migration default for pre-RFC-006 rows and is not reachable from\n // registration. An operator whose registered script happens to equal\n // bip86(key) is a coincidence of what it chose to register, not a fallback.\n //\n // This is why depositor payout validation must accept the legacy BIP-86 form\n // alongside the registered one: a payout graph is built once at BaBe Setup\n // and never rebuilt, so a vault whose graph predates its network's\n // btc-vault#2440 upgrade pays BIP-86 for the rest of its life. See\n // `acceptedPayoutScriptHexes` in `primitives/psbt/payout.ts`.\n {\n type: \"function\",\n name: \"getCurrentOperationBtcKey\",\n inputs: [{ name: \"provider\", type: \"address\", internalType: \"address\" }],\n outputs: [{ name: \"\", type: \"bytes32\", internalType: \"bytes32\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getOperationBtcKeyAtEpoch\",\n inputs: [\n { name: \"provider\", type: \"address\", internalType: \"address\" },\n { name: \"epoch\", type: \"uint64\", internalType: \"uint64\" },\n ],\n outputs: [{ name: \"\", type: \"bytes32\", internalType: \"bytes32\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getPayoutScriptAtEpoch\",\n inputs: [\n { name: \"provider\", type: \"address\", internalType: \"address\" },\n { name: \"epoch\", type: \"uint64\", internalType: \"uint64\" },\n ],\n outputs: [{ name: \"\", type: \"bytes\", internalType: \"bytes\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderCommission\",\n inputs: [{ name: \"vpAddr\", type: \"address\", internalType: \"address\" }],\n outputs: [{ name: \"\", type: \"uint16\", internalType: \"uint16\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderApplication\",\n inputs: [{ name: \"vpAddr\", type: \"address\", internalType: \"address\" }],\n outputs: [{ name: \"\", type: \"address\", internalType: \"address\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getBtcVaultBasicInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vBasic\",\n type: \"tuple\",\n internalType: \"struct BTCVaultTypes.BTCVaultBasicInfo\",\n components: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n { name: \"amount\", type: \"uint256\", internalType: \"uint256\" },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"status\",\n type: \"uint8\",\n internalType: \"enum IBTCVaultRegistry.BTCVaultStatus\",\n },\n {\n name: \"applicationEntryPoint\",\n type: \"address\",\n internalType: \"address\",\n },\n { name: \"createdAt\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getBtcVaultProtocolInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vProtocol\",\n type: \"tuple\",\n internalType: \"struct BTCVaultRegistryTypes.BTCVaultProtocolInfo\",\n components: [\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"verifiedAt\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"prePeginTxHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"vaultProviderCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"claimExpiredUntil\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"protocolParams\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IProtocolParams\",\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"applicationRegistry\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IApplicationRegistry\",\n },\n ],\n stateMutability: \"view\",\n },\n // ============================================================================\n // Errors — needed so viem can decode revert data into a named error.\n // Without these, every revert surfaces as \"Execution reverted for an\n // unknown reason.\" Mirrors errors thrown from BTCVaultRegistry's reachable\n // code paths (pegin submission, ACK, activation). Source:\n // https://github.com/babylonlabs-io/vault-contracts-aave-v4/blob/652c4582/src/protocol/lib/types/Errors.sol\n // ============================================================================\n { type: \"error\", name: \"ZeroAddress\", inputs: [] },\n { type: \"error\", name: \"Unauthorized\", inputs: [] },\n { type: \"error\", name: \"InvalidAmount\", inputs: [] },\n { type: \"error\", name: \"TransferFailed\", inputs: [] },\n { type: \"error\", name: \"InvalidTransaction\", inputs: [] },\n { type: \"error\", name: \"EmptyPayoutAddress\", inputs: [] },\n { type: \"error\", name: \"PayoutAddressTooLong\", inputs: [] },\n { type: \"error\", name: \"VaultAlreadyExists\", inputs: [] },\n { type: \"error\", name: \"VaultFeeAlreadyEscrowed\", inputs: [] },\n { type: \"error\", name: \"NoEscrowedFees\", inputs: [] },\n { type: \"error\", name: \"BTCVaultNotFound\", inputs: [] },\n { type: \"error\", name: \"InvalidBTCVaultStatus\", inputs: [] },\n { type: \"error\", name: \"PeginNotExpired\", inputs: [] },\n { type: \"error\", name: \"InvalidParticipantsList\", inputs: [] },\n { type: \"error\", name: \"DuplicateParticipant\", inputs: [] },\n { type: \"error\", name: \"ParticipantRoleOverlap\", inputs: [] },\n { type: \"error\", name: \"NotAuthorizedToACK\", inputs: [] },\n { type: \"error\", name: \"UnauthorizedVaultKeeper\", inputs: [] },\n { type: \"error\", name: \"BlocklistedVaultKeeper\", inputs: [] },\n { type: \"error\", name: \"PeginTransactionExpired\", inputs: [] },\n { type: \"error\", name: \"PrePeginOutputAlreadyUsed\", inputs: [] },\n { type: \"error\", name: \"PeginTransactionAlreadyUsed\", inputs: [] },\n {\n type: \"error\",\n name: \"InvalidPeginFee\",\n inputs: [\n { name: \"provided\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"required\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"AmountBelowMinimumThreshold\",\n inputs: [\n { name: \"actual\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"minimum\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"InvalidOutputIndex\",\n inputs: [\n { name: \"provided\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"maxValid\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"TooManyHtlcOutputs\",\n inputs: [\n { name: \"outputCount\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"maxAllowed\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"VaultBelowMinimum\",\n inputs: [\n { name: \"actual\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"minimum\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"VaultAboveMaximum\",\n inputs: [\n { name: \"actual\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"maximum\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n { type: \"error\", name: \"InvalidBTCPublicKey\", inputs: [] },\n { type: \"error\", name: \"InvalidDepositorWotsPkHash\", inputs: [] },\n { type: \"error\", name: \"InvalidBTCProofOfPossession\", inputs: [] },\n { type: \"error\", name: \"EthKeyAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"BtcKeyAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"InvalidRegistrationFee\", inputs: [] },\n {\n type: \"error\",\n name: \"CommissionBelowMinimum\",\n inputs: [\n { name: \"provided\", type: \"uint16\", internalType: \"uint16\" },\n { name: \"minimum\", type: \"uint16\", internalType: \"uint16\" },\n ],\n },\n {\n type: \"error\",\n name: \"CommissionAboveMaximum\",\n inputs: [{ name: \"provided\", type: \"uint16\", internalType: \"uint16\" }],\n },\n { type: \"error\", name: \"CommissionUnchanged\", inputs: [] },\n {\n type: \"error\",\n name: \"VaultProviderCommissionExceeded\",\n inputs: [\n { name: \"maxAcceptable\", type: \"uint16\", internalType: \"uint16\" },\n { name: \"actual\", type: \"uint16\", internalType: \"uint16\" },\n ],\n },\n // The same intent-binding shape as VaultProviderCommissionExceeded above,\n // one axis wider: the depositor commits to the whole protocol resolution the\n // Pre-Pegin was built against, and the registry rejects a submission whose\n // resolution moved. Newer than the block header's source commit — it arrives\n // with https://github.com/babylonlabs-io/vault-contracts-aave-v4/pull/555.\n // Selector 0x846c25bb, confirmed against that repo's generated\n // snapshots/selectors.md at head 86577e40.\n {\n type: \"error\",\n name: \"PeginFingerprintChanged\",\n inputs: [\n { name: \"expected\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"actual\", type: \"bytes32\", internalType: \"bytes32\" },\n ],\n },\n { type: \"error\", name: \"VaultProviderNotRegistered\", inputs: [] },\n { type: \"error\", name: \"ApplicationAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"ApplicationNotRegistered\", inputs: [] },\n { type: \"error\", name: \"ApplicationNotActive\", inputs: [] },\n { type: \"error\", name: \"InvalidApplicationStatus\", inputs: [] },\n { type: \"error\", name: \"OnlyApplicationEntryPoint\", inputs: [] },\n { type: \"error\", name: \"EmptyVaultKeepers\", inputs: [] },\n { type: \"error\", name: \"NoUniversalChallengersConfigured\", inputs: [] },\n { type: \"error\", name: \"NoAppVaultKeepersConfigured\", inputs: [] },\n { type: \"error\", name: \"PeginSignaturesIncomplete\", inputs: [] },\n { type: \"error\", name: \"InvalidSignatureLength\", inputs: [] },\n { type: \"error\", name: \"PeginInputSignatureAlreadySubmitted\", inputs: [] },\n { type: \"error\", name: \"InvalidHashlock\", inputs: [] },\n { type: \"error\", name: \"DuplicateHashlock\", inputs: [] },\n { type: \"error\", name: \"InvalidSecret\", inputs: [] },\n { type: \"error\", name: \"ActivationDeadlineExpired\", inputs: [] },\n // Lower bound on activation: reverts while\n // `block.number < verifiedAt + peginActivationDelay`. Clears with time, so\n // unlike ActivationDeadlineExpired it is retryable, not terminal.\n { type: \"error\", name: \"ActivationDelayNotElapsed\", inputs: [] },\n { type: \"error\", name: \"PostExpiryGraceWindowElapsed\", inputs: [] },\n { type: \"error\", name: \"CapExceeded\", inputs: [] },\n // Registration event, emitted on every registration since genesis\n // (vault-contracts-aave-v4 src/protocol/lib/types/Events.sol).\n {\n type: \"event\",\n name: \"PegInSubmitted\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"peginTxHash\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"depositor\",\n type: \"address\",\n indexed: true,\n internalType: \"address\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n indexed: false,\n internalType: \"address\",\n },\n {\n name: \"amount\",\n type: \"uint256\",\n indexed: false,\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"proverCircuitVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n indexed: false,\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n indexed: false,\n internalType: \"uint8\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"vpKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"appKeeperKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"ucKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n ],\n anonymous: false,\n },\n // Emitted alongside PegInSubmitted on every registration since #548; the\n // only on-chain source of the depositor's commission ceiling, which the\n // contract bound-checks and discards (Events.sol, vault-contracts-aave-v4 #548).\n {\n type: \"event\",\n name: \"PegInSubmittedV2\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"peginTxHash\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"depositor\",\n type: \"address\",\n indexed: true,\n internalType: \"address\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n indexed: false,\n internalType: \"address\",\n },\n {\n name: \"amount\",\n type: \"uint256\",\n indexed: false,\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"proverCircuitVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n indexed: false,\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n indexed: false,\n internalType: \"uint8\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"vpKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"appKeeperKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"ucKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n ],\n anonymous: false,\n },\n // Redemption event (vault-contracts-aave-v4 src/protocol/lib/types/Events.sol\n // @ c559f5c2). Emitted once per authorized claimer key, all in one\n // transaction, by RedeemLogic._emitVaultClaimableBy (`redeemForDepositor`\n // and the other depositor paths) and by PeginLogic `claimExpired`\n // (:1101, :1111): the vault provider's key and then the depositor's\n // registered BTC key — except `redeemForAVK`, which authorizes the vault\n // keeper alone, so a REDEEMED vault can carry no log for its depositor.\n {\n type: \"event\",\n name: \"VaultClaimableBy\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"peginTxHash\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"claimerPK\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"proverCircuitVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n ],\n anonymous: false,\n },\n] as const;\n"],"names":["BTCVaultRegistryABI"],"mappings":"aAcO,MAAMA,EAAsB,CACjC,CACE,KAAM,WACN,KAAM,qBACN,OAAQ,CACN,CACE,KAAM,YACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,qBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,kBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,qBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,yBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,gBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,6BACN,KAAM,SACN,aAAc,QAAA,EAEhB,CACE,KAAM,WACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,WACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,4BACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,sBACN,KAAM,UACN,aAAc,SAAA,EAIhB,CACE,KAAM,sBACN,KAAM,UACN,aAAc,SAAA,CAChB,EAEF,QAAS,CACP,CACE,KAAM,GACN,KAAM,UACN,aAAc,SAAA,CAChB,EAEF,gBAAiB,SAAA,EAEnB,CACE,KAAM,WACN,KAAM,qBACN,OAAQ,CACN,CACE,KAAM,YACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,qBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,kBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,qBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,yBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,gBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,6BACN,KAAM,SACN,aAAc,QAAA,EAEhB,CACE,KAAM,WACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,WACN,KAAM,QACN,a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KAAM,aACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,EAEhB,CACE,KAAM,6BACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,CAChB,EAEF,UAAW,EAAA,EASb,CACE,KAAM,QACN,KAAM,mBACN,OAAQ,CACN,CACE,KAAM,UACN,KAAM,UACN,QAAS,GACT,aAAc,SAAA,EAEhB,CACE,KAAM,cACN,KAAM,UACN,QAAS,GACT,aAAc,SAAA,EAEhB,CACE,KAAM,YACN,KAAM,UACN,QAAS,GACT,aAAc,SAAA,EAEhB,CACE,KAAM,mBACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,EAEhB,CACE,KAAM,uBACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,EAEhB,CACE,KAAM,wBACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,EAEhB,CACE,KAAM,8BACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,EAEhB,CACE,KAAM,yBACN,KAAM,SACN,QAAS,GACT,aAAc,QAAA,CAChB,EAEF,UAAW,EAAA,CAEf"}
@@ -252,6 +252,24 @@ const e = [
252
252
  outputs: [],
253
253
  stateMutability: "nonpayable"
254
254
  },
255
+ {
256
+ type: "function",
257
+ name: "claimExpiredVault",
258
+ inputs: [
259
+ {
260
+ name: "vaultId",
261
+ type: "bytes32",
262
+ internalType: "bytes32"
263
+ },
264
+ {
265
+ name: "s",
266
+ type: "bytes32",
267
+ internalType: "bytes32"
268
+ }
269
+ ],
270
+ outputs: [],
271
+ stateMutability: "nonpayable"
272
+ },
255
273
  {
256
274
  type: "function",
257
275
  name: "getPegInFee",
@@ -983,4 +1001,4 @@ const e = [
983
1001
  export {
984
1002
  e as B
985
1003
  };
986
- //# sourceMappingURL=BTCVaultRegistry.abi-BmHpMUWD.js.map
1004
+ //# sourceMappingURL=BTCVaultRegistry.abi-BzNTa_EU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BTCVaultRegistry.abi-BzNTa_EU.js","sources":["../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"sourcesContent":["/**\n * BTCVaultRegistry Contract ABI\n *\n * Minimal ABI containing only the functions needed by the SDK.\n * Full ABI is available in the vault service package.\n *\n * @module contracts/abis/BTCVaultRegistry\n */\n\n/**\n * Minimal ABI for BTCVaultRegistry contract.\n * Contains submitPeginRequest, submitPeginRequestBatch, activateVaultWithSecret, getPegInFee, getBtcVaultBasicInfo, getVaultProviderCommission,\n * and the PegInSubmitted / PegInSubmittedV2 events.\n */\nexport const BTCVaultRegistryABI = [\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n // Appended last on both singular overloads, unlike the batch entry where\n // it sits before `requests`. Order is the signature, so it is the ABI.\n {\n name: \"expectedFingerprint\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"expectedFingerprint\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequestBatch\",\n inputs: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n { name: \"vaultProvider\", type: \"address\", internalType: \"address\" },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n // The fingerprint is argument 4, BEFORE `requests` — not appended, as it\n // is on the two singular overloads. It takes no per-request input and the\n // batch fixes one vault provider, so one value covers every entry.\n {\n name: \"expectedFingerprint\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"requests\",\n type: \"tuple[]\",\n internalType: \"struct BTCVaultRegistryTypes.BatchPeginRequest[]\",\n components: [\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n { name: \"btcPopSignature\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"unsignedPrePeginTx\", type: \"bytes\", internalType: \"bytes\" },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n { name: \"hashlock\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"htlcVout\", type: \"uint8\", internalType: \"uint8\" },\n { name: \"referralCode\", type: \"uint32\", internalType: \"uint32\" },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n },\n ],\n outputs: [\n { name: \"vaultIds\", type: \"bytes32[]\", internalType: \"bytes32[]\" },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"activateVaultWithSecret\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"activationMetadata\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"activateVaultWithSecretAndRedeem\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"claimExpiredVault\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"getPegInFee\",\n inputs: [\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n ],\n outputs: [\n {\n name: \"totalFee\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n },\n // --- RFC-006 operation-key resolution ---------------------------------\n // A vault provider's BTC key is not a fixed registration key: it is an\n // append-only history of *operation* keys, rotated by the provider's cold ETH\n // admin key. Each vault freezes a `vpKeyEpoch` at `submitPeginRequest` and\n // resolves the key bonded at that epoch, so a later rotation never\n // invalidates a live vault.\n //\n // The dedicated `getVaultProviderBTCKey` / `getVaultProviderKeyPair` getters\n // are deliberately absent: vault-contracts-aave-v4#539 removes them, and\n // keeping them here would let a call compile against a selector the registry\n // no longer exposes. The registration key is read as the operation key at\n // epoch 0 instead — see `getVaultProviderGenesisBtcPubKey`.\n //\n // `getCurrentOperationBtcKey` falls back on-chain to the registration key at\n // version 0, so adopting it is a no-op for a provider that never rotated.\n //\n // `getPayoutScriptAtEpoch` does NOT behave that way, and assuming it did was\n // wrong in an earlier revision of this comment. A payout script is mandatory\n // at registration and stored as version 1, so on an RFC-006 registry this\n // returns the operator's own registered script from the very first epoch —\n // not a BIP-86 derivation of its key. The contract's BIP-86 branch is a\n // migration default for pre-RFC-006 rows and is not reachable from\n // registration. An operator whose registered script happens to equal\n // bip86(key) is a coincidence of what it chose to register, not a fallback.\n //\n // This is why depositor payout validation must accept the legacy BIP-86 form\n // alongside the registered one: a payout graph is built once at BaBe Setup\n // and never rebuilt, so a vault whose graph predates its network's\n // btc-vault#2440 upgrade pays BIP-86 for the rest of its life. See\n // `acceptedPayoutScriptHexes` in `primitives/psbt/payout.ts`.\n {\n type: \"function\",\n name: \"getCurrentOperationBtcKey\",\n inputs: [{ name: \"provider\", type: \"address\", internalType: \"address\" }],\n outputs: [{ name: \"\", type: \"bytes32\", internalType: \"bytes32\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getOperationBtcKeyAtEpoch\",\n inputs: [\n { name: \"provider\", type: \"address\", internalType: \"address\" },\n { name: \"epoch\", type: \"uint64\", internalType: \"uint64\" },\n ],\n outputs: [{ name: \"\", type: \"bytes32\", internalType: \"bytes32\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getPayoutScriptAtEpoch\",\n inputs: [\n { name: \"provider\", type: \"address\", internalType: \"address\" },\n { name: \"epoch\", type: \"uint64\", internalType: \"uint64\" },\n ],\n outputs: [{ name: \"\", type: \"bytes\", internalType: \"bytes\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderCommission\",\n inputs: [{ name: \"vpAddr\", type: \"address\", internalType: \"address\" }],\n outputs: [{ name: \"\", type: \"uint16\", internalType: \"uint16\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderApplication\",\n inputs: [{ name: \"vpAddr\", type: \"address\", internalType: \"address\" }],\n outputs: [{ name: \"\", type: \"address\", internalType: \"address\" }],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getBtcVaultBasicInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vBasic\",\n type: \"tuple\",\n internalType: \"struct BTCVaultTypes.BTCVaultBasicInfo\",\n components: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n { name: \"amount\", type: \"uint256\", internalType: \"uint256\" },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"status\",\n type: \"uint8\",\n internalType: \"enum IBTCVaultRegistry.BTCVaultStatus\",\n },\n {\n name: \"applicationEntryPoint\",\n type: \"address\",\n internalType: \"address\",\n },\n { name: \"createdAt\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getBtcVaultProtocolInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vProtocol\",\n type: \"tuple\",\n internalType: \"struct BTCVaultRegistryTypes.BTCVaultProtocolInfo\",\n components: [\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"verifiedAt\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"prePeginTxHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"vaultProviderCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"claimExpiredUntil\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"protocolParams\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IProtocolParams\",\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"applicationRegistry\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IApplicationRegistry\",\n },\n ],\n stateMutability: \"view\",\n },\n // ============================================================================\n // Errors — needed so viem can decode revert data into a named error.\n // Without these, every revert surfaces as \"Execution reverted for an\n // unknown reason.\" Mirrors errors thrown from BTCVaultRegistry's reachable\n // code paths (pegin submission, ACK, activation). Source:\n // https://github.com/babylonlabs-io/vault-contracts-aave-v4/blob/652c4582/src/protocol/lib/types/Errors.sol\n // ============================================================================\n { type: \"error\", name: \"ZeroAddress\", inputs: [] },\n { type: \"error\", name: \"Unauthorized\", inputs: [] },\n { type: \"error\", name: \"InvalidAmount\", inputs: [] },\n { type: \"error\", name: \"TransferFailed\", inputs: [] },\n { type: \"error\", name: \"InvalidTransaction\", inputs: [] },\n { type: \"error\", name: \"EmptyPayoutAddress\", inputs: [] },\n { type: \"error\", name: \"PayoutAddressTooLong\", inputs: [] },\n { type: \"error\", name: \"VaultAlreadyExists\", inputs: [] },\n { type: \"error\", name: \"VaultFeeAlreadyEscrowed\", inputs: [] },\n { type: \"error\", name: \"NoEscrowedFees\", inputs: [] },\n { type: \"error\", name: \"BTCVaultNotFound\", inputs: [] },\n { type: \"error\", name: \"InvalidBTCVaultStatus\", inputs: [] },\n { type: \"error\", name: \"PeginNotExpired\", inputs: [] },\n { type: \"error\", name: \"InvalidParticipantsList\", inputs: [] },\n { type: \"error\", name: \"DuplicateParticipant\", inputs: [] },\n { type: \"error\", name: \"ParticipantRoleOverlap\", inputs: [] },\n { type: \"error\", name: \"NotAuthorizedToACK\", inputs: [] },\n { type: \"error\", name: \"UnauthorizedVaultKeeper\", inputs: [] },\n { type: \"error\", name: \"BlocklistedVaultKeeper\", inputs: [] },\n { type: \"error\", name: \"PeginTransactionExpired\", inputs: [] },\n { type: \"error\", name: \"PrePeginOutputAlreadyUsed\", inputs: [] },\n { type: \"error\", name: \"PeginTransactionAlreadyUsed\", inputs: [] },\n {\n type: \"error\",\n name: \"InvalidPeginFee\",\n inputs: [\n { name: \"provided\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"required\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"AmountBelowMinimumThreshold\",\n inputs: [\n { name: \"actual\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"minimum\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"InvalidOutputIndex\",\n inputs: [\n { name: \"provided\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"maxValid\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"TooManyHtlcOutputs\",\n inputs: [\n { name: \"outputCount\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"maxAllowed\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"VaultBelowMinimum\",\n inputs: [\n { name: \"actual\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"minimum\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n {\n type: \"error\",\n name: \"VaultAboveMaximum\",\n inputs: [\n { name: \"actual\", type: \"uint256\", internalType: \"uint256\" },\n { name: \"maximum\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n { type: \"error\", name: \"InvalidBTCPublicKey\", inputs: [] },\n { type: \"error\", name: \"InvalidDepositorWotsPkHash\", inputs: [] },\n { type: \"error\", name: \"InvalidBTCProofOfPossession\", inputs: [] },\n { type: \"error\", name: \"EthKeyAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"BtcKeyAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"InvalidRegistrationFee\", inputs: [] },\n {\n type: \"error\",\n name: \"CommissionBelowMinimum\",\n inputs: [\n { name: \"provided\", type: \"uint16\", internalType: \"uint16\" },\n { name: \"minimum\", type: \"uint16\", internalType: \"uint16\" },\n ],\n },\n {\n type: \"error\",\n name: \"CommissionAboveMaximum\",\n inputs: [{ name: \"provided\", type: \"uint16\", internalType: \"uint16\" }],\n },\n { type: \"error\", name: \"CommissionUnchanged\", inputs: [] },\n {\n type: \"error\",\n name: \"VaultProviderCommissionExceeded\",\n inputs: [\n { name: \"maxAcceptable\", type: \"uint16\", internalType: \"uint16\" },\n { name: \"actual\", type: \"uint16\", internalType: \"uint16\" },\n ],\n },\n // The same intent-binding shape as VaultProviderCommissionExceeded above,\n // one axis wider: the depositor commits to the whole protocol resolution the\n // Pre-Pegin was built against, and the registry rejects a submission whose\n // resolution moved. Newer than the block header's source commit — it arrives\n // with https://github.com/babylonlabs-io/vault-contracts-aave-v4/pull/555.\n // Selector 0x846c25bb, confirmed against that repo's generated\n // snapshots/selectors.md at head 86577e40.\n {\n type: \"error\",\n name: \"PeginFingerprintChanged\",\n inputs: [\n { name: \"expected\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"actual\", type: \"bytes32\", internalType: \"bytes32\" },\n ],\n },\n { type: \"error\", name: \"VaultProviderNotRegistered\", inputs: [] },\n { type: \"error\", name: \"ApplicationAlreadyRegistered\", inputs: [] },\n { type: \"error\", name: \"ApplicationNotRegistered\", inputs: [] },\n { type: \"error\", name: \"ApplicationNotActive\", inputs: [] },\n { type: \"error\", name: \"InvalidApplicationStatus\", inputs: [] },\n { type: \"error\", name: \"OnlyApplicationEntryPoint\", inputs: [] },\n { type: \"error\", name: \"EmptyVaultKeepers\", inputs: [] },\n { type: \"error\", name: \"NoUniversalChallengersConfigured\", inputs: [] },\n { type: \"error\", name: \"NoAppVaultKeepersConfigured\", inputs: [] },\n { type: \"error\", name: \"PeginSignaturesIncomplete\", inputs: [] },\n { type: \"error\", name: \"InvalidSignatureLength\", inputs: [] },\n { type: \"error\", name: \"PeginInputSignatureAlreadySubmitted\", inputs: [] },\n { type: \"error\", name: \"InvalidHashlock\", inputs: [] },\n { type: \"error\", name: \"DuplicateHashlock\", inputs: [] },\n { type: \"error\", name: \"InvalidSecret\", inputs: [] },\n { type: \"error\", name: \"ActivationDeadlineExpired\", inputs: [] },\n // Lower bound on activation: reverts while\n // `block.number < verifiedAt + peginActivationDelay`. Clears with time, so\n // unlike ActivationDeadlineExpired it is retryable, not terminal.\n { type: \"error\", name: \"ActivationDelayNotElapsed\", inputs: [] },\n { type: \"error\", name: \"PostExpiryGraceWindowElapsed\", inputs: [] },\n { type: \"error\", name: \"CapExceeded\", inputs: [] },\n // Registration event, emitted on every registration since genesis\n // (vault-contracts-aave-v4 src/protocol/lib/types/Events.sol).\n {\n type: \"event\",\n name: \"PegInSubmitted\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"peginTxHash\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"depositor\",\n type: \"address\",\n indexed: true,\n internalType: \"address\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n indexed: false,\n internalType: \"address\",\n },\n {\n name: \"amount\",\n type: \"uint256\",\n indexed: false,\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"proverCircuitVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n indexed: false,\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n indexed: false,\n internalType: \"uint8\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"vpKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"appKeeperKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"ucKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n ],\n anonymous: false,\n },\n // Emitted alongside PegInSubmitted on every registration since #548; the\n // only on-chain source of the depositor's commission ceiling, which the\n // contract bound-checks and discards (Events.sol, vault-contracts-aave-v4 #548).\n {\n type: \"event\",\n name: \"PegInSubmittedV2\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"peginTxHash\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"depositor\",\n type: \"address\",\n indexed: true,\n internalType: \"address\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n indexed: false,\n internalType: \"address\",\n },\n {\n name: \"amount\",\n type: \"uint256\",\n indexed: false,\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"proverCircuitVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n indexed: false,\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n indexed: false,\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n indexed: false,\n internalType: \"uint8\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n indexed: false,\n internalType: \"bytes\",\n },\n {\n name: \"vpKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"appKeeperKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"ucKeyEpoch\",\n type: \"uint64\",\n indexed: false,\n internalType: \"uint64\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n ],\n anonymous: false,\n },\n // Redemption event (vault-contracts-aave-v4 src/protocol/lib/types/Events.sol\n // @ c559f5c2). Emitted once per authorized claimer key, all in one\n // transaction, by RedeemLogic._emitVaultClaimableBy (`redeemForDepositor`\n // and the other depositor paths) and by PeginLogic `claimExpired`\n // (:1101, :1111): the vault provider's key and then the depositor's\n // registered BTC key — except `redeemForAVK`, which authorizes the vault\n // keeper alone, so a REDEEMED vault can carry no log for its depositor.\n {\n type: \"event\",\n name: \"VaultClaimableBy\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"peginTxHash\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"claimerPK\",\n type: \"bytes32\",\n indexed: true,\n internalType: \"bytes32\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"proverCircuitVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n indexed: false,\n internalType: \"uint16\",\n },\n ],\n anonymous: false,\n },\n] as const;\n"],"names":["BTCVaultRegistryABI"],"mappings":"AAcO,MAAMA,IAAsB;AAAA,EACjC;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ;AAAA,MACN;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA;AAAA;AAAA,MA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;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,cAAc;AAAA,MAAA;AAAA,MAEhB;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,IAEF,WAAW;AAAA,EAAA;AAEf;"}
@@ -1,2 +1,2 @@
1
- "use strict";var ve=Object.defineProperty;var Ee=(o,e,t)=>e in o?ve(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var w=(o,e,t)=>Ee(o,typeof e!="symbol"?e+"":e,t);const P=require("./sha2-Ce6KewYx.cjs"),O=require("bitcoinjs-lib"),I=require("buffer"),ee=require("viem"),te=require("./pegin-registration-client-C-abxMWq.cjs"),le=require("./tbv/core/clients/mempool/index.cjs"),Y=require("./tbv/core/wasm/index.cjs"),A=require("./verifyScriptPathSchnorrSignature-D2t1yACC.cjs"),$=require("./verifyKeyPathSchnorrSignature-CQUut2-O.cjs"),h=require("./bitcoin-D-O2GjbC.cjs"),Se=require("./signing-DvISftFk.cjs"),L=require("./validation-C6XTfZak.cjs"),ue=require("./deriveVaultRoot-C3uqnJto.cjs"),E=require("./PayoutManager-DOdsgcUR.cjs"),_e=require("./registration-records-DFQgBaYi.cjs"),oe=require("./psbtInputFields-BrV_ZfL_.cjs"),ne=require("./fundPeginTransaction-54-Rwb2k.cjs"),U=require("./constants-BwCg5K6R.cjs"),Be=require("./btcTxHash-CGb5BqFL.cjs"),Ae=require("./parseFundingOutpoints-C_-PT9BT.cjs"),Ce=require("@bitcoin-js/tiny-secp256k1-asmjs"),V=require("./bip322Verify-DLxJR9CQ.cjs");function he(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const pe=he(O),Ie=he(Ce),M=BigInt(2**32-1),se=BigInt(32);function He(o,e=!1){return e?{h:Number(o&M),l:Number(o>>se&M)}:{h:Number(o>>se&M)|0,l:Number(o&M)|0}}function $e(o,e=!1){const t=o.length;let n=new Uint32Array(t),r=new Uint32Array(t);for(let s=0;s<t;s++){const{h:i,l:a}=He(o[s],e);[n[s],r[s]]=[i,a]}return[n,r]}const Oe=(o,e,t)=>o<<t|e>>>32-t,Re=(o,e,t)=>e<<t|o>>>32-t,Fe=(o,e,t)=>e<<t-32|o>>>64-t,We=(o,e,t)=>o<<t-32|e>>>64-t,Ve=64;function de(o){const e=o.prepeginTxid.toLowerCase();if(!/^[0-9a-f]+$/.test(e)||e.length!==Ve)throw new Error(`buildDepositTerms: prepeginTxid must be 64 hex chars, got "${o.prepeginTxid}"`);if(o.peginAmounts.length===0)throw new Error("buildDepositTerms: at least one pegin amount is required");if(o.timelockPegin<=0||o.timelockAssert<=0||o.timelockRefund<=0)throw new Error("buildDepositTerms: timelocks must be positive");if(!Number.isInteger(o.maxAcceptableCommissionBps)||o.maxAcceptableCommissionBps<0||o.maxAcceptableCommissionBps>=U.MAX_VP_COMMISSION_BPS_EXCLUSIVE)throw new Error(`buildDepositTerms: maxAcceptableCommissionBps must be an integer in [0, ${U.MAX_VP_COMMISSION_BPS_EXCLUSIVE}), got ${o.maxAcceptableCommissionBps}`);const t=BigInt(U.BPS_DENOMINATOR),n=o.peginAmounts.map((r,s)=>({htlcVout:s,vaultProviderBtcPubkey:o.vaultProviderBtcPubkey,peginAmount:r,commissionFee:r*BigInt(o.maxAcceptableCommissionBps)/t,depositorClaimValue:o.depositorClaimValue,peginMaxFee:o.peginMaxFee}));return{vaultCoreVersion:o.vaultCoreVersion,protocolFeeRate:o.protocolFeeRate,timelockPegin:o.timelockPegin,timelockAssert:o.timelockAssert,timelockRefund:o.timelockRefund,prepeginTxid:e,prepeginMaxFee:o.prepeginMaxFee,vaultKeeperBtcPubkeys:[...o.vaultKeeperBtcPubkeys],universalChallengerBtcPubkeys:[...o.universalChallengerBtcPubkeys],vaults:n}}const Me=/^0x[0-9a-f]+$/i,De=/^[0-9a-f]+$/i,Ke=/^[A-Za-z0-9+/]+={0,2}$/;function C(o){if(typeof o!="string"||o.length===0)throw new Error("BTC wallet returned empty public key");return h.processPublicKeyToXOnly(o).toLowerCase()}function Ne(o){if(typeof o!="string"||o.length===0)throw new Error("BTC wallet returned empty BIP-322 signature");if(o.startsWith("0x")||o.startsWith("0X")){if(!Me.test(o)||o.length<4||o.length%2!==0)throw new Error("BTC wallet returned malformed hex BIP-322 signature");return o.toLowerCase()}if(De.test(o)){if(o.length%2!==0)throw new Error("BTC wallet returned malformed hex BIP-322 signature");return`0x${o.toLowerCase()}`}if(!Ke.test(o)||o.length%4!==0)throw new Error("BTC wallet returned malformed base64 BIP-322 signature");const e=I.Buffer.from(o,"base64");if(e.length===0||e.toString("base64")!==o)throw new Error("BTC wallet returned malformed base64 BIP-322 signature");return`0x${e.toString("hex")}`}async function ge(o){const{wallet:e,depositTerms:t,fundedPrePeginTxHex:n,depositorBtcPubkey:r}=o,s=typeof e.approveDepositTerms=="function"?e.approveDepositTerms:void 0;if(!s&&!t)return;const i=n.startsWith("0x")?n.slice(2):n,c=O.Transaction.fromHex(i).getId();if(t&&t.prepeginTxid.replace(/^0x/,"").toLowerCase()!==c)throw new Error(`Deposit terms do not match the transaction being broadcast: terms are for prepeginTxid ${t.prepeginTxid}, but this transaction is ${c}.`);if(!s)return;if(!t)throw new Error("This wallet requires approved deposit terms before signing the Pre-PegIn transaction, but none were provided. Pass PreparePeginResult.depositTerms (fresh flows) or a resume rebuild.");if(typeof e.deriveContextHash!="function")throw new Error("A deposit-approval wallet must also implement deriveContextHash, but this one does not.");if(typeof e.holdsApprovedDepositTerms=="function"){let m=!1;try{m=await e.holdsApprovedDepositTerms(t)}catch{}if(m)return}typeof e.validateDepositTerms=="function"&&await e.validateDepositTerms(t);const p=Ae.parseFundingOutpointsFromTx(n);(await ue.deriveVaultRoot({deriveContextHash:e.deriveContextHash.bind(e)},{depositorBtcPubkey:h.hexToUint8Array(C(r)),fundingOutpoints:p})).fill(0),await s.call(e,t)}const Le=BigInt(0),H=BigInt(1),Ue=BigInt(2),Xe=BigInt(7),qe=BigInt(256),ze=BigInt(113),fe=[],me=[],Pe=[];for(let o=0,e=H,t=1,n=0;o<24;o++){[t,n]=[n,(2*t+3*n)%5],fe.push(2*(5*n+t)),me.push((o+1)*(o+2)/2%64);let r=Le;for(let s=0;s<7;s++)e=(e<<H^(e>>Xe)*ze)%qe,e&Ue&&(r^=H<<(H<<BigInt(s))-H);Pe.push(r)}const be=$e(Pe,!0),Ge=be[0],je=be[1],ie=(o,e,t)=>t>32?Fe(o,e,t):Oe(o,e,t),re=(o,e,t)=>t>32?We(o,e,t):Re(o,e,t);function Ye(o,e=24){const t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let i=0;i<10;i++)t[i]=o[i]^o[i+10]^o[i+20]^o[i+30]^o[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,p=t[c],d=t[c+1],m=ie(p,d,1)^t[a],k=re(p,d,1)^t[a+1];for(let x=0;x<50;x+=10)o[i+x]^=m,o[i+x+1]^=k}let r=o[2],s=o[3];for(let i=0;i<24;i++){const a=me[i],c=ie(r,s,a),p=re(r,s,a),d=fe[i];r=o[d],s=o[d+1],o[d]=c,o[d+1]=p}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)t[a]=o[i+a];for(let a=0;a<10;a++)o[i+a]^=~t[(a+2)%10]&t[(a+4)%10]}o[0]^=Ge[n],o[1]^=je[n]}P.clean(t)}class Z{constructor(e,t,n,r=!1,s=24){w(this,"state");w(this,"pos",0);w(this,"posOut",0);w(this,"finished",!1);w(this,"state32");w(this,"destroyed",!1);w(this,"blockLen");w(this,"suffix");w(this,"outputLen");w(this,"enableXOF",!1);w(this,"rounds");if(this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,P.anumber(n,"outputLen"),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=P.u32(this.state)}clone(){return this._cloneInto()}keccak(){P.swap32IfBE(this.state32),Ye(this.state32,this.rounds),P.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(e){P.aexists(this),P.abytes(e);const{blockLen:t,state:n}=this,r=e.length;for(let s=0;s<r;){const i=Math.min(t-this.pos,r-s);for(let a=0;a<i;a++)n[this.pos++]^=e[s++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,(t&128)!==0&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){P.aexists(this,!1),P.abytes(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,s=e.length;r<s;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return P.anumber(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(P.aoutput(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,P.clean(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:s,enableXOF:i}=this;return e||(e=new Z(t,n,r,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Qe=(o,e,t,n={})=>P.createHasher(()=>new Z(e,o,t),n),Ze=Qe(1,136,32),ae=64,y=20,Q=4,we=2,Je=0,et=1,D=[64,64],tt=o=>Array.from(o).map(e=>e.toString(16).padStart(2,"0")).join("");function J(o){return _e.ripemd160(P.sha256(o))}function xe(o){return(1<<o)-1}function ot(o){let e=1;for(;e*e<o+1;)e++;return Math.max(e,2)}function nt(o){const e=Q,t=o*xe(e);return{d:e,n:o,checksum_radix:ot(t)}}function X(o,e){const t=[];let n=e;for(;n>0;)t.push(n&255),n>>>=8;const r=new Uint8Array(o.length+t.length);r.set(o);for(let s=0;s<t.length;s++)r[o.length+s]=t[s];return J(r)}function q(o,e){let t=o;for(let n=0;n<e;n++)t=J(t);return t}function st(o,e){const t=xe(e.d),n=e.checksum_radix-1,r=Math.floor(e.n*t/e.checksum_radix),s=[];for(let d=0;d<e.n;d++){const m=X(o,d+we),k=q(m,t);s.push(Array.from(k))}const i=X(o,Je),a=q(i,n),c=X(o,et),p=q(c,r);return{config:e,message_terminals:s,checksum_major_terminal:Array.from(p),checksum_minor_terminal:Array.from(a)}}async function ye(o){try{if(o.length!==ae)throw new Error(`WOTS seed must be exactly ${ae} bytes, got ${o.length}`);const e=[];for(let t=0;t<D.length;t++){const n=D[t],r=nt(n),s=new Uint8Array(o.length+1);s.set(o),s[o.length]=t;const i=J(s);try{const a=st(i,r);if(a.config.d!==Q)throw new Error(`Block ${t}: expected d=${Q}, got d=${a.config.d}`);if(a.config.n!==n)throw new Error(`Block ${t}: expected n=${n}, got n=${a.config.n}`);if(a.message_terminals.length!==n)throw new Error(`Block ${t}: expected ${n} message terminals, got ${a.message_terminals.length}`);for(let c=0;c<a.message_terminals.length;c++)if(a.message_terminals[c].length!==y)throw new Error(`Block ${t} terminal ${c}: expected ${y} bytes, got ${a.message_terminals[c].length}`);if(a.checksum_minor_terminal.length!==y)throw new Error(`Block ${t} checksum_minor: expected ${y} bytes`);if(a.checksum_major_terminal.length!==y)throw new Error(`Block ${t} checksum_major: expected ${y} bytes`);e.push(a)}finally{s.fill(0),i.fill(0)}}if(e.length!==D.length)throw new Error(`Expected ${D.length} blocks, got ${e.length}`);return e}finally{o.fill(0)}}function z(o,e,t){if(o.length!==y)throw new Error(`Block ${e} ${t}: expected ${y} bytes, got ${o.length}`);for(let n=0;n<o.length;n++){const r=o[n];if(!Number.isInteger(r)||r<0||r>255)throw new Error(`Block ${e} ${t}[${n}]: invalid byte value ${r}`)}}function ke(o){if(o.length===0)throw new Error("Public keys array must not be empty");for(let s=0;s<o.length;s++){const i=o[s];z(i.checksum_minor_terminal,s,"checksum_minor_terminal"),z(i.checksum_major_terminal,s,"checksum_major_terminal");for(let a=0;a<i.message_terminals.length;a++)z(i.message_terminals[a],s,`message_terminal[${a}]`)}let e=0;for(const s of o)e+=we+s.message_terminals.length;const t=new Uint8Array(e*y);let n=0;for(const s of o){t.set(s.checksum_minor_terminal,n),n+=y,t.set(s.checksum_major_terminal,n),n+=y;for(const i of s.message_terminals)t.set(i,n),n+=y}const r=Ze(t);return`0x${tt(r)}`}async function Te(o,e){const t=[],n=[],r=[],s=[];try{for(let i=0;i<e;i++){const a=await Y.expandWotsSeed(o,i);try{const p=await ye(a);t.push(p),n.push(ke(p))}finally{a.fill(0)}const c=await Y.expandHashlockSecret(o,i);try{const p=h.uint8ArrayToHex(c);r.push(p),s.push(E.computeHashlock(h.ensureHexPrefix(p)).slice(2))}finally{c.fill(0)}}}finally{o.fill(0)}return{perVaultWotsKeys:t,wotsPkHashes:n,htlcSecretHexes:r,hashlocks:s}}const it=1,rt=2,at=33,ct=2,lt=3,ut=1,K=64,ht=0,G=1,ce=/^[0-9a-f]{64}$/i,pt=/^(?:[0-9a-f]{2})+$/;function dt(o){const e=o.slice(2);if(!pt.test(e))throw new Error("proof of possession witness is not even-length lowercase hex");return $.decodeWitnessStack(Uint8Array.from(I.Buffer.from(e,"hex")),"proof of possession witness")}function gt(o,e,t){var r;const n=dt(t);if(n.length===it){const[s]=n;let i,a;if(s.length===K)i=s,a=ht;else if(s.length===K+1&&s[K]===G)i=s.subarray(0,K),a=G;else throw new Error("proof of possession witness item must be a 64-byte Schnorr signature (or 65 bytes ending in 0x01)");if(!ce.test(e))throw new Error(`depositor public key must be bare 64-char x-only hex, got "${e}"`);const c=Uint8Array.from(I.Buffer.from(e,"hex"));if(!V.verifyBip322Simple(o,c,i,a))throw new Error("proof of possession signature does not verify against the depositor key");return{kind:"p2tr-verified"}}if(n.length===rt){if(!ce.test(e))throw new Error(`depositor public key must be bare 64-char x-only hex, got "${e}"`);const[s,i]=n;if(i.length!==at||i[0]!==ct&&i[0]!==lt)throw new Error(`proof of possession P2WPKH witness item 1 is not a compressed public key (${i.length} bytes, prefix 0x${((r=i[0])==null?void 0:r.toString(16))??"none"})`);if(!Ie.isPointCompressed(i))throw new Error("proof of possession P2WPKH witness pubkey is not a valid secp256k1 point");const a=I.Buffer.from(i.subarray(ut)).toString("hex");if(a!==e.toLowerCase())throw new Error(`proof of possession witness pubkey does not match the depositor key: witness carries ${a}, expected ${e}`);if(s.length<V.P2WPKH_ENCODED_SIG_MIN||s.length>V.P2WPKH_ENCODED_SIG_MAX)throw new Error(`proof of possession signature is ${s.length} bytes; vault ingestion accepts only 71/72-byte DER signatures with a sighash byte — try a different account or a Taproot address`);if(s[s.length-1]!==G)throw new Error(`proof of possession P2WPKH signature must end in a SIGHASH_ALL (0x01) byte, got 0x${s[s.length-1].toString(16)}`);if(!V.verifyBip322P2wpkhSimple(o,i,s))throw new Error("proof of possession signature does not verify against the depositor key");return{kind:"p2wpkh-verified"}}throw new Error(`proof of possession witness has ${n.length} items; expected 1 (P2TR) or 2 (P2WPKH)`)}const j="00".repeat(32),ft="00".repeat(32);function mt(o,e){const t={bitcoin:"bc",testnet:"tb",signet:"tb",regtest:"bcrt"};try{const n=pe.address.fromBech32(o);return n.prefix===t[e]&&n.version===0&&n.data.length===20}catch{return!1}}function Pt(o,e,t,n){const r=t==null?void 0:t[`${o}:${e}`];return r?Promise.resolve({txid:o,vout:e,value:r.value,scriptPubKey:r.scriptPubKey}):le.getUtxoInfo(o,e,n)}class bt{constructor(e){w(this,"config");this.config=e}async preparePegin(e){if(e.amounts.length===0)throw new Error("amounts must contain at least one entry");const t=await this.config.btcWallet.getPublicKeyHex(),n=C(t);if(E.supportsDepositApproval(this.config.btcWallet)){const l=(await E.requireChangeAddress(this.config.btcWallet)).trim();if(e.changeAddress.trim()!==l)throw new Error(`Pre-PegIn changeAddress "${e.changeAddress}" is not the approval wallet's change address ("${l}"). Refusing to build a tx the signing device would reject.`)}else if(!h.isAddressFromPublicKey(e.changeAddress,t,this.config.btcNetwork))throw new Error(`Pre-PegIn changeAddress "${e.changeAddress}" is not derived from the connected wallet's public key. Refusing to build a tx that would send change to an address the signing key doesn't control.`);const r=await this.prepareSizing(n,e);if(E.supportsDepositApproval(this.config.btcWallet)){const{validateDepositTerms:l}=this.config.btcWallet;typeof l=="function"&&await l.call(this.config.btcWallet,this.buildPeginDepositTerms({params:e,prepeginTxid:ft,prepeginMaxFee:r.fee,depositorClaimValue:r.depositorClaimValue,peginMaxFee:r.minPeginFee}))}const s=r.selectedUTXOs.map(l=>({txid:h.hexToUint8Array(l.txid),vout:l.vout})),i=await ue.deriveVaultRoot(this.config.btcWallet,{depositorBtcPubkey:h.hexToUint8Array(n),fundingOutpoints:s});let a,c;try{const l=await Y.expandAuthAnchor(i);try{a=h.uint8ArrayToHex(l),c=h.uint8ArrayToHex(P.sha256(l))}finally{l.fill(0)}}catch(l){throw i.fill(0),l}const p=await Te(i,e.amounts.length),{perVaultWotsKeys:d,wotsPkHashes:m,htlcSecretHexes:k,hashlocks:x}=p,f=await this.preparePeginCommit({depositorBtcPubkeyRaw:t,depositorBtcPubkey:n,hashlocks:x,authAnchorHash:c,sizing:r,params:e});for(let l=0;l<f.perVault.length;l++)if(f.perVault[l].htlcVout!==l)throw new Error(`Internal invariant violation: htlcVout/index mismatch at vault ${l} (expected ${l}, got ${f.perVault[l].htlcVout})`);E.assertAuthAnchorOpReturn(f.fundedPrePeginTxHex,e.amounts.length,c);const{depositTerms:S,...T}=f;return{transaction:{...T,selectedUTXOs:r.selectedUTXOs,fee:r.fee,changeAmount:r.changeAmount},depositorBtcPubkey:n,derivedSecrets:{perVaultWotsKeys:d,wotsPkHashes:m,htlcSecretHexes:k,authAnchorHex:a},depositTerms:S}}async prepareSizing(e,t){const n=t.amounts.map(()=>j),r=t.vaultKeeperBtcPubkeys.length,s=await A.buildPrePeginPsbt({vaultCoreVersion:t.vaultCoreVersion,depositorPubkey:e,vaultProviderPubkey:h.stripHexPrefix(t.vaultProviderBtcPubkey),vaultKeeperPubkeys:t.vaultKeeperBtcPubkeys.map(h.stripHexPrefix),universalChallengerPubkeys:t.universalChallengerBtcPubkeys.map(h.stripHexPrefix),hashlocks:n,timelockRefund:t.timelockRefund,pegInAmounts:t.amounts,feeRate:t.protocolFeeRate,minPeginFeeRate:t.minPeginFeeRate,numLocalChallengers:r,councilQuorum:t.councilQuorum,councilSize:t.councilSize,network:this.config.btcNetwork,authAnchorHash:j}),i=oe.selectUtxosForPegin([...t.availableUTXOs],s.totalOutputValue,t.mempoolFeeRate,ne.peginOutputCount(s.htlcValues.length,!0));return{selectedUTXOs:i.selectedUTXOs,fee:i.fee,changeAmount:i.changeAmount,depositorClaimValue:s.depositorClaimValue,minPeginFee:s.minPeginFee}}buildPeginDepositTerms(e){const{params:t}=e;return de({vaultCoreVersion:t.vaultCoreVersion,protocolFeeRate:t.protocolFeeRate,timelockPegin:t.timelockPegin,timelockAssert:t.timelockAssert,timelockRefund:t.timelockRefund,prepeginTxid:e.prepeginTxid,prepeginMaxFee:e.prepeginMaxFee,vaultProviderBtcPubkey:h.stripHexPrefix(t.vaultProviderBtcPubkey),vaultKeeperBtcPubkeys:t.vaultKeeperBtcPubkeys.map(h.stripHexPrefix),universalChallengerBtcPubkeys:t.universalChallengerBtcPubkeys.map(h.stripHexPrefix),maxAcceptableCommissionBps:te.capMaxAcceptableCommissionBps(t.commissionBps),peginAmounts:t.amounts,depositorClaimValue:e.depositorClaimValue,peginMaxFee:e.peginMaxFee})}async preparePeginCommit(e){const{depositorBtcPubkeyRaw:t,depositorBtcPubkey:n,hashlocks:r,authAnchorHash:s,sizing:i,params:a}=e,c=j.toLowerCase();for(let u=0;u<r.length;u++)if(r[u].toLowerCase()===c)throw new Error(`preparePeginCommit refusing to build with sizing-pass placeholder hashlock at vault ${u} — internal substitution bug`);if(s.toLowerCase()===c)throw new Error("preparePeginCommit refusing to build with sizing-pass placeholder auth-anchor hash — internal substitution bug");const p=h.stripHexPrefix(a.vaultProviderBtcPubkey),d=a.vaultKeeperBtcPubkeys.map(h.stripHexPrefix),m=a.universalChallengerBtcPubkeys.map(h.stripHexPrefix),k=d.length,x={vaultCoreVersion:a.vaultCoreVersion,depositorPubkey:n,vaultProviderPubkey:p,vaultKeeperPubkeys:d,universalChallengerPubkeys:m,hashlocks:r,timelockRefund:a.timelockRefund,pegInAmounts:a.amounts,feeRate:a.protocolFeeRate,minPeginFeeRate:a.minPeginFeeRate,numLocalChallengers:k,councilQuorum:a.councilQuorum,councilSize:a.councilSize,network:this.config.btcNetwork,authAnchorHash:s},f=await A.buildPrePeginPsbt(x);if(f.depositorClaimValue!==i.depositorClaimValue||f.minPeginFee!==i.minPeginFee)throw new Error(`Pre-PegIn sizing/commit divergence: depositorClaimValue ${i.depositorClaimValue} -> ${f.depositorClaimValue}, minPeginFee ${i.minPeginFee} -> ${f.minPeginFee}. The provisional deposit terms validated before derivation would not match the terms sent for approval; refusing to continue.`);const S=h.getNetwork(this.config.btcNetwork),T=ne.fundPeginTransaction({unfundedTxHex:f.psbtHex,selectedUTXOs:i.selectedUTXOs,changeAddress:a.changeAddress,changeAmount:i.changeAmount,network:S}),l=i.selectedUTXOs.reduce((u,B)=>u+BigInt(B.value),0n)-f.totalOutputValue-i.changeAmount;if(l!==i.fee)throw new Error(`Pre-PegIn funded fee ${l} does not match the sizing-pass fee ${i.fee}; refusing to publish a deposit-terms fee bound the funded transaction does not pay.`);const R=h.stripHexPrefix(Be.calculateBtcTxHash(T)),F=[],g=[],b=[];for(let u=0;u<r.length;u++){const B=await A.buildPeginTxFromFundedPrePegin({prePeginParams:x,timelockPegin:a.timelockPegin,fundedPrePeginTxHex:T,htlcVout:u}),N=await $.buildPeginInputPsbt({vaultCoreVersion:a.vaultCoreVersion,peginTxHex:B.txHex,fundedPrePeginTxHex:T,depositorPubkey:n,vaultProviderPubkey:p,vaultKeeperPubkeys:d,universalChallengerPubkeys:m,hashlock:r[u],timelockRefund:a.timelockRefund,network:this.config.btcNetwork});F.push(B),g.push(N.psbtHex),b.push(Se.createTaprootScriptPathSignOptions(t,1))}const v=this.buildPeginDepositTerms({params:a,prepeginTxid:R,prepeginMaxFee:i.fee,depositorClaimValue:f.depositorClaimValue,peginMaxFee:f.minPeginFee});E.supportsDepositApproval(this.config.btcWallet)&&await this.config.btcWallet.approveDepositTerms(v);const _=await E.signPsbtsWithFallback(this.config.btcWallet,g,b),W=[];for(let u=0;u<_.length;u++){A.assertPsbtUnsignedTxMatches({requestedPsbtHex:g[u],returnedPsbtHex:_[u]});const B=$.extractPeginInputSignature(_[u],n);A.assertScriptPathSchnorrSignature({requestedPsbtHex:g[u],signatureHex:B,signerXOnlyPubkeyHex:n,inputIndex:0});const N=$.finalizePeginInputPsbt(_[u]);W.push({htlcVout:u,htlcValue:f.htlcValues[u],peginTxHex:N,peginTxid:F[u].txid,peginInputSignature:B,vaultScriptPubKey:F[u].vaultScriptPubKey})}return{fundedPrePeginTxHex:T,prePeginTxid:R,perVault:W,depositTerms:v}}async signAndBroadcast(e){const{fundedPrePeginTxHex:t,depositorBtcPubkey:n}=e,r=t.startsWith("0x")?t.slice(2):t,s=O.Transaction.fromHex(r);if(s.ins.length===0)throw new Error("Transaction has no inputs");const i=new O.Psbt;i.setVersion(s.version),i.setLocktime(s.locktime);const a=I.Buffer.from(C(n),"hex"),c=this.config.mempoolApiUrl,p=s.ins.map(g=>{const b=I.Buffer.from(g.hash).reverse().toString("hex"),v=g.index;return Pt(b,v,e.localPrevouts,c).then(_=>({input:g,utxoData:_,txid:b,vout:v}))}),d=await Promise.all(p),m=d.reduce((g,b)=>g+BigInt(b.utxoData.value),0n),k=s.outs.reduce((g,b)=>g+BigInt(b.value),0n);if(m<k)throw new Error(`UTXO value mismatch: total input value (${m} sat) is less than total output value (${k} sat). This may indicate the mempool API returned manipulated UTXO data.`);const x=m-k;if(x>L.MAX_REASONABLE_FEE_SATS)throw new Error(`Implied transaction fee (${x} sat) exceeds maximum reasonable fee (${L.MAX_REASONABLE_FEE_SATS} sat). This may indicate manipulated UTXO data.`);for(const{input:g,utxoData:b,txid:v,vout:_}of d){const W=oe.getPsbtInputFields({value:b.value,scriptPubKey:b.scriptPubKey},a);i.addInput({hash:g.hash,index:g.index,sequence:g.sequence,...W})}for(const g of s.outs)i.addOutput({script:g.script,value:g.value});await ge({wallet:this.config.btcWallet,depositTerms:e.depositTerms,fundedPrePeginTxHex:t,depositorBtcPubkey:n});const f=i.toHex(),S=await this.config.btcWallet.signPsbt(f);A.assertPsbtUnsignedTxMatches({requestedPsbtHex:f,returnedPsbtHex:S});const T=$.assertReturnedKeyPathSignatures({requestedPsbtHex:f,returnedPsbtHex:S});if(E.supportsDepositApproval(this.config.btcWallet)&&T!==i.data.inputs.length)throw new Error(`Key-path verification covered ${T} of ${i.data.inputs.length} Pre-PegIn inputs; an approval wallet signs every input key-path, so the unverified ones must not be broadcast.`);const l=O.Psbt.fromHex(S);try{l.finalizeAllInputs()}catch(g){if(!l.data.inputs.every(v=>v.finalScriptWitness||v.finalScriptSig))throw new Error(`PSBT finalization failed and wallet did not auto-finalize: ${g}`)}const R=l.extractTransaction().toHex();return await le.pushTx(R,c)}async registerPeginOnChain(e){if(!this.config.ethWallet.account)throw new Error("Ethereum wallet account not found");const t=this.config.ethWallet.account.address;if(!ee.isAddressEqual(e.popSignature.depositorEthAddress,t))throw new Error(`Proof of possession was signed for ${e.popSignature.depositorEthAddress} but the Ethereum wallet is currently connected to ${t}. Reconnect the original account or call signProofOfPossession() again.`);const n=await this.assertPopMatchesBtcWallet(e.popSignature),r=e.depositorPayoutBtcAddress??await this.config.btcWallet.getAddress(),s=this.resolvePayoutScriptPubKey(n,r);return this.createRegistrationClient().registerPeginOnChain({unsignedPrePeginTx:e.unsignedPrePeginTx,depositorSignedPeginTx:e.depositorSignedPeginTx,vaultProvider:e.vaultProvider,hashlock:e.hashlock,htlcVout:e.htlcVout,depositorPayoutScriptPubKey:s,depositorBtcPubkeyRaw:n,depositorWotsPkHash:e.depositorWotsPkHash,popSignature:e.popSignature,quotedCommissionBps:e.quotedCommissionBps,expectedFingerprint:e.expectedFingerprint})}async registerPeginBatchOnChain(e){if(e.requests.length===0)throw new Error("Batch pegin requires at least one request");if(!this.config.ethWallet.account)throw new Error("Ethereum wallet account not found");const t=this.config.ethWallet.account.address;if(!ee.isAddressEqual(e.popSignature.depositorEthAddress,t))throw new Error(`Proof of possession was signed for ${e.popSignature.depositorEthAddress} but the Ethereum wallet is currently connected to ${t}. Reconnect the original account or call signProofOfPossession() again.`);const n=await this.assertPopMatchesBtcWallet(e.popSignature),r=e.requests.map(s=>this.resolvePayoutScriptPubKey(n,s.depositorPayoutBtcAddress));return this.createRegistrationClient().registerPeginBatchOnChain({vaultProvider:e.vaultProvider,unsignedPrePeginTx:e.unsignedPrePeginTx,popSignature:e.popSignature,depositorBtcPubkeyRaw:n,quotedCommissionBps:e.quotedCommissionBps,expectedFingerprint:e.expectedFingerprint,requests:e.requests.map((s,i)=>({depositorSignedPeginTx:s.depositorSignedPeginTx,hashlock:s.hashlock,htlcVout:s.htlcVout,depositorPayoutScriptPubKey:r[i],depositorWotsPkHash:s.depositorWotsPkHash}))})}createRegistrationClient(){return new te.ViemPeginRegistrationClient({ethWallet:this.config.ethWallet,ethChain:this.config.ethChain,publicClient:this.config.publicClient,btcVaultRegistry:this.config.vaultContracts.btcVaultRegistry,requireQuotedCommissionBps:E.supportsDepositApproval(this.config.btcWallet)})}resolvePayoutScriptPubKey(e,t){if(!h.isAddressFromPublicKey(t,e,this.config.btcNetwork))throw h.stripHexPrefix(e).length===L.X_ONLY_PUBKEY_HEX_LEN&&mt(t,this.config.btcNetwork)?new Error(`BTC payout address "${t}" is a P2WPKH (Native SegWit) address, but the connected wallet only exposes an x-only public key. P2WPKH validation requires a compressed key with known y-parity. Use a P2TR (Taproot) payout address instead.`):new Error(`BTC payout address "${t}" is not derived from the connected wallet's public key. The payout sink must be controlled by the same key that signs the pegin; refusing to register a mismatched address.`);const n=h.getNetwork(this.config.btcNetwork);let r;try{r=pe.address.toOutputScript(t,n).toString("hex")}catch{throw new Error(`Invalid BTC payout address: "${t}". Please provide a valid Bitcoin address for the ${this.config.btcNetwork} network.`)}return r}async signProofOfPossession(){if(!this.config.ethWallet.account)throw new Error("Ethereum wallet account not found");const e=this.config.ethWallet.account.address,t=C(await this.config.btcWallet.getPublicKeyHex()),n=this.config.vaultContracts.btcVaultRegistry,r=`${e.toLowerCase()}:${this.config.ethChain.id}:pegin:${n.toLowerCase()}`,s=await this.config.btcWallet.signMessage(r,"bip322-simple"),i=Ne(s);return gt(new TextEncoder().encode(r),t,i),{btcPopSignature:i,depositorEthAddress:e,depositorBtcPubkey:t}}async assertPopMatchesBtcWallet(e){const t=await this.config.btcWallet.getPublicKeyHex(),n=C(t),r=C(e.depositorBtcPubkey);if(n!==r)throw new Error(`Proof of possession was signed with BTC pubkey ${r} but the BTC wallet is currently connected to ${n}. Reconnect the original wallet or call signProofOfPossession() again.`);return t}getNetwork(){return this.config.btcNetwork}getVaultContractAddress(){return this.config.vaultContracts.btcVaultRegistry}}exports.PeginManager=bt;exports.buildDepositTerms=de;exports.computeWotsBlockPublicKeysHash=ke;exports.deriveWotsBlocksFromSeed=ye;exports.ensurePrePeginTermsApproval=ge;exports.expandPerVaultSecrets=Te;
2
- //# sourceMappingURL=PeginManager-PyKbfy5q.cjs.map
1
+ "use strict";var ve=Object.defineProperty;var Ee=(o,e,t)=>e in o?ve(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var w=(o,e,t)=>Ee(o,typeof e!="symbol"?e+"":e,t);const P=require("./sha2-Ce6KewYx.cjs"),O=require("bitcoinjs-lib"),I=require("buffer"),ee=require("viem"),te=require("./pegin-registration-client-BogzOk8B.cjs"),le=require("./tbv/core/clients/mempool/index.cjs"),Y=require("./tbv/core/wasm/index.cjs"),A=require("./verifyScriptPathSchnorrSignature-D2t1yACC.cjs"),$=require("./verifyKeyPathSchnorrSignature-CQUut2-O.cjs"),h=require("./bitcoin-D-O2GjbC.cjs"),Se=require("./signing-DvISftFk.cjs"),L=require("./validation-C6XTfZak.cjs"),ue=require("./deriveVaultRoot-C3uqnJto.cjs"),E=require("./PayoutManager-DOdsgcUR.cjs"),_e=require("./registration-records-DFQgBaYi.cjs"),oe=require("./psbtInputFields-BrV_ZfL_.cjs"),ne=require("./fundPeginTransaction-54-Rwb2k.cjs"),U=require("./constants-BwCg5K6R.cjs"),Be=require("./btcTxHash-CGb5BqFL.cjs"),Ae=require("./parseFundingOutpoints-C_-PT9BT.cjs"),Ce=require("@bitcoin-js/tiny-secp256k1-asmjs"),V=require("./bip322Verify-DLxJR9CQ.cjs");function he(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const pe=he(O),Ie=he(Ce),M=BigInt(2**32-1),se=BigInt(32);function He(o,e=!1){return e?{h:Number(o&M),l:Number(o>>se&M)}:{h:Number(o>>se&M)|0,l:Number(o&M)|0}}function $e(o,e=!1){const t=o.length;let n=new Uint32Array(t),r=new Uint32Array(t);for(let s=0;s<t;s++){const{h:i,l:a}=He(o[s],e);[n[s],r[s]]=[i,a]}return[n,r]}const Oe=(o,e,t)=>o<<t|e>>>32-t,Re=(o,e,t)=>e<<t|o>>>32-t,Fe=(o,e,t)=>e<<t-32|o>>>64-t,We=(o,e,t)=>o<<t-32|e>>>64-t,Ve=64;function de(o){const e=o.prepeginTxid.toLowerCase();if(!/^[0-9a-f]+$/.test(e)||e.length!==Ve)throw new Error(`buildDepositTerms: prepeginTxid must be 64 hex chars, got "${o.prepeginTxid}"`);if(o.peginAmounts.length===0)throw new Error("buildDepositTerms: at least one pegin amount is required");if(o.timelockPegin<=0||o.timelockAssert<=0||o.timelockRefund<=0)throw new Error("buildDepositTerms: timelocks must be positive");if(!Number.isInteger(o.maxAcceptableCommissionBps)||o.maxAcceptableCommissionBps<0||o.maxAcceptableCommissionBps>=U.MAX_VP_COMMISSION_BPS_EXCLUSIVE)throw new Error(`buildDepositTerms: maxAcceptableCommissionBps must be an integer in [0, ${U.MAX_VP_COMMISSION_BPS_EXCLUSIVE}), got ${o.maxAcceptableCommissionBps}`);const t=BigInt(U.BPS_DENOMINATOR),n=o.peginAmounts.map((r,s)=>({htlcVout:s,vaultProviderBtcPubkey:o.vaultProviderBtcPubkey,peginAmount:r,commissionFee:r*BigInt(o.maxAcceptableCommissionBps)/t,depositorClaimValue:o.depositorClaimValue,peginMaxFee:o.peginMaxFee}));return{vaultCoreVersion:o.vaultCoreVersion,protocolFeeRate:o.protocolFeeRate,timelockPegin:o.timelockPegin,timelockAssert:o.timelockAssert,timelockRefund:o.timelockRefund,prepeginTxid:e,prepeginMaxFee:o.prepeginMaxFee,vaultKeeperBtcPubkeys:[...o.vaultKeeperBtcPubkeys],universalChallengerBtcPubkeys:[...o.universalChallengerBtcPubkeys],vaults:n}}const Me=/^0x[0-9a-f]+$/i,De=/^[0-9a-f]+$/i,Ke=/^[A-Za-z0-9+/]+={0,2}$/;function C(o){if(typeof o!="string"||o.length===0)throw new Error("BTC wallet returned empty public key");return h.processPublicKeyToXOnly(o).toLowerCase()}function Ne(o){if(typeof o!="string"||o.length===0)throw new Error("BTC wallet returned empty BIP-322 signature");if(o.startsWith("0x")||o.startsWith("0X")){if(!Me.test(o)||o.length<4||o.length%2!==0)throw new Error("BTC wallet returned malformed hex BIP-322 signature");return o.toLowerCase()}if(De.test(o)){if(o.length%2!==0)throw new Error("BTC wallet returned malformed hex BIP-322 signature");return`0x${o.toLowerCase()}`}if(!Ke.test(o)||o.length%4!==0)throw new Error("BTC wallet returned malformed base64 BIP-322 signature");const e=I.Buffer.from(o,"base64");if(e.length===0||e.toString("base64")!==o)throw new Error("BTC wallet returned malformed base64 BIP-322 signature");return`0x${e.toString("hex")}`}async function ge(o){const{wallet:e,depositTerms:t,fundedPrePeginTxHex:n,depositorBtcPubkey:r}=o,s=typeof e.approveDepositTerms=="function"?e.approveDepositTerms:void 0;if(!s&&!t)return;const i=n.startsWith("0x")?n.slice(2):n,c=O.Transaction.fromHex(i).getId();if(t&&t.prepeginTxid.replace(/^0x/,"").toLowerCase()!==c)throw new Error(`Deposit terms do not match the transaction being broadcast: terms are for prepeginTxid ${t.prepeginTxid}, but this transaction is ${c}.`);if(!s)return;if(!t)throw new Error("This wallet requires approved deposit terms before signing the Pre-PegIn transaction, but none were provided. Pass PreparePeginResult.depositTerms (fresh flows) or a resume rebuild.");if(typeof e.deriveContextHash!="function")throw new Error("A deposit-approval wallet must also implement deriveContextHash, but this one does not.");if(typeof e.holdsApprovedDepositTerms=="function"){let m=!1;try{m=await e.holdsApprovedDepositTerms(t)}catch{}if(m)return}typeof e.validateDepositTerms=="function"&&await e.validateDepositTerms(t);const p=Ae.parseFundingOutpointsFromTx(n);(await ue.deriveVaultRoot({deriveContextHash:e.deriveContextHash.bind(e)},{depositorBtcPubkey:h.hexToUint8Array(C(r)),fundingOutpoints:p})).fill(0),await s.call(e,t)}const Le=BigInt(0),H=BigInt(1),Ue=BigInt(2),Xe=BigInt(7),qe=BigInt(256),ze=BigInt(113),fe=[],me=[],Pe=[];for(let o=0,e=H,t=1,n=0;o<24;o++){[t,n]=[n,(2*t+3*n)%5],fe.push(2*(5*n+t)),me.push((o+1)*(o+2)/2%64);let r=Le;for(let s=0;s<7;s++)e=(e<<H^(e>>Xe)*ze)%qe,e&Ue&&(r^=H<<(H<<BigInt(s))-H);Pe.push(r)}const be=$e(Pe,!0),Ge=be[0],je=be[1],ie=(o,e,t)=>t>32?Fe(o,e,t):Oe(o,e,t),re=(o,e,t)=>t>32?We(o,e,t):Re(o,e,t);function Ye(o,e=24){const t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let i=0;i<10;i++)t[i]=o[i]^o[i+10]^o[i+20]^o[i+30]^o[i+40];for(let i=0;i<10;i+=2){const a=(i+8)%10,c=(i+2)%10,p=t[c],d=t[c+1],m=ie(p,d,1)^t[a],k=re(p,d,1)^t[a+1];for(let x=0;x<50;x+=10)o[i+x]^=m,o[i+x+1]^=k}let r=o[2],s=o[3];for(let i=0;i<24;i++){const a=me[i],c=ie(r,s,a),p=re(r,s,a),d=fe[i];r=o[d],s=o[d+1],o[d]=c,o[d+1]=p}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)t[a]=o[i+a];for(let a=0;a<10;a++)o[i+a]^=~t[(a+2)%10]&t[(a+4)%10]}o[0]^=Ge[n],o[1]^=je[n]}P.clean(t)}class Z{constructor(e,t,n,r=!1,s=24){w(this,"state");w(this,"pos",0);w(this,"posOut",0);w(this,"finished",!1);w(this,"state32");w(this,"destroyed",!1);w(this,"blockLen");w(this,"suffix");w(this,"outputLen");w(this,"enableXOF",!1);w(this,"rounds");if(this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,P.anumber(n,"outputLen"),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=P.u32(this.state)}clone(){return this._cloneInto()}keccak(){P.swap32IfBE(this.state32),Ye(this.state32,this.rounds),P.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(e){P.aexists(this),P.abytes(e);const{blockLen:t,state:n}=this,r=e.length;for(let s=0;s<r;){const i=Math.min(t-this.pos,r-s);for(let a=0;a<i;a++)n[this.pos++]^=e[s++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,(t&128)!==0&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){P.aexists(this,!1),P.abytes(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,s=e.length;r<s;){this.posOut>=n&&this.keccak();const i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return P.anumber(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(P.aoutput(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,P.clean(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:s,enableXOF:i}=this;return e||(e=new Z(t,n,r,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Qe=(o,e,t,n={})=>P.createHasher(()=>new Z(e,o,t),n),Ze=Qe(1,136,32),ae=64,y=20,Q=4,we=2,Je=0,et=1,D=[64,64],tt=o=>Array.from(o).map(e=>e.toString(16).padStart(2,"0")).join("");function J(o){return _e.ripemd160(P.sha256(o))}function xe(o){return(1<<o)-1}function ot(o){let e=1;for(;e*e<o+1;)e++;return Math.max(e,2)}function nt(o){const e=Q,t=o*xe(e);return{d:e,n:o,checksum_radix:ot(t)}}function X(o,e){const t=[];let n=e;for(;n>0;)t.push(n&255),n>>>=8;const r=new Uint8Array(o.length+t.length);r.set(o);for(let s=0;s<t.length;s++)r[o.length+s]=t[s];return J(r)}function q(o,e){let t=o;for(let n=0;n<e;n++)t=J(t);return t}function st(o,e){const t=xe(e.d),n=e.checksum_radix-1,r=Math.floor(e.n*t/e.checksum_radix),s=[];for(let d=0;d<e.n;d++){const m=X(o,d+we),k=q(m,t);s.push(Array.from(k))}const i=X(o,Je),a=q(i,n),c=X(o,et),p=q(c,r);return{config:e,message_terminals:s,checksum_major_terminal:Array.from(p),checksum_minor_terminal:Array.from(a)}}async function ye(o){try{if(o.length!==ae)throw new Error(`WOTS seed must be exactly ${ae} bytes, got ${o.length}`);const e=[];for(let t=0;t<D.length;t++){const n=D[t],r=nt(n),s=new Uint8Array(o.length+1);s.set(o),s[o.length]=t;const i=J(s);try{const a=st(i,r);if(a.config.d!==Q)throw new Error(`Block ${t}: expected d=${Q}, got d=${a.config.d}`);if(a.config.n!==n)throw new Error(`Block ${t}: expected n=${n}, got n=${a.config.n}`);if(a.message_terminals.length!==n)throw new Error(`Block ${t}: expected ${n} message terminals, got ${a.message_terminals.length}`);for(let c=0;c<a.message_terminals.length;c++)if(a.message_terminals[c].length!==y)throw new Error(`Block ${t} terminal ${c}: expected ${y} bytes, got ${a.message_terminals[c].length}`);if(a.checksum_minor_terminal.length!==y)throw new Error(`Block ${t} checksum_minor: expected ${y} bytes`);if(a.checksum_major_terminal.length!==y)throw new Error(`Block ${t} checksum_major: expected ${y} bytes`);e.push(a)}finally{s.fill(0),i.fill(0)}}if(e.length!==D.length)throw new Error(`Expected ${D.length} blocks, got ${e.length}`);return e}finally{o.fill(0)}}function z(o,e,t){if(o.length!==y)throw new Error(`Block ${e} ${t}: expected ${y} bytes, got ${o.length}`);for(let n=0;n<o.length;n++){const r=o[n];if(!Number.isInteger(r)||r<0||r>255)throw new Error(`Block ${e} ${t}[${n}]: invalid byte value ${r}`)}}function ke(o){if(o.length===0)throw new Error("Public keys array must not be empty");for(let s=0;s<o.length;s++){const i=o[s];z(i.checksum_minor_terminal,s,"checksum_minor_terminal"),z(i.checksum_major_terminal,s,"checksum_major_terminal");for(let a=0;a<i.message_terminals.length;a++)z(i.message_terminals[a],s,`message_terminal[${a}]`)}let e=0;for(const s of o)e+=we+s.message_terminals.length;const t=new Uint8Array(e*y);let n=0;for(const s of o){t.set(s.checksum_minor_terminal,n),n+=y,t.set(s.checksum_major_terminal,n),n+=y;for(const i of s.message_terminals)t.set(i,n),n+=y}const r=Ze(t);return`0x${tt(r)}`}async function Te(o,e){const t=[],n=[],r=[],s=[];try{for(let i=0;i<e;i++){const a=await Y.expandWotsSeed(o,i);try{const p=await ye(a);t.push(p),n.push(ke(p))}finally{a.fill(0)}const c=await Y.expandHashlockSecret(o,i);try{const p=h.uint8ArrayToHex(c);r.push(p),s.push(E.computeHashlock(h.ensureHexPrefix(p)).slice(2))}finally{c.fill(0)}}}finally{o.fill(0)}return{perVaultWotsKeys:t,wotsPkHashes:n,htlcSecretHexes:r,hashlocks:s}}const it=1,rt=2,at=33,ct=2,lt=3,ut=1,K=64,ht=0,G=1,ce=/^[0-9a-f]{64}$/i,pt=/^(?:[0-9a-f]{2})+$/;function dt(o){const e=o.slice(2);if(!pt.test(e))throw new Error("proof of possession witness is not even-length lowercase hex");return $.decodeWitnessStack(Uint8Array.from(I.Buffer.from(e,"hex")),"proof of possession witness")}function gt(o,e,t){var r;const n=dt(t);if(n.length===it){const[s]=n;let i,a;if(s.length===K)i=s,a=ht;else if(s.length===K+1&&s[K]===G)i=s.subarray(0,K),a=G;else throw new Error("proof of possession witness item must be a 64-byte Schnorr signature (or 65 bytes ending in 0x01)");if(!ce.test(e))throw new Error(`depositor public key must be bare 64-char x-only hex, got "${e}"`);const c=Uint8Array.from(I.Buffer.from(e,"hex"));if(!V.verifyBip322Simple(o,c,i,a))throw new Error("proof of possession signature does not verify against the depositor key");return{kind:"p2tr-verified"}}if(n.length===rt){if(!ce.test(e))throw new Error(`depositor public key must be bare 64-char x-only hex, got "${e}"`);const[s,i]=n;if(i.length!==at||i[0]!==ct&&i[0]!==lt)throw new Error(`proof of possession P2WPKH witness item 1 is not a compressed public key (${i.length} bytes, prefix 0x${((r=i[0])==null?void 0:r.toString(16))??"none"})`);if(!Ie.isPointCompressed(i))throw new Error("proof of possession P2WPKH witness pubkey is not a valid secp256k1 point");const a=I.Buffer.from(i.subarray(ut)).toString("hex");if(a!==e.toLowerCase())throw new Error(`proof of possession witness pubkey does not match the depositor key: witness carries ${a}, expected ${e}`);if(s.length<V.P2WPKH_ENCODED_SIG_MIN||s.length>V.P2WPKH_ENCODED_SIG_MAX)throw new Error(`proof of possession signature is ${s.length} bytes; vault ingestion accepts only 71/72-byte DER signatures with a sighash byte — try a different account or a Taproot address`);if(s[s.length-1]!==G)throw new Error(`proof of possession P2WPKH signature must end in a SIGHASH_ALL (0x01) byte, got 0x${s[s.length-1].toString(16)}`);if(!V.verifyBip322P2wpkhSimple(o,i,s))throw new Error("proof of possession signature does not verify against the depositor key");return{kind:"p2wpkh-verified"}}throw new Error(`proof of possession witness has ${n.length} items; expected 1 (P2TR) or 2 (P2WPKH)`)}const j="00".repeat(32),ft="00".repeat(32);function mt(o,e){const t={bitcoin:"bc",testnet:"tb",signet:"tb",regtest:"bcrt"};try{const n=pe.address.fromBech32(o);return n.prefix===t[e]&&n.version===0&&n.data.length===20}catch{return!1}}function Pt(o,e,t,n){const r=t==null?void 0:t[`${o}:${e}`];return r?Promise.resolve({txid:o,vout:e,value:r.value,scriptPubKey:r.scriptPubKey}):le.getUtxoInfo(o,e,n)}class bt{constructor(e){w(this,"config");this.config=e}async preparePegin(e){if(e.amounts.length===0)throw new Error("amounts must contain at least one entry");const t=await this.config.btcWallet.getPublicKeyHex(),n=C(t);if(E.supportsDepositApproval(this.config.btcWallet)){const l=(await E.requireChangeAddress(this.config.btcWallet)).trim();if(e.changeAddress.trim()!==l)throw new Error(`Pre-PegIn changeAddress "${e.changeAddress}" is not the approval wallet's change address ("${l}"). Refusing to build a tx the signing device would reject.`)}else if(!h.isAddressFromPublicKey(e.changeAddress,t,this.config.btcNetwork))throw new Error(`Pre-PegIn changeAddress "${e.changeAddress}" is not derived from the connected wallet's public key. Refusing to build a tx that would send change to an address the signing key doesn't control.`);const r=await this.prepareSizing(n,e);if(E.supportsDepositApproval(this.config.btcWallet)){const{validateDepositTerms:l}=this.config.btcWallet;typeof l=="function"&&await l.call(this.config.btcWallet,this.buildPeginDepositTerms({params:e,prepeginTxid:ft,prepeginMaxFee:r.fee,depositorClaimValue:r.depositorClaimValue,peginMaxFee:r.minPeginFee}))}const s=r.selectedUTXOs.map(l=>({txid:h.hexToUint8Array(l.txid),vout:l.vout})),i=await ue.deriveVaultRoot(this.config.btcWallet,{depositorBtcPubkey:h.hexToUint8Array(n),fundingOutpoints:s});let a,c;try{const l=await Y.expandAuthAnchor(i);try{a=h.uint8ArrayToHex(l),c=h.uint8ArrayToHex(P.sha256(l))}finally{l.fill(0)}}catch(l){throw i.fill(0),l}const p=await Te(i,e.amounts.length),{perVaultWotsKeys:d,wotsPkHashes:m,htlcSecretHexes:k,hashlocks:x}=p,f=await this.preparePeginCommit({depositorBtcPubkeyRaw:t,depositorBtcPubkey:n,hashlocks:x,authAnchorHash:c,sizing:r,params:e});for(let l=0;l<f.perVault.length;l++)if(f.perVault[l].htlcVout!==l)throw new Error(`Internal invariant violation: htlcVout/index mismatch at vault ${l} (expected ${l}, got ${f.perVault[l].htlcVout})`);E.assertAuthAnchorOpReturn(f.fundedPrePeginTxHex,e.amounts.length,c);const{depositTerms:S,...T}=f;return{transaction:{...T,selectedUTXOs:r.selectedUTXOs,fee:r.fee,changeAmount:r.changeAmount},depositorBtcPubkey:n,derivedSecrets:{perVaultWotsKeys:d,wotsPkHashes:m,htlcSecretHexes:k,authAnchorHex:a},depositTerms:S}}async prepareSizing(e,t){const n=t.amounts.map(()=>j),r=t.vaultKeeperBtcPubkeys.length,s=await A.buildPrePeginPsbt({vaultCoreVersion:t.vaultCoreVersion,depositorPubkey:e,vaultProviderPubkey:h.stripHexPrefix(t.vaultProviderBtcPubkey),vaultKeeperPubkeys:t.vaultKeeperBtcPubkeys.map(h.stripHexPrefix),universalChallengerPubkeys:t.universalChallengerBtcPubkeys.map(h.stripHexPrefix),hashlocks:n,timelockRefund:t.timelockRefund,pegInAmounts:t.amounts,feeRate:t.protocolFeeRate,minPeginFeeRate:t.minPeginFeeRate,numLocalChallengers:r,councilQuorum:t.councilQuorum,councilSize:t.councilSize,network:this.config.btcNetwork,authAnchorHash:j}),i=oe.selectUtxosForPegin([...t.availableUTXOs],s.totalOutputValue,t.mempoolFeeRate,ne.peginOutputCount(s.htlcValues.length,!0));return{selectedUTXOs:i.selectedUTXOs,fee:i.fee,changeAmount:i.changeAmount,depositorClaimValue:s.depositorClaimValue,minPeginFee:s.minPeginFee}}buildPeginDepositTerms(e){const{params:t}=e;return de({vaultCoreVersion:t.vaultCoreVersion,protocolFeeRate:t.protocolFeeRate,timelockPegin:t.timelockPegin,timelockAssert:t.timelockAssert,timelockRefund:t.timelockRefund,prepeginTxid:e.prepeginTxid,prepeginMaxFee:e.prepeginMaxFee,vaultProviderBtcPubkey:h.stripHexPrefix(t.vaultProviderBtcPubkey),vaultKeeperBtcPubkeys:t.vaultKeeperBtcPubkeys.map(h.stripHexPrefix),universalChallengerBtcPubkeys:t.universalChallengerBtcPubkeys.map(h.stripHexPrefix),maxAcceptableCommissionBps:te.capMaxAcceptableCommissionBps(t.commissionBps),peginAmounts:t.amounts,depositorClaimValue:e.depositorClaimValue,peginMaxFee:e.peginMaxFee})}async preparePeginCommit(e){const{depositorBtcPubkeyRaw:t,depositorBtcPubkey:n,hashlocks:r,authAnchorHash:s,sizing:i,params:a}=e,c=j.toLowerCase();for(let u=0;u<r.length;u++)if(r[u].toLowerCase()===c)throw new Error(`preparePeginCommit refusing to build with sizing-pass placeholder hashlock at vault ${u} — internal substitution bug`);if(s.toLowerCase()===c)throw new Error("preparePeginCommit refusing to build with sizing-pass placeholder auth-anchor hash — internal substitution bug");const p=h.stripHexPrefix(a.vaultProviderBtcPubkey),d=a.vaultKeeperBtcPubkeys.map(h.stripHexPrefix),m=a.universalChallengerBtcPubkeys.map(h.stripHexPrefix),k=d.length,x={vaultCoreVersion:a.vaultCoreVersion,depositorPubkey:n,vaultProviderPubkey:p,vaultKeeperPubkeys:d,universalChallengerPubkeys:m,hashlocks:r,timelockRefund:a.timelockRefund,pegInAmounts:a.amounts,feeRate:a.protocolFeeRate,minPeginFeeRate:a.minPeginFeeRate,numLocalChallengers:k,councilQuorum:a.councilQuorum,councilSize:a.councilSize,network:this.config.btcNetwork,authAnchorHash:s},f=await A.buildPrePeginPsbt(x);if(f.depositorClaimValue!==i.depositorClaimValue||f.minPeginFee!==i.minPeginFee)throw new Error(`Pre-PegIn sizing/commit divergence: depositorClaimValue ${i.depositorClaimValue} -> ${f.depositorClaimValue}, minPeginFee ${i.minPeginFee} -> ${f.minPeginFee}. The provisional deposit terms validated before derivation would not match the terms sent for approval; refusing to continue.`);const S=h.getNetwork(this.config.btcNetwork),T=ne.fundPeginTransaction({unfundedTxHex:f.psbtHex,selectedUTXOs:i.selectedUTXOs,changeAddress:a.changeAddress,changeAmount:i.changeAmount,network:S}),l=i.selectedUTXOs.reduce((u,B)=>u+BigInt(B.value),0n)-f.totalOutputValue-i.changeAmount;if(l!==i.fee)throw new Error(`Pre-PegIn funded fee ${l} does not match the sizing-pass fee ${i.fee}; refusing to publish a deposit-terms fee bound the funded transaction does not pay.`);const R=h.stripHexPrefix(Be.calculateBtcTxHash(T)),F=[],g=[],b=[];for(let u=0;u<r.length;u++){const B=await A.buildPeginTxFromFundedPrePegin({prePeginParams:x,timelockPegin:a.timelockPegin,fundedPrePeginTxHex:T,htlcVout:u}),N=await $.buildPeginInputPsbt({vaultCoreVersion:a.vaultCoreVersion,peginTxHex:B.txHex,fundedPrePeginTxHex:T,depositorPubkey:n,vaultProviderPubkey:p,vaultKeeperPubkeys:d,universalChallengerPubkeys:m,hashlock:r[u],timelockRefund:a.timelockRefund,network:this.config.btcNetwork});F.push(B),g.push(N.psbtHex),b.push(Se.createTaprootScriptPathSignOptions(t,1))}const v=this.buildPeginDepositTerms({params:a,prepeginTxid:R,prepeginMaxFee:i.fee,depositorClaimValue:f.depositorClaimValue,peginMaxFee:f.minPeginFee});E.supportsDepositApproval(this.config.btcWallet)&&await this.config.btcWallet.approveDepositTerms(v);const _=await E.signPsbtsWithFallback(this.config.btcWallet,g,b),W=[];for(let u=0;u<_.length;u++){A.assertPsbtUnsignedTxMatches({requestedPsbtHex:g[u],returnedPsbtHex:_[u]});const B=$.extractPeginInputSignature(_[u],n);A.assertScriptPathSchnorrSignature({requestedPsbtHex:g[u],signatureHex:B,signerXOnlyPubkeyHex:n,inputIndex:0});const N=$.finalizePeginInputPsbt(_[u]);W.push({htlcVout:u,htlcValue:f.htlcValues[u],peginTxHex:N,peginTxid:F[u].txid,peginInputSignature:B,vaultScriptPubKey:F[u].vaultScriptPubKey})}return{fundedPrePeginTxHex:T,prePeginTxid:R,perVault:W,depositTerms:v}}async signAndBroadcast(e){const{fundedPrePeginTxHex:t,depositorBtcPubkey:n}=e,r=t.startsWith("0x")?t.slice(2):t,s=O.Transaction.fromHex(r);if(s.ins.length===0)throw new Error("Transaction has no inputs");const i=new O.Psbt;i.setVersion(s.version),i.setLocktime(s.locktime);const a=I.Buffer.from(C(n),"hex"),c=this.config.mempoolApiUrl,p=s.ins.map(g=>{const b=I.Buffer.from(g.hash).reverse().toString("hex"),v=g.index;return Pt(b,v,e.localPrevouts,c).then(_=>({input:g,utxoData:_,txid:b,vout:v}))}),d=await Promise.all(p),m=d.reduce((g,b)=>g+BigInt(b.utxoData.value),0n),k=s.outs.reduce((g,b)=>g+BigInt(b.value),0n);if(m<k)throw new Error(`UTXO value mismatch: total input value (${m} sat) is less than total output value (${k} sat). This may indicate the mempool API returned manipulated UTXO data.`);const x=m-k;if(x>L.MAX_REASONABLE_FEE_SATS)throw new Error(`Implied transaction fee (${x} sat) exceeds maximum reasonable fee (${L.MAX_REASONABLE_FEE_SATS} sat). This may indicate manipulated UTXO data.`);for(const{input:g,utxoData:b,txid:v,vout:_}of d){const W=oe.getPsbtInputFields({value:b.value,scriptPubKey:b.scriptPubKey},a);i.addInput({hash:g.hash,index:g.index,sequence:g.sequence,...W})}for(const g of s.outs)i.addOutput({script:g.script,value:g.value});await ge({wallet:this.config.btcWallet,depositTerms:e.depositTerms,fundedPrePeginTxHex:t,depositorBtcPubkey:n});const f=i.toHex(),S=await this.config.btcWallet.signPsbt(f);A.assertPsbtUnsignedTxMatches({requestedPsbtHex:f,returnedPsbtHex:S});const T=$.assertReturnedKeyPathSignatures({requestedPsbtHex:f,returnedPsbtHex:S});if(E.supportsDepositApproval(this.config.btcWallet)&&T!==i.data.inputs.length)throw new Error(`Key-path verification covered ${T} of ${i.data.inputs.length} Pre-PegIn inputs; an approval wallet signs every input key-path, so the unverified ones must not be broadcast.`);const l=O.Psbt.fromHex(S);try{l.finalizeAllInputs()}catch(g){if(!l.data.inputs.every(v=>v.finalScriptWitness||v.finalScriptSig))throw new Error(`PSBT finalization failed and wallet did not auto-finalize: ${g}`)}const R=l.extractTransaction().toHex();return await le.pushTx(R,c)}async registerPeginOnChain(e){if(!this.config.ethWallet.account)throw new Error("Ethereum wallet account not found");const t=this.config.ethWallet.account.address;if(!ee.isAddressEqual(e.popSignature.depositorEthAddress,t))throw new Error(`Proof of possession was signed for ${e.popSignature.depositorEthAddress} but the Ethereum wallet is currently connected to ${t}. Reconnect the original account or call signProofOfPossession() again.`);const n=await this.assertPopMatchesBtcWallet(e.popSignature),r=e.depositorPayoutBtcAddress??await this.config.btcWallet.getAddress(),s=this.resolvePayoutScriptPubKey(n,r);return this.createRegistrationClient().registerPeginOnChain({unsignedPrePeginTx:e.unsignedPrePeginTx,depositorSignedPeginTx:e.depositorSignedPeginTx,vaultProvider:e.vaultProvider,hashlock:e.hashlock,htlcVout:e.htlcVout,depositorPayoutScriptPubKey:s,depositorBtcPubkeyRaw:n,depositorWotsPkHash:e.depositorWotsPkHash,popSignature:e.popSignature,quotedCommissionBps:e.quotedCommissionBps,expectedFingerprint:e.expectedFingerprint})}async registerPeginBatchOnChain(e){if(e.requests.length===0)throw new Error("Batch pegin requires at least one request");if(!this.config.ethWallet.account)throw new Error("Ethereum wallet account not found");const t=this.config.ethWallet.account.address;if(!ee.isAddressEqual(e.popSignature.depositorEthAddress,t))throw new Error(`Proof of possession was signed for ${e.popSignature.depositorEthAddress} but the Ethereum wallet is currently connected to ${t}. Reconnect the original account or call signProofOfPossession() again.`);const n=await this.assertPopMatchesBtcWallet(e.popSignature),r=e.requests.map(s=>this.resolvePayoutScriptPubKey(n,s.depositorPayoutBtcAddress));return this.createRegistrationClient().registerPeginBatchOnChain({vaultProvider:e.vaultProvider,unsignedPrePeginTx:e.unsignedPrePeginTx,popSignature:e.popSignature,depositorBtcPubkeyRaw:n,quotedCommissionBps:e.quotedCommissionBps,expectedFingerprint:e.expectedFingerprint,requests:e.requests.map((s,i)=>({depositorSignedPeginTx:s.depositorSignedPeginTx,hashlock:s.hashlock,htlcVout:s.htlcVout,depositorPayoutScriptPubKey:r[i],depositorWotsPkHash:s.depositorWotsPkHash}))})}createRegistrationClient(){return new te.ViemPeginRegistrationClient({ethWallet:this.config.ethWallet,ethChain:this.config.ethChain,publicClient:this.config.publicClient,btcVaultRegistry:this.config.vaultContracts.btcVaultRegistry,requireQuotedCommissionBps:E.supportsDepositApproval(this.config.btcWallet)})}resolvePayoutScriptPubKey(e,t){if(!h.isAddressFromPublicKey(t,e,this.config.btcNetwork))throw h.stripHexPrefix(e).length===L.X_ONLY_PUBKEY_HEX_LEN&&mt(t,this.config.btcNetwork)?new Error(`BTC payout address "${t}" is a P2WPKH (Native SegWit) address, but the connected wallet only exposes an x-only public key. P2WPKH validation requires a compressed key with known y-parity. Use a P2TR (Taproot) payout address instead.`):new Error(`BTC payout address "${t}" is not derived from the connected wallet's public key. The payout sink must be controlled by the same key that signs the pegin; refusing to register a mismatched address.`);const n=h.getNetwork(this.config.btcNetwork);let r;try{r=pe.address.toOutputScript(t,n).toString("hex")}catch{throw new Error(`Invalid BTC payout address: "${t}". Please provide a valid Bitcoin address for the ${this.config.btcNetwork} network.`)}return r}async signProofOfPossession(){if(!this.config.ethWallet.account)throw new Error("Ethereum wallet account not found");const e=this.config.ethWallet.account.address,t=C(await this.config.btcWallet.getPublicKeyHex()),n=this.config.vaultContracts.btcVaultRegistry,r=`${e.toLowerCase()}:${this.config.ethChain.id}:pegin:${n.toLowerCase()}`,s=await this.config.btcWallet.signMessage(r,"bip322-simple"),i=Ne(s);return gt(new TextEncoder().encode(r),t,i),{btcPopSignature:i,depositorEthAddress:e,depositorBtcPubkey:t}}async assertPopMatchesBtcWallet(e){const t=await this.config.btcWallet.getPublicKeyHex(),n=C(t),r=C(e.depositorBtcPubkey);if(n!==r)throw new Error(`Proof of possession was signed with BTC pubkey ${r} but the BTC wallet is currently connected to ${n}. Reconnect the original wallet or call signProofOfPossession() again.`);return t}getNetwork(){return this.config.btcNetwork}getVaultContractAddress(){return this.config.vaultContracts.btcVaultRegistry}}exports.PeginManager=bt;exports.buildDepositTerms=de;exports.computeWotsBlockPublicKeysHash=ke;exports.deriveWotsBlocksFromSeed=ye;exports.ensurePrePeginTermsApproval=ge;exports.expandPerVaultSecrets=Te;
2
+ //# sourceMappingURL=PeginManager-BHplS4dM.cjs.map