@babylonlabs-io/ts-sdk 3.0.2 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/dist/ApplicationRegistry.abi-s8cQ1ooR.js +160 -0
  2. package/dist/ApplicationRegistry.abi-s8cQ1ooR.js.map +1 -0
  3. package/dist/ApplicationRegistry.abi-sMiTWmnL.cjs +2 -0
  4. package/dist/ApplicationRegistry.abi-sMiTWmnL.cjs.map +1 -0
  5. package/dist/{BTCVaultRegistry.abi-BQ5tFNSu.cjs → BTCVaultRegistry.abi-CohlJX7c.cjs} +2 -2
  6. package/dist/{BTCVaultRegistry.abi-BQ5tFNSu.cjs.map → BTCVaultRegistry.abi-CohlJX7c.cjs.map} +1 -1
  7. package/dist/{BTCVaultRegistry.abi-B0x9_Bza.js → BTCVaultRegistry.abi-DBW0dyqH.js} +63 -1
  8. package/dist/{BTCVaultRegistry.abi-B0x9_Bza.js.map → BTCVaultRegistry.abi-DBW0dyqH.js.map} +1 -1
  9. package/dist/{PayoutManager-BSwbUQeF.js → PayoutManager-BZ212yml.js} +124 -123
  10. package/dist/PayoutManager-BZ212yml.js.map +1 -0
  11. package/dist/PayoutManager-DOdsgcUR.cjs +2 -0
  12. package/dist/PayoutManager-DOdsgcUR.cjs.map +1 -0
  13. package/dist/PeginManager-8EUlm10F.cjs +2 -0
  14. package/dist/{PeginManager-IgDHy_eU.cjs.map → PeginManager-8EUlm10F.cjs.map} +1 -1
  15. package/dist/{PeginManager-D8WGB8eN.js → PeginManager-QRwMUxZg.js} +45 -43
  16. package/dist/{PeginManager-D8WGB8eN.js.map → PeginManager-QRwMUxZg.js.map} +1 -1
  17. package/dist/{ProtocolParams.abi-q0AidvYX.js → ProtocolParams.abi-CKOVqFJP.js} +2 -158
  18. package/dist/ProtocolParams.abi-CKOVqFJP.js.map +1 -0
  19. package/dist/ProtocolParams.abi-CjrT0545.cjs +2 -0
  20. package/dist/ProtocolParams.abi-CjrT0545.cjs.map +1 -0
  21. package/dist/btcTxHash-BRZ8_EZq.js +9 -0
  22. package/dist/btcTxHash-BRZ8_EZq.js.map +1 -0
  23. package/dist/btcTxHash-CGb5BqFL.cjs +2 -0
  24. package/dist/btcTxHash-CGb5BqFL.cjs.map +1 -0
  25. package/dist/buildAndBroadcastReclaim-DjX7wVb2.cjs +2 -0
  26. package/dist/buildAndBroadcastReclaim-DjX7wVb2.cjs.map +1 -0
  27. package/dist/buildAndBroadcastReclaim-DoprHX7o.js +3077 -0
  28. package/dist/buildAndBroadcastReclaim-DoprHX7o.js.map +1 -0
  29. package/dist/buildVaultContextInputForClaim-9XZaqIiw.cjs +2 -0
  30. package/dist/buildVaultContextInputForClaim-9XZaqIiw.cjs.map +1 -0
  31. package/dist/buildVaultContextInputForClaim-DhBoQKyN.js +25 -0
  32. package/dist/buildVaultContextInputForClaim-DhBoQKyN.js.map +1 -0
  33. package/dist/constants-BeYquVd-.js +36 -0
  34. package/dist/constants-BeYquVd-.js.map +1 -0
  35. package/dist/constants-BwCg5K6R.cjs +2 -0
  36. package/dist/constants-BwCg5K6R.cjs.map +1 -0
  37. package/dist/{index-D2mybjXD.js → index-CVBtBjQ5.js} +2 -2
  38. package/dist/{index-D2mybjXD.js.map → index-CVBtBjQ5.js.map} +1 -1
  39. package/dist/{index-MRdle0fs.cjs → index-DpjYs5yr.cjs} +2 -2
  40. package/dist/{index-MRdle0fs.cjs.map → index-DpjYs5yr.cjs.map} +1 -1
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.js +288 -260
  43. package/dist/index.js.map +1 -1
  44. package/dist/{noPayout-qBXWKwav.js → noPayout-B-vGXJ-V.js} +3 -3
  45. package/dist/{noPayout-qBXWKwav.js.map → noPayout-B-vGXJ-V.js.map} +1 -1
  46. package/dist/{noPayout-DAWBQ0eG.cjs → noPayout-DOHak0ui.cjs} +2 -2
  47. package/dist/{noPayout-DAWBQ0eG.cjs.map → noPayout-DOHak0ui.cjs.map} +1 -1
  48. package/dist/pegin-registration-client-BWMwxtr8.js +718 -0
  49. package/dist/pegin-registration-client-BWMwxtr8.js.map +1 -0
  50. package/dist/pegin-registration-client-D4EguWaz.cjs +2 -0
  51. package/dist/pegin-registration-client-D4EguWaz.cjs.map +1 -0
  52. package/dist/{primeVpAuth-BDWBKYhv.cjs → primeVpAuth-BPj2TPdD.cjs} +2 -2
  53. package/dist/{primeVpAuth-BDWBKYhv.cjs.map → primeVpAuth-BPj2TPdD.cjs.map} +1 -1
  54. package/dist/{primeVpAuth-D0ZnsjRi.js → primeVpAuth-CiCdRNGf.js} +2 -2
  55. package/dist/{primeVpAuth-D0ZnsjRi.js.map → primeVpAuth-CiCdRNGf.js.map} +1 -1
  56. package/dist/registration-records-CKLAv3gw.js +447 -0
  57. package/dist/registration-records-CKLAv3gw.js.map +1 -0
  58. package/dist/registration-records-DFQgBaYi.cjs +2 -0
  59. package/dist/registration-records-DFQgBaYi.cjs.map +1 -0
  60. package/dist/{secp256k1-D-H9jmd7.js → secp256k1-BuxBFUHm.js} +3 -3
  61. package/dist/{secp256k1-D-H9jmd7.js.map → secp256k1-BuxBFUHm.js.map} +1 -1
  62. package/dist/signer-set-reader-C1VmC9_U.js +264 -0
  63. package/dist/signer-set-reader-C1VmC9_U.js.map +1 -0
  64. package/dist/signer-set-reader-C6g47hdk.cjs +2 -0
  65. package/dist/signer-set-reader-C6g47hdk.cjs.map +1 -0
  66. package/dist/{signing-Dhr2t0Z6.js → signing-C1rR4tqs.js} +9 -15
  67. package/dist/signing-C1rR4tqs.js.map +1 -0
  68. package/dist/signing-DvISftFk.cjs +2 -0
  69. package/dist/signing-DvISftFk.cjs.map +1 -0
  70. package/dist/tbv/core/clients/eth/__tests__/registration-records.test.d.ts +2 -0
  71. package/dist/tbv/core/clients/eth/__tests__/registration-records.test.d.ts.map +1 -0
  72. package/dist/tbv/core/clients/eth/claimable-event-error.d.ts +14 -0
  73. package/dist/tbv/core/clients/eth/claimable-event-error.d.ts.map +1 -0
  74. package/dist/tbv/core/clients/eth/index.cjs +1 -1
  75. package/dist/tbv/core/clients/eth/index.d.ts +3 -1
  76. package/dist/tbv/core/clients/eth/index.d.ts.map +1 -1
  77. package/dist/tbv/core/clients/eth/index.js +27 -21
  78. package/dist/tbv/core/clients/eth/index.js.map +1 -1
  79. package/dist/tbv/core/clients/eth/payout-script.d.ts +8 -0
  80. package/dist/tbv/core/clients/eth/payout-script.d.ts.map +1 -1
  81. package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts +13 -0
  82. package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts.map +1 -1
  83. package/dist/tbv/core/clients/eth/registration-logs-error.d.ts +11 -1
  84. package/dist/tbv/core/clients/eth/registration-logs-error.d.ts.map +1 -1
  85. package/dist/tbv/core/clients/eth/registration-records.d.ts +29 -0
  86. package/dist/tbv/core/clients/eth/registration-records.d.ts.map +1 -0
  87. package/dist/tbv/core/clients/eth/types.d.ts +120 -3
  88. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  89. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +9 -10
  90. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
  91. package/dist/tbv/core/clients/index.cjs +1 -1
  92. package/dist/tbv/core/clients/index.js +56 -50
  93. package/dist/tbv/core/clients/index.js.map +1 -1
  94. package/dist/tbv/core/clients/vault-provider/status/index.cjs +1 -1
  95. package/dist/tbv/core/clients/vault-provider/status/index.js +1 -1
  96. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +45 -0
  97. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  98. package/dist/tbv/core/contracts/index.cjs +1 -1
  99. package/dist/tbv/core/contracts/index.js +16 -15
  100. package/dist/tbv/core/contracts/index.js.map +1 -1
  101. package/dist/tbv/core/deposit-terms/__tests__/claimSiblings.test.d.ts +2 -0
  102. package/dist/tbv/core/deposit-terms/__tests__/claimSiblings.test.d.ts.map +1 -0
  103. package/dist/tbv/core/deposit-terms/__tests__/fixtures/realFundedPrePegin.d.ts +29 -0
  104. package/dist/tbv/core/deposit-terms/__tests__/fixtures/realFundedPrePegin.d.ts.map +1 -0
  105. package/dist/tbv/core/deposit-terms/__tests__/fundedPrePeginFee.test.d.ts +2 -0
  106. package/dist/tbv/core/deposit-terms/__tests__/fundedPrePeginFee.test.d.ts.map +1 -0
  107. package/dist/tbv/core/deposit-terms/__tests__/rebuildDepositTermsForClaim.golden.test.d.ts +2 -0
  108. package/dist/tbv/core/deposit-terms/__tests__/rebuildDepositTermsForClaim.golden.test.d.ts.map +1 -0
  109. package/dist/tbv/core/deposit-terms/__tests__/rebuildDepositTermsForClaim.test.d.ts +2 -0
  110. package/dist/tbv/core/deposit-terms/__tests__/rebuildDepositTermsForClaim.test.d.ts.map +1 -0
  111. package/dist/tbv/core/deposit-terms/claimSiblings.d.ts +23 -0
  112. package/dist/tbv/core/deposit-terms/claimSiblings.d.ts.map +1 -0
  113. package/dist/tbv/core/deposit-terms/fundedPrePeginFee.d.ts +15 -0
  114. package/dist/tbv/core/deposit-terms/fundedPrePeginFee.d.ts.map +1 -0
  115. package/dist/tbv/core/deposit-terms/index.d.ts +3 -0
  116. package/dist/tbv/core/deposit-terms/index.d.ts.map +1 -1
  117. package/dist/tbv/core/deposit-terms/rebuildDepositTermsForClaim.d.ts +40 -0
  118. package/dist/tbv/core/deposit-terms/rebuildDepositTermsForClaim.d.ts.map +1 -0
  119. package/dist/tbv/core/index.cjs +1 -1
  120. package/dist/tbv/core/index.js +287 -259
  121. package/dist/tbv/core/index.js.map +1 -1
  122. package/dist/tbv/core/managers/index.cjs +1 -1
  123. package/dist/tbv/core/managers/index.js +2 -2
  124. package/dist/tbv/core/managers/pegin/signPsbtsWithFallback.d.ts +6 -2
  125. package/dist/tbv/core/managers/pegin/signPsbtsWithFallback.d.ts.map +1 -1
  126. package/dist/tbv/core/primitives/index.cjs +1 -1
  127. package/dist/tbv/core/primitives/index.js +4 -4
  128. package/dist/tbv/core/primitives/psbt/constants.d.ts +54 -6
  129. package/dist/tbv/core/primitives/psbt/constants.d.ts.map +1 -1
  130. package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifactsFromSignatures.test.d.ts +2 -0
  131. package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifactsFromSignatures.test.d.ts.map +1 -0
  132. package/dist/tbv/core/services/delegated-claim/__tests__/assertBinding.test.d.ts +2 -0
  133. package/dist/tbv/core/services/delegated-claim/__tests__/assertBinding.test.d.ts.map +1 -0
  134. package/dist/tbv/core/services/delegated-claim/__tests__/assertPayoutFeeAndTimelocks.test.d.ts +2 -0
  135. package/dist/tbv/core/services/delegated-claim/__tests__/assertPayoutFeeAndTimelocks.test.d.ts.map +1 -0
  136. package/dist/tbv/core/services/delegated-claim/__tests__/fixtures/delegatedClaimPsbts.d.ts +49 -0
  137. package/dist/tbv/core/services/delegated-claim/__tests__/fixtures/delegatedClaimPsbts.d.ts.map +1 -0
  138. package/dist/tbv/core/services/delegated-claim/__tests__/payoutBinding.test.d.ts +2 -0
  139. package/dist/tbv/core/services/delegated-claim/__tests__/payoutBinding.test.d.ts.map +1 -0
  140. package/dist/tbv/core/services/delegated-claim/__tests__/payoutInputLeaf.test.d.ts +2 -0
  141. package/dist/tbv/core/services/delegated-claim/__tests__/payoutInputLeaf.test.d.ts.map +1 -0
  142. package/dist/tbv/core/services/delegated-claim/__tests__/planDelegatedClaimSigning.test.d.ts +2 -0
  143. package/dist/tbv/core/services/delegated-claim/__tests__/planDelegatedClaimSigning.test.d.ts.map +1 -0
  144. package/dist/tbv/core/services/delegated-claim/__tests__/readDelegatedClaimVaultContext.test.d.ts +2 -0
  145. package/dist/tbv/core/services/delegated-claim/__tests__/readDelegatedClaimVaultContext.test.d.ts.map +1 -0
  146. package/dist/tbv/core/services/delegated-claim/__tests__/realSchnorrVerification.test.d.ts +2 -0
  147. package/dist/tbv/core/services/delegated-claim/__tests__/realSchnorrVerification.test.d.ts.map +1 -0
  148. package/dist/tbv/core/services/delegated-claim/__tests__/signDelegatedClaimPlan.test.d.ts +2 -0
  149. package/dist/tbv/core/services/delegated-claim/__tests__/signDelegatedClaimPlan.test.d.ts.map +1 -0
  150. package/dist/tbv/core/services/delegated-claim/__tests__/signingRequests.test.d.ts +2 -0
  151. package/dist/tbv/core/services/delegated-claim/__tests__/signingRequests.test.d.ts.map +1 -0
  152. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +34 -9
  153. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -1
  154. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifactsFromSignatures.d.ts +36 -0
  155. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifactsFromSignatures.d.ts.map +1 -0
  156. package/dist/tbv/core/services/delegated-claim/assertBinding.d.ts +37 -0
  157. package/dist/tbv/core/services/delegated-claim/assertBinding.d.ts.map +1 -0
  158. package/dist/tbv/core/services/delegated-claim/assertPayoutFeeAndTimelocks.d.ts +35 -0
  159. package/dist/tbv/core/services/delegated-claim/assertPayoutFeeAndTimelocks.d.ts.map +1 -0
  160. package/dist/tbv/core/services/delegated-claim/index.d.ts +22 -4
  161. package/dist/tbv/core/services/delegated-claim/index.d.ts.map +1 -1
  162. package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts +10 -4
  163. package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts.map +1 -1
  164. package/dist/tbv/core/services/delegated-claim/payoutInputLeaf.d.ts +34 -0
  165. package/dist/tbv/core/services/delegated-claim/payoutInputLeaf.d.ts.map +1 -0
  166. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts +43 -0
  167. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts.map +1 -0
  168. package/dist/tbv/core/services/delegated-claim/readDelegatedClaimVaultContext.d.ts +70 -0
  169. package/dist/tbv/core/services/delegated-claim/readDelegatedClaimVaultContext.d.ts.map +1 -0
  170. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +31 -2
  171. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -1
  172. package/dist/tbv/core/services/delegated-claim/signDelegatedClaimPlan.d.ts +110 -0
  173. package/dist/tbv/core/services/delegated-claim/signDelegatedClaimPlan.d.ts.map +1 -0
  174. package/dist/tbv/core/services/delegated-claim/signingRequests.d.ts +24 -0
  175. package/dist/tbv/core/services/delegated-claim/signingRequests.d.ts.map +1 -0
  176. package/dist/tbv/core/services/delegated-claim/types.d.ts +110 -9
  177. package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -1
  178. package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts +16 -1
  179. package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts.map +1 -1
  180. package/dist/tbv/core/services/delegated-claim/verifySignatureForRequest.d.ts +19 -0
  181. package/dist/tbv/core/services/delegated-claim/verifySignatureForRequest.d.ts.map +1 -0
  182. package/dist/tbv/core/services/delegated-claim/verifyingKeyBinding.d.ts +40 -0
  183. package/dist/tbv/core/services/delegated-claim/verifyingKeyBinding.d.ts.map +1 -0
  184. package/dist/tbv/core/services/delegated-claim/walletIdentity.d.ts +23 -0
  185. package/dist/tbv/core/services/delegated-claim/walletIdentity.d.ts.map +1 -0
  186. package/dist/tbv/core/services/index.cjs +1 -1
  187. package/dist/tbv/core/services/index.js +89 -76
  188. package/dist/tbv/core/services/participants/__tests__/readStampedParticipantKeys.test.d.ts +2 -0
  189. package/dist/tbv/core/services/participants/__tests__/readStampedParticipantKeys.test.d.ts.map +1 -0
  190. package/dist/tbv/core/services/participants/index.d.ts +1 -0
  191. package/dist/tbv/core/services/participants/index.d.ts.map +1 -1
  192. package/dist/tbv/core/services/participants/readStampedParticipantKeys.d.ts +29 -0
  193. package/dist/tbv/core/services/participants/readStampedParticipantKeys.d.ts.map +1 -0
  194. package/dist/tbv/core/services/participants/resolveParticipantKeys.d.ts +1 -1
  195. package/dist/tbv/core/services/participants/resolveParticipantKeys.d.ts.map +1 -1
  196. package/dist/tbv/core/utils/eth/index.cjs +1 -1
  197. package/dist/tbv/core/utils/eth/index.cjs.map +1 -1
  198. package/dist/tbv/core/utils/eth/index.js +20 -20
  199. package/dist/tbv/core/utils/eth/index.js.map +1 -1
  200. package/dist/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.d.ts.map +1 -1
  201. package/dist/tbv/core/utils/index.cjs +1 -1
  202. package/dist/tbv/core/utils/index.js +47 -46
  203. package/dist/tbv/core/utils/index.js.map +1 -1
  204. package/dist/tbv/core/vault-secrets/__tests__/buildVaultContextInputForClaim.test.d.ts +2 -0
  205. package/dist/tbv/core/vault-secrets/__tests__/buildVaultContextInputForClaim.test.d.ts.map +1 -0
  206. package/dist/tbv/core/vault-secrets/buildVaultContextInputForClaim.d.ts +18 -0
  207. package/dist/tbv/core/vault-secrets/buildVaultContextInputForClaim.d.ts.map +1 -0
  208. package/dist/tbv/core/vault-secrets/index.cjs +1 -1
  209. package/dist/tbv/core/vault-secrets/index.d.ts +1 -0
  210. package/dist/tbv/core/vault-secrets/index.d.ts.map +1 -1
  211. package/dist/tbv/core/vault-secrets/index.js +12 -10
  212. package/dist/tbv/core/vault-secrets/index.js.map +1 -1
  213. package/dist/tbv/index.cjs +1 -1
  214. package/dist/tbv/index.js +287 -259
  215. package/dist/tbv/index.js.map +1 -1
  216. package/dist/toRefundInputs-BZXvuOMY.cjs +2 -0
  217. package/dist/toRefundInputs-BZXvuOMY.cjs.map +1 -0
  218. package/dist/toRefundInputs-dKDSvpVI.js +698 -0
  219. package/dist/toRefundInputs-dKDSvpVI.js.map +1 -0
  220. package/dist/types-Bda75Od0.cjs +2 -0
  221. package/dist/types-Bda75Od0.cjs.map +1 -0
  222. package/dist/types-C5jj3Cc-.js +198 -0
  223. package/dist/types-C5jj3Cc-.js.map +1 -0
  224. package/dist/{verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs → verifyKeyPathSchnorrSignature-CQUut2-O.cjs} +2 -2
  225. package/dist/{verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs.map → verifyKeyPathSchnorrSignature-CQUut2-O.cjs.map} +1 -1
  226. package/dist/{verifyKeyPathSchnorrSignature-BQHNhRj6.js → verifyKeyPathSchnorrSignature-DxPbeSdQ.js} +2 -2
  227. package/dist/{verifyKeyPathSchnorrSignature-BQHNhRj6.js.map → verifyKeyPathSchnorrSignature-DxPbeSdQ.js.map} +1 -1
  228. package/dist/{verifyScriptPathSchnorrSignature-CpjSTfMj.js → verifyScriptPathSchnorrSignature-B3-VkvnK.js} +6 -4
  229. package/dist/{verifyScriptPathSchnorrSignature-CpjSTfMj.js.map → verifyScriptPathSchnorrSignature-B3-VkvnK.js.map} +1 -1
  230. package/dist/{verifyScriptPathSchnorrSignature-BKZihCjk.cjs → verifyScriptPathSchnorrSignature-D2t1yACC.cjs} +2 -2
  231. package/dist/{verifyScriptPathSchnorrSignature-BKZihCjk.cjs.map → verifyScriptPathSchnorrSignature-D2t1yACC.cjs.map} +1 -1
  232. package/package.json +3 -3
  233. package/dist/PayoutManager-B6GFbG3X.cjs +0 -2
  234. package/dist/PayoutManager-B6GFbG3X.cjs.map +0 -1
  235. package/dist/PayoutManager-BSwbUQeF.js.map +0 -1
  236. package/dist/PeginManager-IgDHy_eU.cjs +0 -2
  237. package/dist/ProtocolParams.abi-Db2USqQm.cjs +0 -2
  238. package/dist/ProtocolParams.abi-Db2USqQm.cjs.map +0 -1
  239. package/dist/ProtocolParams.abi-q0AidvYX.js.map +0 -1
  240. package/dist/buildAndBroadcastReclaim-B8aFMGf-.cjs +0 -2
  241. package/dist/buildAndBroadcastReclaim-B8aFMGf-.cjs.map +0 -1
  242. package/dist/buildAndBroadcastReclaim-D5520lbL.js +0 -2210
  243. package/dist/buildAndBroadcastReclaim-D5520lbL.js.map +0 -1
  244. package/dist/constants-BTZdyOuk.cjs +0 -2
  245. package/dist/constants-BTZdyOuk.cjs.map +0 -1
  246. package/dist/constants-D5vORbQE.js +0 -29
  247. package/dist/constants-D5vORbQE.js.map +0 -1
  248. package/dist/onChainBtcPubkey-BlzxYImF.cjs +0 -2
  249. package/dist/onChainBtcPubkey-BlzxYImF.cjs.map +0 -1
  250. package/dist/onChainBtcPubkey-CCTdl53s.js +0 -159
  251. package/dist/onChainBtcPubkey-CCTdl53s.js.map +0 -1
  252. package/dist/pegin-registration-client-B0j6ugt9.cjs +0 -2
  253. package/dist/pegin-registration-client-B0j6ugt9.cjs.map +0 -1
  254. package/dist/pegin-registration-client-ilkV1mLP.js +0 -878
  255. package/dist/pegin-registration-client-ilkV1mLP.js.map +0 -1
  256. package/dist/signing-3l5Aqd-H.cjs +0 -2
  257. package/dist/signing-3l5Aqd-H.cjs.map +0 -1
  258. package/dist/signing-Dhr2t0Z6.js.map +0 -1
  259. package/dist/toRefundInputs-10RYIfh1.js +0 -559
  260. package/dist/toRefundInputs-10RYIfh1.js.map +0 -1
  261. package/dist/toRefundInputs-a-0HRyrl.cjs +0 -2
  262. package/dist/toRefundInputs-a-0HRyrl.cjs.map +0 -1
  263. package/dist/types-BueQoMjO.cjs +0 -2
  264. package/dist/types-BueQoMjO.cjs.map +0 -1
  265. package/dist/types-DGkejGZH.js +0 -456
  266. package/dist/types-DGkejGZH.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../PayoutManager-B6GFbG3X.cjs"),t=require("../../../buildAndBroadcastReclaim-B8aFMGf-.cjs"),i=require("../wasm/index.cjs"),e=require("../../../peginState-DUv10EJR.cjs"),r=require("../../../state-C4WoNCy1.cjs");exports.computeHashlock=a.computeHashlock;exports.validateSecretAgainstHashlock=a.validateSecretAgainstHashlock;exports.ApplicationEntryPointMismatchError=t.ApplicationEntryPointMismatchError;exports.ArtifactsVaultMismatchError=t.ArtifactsVaultMismatchError;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ChallengerSetMismatchError=t.ChallengerSetMismatchError;exports.DELEGATED_CLAIM_TX_GRAPH_VERSION=t.DELEGATED_CLAIM_TX_GRAPH_VERSION;exports.GraphFingerprintError=t.GraphFingerprintError;exports.PEGIN_ETH_CONFIRMATIONS=t.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=t.ParticipantKeyDriftError;exports.PayoutDestinationError=t.PayoutDestinationError;exports.PeginRegistrationMissingError=t.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=t.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=t.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=t.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=t.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=t.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=t.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=t.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=t.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=t.REFUND_VSIZE;exports.ReclaimUneconomicalError=t.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=t.RegisteredVaultVersionMismatchError;exports.VaultIdBindingError=t.VaultIdBindingError;exports.activateVault=t.activateVault;exports.activateVaultAndRedeem=t.activateVaultAndRedeem;exports.assembleWatchtowerArtifacts=t.assembleWatchtowerArtifacts;exports.assertArtifactsUsableForVault=t.assertArtifactsUsableForVault;exports.assertChallengerSetMatchesVault=t.assertChallengerSetMatchesVault;exports.assertClaimSpendsVault=t.assertClaimSpendsVault;exports.assertPayoutPaysRegisteredScript=t.assertPayoutPaysRegisteredScript;exports.assertReturnedGraphMatchesFingerprint=t.assertReturnedGraphMatchesFingerprint;exports.assertVaultProviderHintAccepted=t.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=t.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.deriveClaimerWotsKeypair=t.deriveClaimerWotsKeypair;exports.estimateRefundFeeSats=t.estimateRefundFeeSats;exports.fingerprintReturnedGraph=t.fingerprintReturnedGraph;exports.isApplicationEntryPointMismatchError=t.isApplicationEntryPointMismatchError;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isHintAccepted=t.isHintAccepted;exports.isParticipantKeyDriftError=t.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=t.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=t.isPeginRegistrationNotFinalError;exports.isRegisteredVaultVersionMismatchError=t.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=t.matchKeyHint;exports.matchKeySetHint=t.matchKeySetHint;exports.resolveCurrentParticipantKeys=t.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=t.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=t.runDepositorPresignFlow;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.summarizeWatchtowerArtifacts=t.summarizeWatchtowerArtifacts;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=t.validateOnChainParticipantKeys;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.verifyRegisteredParticipantKeys=t.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=t.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=t.waitForPeginRegistrationDepth;exports.waitForPeginStatus=t.waitForPeginStatus;exports.attachFinalizedAssert=i.attachFinalizedAssert;exports.finalizePayout=i.finalizePayout;exports.finalizeWronglyChallenged=i.finalizeWronglyChallenged;exports.pinPegoutProof=i.pinPegoutProof;exports.ContractStatus=e.ContractStatus;exports.PeginAction=e.PeginAction;exports.activationDeadlineBlocksRemaining=e.activationDeadlineBlocksRemaining;exports.canPerformAction=e.canPerformAction;exports.getPeginProtocolState=e.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=e.isActivationDeadlinePassedOnChain;exports.ClaimerPegoutStatusValue=r.ClaimerPegoutStatusValue;exports.isPegoutTerminalStatus=r.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=r.isRecognizedPegoutStatus;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../PayoutManager-DOdsgcUR.cjs"),t=require("../../../buildAndBroadcastReclaim-DjX7wVb2.cjs"),i=require("../wasm/index.cjs"),e=require("../../../peginState-DUv10EJR.cjs"),a=require("../../../state-C4WoNCy1.cjs");exports.computeHashlock=r.computeHashlock;exports.validateSecretAgainstHashlock=r.validateSecretAgainstHashlock;exports.ApplicationEntryPointMismatchError=t.ApplicationEntryPointMismatchError;exports.ArtifactsVaultMismatchError=t.ArtifactsVaultMismatchError;exports.AssertBindingError=t.AssertBindingError;exports.BABE_SESSION_PLACEHOLDER_DECRYPTOR_HEX=t.BABE_SESSION_PLACEHOLDER_DECRYPTOR_HEX;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ChallengerSetMismatchError=t.ChallengerSetMismatchError;exports.DELEGATED_CLAIM_TX_GRAPH_VERSION=t.DELEGATED_CLAIM_TX_GRAPH_VERSION;exports.DelegatedClaimSigningIncompleteError=t.DelegatedClaimSigningIncompleteError;exports.GraphFingerprintError=t.GraphFingerprintError;exports.PEGIN_ETH_CONFIRMATIONS=t.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=t.ParticipantKeyDriftError;exports.PayoutDestinationError=t.PayoutDestinationError;exports.PayoutInputLeafError=t.PayoutInputLeafError;exports.PeginRegistrationMissingError=t.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=t.PeginRegistrationNotFinalError;exports.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR=t.RECLAIM_MAX_FEE_FRACTION_DENOMINATOR;exports.RECLAIM_MAX_FEE_FRACTION_NUMERATOR=t.RECLAIM_MAX_FEE_FRACTION_NUMERATOR;exports.RECLAIM_MAX_FEE_RATE_SATS_VB=t.RECLAIM_MAX_FEE_RATE_SATS_VB;exports.RECLAIM_WARN_FEE_FRACTION_NUMERATOR=t.RECLAIM_WARN_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=t.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=t.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=t.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=t.REFUND_VSIZE;exports.ReclaimUneconomicalError=t.ReclaimUneconomicalError;exports.RegisteredVaultVersionMismatchError=t.RegisteredVaultVersionMismatchError;exports.SigningPlanMismatchError=t.SigningPlanMismatchError;exports.VaultIdBindingError=t.VaultIdBindingError;exports.activateVault=t.activateVault;exports.activateVaultAndRedeem=t.activateVaultAndRedeem;exports.assembleWatchtowerArtifacts=t.assembleWatchtowerArtifacts;exports.assembleWatchtowerArtifactsFromSignatures=t.assembleWatchtowerArtifactsFromSignatures;exports.assertArtifactsUsableForVault=t.assertArtifactsUsableForVault;exports.assertAssertBindsClaimAndPayout=t.assertAssertBindsClaimAndPayout;exports.assertChallengerSetMatchesVault=t.assertChallengerSetMatchesVault;exports.assertClaimSpendsVault=t.assertClaimSpendsVault;exports.assertPayoutPaysRegisteredScript=t.assertPayoutPaysRegisteredScript;exports.assertReturnedGraphMatchesFingerprint=t.assertReturnedGraphMatchesFingerprint;exports.assertTermsMatchVault=t.assertTermsMatchVault;exports.assertVaultProviderHintAccepted=t.assertVaultProviderHintAccepted;exports.buildAndBroadcastReclaim=t.buildAndBroadcastReclaim;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.copyAssertConnectorLeaf=t.copyAssertConnectorLeaf;exports.deriveClaimerWotsKeypair=t.deriveClaimerWotsKeypair;exports.estimateRefundFeeSats=t.estimateRefundFeeSats;exports.fingerprintReturnedGraph=t.fingerprintReturnedGraph;exports.isApplicationEntryPointMismatchError=t.isApplicationEntryPointMismatchError;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isHintAccepted=t.isHintAccepted;exports.isParticipantKeyDriftError=t.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=t.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=t.isPeginRegistrationNotFinalError;exports.isRegisteredVaultVersionMismatchError=t.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=t.matchKeyHint;exports.matchKeySetHint=t.matchKeySetHint;exports.planDelegatedClaimSigning=t.planDelegatedClaimSigning;exports.readDelegatedClaimVaultContext=t.readDelegatedClaimVaultContext;exports.readStampedParticipantKeys=t.readStampedParticipantKeys;exports.resolveCurrentParticipantKeys=t.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=t.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=t.runDepositorPresignFlow;exports.signDelegatedClaimPlan=t.signDelegatedClaimPlan;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.summarizeWatchtowerArtifacts=t.summarizeWatchtowerArtifacts;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=t.validateOnChainParticipantKeys;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.verifyRegisteredParticipantKeys=t.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=t.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=t.waitForPeginRegistrationDepth;exports.waitForPeginStatus=t.waitForPeginStatus;exports.attachFinalizedAssert=i.attachFinalizedAssert;exports.finalizePayout=i.finalizePayout;exports.finalizeWronglyChallenged=i.finalizeWronglyChallenged;exports.pinPegoutProof=i.pinPegoutProof;exports.ContractStatus=e.ContractStatus;exports.PeginAction=e.PeginAction;exports.activationDeadlineBlocksRemaining=e.activationDeadlineBlocksRemaining;exports.canPerformAction=e.canPerformAction;exports.getPeginProtocolState=e.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=e.isActivationDeadlinePassedOnChain;exports.ClaimerPegoutStatusValue=a.ClaimerPegoutStatusValue;exports.isPegoutTerminalStatus=a.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=a.isRecognizedPegoutStatus;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,85 +1,98 @@
1
- import { c as s, v as e } from "../../../PayoutManager-BSwbUQeF.js";
2
- import { t as r, A as o, X as n, C as l, D as c, G as E, i as A, I as R, P as u, j as d, k as g, a4 as p, a5 as P, a6 as _, a7 as m, _ as M, $ as F, a0 as h, a1 as C, a2 as N, R as V, V as f, a as v, b as y, c as S, e as I, f as D, h as T, g as O, n as K, O as U, a3 as H, Y as b, d as B, Z as G, o as X, u as L, x as W, Q as w, J as x, l as z, m as k, L as Z, S as j, T as q, U as J, W as Q, r as Y, p as $, q as aa, s as ta, y as sa, z as ea, v as ia, B as ra, E as oa, F as na, H as la, K as ca, M as Ea, w as Aa, N as Ra } from "../../../buildAndBroadcastReclaim-D5520lbL.js";
3
- import { attachFinalizedAssert as da, finalizePayout as ga, finalizeWronglyChallenged as pa, pinPegoutProof as Pa } from "../wasm/index.js";
4
- import { C as ma, P as Ma, a as Fa, c as ha, g as Ca, i as Na } from "../../../peginState-BU2ONFXF.js";
5
- import { C as fa, g as va, f as ya } from "../../../state-CFn1rT74.js";
1
+ import { c as s, v as e } from "../../../PayoutManager-BZ212yml.js";
2
+ import { J as r, k as n, A as o, B as l, a8 as c, C as E, D as A, m as g, G as d, t as u, W as R, P, i as m, u as p, v as _, ah as C, ai as M, aj as h, ak as S, ab as F, ac as f, ad as y, ae as D, af as N, Z as V, S as I, V as v, a as T, b as O, c as B, d as K, l as H, e as L, f as b, q as U, h as X, z as G, n as W, a1 as w, ag as x, a9 as k, j as z, g as j, aa as Y, E as Z, K as q, M as J, a2 as Q, X as $, w as aa, x as ta, _ as sa, a3 as ea, a4 as ia, p as ra, r as na, a5 as oa, a6 as la, a7 as ca, F as Ea, o as Aa, H as ga, I as da, s as ua, N as Ra, O as Pa, L as ma, Q as pa, R as _a, T as Ca, U as Ma, Y as ha, $ as Sa, y as Fa, a0 as fa } from "../../../buildAndBroadcastReclaim-DoprHX7o.js";
3
+ import { attachFinalizedAssert as Da, finalizePayout as Na, finalizeWronglyChallenged as Va, pinPegoutProof as Ia } from "../wasm/index.js";
4
+ import { C as Ta, P as Oa, a as Ba, c as Ka, g as Ha, i as La } from "../../../peginState-BU2ONFXF.js";
5
+ import { C as Ua, g as Xa, f as Ga } from "../../../state-CFn1rT74.js";
6
6
  export {
7
7
  r as ApplicationEntryPointMismatchError,
8
- o as ArtifactsVaultMismatchError,
9
- n as BIP68NotMatureError,
10
- l as ChallengerSetMismatchError,
11
- fa as ClaimerPegoutStatusValue,
12
- ma as ContractStatus,
13
- c as DELEGATED_CLAIM_TX_GRAPH_VERSION,
14
- E as GraphFingerprintError,
15
- A as PEGIN_ETH_CONFIRMATIONS,
8
+ n as ArtifactsVaultMismatchError,
9
+ o as AssertBindingError,
10
+ l as BABE_SESSION_PLACEHOLDER_DECRYPTOR_HEX,
11
+ c as BIP68NotMatureError,
12
+ E as ChallengerSetMismatchError,
13
+ Ua as ClaimerPegoutStatusValue,
14
+ Ta as ContractStatus,
15
+ A as DELEGATED_CLAIM_TX_GRAPH_VERSION,
16
+ g as DelegatedClaimSigningIncompleteError,
17
+ d as GraphFingerprintError,
18
+ u as PEGIN_ETH_CONFIRMATIONS,
16
19
  R as ParticipantKeyDriftError,
17
- u as PayoutDestinationError,
18
- Ma as PeginAction,
19
- d as PeginRegistrationMissingError,
20
- g as PeginRegistrationNotFinalError,
21
- p as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
22
- P as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
23
- _ as RECLAIM_MAX_FEE_RATE_SATS_VB,
24
- m as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
25
- M as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
26
- F as REFUND_MAX_FEE_FRACTION_NUMERATOR,
27
- h as REFUND_MAX_FEE_RATE_SATS_VB,
28
- C as REFUND_VSIZE,
20
+ P as PayoutDestinationError,
21
+ m as PayoutInputLeafError,
22
+ Oa as PeginAction,
23
+ p as PeginRegistrationMissingError,
24
+ _ as PeginRegistrationNotFinalError,
25
+ C as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
26
+ M as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
27
+ h as RECLAIM_MAX_FEE_RATE_SATS_VB,
28
+ S as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
29
+ F as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
30
+ f as REFUND_MAX_FEE_FRACTION_NUMERATOR,
31
+ y as REFUND_MAX_FEE_RATE_SATS_VB,
32
+ D as REFUND_VSIZE,
29
33
  N as ReclaimUneconomicalError,
30
34
  V as RegisteredVaultVersionMismatchError,
31
- f as VaultIdBindingError,
32
- v as activateVault,
33
- y as activateVaultAndRedeem,
34
- Fa as activationDeadlineBlocksRemaining,
35
- S as assembleWatchtowerArtifacts,
36
- I as assertArtifactsUsableForVault,
37
- D as assertChallengerSetMatchesVault,
38
- T as assertClaimSpendsVault,
39
- O as assertPayoutPaysRegisteredScript,
40
- K as assertReturnedGraphMatchesFingerprint,
41
- U as assertVaultProviderHintAccepted,
42
- da as attachFinalizedAssert,
43
- H as buildAndBroadcastReclaim,
44
- b as buildAndBroadcastRefund,
45
- ha as canPerformAction,
35
+ I as SigningPlanMismatchError,
36
+ v as VaultIdBindingError,
37
+ T as activateVault,
38
+ O as activateVaultAndRedeem,
39
+ Ba as activationDeadlineBlocksRemaining,
40
+ B as assembleWatchtowerArtifacts,
41
+ K as assembleWatchtowerArtifactsFromSignatures,
42
+ H as assertArtifactsUsableForVault,
43
+ L as assertAssertBindsClaimAndPayout,
44
+ b as assertChallengerSetMatchesVault,
45
+ U as assertClaimSpendsVault,
46
+ X as assertPayoutPaysRegisteredScript,
47
+ G as assertReturnedGraphMatchesFingerprint,
48
+ W as assertTermsMatchVault,
49
+ w as assertVaultProviderHintAccepted,
50
+ Da as attachFinalizedAssert,
51
+ x as buildAndBroadcastReclaim,
52
+ k as buildAndBroadcastRefund,
53
+ Ka as canPerformAction,
46
54
  s as computeHashlock,
47
- B as deriveClaimerWotsKeypair,
48
- G as estimateRefundFeeSats,
49
- ga as finalizePayout,
50
- pa as finalizeWronglyChallenged,
51
- X as fingerprintReturnedGraph,
52
- Ca as getPeginProtocolState,
53
- Na as isActivationDeadlinePassedOnChain,
54
- L as isApplicationEntryPointMismatchError,
55
- W as isDepositAmountValid,
56
- w as isHintAccepted,
57
- x as isParticipantKeyDriftError,
58
- z as isPeginRegistrationMissingError,
59
- k as isPeginRegistrationNotFinalError,
60
- va as isPegoutTerminalStatus,
61
- ya as isRecognizedPegoutStatus,
62
- Z as isRegisteredVaultVersionMismatchError,
63
- j as matchKeyHint,
64
- q as matchKeySetHint,
65
- Pa as pinPegoutProof,
66
- J as resolveCurrentParticipantKeys,
67
- Q as resolveParticipantKeysAtEpochs,
68
- Y as runDepositorPresignFlow,
69
- $ as signDepositorGraph,
70
- aa as submitWotsPublicKey,
71
- ta as summarizeWatchtowerArtifacts,
72
- sa as validateDepositAmount,
73
- ea as validateMultiVaultDepositInputs,
74
- ia as validateOnChainParticipantKeys,
75
- ra as validateProviderSelection,
76
- oa as validateRemainingCapacity,
55
+ z as copyAssertConnectorLeaf,
56
+ j as deriveClaimerWotsKeypair,
57
+ Y as estimateRefundFeeSats,
58
+ Na as finalizePayout,
59
+ Va as finalizeWronglyChallenged,
60
+ Z as fingerprintReturnedGraph,
61
+ Ha as getPeginProtocolState,
62
+ La as isActivationDeadlinePassedOnChain,
63
+ q as isApplicationEntryPointMismatchError,
64
+ J as isDepositAmountValid,
65
+ Q as isHintAccepted,
66
+ $ as isParticipantKeyDriftError,
67
+ aa as isPeginRegistrationMissingError,
68
+ ta as isPeginRegistrationNotFinalError,
69
+ Xa as isPegoutTerminalStatus,
70
+ Ga as isRecognizedPegoutStatus,
71
+ sa as isRegisteredVaultVersionMismatchError,
72
+ ea as matchKeyHint,
73
+ ia as matchKeySetHint,
74
+ Ia as pinPegoutProof,
75
+ ra as planDelegatedClaimSigning,
76
+ na as readDelegatedClaimVaultContext,
77
+ oa as readStampedParticipantKeys,
78
+ la as resolveCurrentParticipantKeys,
79
+ ca as resolveParticipantKeysAtEpochs,
80
+ Ea as runDepositorPresignFlow,
81
+ Aa as signDelegatedClaimPlan,
82
+ ga as signDepositorGraph,
83
+ da as submitWotsPublicKey,
84
+ ua as summarizeWatchtowerArtifacts,
85
+ Ra as validateDepositAmount,
86
+ Pa as validateMultiVaultDepositInputs,
87
+ ma as validateOnChainParticipantKeys,
88
+ pa as validateProviderSelection,
89
+ _a as validateRemainingCapacity,
77
90
  e as validateSecretAgainstHashlock,
78
- na as validateVaultAmounts,
79
- la as validateVaultProviderPubkey,
80
- ca as verifyRegisteredParticipantKeys,
81
- Ea as verifyRegisteredVaultVersions,
82
- Aa as waitForPeginRegistrationDepth,
83
- Ra as waitForPeginStatus
91
+ Ca as validateVaultAmounts,
92
+ Ma as validateVaultProviderPubkey,
93
+ ha as verifyRegisteredParticipantKeys,
94
+ Sa as verifyRegisteredVaultVersions,
95
+ Fa as waitForPeginRegistrationDepth,
96
+ fa as waitForPeginStatus
84
97
  };
85
98
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=readStampedParticipantKeys.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readStampedParticipantKeys.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/participants/__tests__/readStampedParticipantKeys.test.ts"],"names":[],"mappings":""}
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export { assertVaultProviderHintAccepted, isHintAccepted, matchKeyHint, matchKeySetHint, } from './indexerKeyHint';
7
7
  export type { AssertVaultProviderHintAcceptedParams, HintMatch, } from './indexerKeyHint';
8
+ export { readStampedParticipantKeys, type ReadStampedParticipantKeysParams, type StampedParticipantKeyReaders, } from './readStampedParticipantKeys';
8
9
  export { resolveCurrentParticipantKeys, resolveParticipantKeysAtEpochs, } from './resolveParticipantKeys';
9
10
  export type { KeyResolutionMode, ParticipantKeySet, ResolvedParticipant, } from './types';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,+BAA+B,EAC/B,cAAc,EACd,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,qCAAqC,EACrC,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,+BAA+B,EAC/B,cAAc,EACd,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,qCAAqC,EACrC,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,0BAA0B,EAC1B,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { Hex } from 'viem';
2
+ import { OperationKeyReader, UniversalChallengerReader, VaultData, VaultKeeperReader, VaultRegistryReader } from '../../clients/eth/types';
3
+ import { ParticipantKeySet } from './types';
4
+ /**
5
+ * The reads this needs, as `Pick`s so a caller can pass the SDK's viem readers
6
+ * or a narrower implementation.
7
+ *
8
+ * @experimental
9
+ */
10
+ export interface StampedParticipantKeyReaders {
11
+ registryReader: Pick<VaultRegistryReader, "getVaultProviderGenesisBtcPubKey" | "getVaultKeyEpochs">;
12
+ vaultKeeperReader: Pick<VaultKeeperReader, "getVaultKeepersByVersion">;
13
+ universalChallengerReader: Pick<UniversalChallengerReader, "getUniversalChallengersByVersion">;
14
+ operationKeyReader: Pick<OperationKeyReader, "getOperationKeysAtEpochs">;
15
+ }
16
+ /** @experimental */
17
+ export interface ReadStampedParticipantKeysParams {
18
+ vaultId: Hex;
19
+ /** The vault's on-chain record, as `VaultRegistryReader.getVaultData` returns it. */
20
+ vault: VaultData;
21
+ readers: StampedParticipantKeyReaders;
22
+ }
23
+ /**
24
+ * @throws When either stamped roster is empty, or key resolution fails
25
+ * (`resolveParticipantKeysAtEpochs`).
26
+ * @experimental
27
+ */
28
+ export declare function readStampedParticipantKeys(params: ReadStampedParticipantKeysParams): Promise<ParticipantKeySet>;
29
+ //# sourceMappingURL=readStampedParticipantKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readStampedParticipantKeys.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/readStampedParticipantKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,IAAI,CAClB,mBAAmB,EACnB,kCAAkC,GAAG,mBAAmB,CACzD,CAAC;IACF,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IACvE,yBAAyB,EAAE,IAAI,CAC7B,yBAAyB,EACzB,kCAAkC,CACnC,CAAC;IACF,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;CAC1E;AAED,oBAAoB;AACpB,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,GAAG,CAAC;IACb,qFAAqF;IACrF,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,4BAA4B,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAiD5B"}
@@ -27,7 +27,7 @@ export declare function resolveCurrentParticipantKeys(params: {
27
27
  * back to.
28
28
  */
29
29
  export declare function resolveParticipantKeysAtEpochs(params: {
30
- operationKeyReader: OperationKeyReader;
30
+ operationKeyReader: Pick<OperationKeyReader, "getOperationKeysAtEpochs">;
31
31
  query: OperationKeyQuery;
32
32
  epochs: KeyEpochs;
33
33
  }): Promise<ParticipantKeySet>;
@@ -1 +1 @@
1
- {"version":3,"file":"resolveParticipantKeys.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/resolveParticipantKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,SAAS,CAAC;AAmHjB;;;;;;;;;;;;GAYG;AACH,wBAAsB,6BAA6B,CAAC,MAAM,EAAE;IAC1D,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAM7B;AAED;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAC3D,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,SAAS,CAAC;CACnB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAS7B"}
1
+ {"version":3,"file":"resolveParticipantKeys.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/resolveParticipantKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EACV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,SAAS,CAAC;AAmHjB;;;;;;;;;;;;GAYG;AACH,wBAAsB,6BAA6B,CAAC,MAAM,EAAE;IAC1D,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAM7B;AAED;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAG3D,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;IACzE,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,SAAS,CAAC;CACnB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAS7B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f={1:"https://safe-transaction-mainnet.safe.global",11155111:"https://safe-transaction-sepolia.safe.global"},w=5e3,d=14400*1e3,T=1e4,h="/api/v1/multisig-transactions",p=404,A=500,m=2,_="0xef0100",R=20,g=_.length+m*R;function I(e){return e.length===g&&e.toLowerCase().startsWith(_)}async function F(e){const{publicClient:t,walletAddress:a,hash:r,confirmations:i,timeout:c,safePollTimeoutMs:l=d,safePollIntervalMs:u=w}=e,s=await t.getCode({address:a});if(!(s!==void 0&&s!=="0x"&&!I(s)))return t.waitForTransactionReceipt({hash:r,confirmations:i,timeout:c});const o=await t.getChainId(),n=await L({chainId:o,publicClient:t,safeTxHash:r,pollIntervalMs:u,timeoutMs:l});return n.kind==="not-a-proposal"?t.waitForTransactionReceipt({hash:r,confirmations:i,timeout:c}):t.waitForTransactionReceipt({hash:n.transactionHash,confirmations:i})}async function C(e,t){return await e.getTransaction({hash:t}).catch(()=>null)!==null}async function L({chainId:e,publicClient:t,safeTxHash:a,pollIntervalMs:r,timeoutMs:i}){const c=f[e];if(!c)throw new Error(`Safe Transaction Service not configured for chainId ${e}. Connected wallet appears to be a smart-contract account, but this chain is not in the supported list. Either connect an EOA or extend SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`);const l=`${c}${h}/${a}/`,u=Date.now()+i;for(;Date.now()<u;){const s=new AbortController,E=setTimeout(()=>s.abort(),T);let o;try{o=await fetch(l,{signal:s.signal})}catch(n){console.warn(`Safe Transaction Service request failed (will retry in ${r}ms): `+(n instanceof Error?n.message:String(n))),await S(r);continue}finally{clearTimeout(E)}if(o.ok){const n=await o.json();if(n.isExecuted){if(n.isSuccessful===!1)throw new Error(`Safe transaction ${a} was executed on chain but reverted. Check the Safe queue UI for details.`);if(n.transactionHash)return{kind:"executed",transactionHash:n.transactionHash}}}else if(o.status===p){if(await C(t,a))return console.warn(`${a} is a real transaction, not a Safe proposal — the connected wallet submits its own transactions despite reporting contract bytecode. Waiting for its receipt directly.`),{kind:"not-a-proposal"}}else if(o.status>=A)console.warn(`Safe Transaction Service returned ${o.status} for ${a}; retrying in ${r}ms.`);else throw new Error(`Safe Transaction Service returned ${o.status} for ${a}.`);await S(r)}throw new Error(`Timed out after ${i}ms waiting for Safe transaction ${a} to reach quorum and execute. The proposal is still pending in the Safe queue — co-signers must sign and execute it before the dApp can proceed.`)}function S(e){return new Promise(t=>{setTimeout(t,e)})}exports.waitForTransactionReceiptSmartAware=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f={1:"https://safe-transaction-mainnet.safe.global",11155111:"https://safe-transaction-sepolia.safe.global"},d=5e3,w=14400*1e3,T=1e4,h="/api/v1/multisig-transactions",p=404,A=500,m=2,_="0xef0100",R=20,g=_.length+m*R;function I(e){return e.length===g&&e.toLowerCase().startsWith(_)}async function F(e){const{publicClient:t,walletAddress:a,hash:i,confirmations:r,timeout:c,safePollTimeoutMs:l=w,safePollIntervalMs:u=d}=e,s=await t.getCode({address:a});if(!(s!==void 0&&s!=="0x"&&!I(s)))return t.waitForTransactionReceipt({hash:i,confirmations:r,timeout:c});const o=t.chain===void 0?await t.getChainId():t.chain.id,n=await L({chainId:o,publicClient:t,safeTxHash:i,pollIntervalMs:u,timeoutMs:l});return n.kind==="not-a-proposal"?t.waitForTransactionReceipt({hash:i,confirmations:r,timeout:c}):t.waitForTransactionReceipt({hash:n.transactionHash,confirmations:r})}async function C(e,t){return await e.getTransaction({hash:t}).catch(()=>null)!==null}async function L({chainId:e,publicClient:t,safeTxHash:a,pollIntervalMs:i,timeoutMs:r}){const c=f[e];if(!c)throw new Error(`Safe Transaction Service not configured for chainId ${e}. Connected wallet appears to be a smart-contract account, but this chain is not in the supported list. Either connect an EOA or extend SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`);const l=`${c}${h}/${a}/`,u=Date.now()+r;for(;Date.now()<u;){const s=new AbortController,E=setTimeout(()=>s.abort(),T);let o;try{o=await fetch(l,{signal:s.signal})}catch(n){console.warn(`Safe Transaction Service request failed (will retry in ${i}ms): `+(n instanceof Error?n.message:String(n))),await S(i);continue}finally{clearTimeout(E)}if(o.ok){const n=await o.json();if(n.isExecuted){if(n.isSuccessful===!1)throw new Error(`Safe transaction ${a} was executed on chain but reverted. Check the Safe queue UI for details.`);if(n.transactionHash)return{kind:"executed",transactionHash:n.transactionHash}}}else if(o.status===p){if(await C(t,a))return console.warn(`${a} is a real transaction, not a Safe proposal — the connected wallet submits its own transactions despite reporting contract bytecode. Waiting for its receipt directly.`),{kind:"not-a-proposal"}}else if(o.status>=A)console.warn(`Safe Transaction Service returned ${o.status} for ${a}; retrying in ${i}ms.`);else throw new Error(`Safe Transaction Service returned ${o.status} for ${a}.`);await S(i)}throw new Error(`Timed out after ${r}ms waiting for Safe transaction ${a} to reach quorum and execute. The proposal is still pending in the Safe queue — co-signers must sign and execute it before the dApp can proceed.`)}function S(e){return new Promise(t=>{setTimeout(t,e)})}exports.waitForTransactionReceiptSmartAware=F;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../src/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.ts"],"sourcesContent":["/**\n * Smart-account-aware wrapper around viem's `waitForTransactionReceipt`.\n *\n * Externally Owned Accounts (EOAs) — wallets controlled by a single private\n * key, e.g. MetaMask or a hardware wallet. `eth_sendTransaction` returns a real\n * Ethereum tx hash, which viem can poll directly. This wrapper delegates\n * unchanged for them.\n *\n * Smart-contract accounts (e.g. Safe multisigs) — the wallet address is a\n * deployed contract that decides whether to accept a transaction. WalletConnect's\n * `eth_sendTransaction` returns a `safeTxHash` (an EIP-712 hash of the\n * *proposal*) rather than a real tx hash, and the proposal is held in Safe's\n * off-chain Transaction Service until quorum signs and executes it. We poll\n * that service for the proposal until execution, then wait for receipt on the\n * real Ethereum tx hash exposed in the service's response.\n *\n * The two are told apart by `eth_getCode`, but NOT by \"empty vs non-empty\":\n * an EIP-7702 delegated EOA reports `0xef0100 ‖ <delegate address>` and is\n * still an EOA — it signs and submits its own transactions, so\n * `eth_sendTransaction` returns a real tx hash. MetaMask upgrades accounts to\n * smart accounts this way by default, and treating one as a Safe means polling\n * the Transaction Service for a hash that is not a `safeTxHash`: a permanent\n * 404 that reads as \"proposal not yet indexed\" and hangs for the full poll\n * budget on a transaction that already succeeded. Delegation designators are\n * therefore classified as EOAs. As a backstop for any wallet that behaves this\n * way in future, a 404 from the Transaction Service is also checked against the\n * node: if it knows the hash as a real transaction, we were never waiting on a\n * proposal and switch to waiting for that transaction's receipt.\n *\n * @module utils/eth\n */\n\nimport type { Address, Hash, PublicClient, TransactionReceipt } from \"viem\";\n\n/**\n * Chains where the Safe Transaction Service is supported by this utility.\n * Extend the map as more Safe-enabled chains are needed.\n */\nconst SAFE_TX_SERVICE_BASE_URLS: Record<number, string> = {\n 1: \"https://safe-transaction-mainnet.safe.global\",\n 11155111: \"https://safe-transaction-sepolia.safe.global\",\n};\n\nconst DEFAULT_SAFE_POLL_INTERVAL_MS = 5_000;\nconst DEFAULT_SAFE_POLL_TIMEOUT_MS = 4 * 60 * 60 * 1_000;\nconst SAFE_TX_SERVICE_FETCH_TIMEOUT_MS = 10_000;\n\n/** Safe Transaction Service route for one multisig-transaction proposal. */\nconst SAFE_MULTISIG_TX_PATH = \"/api/v1/multisig-transactions\";\n/** The service answers 404 both for an unindexed proposal and an unknown Safe. */\nconst SAFE_TX_SERVICE_NOT_FOUND = 404;\n/** Statuses at or above this are server-side, so worth retrying. */\nconst SAFE_TX_SERVICE_SERVER_ERROR = 500;\n\n/** Two hex characters encode one byte in an `eth_getCode` result. */\nconst HEX_CHARS_PER_BYTE = 2;\n\n/**\n * EIP-7702 delegation designator: an EOA that has delegated its code to a\n * contract reports exactly `0xef0100 ‖ <20-byte delegate address>` from\n * `eth_getCode` (EIP-7702 §\"Delegation Designation\"). Both the prefix and the\n * exact length are checked so ordinary contract bytecode that merely happens to\n * start with these bytes is not mistaken for a delegation.\n */\nconst EIP_7702_DELEGATION_PREFIX = \"0xef0100\";\nconst EIP_7702_DELEGATION_ADDRESS_BYTES = 20;\nconst EIP_7702_DELEGATION_CODE_LENGTH =\n EIP_7702_DELEGATION_PREFIX.length +\n HEX_CHARS_PER_BYTE * EIP_7702_DELEGATION_ADDRESS_BYTES;\n\n/**\n * True when `eth_getCode` reports an EIP-7702 delegation designator rather than\n * a deployed contract. Such an account is still an EOA for our purposes: it\n * signs and submits its own transactions, so the hash we hold is a real tx hash.\n */\nfunction isEip7702DelegatedEoa(code: string): boolean {\n return (\n code.length === EIP_7702_DELEGATION_CODE_LENGTH &&\n code.toLowerCase().startsWith(EIP_7702_DELEGATION_PREFIX)\n );\n}\n\nexport interface WaitForTransactionReceiptSmartAwareParams {\n publicClient: PublicClient;\n walletAddress: Address;\n hash: Hash;\n /**\n * Forwarded to viem verbatim.\n *\n * MUST NOT be used as a finality/reorg gate. viem fetches the receipt once\n * and then only compares block numbers against that cached copy — it never\n * re-checks that the receipt's block is still canonical, so it resolves\n * happily for a transaction that has been reorged out. Setting this buys a\n * delay, not a guarantee. For peg-in registration finality use\n * `waitForPeginRegistrationDepth`, which re-reads live contract state on\n * every poll.\n */\n confirmations?: number;\n /**\n * Forwarded to viem on the EOA (externally owned account) path, and on the\n * fallback where a supposed smart account turns out to submit its own\n * transactions — that is the EOA case too, however we arrived at it.\n *\n * Ignored only while waiting on a genuine Safe proposal, whose budget is\n * safePollTimeoutMs. It is not forwarded to the receipt wait that follows a\n * proposal's execution either: viem's own default applies there (180s as of\n * viem 2.38.2), so that wait is bounded too — a sufficiently slow node still\n * raises WaitForTransactionReceiptTimeoutError, just on viem's uniform bound\n * rather than on a caller's shorter one.\n */\n timeout?: number;\n /** Total budget for waiting on Safe quorum + execution. Default 4h. */\n safePollTimeoutMs?: number;\n /** Poll cadence against the Safe Transaction Service. Default 5s. */\n safePollIntervalMs?: number;\n}\n\nexport async function waitForTransactionReceiptSmartAware(\n params: WaitForTransactionReceiptSmartAwareParams,\n): Promise<TransactionReceipt> {\n const {\n publicClient,\n walletAddress,\n hash,\n confirmations,\n timeout,\n safePollTimeoutMs = DEFAULT_SAFE_POLL_TIMEOUT_MS,\n safePollIntervalMs = DEFAULT_SAFE_POLL_INTERVAL_MS,\n } = params;\n\n const code = await publicClient.getCode({ address: walletAddress });\n // An EIP-7702 delegated EOA has non-empty code but still submits its own\n // transactions, so it belongs on the EOA path — see the module docblock.\n const isSmartAccount =\n code !== undefined && code !== \"0x\" && !isEip7702DelegatedEoa(code);\n\n if (!isSmartAccount) {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n const chainId = await publicClient.getChainId();\n const outcome = await pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash: hash,\n pollIntervalMs: safePollIntervalMs,\n timeoutMs: safePollTimeoutMs,\n });\n\n // The wallet turned out to submit its own transactions, so this is the EOA\n // case after all — including the caller's `timeout`, which only ever meant to\n // be ignored while waiting on a genuine Safe proposal.\n if (outcome.kind === \"not-a-proposal\") {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n return publicClient.waitForTransactionReceipt({\n hash: outcome.transactionHash,\n confirmations,\n });\n}\n\n/**\n * How the Safe path ended. The two outcomes are not interchangeable, so they are\n * distinguished rather than both collapsing to a bare hash: `executed` is a real\n * Safe proposal that reached quorum, while `not-a-proposal` means the wallet was\n * never a Safe and we are really on the EOA path — which decides whether the\n * caller's `timeout` applies to the receipt wait that follows.\n */\ntype SafePollOutcome =\n | { kind: \"executed\"; transactionHash: Hash }\n | { kind: \"not-a-proposal\" };\n\ninterface SafeMultisigTransaction {\n isExecuted: boolean;\n isSuccessful: boolean | null;\n transactionHash: Hash | null;\n}\n\n/**\n * Decide whether a 404 from the Transaction Service means \"proposal not indexed\n * yet\" or \"this hash was never a proposal at all\".\n *\n * The Safe indexer cannot answer that: a genuine Safe and its freshly-submitted\n * proposal are both absent from it for a while, so its 404 proves nothing. The\n * NODE can. A `safeTxHash` is an EIP-712 digest of a proposal and is never a\n * transaction on chain, so if the node knows the hash as a real transaction then\n * this was never a proposal and we are on the wrong path entirely.\n *\n * Returns true only on that positive identification. Anything else — the node\n * has not seen it yet, or the lookup fails — is inconclusive and leaves the\n * caller polling, which is the correct behaviour for a Safe that is simply\n * still being indexed.\n */\nasync function hashIsRealTransaction(\n publicClient: PublicClient,\n hash: Hash,\n): Promise<boolean> {\n const transaction = await publicClient\n .getTransaction({ hash })\n .catch(() => null);\n return transaction !== null;\n}\n\nasync function pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash,\n pollIntervalMs,\n timeoutMs,\n}: {\n chainId: number;\n publicClient: PublicClient;\n safeTxHash: Hash;\n pollIntervalMs: number;\n timeoutMs: number;\n}): Promise<SafePollOutcome> {\n const baseUrl = SAFE_TX_SERVICE_BASE_URLS[chainId];\n if (!baseUrl) {\n throw new Error(\n `Safe Transaction Service not configured for chainId ${chainId}. ` +\n `Connected wallet appears to be a smart-contract account, but this ` +\n `chain is not in the supported list. Either connect an EOA or extend ` +\n `SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`,\n );\n }\n\n const url = `${baseUrl}${SAFE_MULTISIG_TX_PATH}/${safeTxHash}/`;\n const deadline = Date.now() + timeoutMs;\n\n while (Date.now() < deadline) {\n const controller = new AbortController();\n const fetchTimeoutId = setTimeout(\n () => controller.abort(),\n SAFE_TX_SERVICE_FETCH_TIMEOUT_MS,\n );\n\n let response: Response;\n try {\n response = await fetch(url, { signal: controller.signal });\n } catch (err) {\n // Transient failure (AbortError on per-request timeout, DNS hiccup,\n // connection reset, etc.). Log and continue to the next poll iteration\n // instead of consuming the entire safePollTimeoutMs budget on one blip.\n // The outer `while (Date.now() < deadline)` is what enforces the overall\n // budget; this catch deliberately preserves it.\n console.warn(\n `Safe Transaction Service request failed (will retry in ${pollIntervalMs}ms): ` +\n (err instanceof Error ? err.message : String(err)),\n );\n await sleep(pollIntervalMs);\n continue;\n } finally {\n clearTimeout(fetchTimeoutId);\n }\n\n if (response.ok) {\n const data = (await response.json()) as SafeMultisigTransaction;\n if (data.isExecuted) {\n if (data.isSuccessful === false) {\n throw new Error(\n `Safe transaction ${safeTxHash} was executed on chain but reverted. ` +\n `Check the Safe queue UI for details.`,\n );\n }\n if (data.transactionHash) {\n return { kind: \"executed\", transactionHash: data.transactionHash };\n }\n }\n } else if (response.status === SAFE_TX_SERVICE_NOT_FOUND) {\n // Usually \"proposal not indexed yet\", so keep polling. But the very same\n // 404 appears when the hash is not a safeTxHash at all — the case that\n // used to burn the whole budget on an already-mined transaction. Ask the\n // node: if it knows this hash, it is a real transaction, so stop treating\n // it as a proposal and let the caller wait on it directly.\n if (await hashIsRealTransaction(publicClient, safeTxHash)) {\n console.warn(\n `${safeTxHash} is a real transaction, not a Safe proposal — the ` +\n `connected wallet submits its own transactions despite reporting ` +\n `contract bytecode. Waiting for its receipt directly.`,\n );\n return { kind: \"not-a-proposal\" };\n }\n } else if (response.status >= SAFE_TX_SERVICE_SERVER_ERROR) {\n // Transient server error — same treatment as a hung connection: log and retry.\n console.warn(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}; retrying in ${pollIntervalMs}ms.`,\n );\n } else {\n // Other 4xx (403, 410, etc.) is likely permanent — surface immediately.\n throw new Error(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}.`,\n );\n }\n\n await sleep(pollIntervalMs);\n }\n\n throw new Error(\n `Timed out after ${timeoutMs}ms waiting for Safe transaction ${safeTxHash} ` +\n `to reach quorum and execute. The proposal is still pending in the Safe ` +\n `queue — co-signers must sign and execute it before the dApp can proceed.`,\n );\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n"],"names":["SAFE_TX_SERVICE_BASE_URLS","DEFAULT_SAFE_POLL_INTERVAL_MS","DEFAULT_SAFE_POLL_TIMEOUT_MS","SAFE_TX_SERVICE_FETCH_TIMEOUT_MS","SAFE_MULTISIG_TX_PATH","SAFE_TX_SERVICE_NOT_FOUND","SAFE_TX_SERVICE_SERVER_ERROR","HEX_CHARS_PER_BYTE","EIP_7702_DELEGATION_PREFIX","EIP_7702_DELEGATION_ADDRESS_BYTES","EIP_7702_DELEGATION_CODE_LENGTH","isEip7702DelegatedEoa","code","waitForTransactionReceiptSmartAware","params","publicClient","walletAddress","hash","confirmations","timeout","safePollTimeoutMs","safePollIntervalMs","chainId","outcome","pollSafeTransactionServiceUntilExecuted","hashIsRealTransaction","safeTxHash","pollIntervalMs","timeoutMs","baseUrl","url","deadline","controller","fetchTimeoutId","response","err","sleep","data","ms","resolve"],"mappings":"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"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../src/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.ts"],"sourcesContent":["/**\n * Smart-account-aware wrapper around viem's `waitForTransactionReceipt`.\n *\n * Externally Owned Accounts (EOAs) — wallets controlled by a single private\n * key, e.g. MetaMask or a hardware wallet. `eth_sendTransaction` returns a real\n * Ethereum tx hash, which viem can poll directly. This wrapper delegates\n * unchanged for them.\n *\n * Smart-contract accounts (e.g. Safe multisigs) — the wallet address is a\n * deployed contract that decides whether to accept a transaction. WalletConnect's\n * `eth_sendTransaction` returns a `safeTxHash` (an EIP-712 hash of the\n * *proposal*) rather than a real tx hash, and the proposal is held in Safe's\n * off-chain Transaction Service until quorum signs and executes it. We poll\n * that service for the proposal until execution, then wait for receipt on the\n * real Ethereum tx hash exposed in the service's response.\n *\n * The two are told apart by `eth_getCode`, but NOT by \"empty vs non-empty\":\n * an EIP-7702 delegated EOA reports `0xef0100 ‖ <delegate address>` and is\n * still an EOA — it signs and submits its own transactions, so\n * `eth_sendTransaction` returns a real tx hash. MetaMask upgrades accounts to\n * smart accounts this way by default, and treating one as a Safe means polling\n * the Transaction Service for a hash that is not a `safeTxHash`: a permanent\n * 404 that reads as \"proposal not yet indexed\" and hangs for the full poll\n * budget on a transaction that already succeeded. Delegation designators are\n * therefore classified as EOAs. As a backstop for any wallet that behaves this\n * way in future, a 404 from the Transaction Service is also checked against the\n * node: if it knows the hash as a real transaction, we were never waiting on a\n * proposal and switch to waiting for that transaction's receipt.\n *\n * @module utils/eth\n */\n\nimport type { Address, Hash, PublicClient, TransactionReceipt } from \"viem\";\n\n/**\n * Chains where the Safe Transaction Service is supported by this utility.\n * Extend the map as more Safe-enabled chains are needed.\n */\nconst SAFE_TX_SERVICE_BASE_URLS: Record<number, string> = {\n 1: \"https://safe-transaction-mainnet.safe.global\",\n 11155111: \"https://safe-transaction-sepolia.safe.global\",\n};\n\nconst DEFAULT_SAFE_POLL_INTERVAL_MS = 5_000;\nconst DEFAULT_SAFE_POLL_TIMEOUT_MS = 4 * 60 * 60 * 1_000;\nconst SAFE_TX_SERVICE_FETCH_TIMEOUT_MS = 10_000;\n\n/** Safe Transaction Service route for one multisig-transaction proposal. */\nconst SAFE_MULTISIG_TX_PATH = \"/api/v1/multisig-transactions\";\n/** The service answers 404 both for an unindexed proposal and an unknown Safe. */\nconst SAFE_TX_SERVICE_NOT_FOUND = 404;\n/** Statuses at or above this are server-side, so worth retrying. */\nconst SAFE_TX_SERVICE_SERVER_ERROR = 500;\n\n/** Two hex characters encode one byte in an `eth_getCode` result. */\nconst HEX_CHARS_PER_BYTE = 2;\n\n/**\n * EIP-7702 delegation designator: an EOA that has delegated its code to a\n * contract reports exactly `0xef0100 ‖ <20-byte delegate address>` from\n * `eth_getCode` (EIP-7702 §\"Delegation Designation\"). Both the prefix and the\n * exact length are checked so ordinary contract bytecode that merely happens to\n * start with these bytes is not mistaken for a delegation.\n */\nconst EIP_7702_DELEGATION_PREFIX = \"0xef0100\";\nconst EIP_7702_DELEGATION_ADDRESS_BYTES = 20;\nconst EIP_7702_DELEGATION_CODE_LENGTH =\n EIP_7702_DELEGATION_PREFIX.length +\n HEX_CHARS_PER_BYTE * EIP_7702_DELEGATION_ADDRESS_BYTES;\n\n/**\n * True when `eth_getCode` reports an EIP-7702 delegation designator rather than\n * a deployed contract. Such an account is still an EOA for our purposes: it\n * signs and submits its own transactions, so the hash we hold is a real tx hash.\n */\nfunction isEip7702DelegatedEoa(code: string): boolean {\n return (\n code.length === EIP_7702_DELEGATION_CODE_LENGTH &&\n code.toLowerCase().startsWith(EIP_7702_DELEGATION_PREFIX)\n );\n}\n\nexport interface WaitForTransactionReceiptSmartAwareParams {\n publicClient: PublicClient;\n walletAddress: Address;\n hash: Hash;\n /**\n * Forwarded to viem verbatim.\n *\n * MUST NOT be used as a finality/reorg gate. viem fetches the receipt once\n * and then only compares block numbers against that cached copy — it never\n * re-checks that the receipt's block is still canonical, so it resolves\n * happily for a transaction that has been reorged out. Setting this buys a\n * delay, not a guarantee. For peg-in registration finality use\n * `waitForPeginRegistrationDepth`, which re-reads live contract state on\n * every poll.\n */\n confirmations?: number;\n /**\n * Forwarded to viem on the EOA (externally owned account) path, and on the\n * fallback where a supposed smart account turns out to submit its own\n * transactions — that is the EOA case too, however we arrived at it.\n *\n * Ignored only while waiting on a genuine Safe proposal, whose budget is\n * safePollTimeoutMs. It is not forwarded to the receipt wait that follows a\n * proposal's execution either: viem's own default applies there (180s as of\n * viem 2.38.2), so that wait is bounded too — a sufficiently slow node still\n * raises WaitForTransactionReceiptTimeoutError, just on viem's uniform bound\n * rather than on a caller's shorter one.\n */\n timeout?: number;\n /** Total budget for waiting on Safe quorum + execution. Default 4h. */\n safePollTimeoutMs?: number;\n /** Poll cadence against the Safe Transaction Service. Default 5s. */\n safePollIntervalMs?: number;\n}\n\nexport async function waitForTransactionReceiptSmartAware(\n params: WaitForTransactionReceiptSmartAwareParams,\n): Promise<TransactionReceipt> {\n const {\n publicClient,\n walletAddress,\n hash,\n confirmations,\n timeout,\n safePollTimeoutMs = DEFAULT_SAFE_POLL_TIMEOUT_MS,\n safePollIntervalMs = DEFAULT_SAFE_POLL_INTERVAL_MS,\n } = params;\n\n const code = await publicClient.getCode({ address: walletAddress });\n // An EIP-7702 delegated EOA has non-empty code but still submits its own\n // transactions, so it belongs on the EOA path — see the module docblock.\n const isSmartAccount =\n code !== undefined && code !== \"0x\" && !isEip7702DelegatedEoa(code);\n\n if (!isSmartAccount) {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n const chainId =\n publicClient.chain === undefined\n ? await publicClient.getChainId()\n : publicClient.chain.id;\n const outcome = await pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash: hash,\n pollIntervalMs: safePollIntervalMs,\n timeoutMs: safePollTimeoutMs,\n });\n\n // The wallet turned out to submit its own transactions, so this is the EOA\n // case after all — including the caller's `timeout`, which only ever meant to\n // be ignored while waiting on a genuine Safe proposal.\n if (outcome.kind === \"not-a-proposal\") {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n return publicClient.waitForTransactionReceipt({\n hash: outcome.transactionHash,\n confirmations,\n });\n}\n\n/**\n * How the Safe path ended. The two outcomes are not interchangeable, so they are\n * distinguished rather than both collapsing to a bare hash: `executed` is a real\n * Safe proposal that reached quorum, while `not-a-proposal` means the wallet was\n * never a Safe and we are really on the EOA path — which decides whether the\n * caller's `timeout` applies to the receipt wait that follows.\n */\ntype SafePollOutcome =\n | { kind: \"executed\"; transactionHash: Hash }\n | { kind: \"not-a-proposal\" };\n\ninterface SafeMultisigTransaction {\n isExecuted: boolean;\n isSuccessful: boolean | null;\n transactionHash: Hash | null;\n}\n\n/**\n * Decide whether a 404 from the Transaction Service means \"proposal not indexed\n * yet\" or \"this hash was never a proposal at all\".\n *\n * The Safe indexer cannot answer that: a genuine Safe and its freshly-submitted\n * proposal are both absent from it for a while, so its 404 proves nothing. The\n * NODE can. A `safeTxHash` is an EIP-712 digest of a proposal and is never a\n * transaction on chain, so if the node knows the hash as a real transaction then\n * this was never a proposal and we are on the wrong path entirely.\n *\n * Returns true only on that positive identification. Anything else — the node\n * has not seen it yet, or the lookup fails — is inconclusive and leaves the\n * caller polling, which is the correct behaviour for a Safe that is simply\n * still being indexed.\n */\nasync function hashIsRealTransaction(\n publicClient: PublicClient,\n hash: Hash,\n): Promise<boolean> {\n const transaction = await publicClient\n .getTransaction({ hash })\n .catch(() => null);\n return transaction !== null;\n}\n\nasync function pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash,\n pollIntervalMs,\n timeoutMs,\n}: {\n chainId: number;\n publicClient: PublicClient;\n safeTxHash: Hash;\n pollIntervalMs: number;\n timeoutMs: number;\n}): Promise<SafePollOutcome> {\n const baseUrl = SAFE_TX_SERVICE_BASE_URLS[chainId];\n if (!baseUrl) {\n throw new Error(\n `Safe Transaction Service not configured for chainId ${chainId}. ` +\n `Connected wallet appears to be a smart-contract account, but this ` +\n `chain is not in the supported list. Either connect an EOA or extend ` +\n `SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`,\n );\n }\n\n const url = `${baseUrl}${SAFE_MULTISIG_TX_PATH}/${safeTxHash}/`;\n const deadline = Date.now() + timeoutMs;\n\n while (Date.now() < deadline) {\n const controller = new AbortController();\n const fetchTimeoutId = setTimeout(\n () => controller.abort(),\n SAFE_TX_SERVICE_FETCH_TIMEOUT_MS,\n );\n\n let response: Response;\n try {\n response = await fetch(url, { signal: controller.signal });\n } catch (err) {\n // Transient failure (AbortError on per-request timeout, DNS hiccup,\n // connection reset, etc.). Log and continue to the next poll iteration\n // instead of consuming the entire safePollTimeoutMs budget on one blip.\n // The outer `while (Date.now() < deadline)` is what enforces the overall\n // budget; this catch deliberately preserves it.\n console.warn(\n `Safe Transaction Service request failed (will retry in ${pollIntervalMs}ms): ` +\n (err instanceof Error ? err.message : String(err)),\n );\n await sleep(pollIntervalMs);\n continue;\n } finally {\n clearTimeout(fetchTimeoutId);\n }\n\n if (response.ok) {\n const data = (await response.json()) as SafeMultisigTransaction;\n if (data.isExecuted) {\n if (data.isSuccessful === false) {\n throw new Error(\n `Safe transaction ${safeTxHash} was executed on chain but reverted. ` +\n `Check the Safe queue UI for details.`,\n );\n }\n if (data.transactionHash) {\n return { kind: \"executed\", transactionHash: data.transactionHash };\n }\n }\n } else if (response.status === SAFE_TX_SERVICE_NOT_FOUND) {\n // Usually \"proposal not indexed yet\", so keep polling. But the very same\n // 404 appears when the hash is not a safeTxHash at all — the case that\n // used to burn the whole budget on an already-mined transaction. Ask the\n // node: if it knows this hash, it is a real transaction, so stop treating\n // it as a proposal and let the caller wait on it directly.\n if (await hashIsRealTransaction(publicClient, safeTxHash)) {\n console.warn(\n `${safeTxHash} is a real transaction, not a Safe proposal — the ` +\n `connected wallet submits its own transactions despite reporting ` +\n `contract bytecode. Waiting for its receipt directly.`,\n );\n return { kind: \"not-a-proposal\" };\n }\n } else if (response.status >= SAFE_TX_SERVICE_SERVER_ERROR) {\n // Transient server error — same treatment as a hung connection: log and retry.\n console.warn(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}; retrying in ${pollIntervalMs}ms.`,\n );\n } else {\n // Other 4xx (403, 410, etc.) is likely permanent — surface immediately.\n throw new Error(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}.`,\n );\n }\n\n await sleep(pollIntervalMs);\n }\n\n throw new Error(\n `Timed out after ${timeoutMs}ms waiting for Safe transaction ${safeTxHash} ` +\n `to reach quorum and execute. The proposal is still pending in the Safe ` +\n `queue — co-signers must sign and execute it before the dApp can proceed.`,\n );\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n"],"names":["SAFE_TX_SERVICE_BASE_URLS","DEFAULT_SAFE_POLL_INTERVAL_MS","DEFAULT_SAFE_POLL_TIMEOUT_MS","SAFE_TX_SERVICE_FETCH_TIMEOUT_MS","SAFE_MULTISIG_TX_PATH","SAFE_TX_SERVICE_NOT_FOUND","SAFE_TX_SERVICE_SERVER_ERROR","HEX_CHARS_PER_BYTE","EIP_7702_DELEGATION_PREFIX","EIP_7702_DELEGATION_ADDRESS_BYTES","EIP_7702_DELEGATION_CODE_LENGTH","isEip7702DelegatedEoa","code","waitForTransactionReceiptSmartAware","params","publicClient","walletAddress","hash","confirmations","timeout","safePollTimeoutMs","safePollIntervalMs","chainId","outcome","pollSafeTransactionServiceUntilExecuted","hashIsRealTransaction","safeTxHash","pollIntervalMs","timeoutMs","baseUrl","url","deadline","controller","fetchTimeoutId","response","err","sleep","data","ms","resolve"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  const f = {
2
2
  1: "https://safe-transaction-mainnet.safe.global",
3
3
  11155111: "https://safe-transaction-sepolia.safe.global"
4
- }, w = 5e3, d = 14400 * 1e3, T = 1e4, h = "/api/v1/multisig-transactions", p = 404, A = 500, m = 2, _ = "0xef0100", R = 20, g = _.length + m * R;
4
+ }, d = 5e3, w = 14400 * 1e3, T = 1e4, h = "/api/v1/multisig-transactions", p = 404, A = 500, m = 2, _ = "0xef0100", R = 20, g = _.length + m * R;
5
5
  function I(e) {
6
6
  return e.length === g && e.toLowerCase().startsWith(_);
7
7
  }
@@ -9,32 +9,32 @@ async function L(e) {
9
9
  const {
10
10
  publicClient: t,
11
11
  walletAddress: a,
12
- hash: r,
13
- confirmations: i,
12
+ hash: i,
13
+ confirmations: r,
14
14
  timeout: c,
15
- safePollTimeoutMs: l = d,
16
- safePollIntervalMs: u = w
15
+ safePollTimeoutMs: l = w,
16
+ safePollIntervalMs: u = d
17
17
  } = e, s = await t.getCode({ address: a });
18
18
  if (!(s !== void 0 && s !== "0x" && !I(s)))
19
19
  return t.waitForTransactionReceipt({
20
- hash: r,
21
- confirmations: i,
20
+ hash: i,
21
+ confirmations: r,
22
22
  timeout: c
23
23
  });
24
- const o = await t.getChainId(), n = await C({
24
+ const o = t.chain === void 0 ? await t.getChainId() : t.chain.id, n = await C({
25
25
  chainId: o,
26
26
  publicClient: t,
27
- safeTxHash: r,
27
+ safeTxHash: i,
28
28
  pollIntervalMs: u,
29
29
  timeoutMs: l
30
30
  });
31
31
  return n.kind === "not-a-proposal" ? t.waitForTransactionReceipt({
32
- hash: r,
33
- confirmations: i,
32
+ hash: i,
33
+ confirmations: r,
34
34
  timeout: c
35
35
  }) : t.waitForTransactionReceipt({
36
36
  hash: n.transactionHash,
37
- confirmations: i
37
+ confirmations: r
38
38
  });
39
39
  }
40
40
  async function F(e, t) {
@@ -44,15 +44,15 @@ async function C({
44
44
  chainId: e,
45
45
  publicClient: t,
46
46
  safeTxHash: a,
47
- pollIntervalMs: r,
48
- timeoutMs: i
47
+ pollIntervalMs: i,
48
+ timeoutMs: r
49
49
  }) {
50
50
  const c = f[e];
51
51
  if (!c)
52
52
  throw new Error(
53
53
  `Safe Transaction Service not configured for chainId ${e}. Connected wallet appears to be a smart-contract account, but this chain is not in the supported list. Either connect an EOA or extend SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`
54
54
  );
55
- const l = `${c}${h}/${a}/`, u = Date.now() + i;
55
+ const l = `${c}${h}/${a}/`, u = Date.now() + r;
56
56
  for (; Date.now() < u; ) {
57
57
  const s = new AbortController(), E = setTimeout(
58
58
  () => s.abort(),
@@ -63,8 +63,8 @@ async function C({
63
63
  o = await fetch(l, { signal: s.signal });
64
64
  } catch (n) {
65
65
  console.warn(
66
- `Safe Transaction Service request failed (will retry in ${r}ms): ` + (n instanceof Error ? n.message : String(n))
67
- ), await S(r);
66
+ `Safe Transaction Service request failed (will retry in ${i}ms): ` + (n instanceof Error ? n.message : String(n))
67
+ ), await S(i);
68
68
  continue;
69
69
  } finally {
70
70
  clearTimeout(E);
@@ -86,16 +86,16 @@ async function C({
86
86
  ), { kind: "not-a-proposal" };
87
87
  } else if (o.status >= A)
88
88
  console.warn(
89
- `Safe Transaction Service returned ${o.status} for ${a}; retrying in ${r}ms.`
89
+ `Safe Transaction Service returned ${o.status} for ${a}; retrying in ${i}ms.`
90
90
  );
91
91
  else
92
92
  throw new Error(
93
93
  `Safe Transaction Service returned ${o.status} for ${a}.`
94
94
  );
95
- await S(r);
95
+ await S(i);
96
96
  }
97
97
  throw new Error(
98
- `Timed out after ${i}ms waiting for Safe transaction ${a} to reach quorum and execute. The proposal is still pending in the Safe queue — co-signers must sign and execute it before the dApp can proceed.`
98
+ `Timed out after ${r}ms waiting for Safe transaction ${a} to reach quorum and execute. The proposal is still pending in the Safe queue — co-signers must sign and execute it before the dApp can proceed.`
99
99
  );
100
100
  }
101
101
  function S(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.ts"],"sourcesContent":["/**\n * Smart-account-aware wrapper around viem's `waitForTransactionReceipt`.\n *\n * Externally Owned Accounts (EOAs) — wallets controlled by a single private\n * key, e.g. MetaMask or a hardware wallet. `eth_sendTransaction` returns a real\n * Ethereum tx hash, which viem can poll directly. This wrapper delegates\n * unchanged for them.\n *\n * Smart-contract accounts (e.g. Safe multisigs) — the wallet address is a\n * deployed contract that decides whether to accept a transaction. WalletConnect's\n * `eth_sendTransaction` returns a `safeTxHash` (an EIP-712 hash of the\n * *proposal*) rather than a real tx hash, and the proposal is held in Safe's\n * off-chain Transaction Service until quorum signs and executes it. We poll\n * that service for the proposal until execution, then wait for receipt on the\n * real Ethereum tx hash exposed in the service's response.\n *\n * The two are told apart by `eth_getCode`, but NOT by \"empty vs non-empty\":\n * an EIP-7702 delegated EOA reports `0xef0100 ‖ <delegate address>` and is\n * still an EOA — it signs and submits its own transactions, so\n * `eth_sendTransaction` returns a real tx hash. MetaMask upgrades accounts to\n * smart accounts this way by default, and treating one as a Safe means polling\n * the Transaction Service for a hash that is not a `safeTxHash`: a permanent\n * 404 that reads as \"proposal not yet indexed\" and hangs for the full poll\n * budget on a transaction that already succeeded. Delegation designators are\n * therefore classified as EOAs. As a backstop for any wallet that behaves this\n * way in future, a 404 from the Transaction Service is also checked against the\n * node: if it knows the hash as a real transaction, we were never waiting on a\n * proposal and switch to waiting for that transaction's receipt.\n *\n * @module utils/eth\n */\n\nimport type { Address, Hash, PublicClient, TransactionReceipt } from \"viem\";\n\n/**\n * Chains where the Safe Transaction Service is supported by this utility.\n * Extend the map as more Safe-enabled chains are needed.\n */\nconst SAFE_TX_SERVICE_BASE_URLS: Record<number, string> = {\n 1: \"https://safe-transaction-mainnet.safe.global\",\n 11155111: \"https://safe-transaction-sepolia.safe.global\",\n};\n\nconst DEFAULT_SAFE_POLL_INTERVAL_MS = 5_000;\nconst DEFAULT_SAFE_POLL_TIMEOUT_MS = 4 * 60 * 60 * 1_000;\nconst SAFE_TX_SERVICE_FETCH_TIMEOUT_MS = 10_000;\n\n/** Safe Transaction Service route for one multisig-transaction proposal. */\nconst SAFE_MULTISIG_TX_PATH = \"/api/v1/multisig-transactions\";\n/** The service answers 404 both for an unindexed proposal and an unknown Safe. */\nconst SAFE_TX_SERVICE_NOT_FOUND = 404;\n/** Statuses at or above this are server-side, so worth retrying. */\nconst SAFE_TX_SERVICE_SERVER_ERROR = 500;\n\n/** Two hex characters encode one byte in an `eth_getCode` result. */\nconst HEX_CHARS_PER_BYTE = 2;\n\n/**\n * EIP-7702 delegation designator: an EOA that has delegated its code to a\n * contract reports exactly `0xef0100 ‖ <20-byte delegate address>` from\n * `eth_getCode` (EIP-7702 §\"Delegation Designation\"). Both the prefix and the\n * exact length are checked so ordinary contract bytecode that merely happens to\n * start with these bytes is not mistaken for a delegation.\n */\nconst EIP_7702_DELEGATION_PREFIX = \"0xef0100\";\nconst EIP_7702_DELEGATION_ADDRESS_BYTES = 20;\nconst EIP_7702_DELEGATION_CODE_LENGTH =\n EIP_7702_DELEGATION_PREFIX.length +\n HEX_CHARS_PER_BYTE * EIP_7702_DELEGATION_ADDRESS_BYTES;\n\n/**\n * True when `eth_getCode` reports an EIP-7702 delegation designator rather than\n * a deployed contract. Such an account is still an EOA for our purposes: it\n * signs and submits its own transactions, so the hash we hold is a real tx hash.\n */\nfunction isEip7702DelegatedEoa(code: string): boolean {\n return (\n code.length === EIP_7702_DELEGATION_CODE_LENGTH &&\n code.toLowerCase().startsWith(EIP_7702_DELEGATION_PREFIX)\n );\n}\n\nexport interface WaitForTransactionReceiptSmartAwareParams {\n publicClient: PublicClient;\n walletAddress: Address;\n hash: Hash;\n /**\n * Forwarded to viem verbatim.\n *\n * MUST NOT be used as a finality/reorg gate. viem fetches the receipt once\n * and then only compares block numbers against that cached copy — it never\n * re-checks that the receipt's block is still canonical, so it resolves\n * happily for a transaction that has been reorged out. Setting this buys a\n * delay, not a guarantee. For peg-in registration finality use\n * `waitForPeginRegistrationDepth`, which re-reads live contract state on\n * every poll.\n */\n confirmations?: number;\n /**\n * Forwarded to viem on the EOA (externally owned account) path, and on the\n * fallback where a supposed smart account turns out to submit its own\n * transactions — that is the EOA case too, however we arrived at it.\n *\n * Ignored only while waiting on a genuine Safe proposal, whose budget is\n * safePollTimeoutMs. It is not forwarded to the receipt wait that follows a\n * proposal's execution either: viem's own default applies there (180s as of\n * viem 2.38.2), so that wait is bounded too — a sufficiently slow node still\n * raises WaitForTransactionReceiptTimeoutError, just on viem's uniform bound\n * rather than on a caller's shorter one.\n */\n timeout?: number;\n /** Total budget for waiting on Safe quorum + execution. Default 4h. */\n safePollTimeoutMs?: number;\n /** Poll cadence against the Safe Transaction Service. Default 5s. */\n safePollIntervalMs?: number;\n}\n\nexport async function waitForTransactionReceiptSmartAware(\n params: WaitForTransactionReceiptSmartAwareParams,\n): Promise<TransactionReceipt> {\n const {\n publicClient,\n walletAddress,\n hash,\n confirmations,\n timeout,\n safePollTimeoutMs = DEFAULT_SAFE_POLL_TIMEOUT_MS,\n safePollIntervalMs = DEFAULT_SAFE_POLL_INTERVAL_MS,\n } = params;\n\n const code = await publicClient.getCode({ address: walletAddress });\n // An EIP-7702 delegated EOA has non-empty code but still submits its own\n // transactions, so it belongs on the EOA path — see the module docblock.\n const isSmartAccount =\n code !== undefined && code !== \"0x\" && !isEip7702DelegatedEoa(code);\n\n if (!isSmartAccount) {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n const chainId = await publicClient.getChainId();\n const outcome = await pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash: hash,\n pollIntervalMs: safePollIntervalMs,\n timeoutMs: safePollTimeoutMs,\n });\n\n // The wallet turned out to submit its own transactions, so this is the EOA\n // case after all — including the caller's `timeout`, which only ever meant to\n // be ignored while waiting on a genuine Safe proposal.\n if (outcome.kind === \"not-a-proposal\") {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n return publicClient.waitForTransactionReceipt({\n hash: outcome.transactionHash,\n confirmations,\n });\n}\n\n/**\n * How the Safe path ended. The two outcomes are not interchangeable, so they are\n * distinguished rather than both collapsing to a bare hash: `executed` is a real\n * Safe proposal that reached quorum, while `not-a-proposal` means the wallet was\n * never a Safe and we are really on the EOA path — which decides whether the\n * caller's `timeout` applies to the receipt wait that follows.\n */\ntype SafePollOutcome =\n | { kind: \"executed\"; transactionHash: Hash }\n | { kind: \"not-a-proposal\" };\n\ninterface SafeMultisigTransaction {\n isExecuted: boolean;\n isSuccessful: boolean | null;\n transactionHash: Hash | null;\n}\n\n/**\n * Decide whether a 404 from the Transaction Service means \"proposal not indexed\n * yet\" or \"this hash was never a proposal at all\".\n *\n * The Safe indexer cannot answer that: a genuine Safe and its freshly-submitted\n * proposal are both absent from it for a while, so its 404 proves nothing. The\n * NODE can. A `safeTxHash` is an EIP-712 digest of a proposal and is never a\n * transaction on chain, so if the node knows the hash as a real transaction then\n * this was never a proposal and we are on the wrong path entirely.\n *\n * Returns true only on that positive identification. Anything else — the node\n * has not seen it yet, or the lookup fails — is inconclusive and leaves the\n * caller polling, which is the correct behaviour for a Safe that is simply\n * still being indexed.\n */\nasync function hashIsRealTransaction(\n publicClient: PublicClient,\n hash: Hash,\n): Promise<boolean> {\n const transaction = await publicClient\n .getTransaction({ hash })\n .catch(() => null);\n return transaction !== null;\n}\n\nasync function pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash,\n pollIntervalMs,\n timeoutMs,\n}: {\n chainId: number;\n publicClient: PublicClient;\n safeTxHash: Hash;\n pollIntervalMs: number;\n timeoutMs: number;\n}): Promise<SafePollOutcome> {\n const baseUrl = SAFE_TX_SERVICE_BASE_URLS[chainId];\n if (!baseUrl) {\n throw new Error(\n `Safe Transaction Service not configured for chainId ${chainId}. ` +\n `Connected wallet appears to be a smart-contract account, but this ` +\n `chain is not in the supported list. Either connect an EOA or extend ` +\n `SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`,\n );\n }\n\n const url = `${baseUrl}${SAFE_MULTISIG_TX_PATH}/${safeTxHash}/`;\n const deadline = Date.now() + timeoutMs;\n\n while (Date.now() < deadline) {\n const controller = new AbortController();\n const fetchTimeoutId = setTimeout(\n () => controller.abort(),\n SAFE_TX_SERVICE_FETCH_TIMEOUT_MS,\n );\n\n let response: Response;\n try {\n response = await fetch(url, { signal: controller.signal });\n } catch (err) {\n // Transient failure (AbortError on per-request timeout, DNS hiccup,\n // connection reset, etc.). Log and continue to the next poll iteration\n // instead of consuming the entire safePollTimeoutMs budget on one blip.\n // The outer `while (Date.now() < deadline)` is what enforces the overall\n // budget; this catch deliberately preserves it.\n console.warn(\n `Safe Transaction Service request failed (will retry in ${pollIntervalMs}ms): ` +\n (err instanceof Error ? err.message : String(err)),\n );\n await sleep(pollIntervalMs);\n continue;\n } finally {\n clearTimeout(fetchTimeoutId);\n }\n\n if (response.ok) {\n const data = (await response.json()) as SafeMultisigTransaction;\n if (data.isExecuted) {\n if (data.isSuccessful === false) {\n throw new Error(\n `Safe transaction ${safeTxHash} was executed on chain but reverted. ` +\n `Check the Safe queue UI for details.`,\n );\n }\n if (data.transactionHash) {\n return { kind: \"executed\", transactionHash: data.transactionHash };\n }\n }\n } else if (response.status === SAFE_TX_SERVICE_NOT_FOUND) {\n // Usually \"proposal not indexed yet\", so keep polling. But the very same\n // 404 appears when the hash is not a safeTxHash at all — the case that\n // used to burn the whole budget on an already-mined transaction. Ask the\n // node: if it knows this hash, it is a real transaction, so stop treating\n // it as a proposal and let the caller wait on it directly.\n if (await hashIsRealTransaction(publicClient, safeTxHash)) {\n console.warn(\n `${safeTxHash} is a real transaction, not a Safe proposal — the ` +\n `connected wallet submits its own transactions despite reporting ` +\n `contract bytecode. Waiting for its receipt directly.`,\n );\n return { kind: \"not-a-proposal\" };\n }\n } else if (response.status >= SAFE_TX_SERVICE_SERVER_ERROR) {\n // Transient server error — same treatment as a hung connection: log and retry.\n console.warn(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}; retrying in ${pollIntervalMs}ms.`,\n );\n } else {\n // Other 4xx (403, 410, etc.) is likely permanent — surface immediately.\n throw new Error(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}.`,\n );\n }\n\n await sleep(pollIntervalMs);\n }\n\n throw new Error(\n `Timed out after ${timeoutMs}ms waiting for Safe transaction ${safeTxHash} ` +\n `to reach quorum and execute. The proposal is still pending in the Safe ` +\n `queue — co-signers must sign and execute it before the dApp can proceed.`,\n );\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n"],"names":["SAFE_TX_SERVICE_BASE_URLS","DEFAULT_SAFE_POLL_INTERVAL_MS","DEFAULT_SAFE_POLL_TIMEOUT_MS","SAFE_TX_SERVICE_FETCH_TIMEOUT_MS","SAFE_MULTISIG_TX_PATH","SAFE_TX_SERVICE_NOT_FOUND","SAFE_TX_SERVICE_SERVER_ERROR","HEX_CHARS_PER_BYTE","EIP_7702_DELEGATION_PREFIX","EIP_7702_DELEGATION_ADDRESS_BYTES","EIP_7702_DELEGATION_CODE_LENGTH","isEip7702DelegatedEoa","code","waitForTransactionReceiptSmartAware","params","publicClient","walletAddress","hash","confirmations","timeout","safePollTimeoutMs","safePollIntervalMs","chainId","outcome","pollSafeTransactionServiceUntilExecuted","hashIsRealTransaction","safeTxHash","pollIntervalMs","timeoutMs","baseUrl","url","deadline","controller","fetchTimeoutId","response","err","sleep","data","ms","resolve"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.ts"],"sourcesContent":["/**\n * Smart-account-aware wrapper around viem's `waitForTransactionReceipt`.\n *\n * Externally Owned Accounts (EOAs) — wallets controlled by a single private\n * key, e.g. MetaMask or a hardware wallet. `eth_sendTransaction` returns a real\n * Ethereum tx hash, which viem can poll directly. This wrapper delegates\n * unchanged for them.\n *\n * Smart-contract accounts (e.g. Safe multisigs) — the wallet address is a\n * deployed contract that decides whether to accept a transaction. WalletConnect's\n * `eth_sendTransaction` returns a `safeTxHash` (an EIP-712 hash of the\n * *proposal*) rather than a real tx hash, and the proposal is held in Safe's\n * off-chain Transaction Service until quorum signs and executes it. We poll\n * that service for the proposal until execution, then wait for receipt on the\n * real Ethereum tx hash exposed in the service's response.\n *\n * The two are told apart by `eth_getCode`, but NOT by \"empty vs non-empty\":\n * an EIP-7702 delegated EOA reports `0xef0100 ‖ <delegate address>` and is\n * still an EOA — it signs and submits its own transactions, so\n * `eth_sendTransaction` returns a real tx hash. MetaMask upgrades accounts to\n * smart accounts this way by default, and treating one as a Safe means polling\n * the Transaction Service for a hash that is not a `safeTxHash`: a permanent\n * 404 that reads as \"proposal not yet indexed\" and hangs for the full poll\n * budget on a transaction that already succeeded. Delegation designators are\n * therefore classified as EOAs. As a backstop for any wallet that behaves this\n * way in future, a 404 from the Transaction Service is also checked against the\n * node: if it knows the hash as a real transaction, we were never waiting on a\n * proposal and switch to waiting for that transaction's receipt.\n *\n * @module utils/eth\n */\n\nimport type { Address, Hash, PublicClient, TransactionReceipt } from \"viem\";\n\n/**\n * Chains where the Safe Transaction Service is supported by this utility.\n * Extend the map as more Safe-enabled chains are needed.\n */\nconst SAFE_TX_SERVICE_BASE_URLS: Record<number, string> = {\n 1: \"https://safe-transaction-mainnet.safe.global\",\n 11155111: \"https://safe-transaction-sepolia.safe.global\",\n};\n\nconst DEFAULT_SAFE_POLL_INTERVAL_MS = 5_000;\nconst DEFAULT_SAFE_POLL_TIMEOUT_MS = 4 * 60 * 60 * 1_000;\nconst SAFE_TX_SERVICE_FETCH_TIMEOUT_MS = 10_000;\n\n/** Safe Transaction Service route for one multisig-transaction proposal. */\nconst SAFE_MULTISIG_TX_PATH = \"/api/v1/multisig-transactions\";\n/** The service answers 404 both for an unindexed proposal and an unknown Safe. */\nconst SAFE_TX_SERVICE_NOT_FOUND = 404;\n/** Statuses at or above this are server-side, so worth retrying. */\nconst SAFE_TX_SERVICE_SERVER_ERROR = 500;\n\n/** Two hex characters encode one byte in an `eth_getCode` result. */\nconst HEX_CHARS_PER_BYTE = 2;\n\n/**\n * EIP-7702 delegation designator: an EOA that has delegated its code to a\n * contract reports exactly `0xef0100 ‖ <20-byte delegate address>` from\n * `eth_getCode` (EIP-7702 §\"Delegation Designation\"). Both the prefix and the\n * exact length are checked so ordinary contract bytecode that merely happens to\n * start with these bytes is not mistaken for a delegation.\n */\nconst EIP_7702_DELEGATION_PREFIX = \"0xef0100\";\nconst EIP_7702_DELEGATION_ADDRESS_BYTES = 20;\nconst EIP_7702_DELEGATION_CODE_LENGTH =\n EIP_7702_DELEGATION_PREFIX.length +\n HEX_CHARS_PER_BYTE * EIP_7702_DELEGATION_ADDRESS_BYTES;\n\n/**\n * True when `eth_getCode` reports an EIP-7702 delegation designator rather than\n * a deployed contract. Such an account is still an EOA for our purposes: it\n * signs and submits its own transactions, so the hash we hold is a real tx hash.\n */\nfunction isEip7702DelegatedEoa(code: string): boolean {\n return (\n code.length === EIP_7702_DELEGATION_CODE_LENGTH &&\n code.toLowerCase().startsWith(EIP_7702_DELEGATION_PREFIX)\n );\n}\n\nexport interface WaitForTransactionReceiptSmartAwareParams {\n publicClient: PublicClient;\n walletAddress: Address;\n hash: Hash;\n /**\n * Forwarded to viem verbatim.\n *\n * MUST NOT be used as a finality/reorg gate. viem fetches the receipt once\n * and then only compares block numbers against that cached copy — it never\n * re-checks that the receipt's block is still canonical, so it resolves\n * happily for a transaction that has been reorged out. Setting this buys a\n * delay, not a guarantee. For peg-in registration finality use\n * `waitForPeginRegistrationDepth`, which re-reads live contract state on\n * every poll.\n */\n confirmations?: number;\n /**\n * Forwarded to viem on the EOA (externally owned account) path, and on the\n * fallback where a supposed smart account turns out to submit its own\n * transactions — that is the EOA case too, however we arrived at it.\n *\n * Ignored only while waiting on a genuine Safe proposal, whose budget is\n * safePollTimeoutMs. It is not forwarded to the receipt wait that follows a\n * proposal's execution either: viem's own default applies there (180s as of\n * viem 2.38.2), so that wait is bounded too — a sufficiently slow node still\n * raises WaitForTransactionReceiptTimeoutError, just on viem's uniform bound\n * rather than on a caller's shorter one.\n */\n timeout?: number;\n /** Total budget for waiting on Safe quorum + execution. Default 4h. */\n safePollTimeoutMs?: number;\n /** Poll cadence against the Safe Transaction Service. Default 5s. */\n safePollIntervalMs?: number;\n}\n\nexport async function waitForTransactionReceiptSmartAware(\n params: WaitForTransactionReceiptSmartAwareParams,\n): Promise<TransactionReceipt> {\n const {\n publicClient,\n walletAddress,\n hash,\n confirmations,\n timeout,\n safePollTimeoutMs = DEFAULT_SAFE_POLL_TIMEOUT_MS,\n safePollIntervalMs = DEFAULT_SAFE_POLL_INTERVAL_MS,\n } = params;\n\n const code = await publicClient.getCode({ address: walletAddress });\n // An EIP-7702 delegated EOA has non-empty code but still submits its own\n // transactions, so it belongs on the EOA path — see the module docblock.\n const isSmartAccount =\n code !== undefined && code !== \"0x\" && !isEip7702DelegatedEoa(code);\n\n if (!isSmartAccount) {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n const chainId =\n publicClient.chain === undefined\n ? await publicClient.getChainId()\n : publicClient.chain.id;\n const outcome = await pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash: hash,\n pollIntervalMs: safePollIntervalMs,\n timeoutMs: safePollTimeoutMs,\n });\n\n // The wallet turned out to submit its own transactions, so this is the EOA\n // case after all — including the caller's `timeout`, which only ever meant to\n // be ignored while waiting on a genuine Safe proposal.\n if (outcome.kind === \"not-a-proposal\") {\n return publicClient.waitForTransactionReceipt({\n hash,\n confirmations,\n timeout,\n });\n }\n\n return publicClient.waitForTransactionReceipt({\n hash: outcome.transactionHash,\n confirmations,\n });\n}\n\n/**\n * How the Safe path ended. The two outcomes are not interchangeable, so they are\n * distinguished rather than both collapsing to a bare hash: `executed` is a real\n * Safe proposal that reached quorum, while `not-a-proposal` means the wallet was\n * never a Safe and we are really on the EOA path — which decides whether the\n * caller's `timeout` applies to the receipt wait that follows.\n */\ntype SafePollOutcome =\n | { kind: \"executed\"; transactionHash: Hash }\n | { kind: \"not-a-proposal\" };\n\ninterface SafeMultisigTransaction {\n isExecuted: boolean;\n isSuccessful: boolean | null;\n transactionHash: Hash | null;\n}\n\n/**\n * Decide whether a 404 from the Transaction Service means \"proposal not indexed\n * yet\" or \"this hash was never a proposal at all\".\n *\n * The Safe indexer cannot answer that: a genuine Safe and its freshly-submitted\n * proposal are both absent from it for a while, so its 404 proves nothing. The\n * NODE can. A `safeTxHash` is an EIP-712 digest of a proposal and is never a\n * transaction on chain, so if the node knows the hash as a real transaction then\n * this was never a proposal and we are on the wrong path entirely.\n *\n * Returns true only on that positive identification. Anything else — the node\n * has not seen it yet, or the lookup fails — is inconclusive and leaves the\n * caller polling, which is the correct behaviour for a Safe that is simply\n * still being indexed.\n */\nasync function hashIsRealTransaction(\n publicClient: PublicClient,\n hash: Hash,\n): Promise<boolean> {\n const transaction = await publicClient\n .getTransaction({ hash })\n .catch(() => null);\n return transaction !== null;\n}\n\nasync function pollSafeTransactionServiceUntilExecuted({\n chainId,\n publicClient,\n safeTxHash,\n pollIntervalMs,\n timeoutMs,\n}: {\n chainId: number;\n publicClient: PublicClient;\n safeTxHash: Hash;\n pollIntervalMs: number;\n timeoutMs: number;\n}): Promise<SafePollOutcome> {\n const baseUrl = SAFE_TX_SERVICE_BASE_URLS[chainId];\n if (!baseUrl) {\n throw new Error(\n `Safe Transaction Service not configured for chainId ${chainId}. ` +\n `Connected wallet appears to be a smart-contract account, but this ` +\n `chain is not in the supported list. Either connect an EOA or extend ` +\n `SAFE_TX_SERVICE_BASE_URLS in waitForTransactionReceiptSmartAware.ts.`,\n );\n }\n\n const url = `${baseUrl}${SAFE_MULTISIG_TX_PATH}/${safeTxHash}/`;\n const deadline = Date.now() + timeoutMs;\n\n while (Date.now() < deadline) {\n const controller = new AbortController();\n const fetchTimeoutId = setTimeout(\n () => controller.abort(),\n SAFE_TX_SERVICE_FETCH_TIMEOUT_MS,\n );\n\n let response: Response;\n try {\n response = await fetch(url, { signal: controller.signal });\n } catch (err) {\n // Transient failure (AbortError on per-request timeout, DNS hiccup,\n // connection reset, etc.). Log and continue to the next poll iteration\n // instead of consuming the entire safePollTimeoutMs budget on one blip.\n // The outer `while (Date.now() < deadline)` is what enforces the overall\n // budget; this catch deliberately preserves it.\n console.warn(\n `Safe Transaction Service request failed (will retry in ${pollIntervalMs}ms): ` +\n (err instanceof Error ? err.message : String(err)),\n );\n await sleep(pollIntervalMs);\n continue;\n } finally {\n clearTimeout(fetchTimeoutId);\n }\n\n if (response.ok) {\n const data = (await response.json()) as SafeMultisigTransaction;\n if (data.isExecuted) {\n if (data.isSuccessful === false) {\n throw new Error(\n `Safe transaction ${safeTxHash} was executed on chain but reverted. ` +\n `Check the Safe queue UI for details.`,\n );\n }\n if (data.transactionHash) {\n return { kind: \"executed\", transactionHash: data.transactionHash };\n }\n }\n } else if (response.status === SAFE_TX_SERVICE_NOT_FOUND) {\n // Usually \"proposal not indexed yet\", so keep polling. But the very same\n // 404 appears when the hash is not a safeTxHash at all — the case that\n // used to burn the whole budget on an already-mined transaction. Ask the\n // node: if it knows this hash, it is a real transaction, so stop treating\n // it as a proposal and let the caller wait on it directly.\n if (await hashIsRealTransaction(publicClient, safeTxHash)) {\n console.warn(\n `${safeTxHash} is a real transaction, not a Safe proposal — the ` +\n `connected wallet submits its own transactions despite reporting ` +\n `contract bytecode. Waiting for its receipt directly.`,\n );\n return { kind: \"not-a-proposal\" };\n }\n } else if (response.status >= SAFE_TX_SERVICE_SERVER_ERROR) {\n // Transient server error — same treatment as a hung connection: log and retry.\n console.warn(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}; retrying in ${pollIntervalMs}ms.`,\n );\n } else {\n // Other 4xx (403, 410, etc.) is likely permanent — surface immediately.\n throw new Error(\n `Safe Transaction Service returned ${response.status} for ${safeTxHash}.`,\n );\n }\n\n await sleep(pollIntervalMs);\n }\n\n throw new Error(\n `Timed out after ${timeoutMs}ms waiting for Safe transaction ${safeTxHash} ` +\n `to reach quorum and execute. The proposal is still pending in the Safe ` +\n `queue — co-signers must sign and execute it before the dApp can proceed.`,\n );\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\n"],"names":["SAFE_TX_SERVICE_BASE_URLS","DEFAULT_SAFE_POLL_INTERVAL_MS","DEFAULT_SAFE_POLL_TIMEOUT_MS","SAFE_TX_SERVICE_FETCH_TIMEOUT_MS","SAFE_MULTISIG_TX_PATH","SAFE_TX_SERVICE_NOT_FOUND","SAFE_TX_SERVICE_SERVER_ERROR","HEX_CHARS_PER_BYTE","EIP_7702_DELEGATION_PREFIX","EIP_7702_DELEGATION_ADDRESS_BYTES","EIP_7702_DELEGATION_CODE_LENGTH","isEip7702DelegatedEoa","code","waitForTransactionReceiptSmartAware","params","publicClient","walletAddress","hash","confirmations","timeout","safePollTimeoutMs","safePollIntervalMs","chainId","outcome","pollSafeTransactionServiceUntilExecuted","hashIsRealTransaction","safeTxHash","pollIntervalMs","timeoutMs","baseUrl","url","deadline","controller","fetchTimeoutId","response","err","sleep","data","ms","resolve"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"waitForTransactionReceiptSmartAware.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAkD5E,MAAM,WAAW,yCAAyC;IACxD,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,IAAI,CAAC;IACX;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,yCAAyC,GAChD,OAAO,CAAC,kBAAkB,CAAC,CAiD7B"}
1
+ {"version":3,"file":"waitForTransactionReceiptSmartAware.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAkD5E,MAAM,WAAW,yCAAyC;IACxD,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,IAAI,CAAC;IACX;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,yCAAyC,GAChD,OAAO,CAAC,kBAAkB,CAAC,CAoD7B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../abortSignals-msbmbqFe.cjs"),E=require("../../../signing-3l5Aqd-H.cjs"),_=require("../../../validation-C6XTfZak.cjs"),n=require("./eth/index.cjs"),e=require("../../../psbtInputFields-BrV_ZfL_.cjs"),t=require("../../../fundPeginTransaction-54-Rwb2k.cjs"),a=require("../../../reservation-ECxjZi5t.cjs"),r=require("../../../bitcoin-D-O2GjbC.cjs");exports.combineAbortSignals=i.combineAbortSignals;exports.calculateBtcTxHash=E.calculateBtcTxHash;exports.createTaprootScriptPathSignOptions=E.createTaprootScriptPathSignOptions;exports.createTaprootScriptPathSignOptionsForInput=E.createTaprootScriptPathSignOptionsForInput;exports.BITCOIN_ADDRESS_RE=_.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=_.COMPRESSED_PUBKEY_HEX_LEN;exports.HEX_RE=_.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=_.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=_.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=_.TXID_RE;exports.X_ONLY_PUBKEY_HEX_LEN=_.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=n.waitForTransactionReceiptSmartAware;exports.BitcoinScriptType=e.BitcoinScriptType;exports.applyChangeOutputPolicy=e.applyChangeOutputPolicy;exports.computeChangeOutputFeeSats=e.computeChangeOutputFeeSats;exports.computeMaxDeposit=e.computeMaxDeposit;exports.computePeginBaseFeeSats=e.computePeginBaseFeeSats;exports.getDustThreshold=e.getDustThreshold;exports.getPsbtInputFields=e.getPsbtInputFields;exports.getScriptType=e.getScriptType;exports.selectUtxosForPegin=e.selectUtxosForPegin;exports.shouldAddChangeOutput=e.shouldAddChangeOutput;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=a.UtxoNotAvailableError;exports.assertUtxosAvailable=a.assertUtxosAvailable;exports.extractInputsFromTransaction=a.extractInputsFromTransaction;exports.findOverlappingPendingVaults=a.findOverlappingPendingVaults;exports.validateUtxosAvailable=a.validateUtxosAvailable;exports.getNetwork=r.getNetwork;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../abortSignals-msbmbqFe.cjs"),E=require("../../../signing-DvISftFk.cjs"),a=require("../../../validation-C6XTfZak.cjs"),n=require("./eth/index.cjs"),e=require("../../../psbtInputFields-BrV_ZfL_.cjs"),t=require("../../../fundPeginTransaction-54-Rwb2k.cjs"),_=require("../../../reservation-ECxjZi5t.cjs"),r=require("../../../bitcoin-D-O2GjbC.cjs"),T=require("../../../btcTxHash-CGb5BqFL.cjs");exports.combineAbortSignals=i.combineAbortSignals;exports.createTaprootScriptPathSignOptions=E.createTaprootScriptPathSignOptions;exports.createTaprootScriptPathSignOptionsForInput=E.createTaprootScriptPathSignOptionsForInput;exports.BITCOIN_ADDRESS_RE=a.BITCOIN_ADDRESS_RE;exports.COMPRESSED_PUBKEY_HEX_LEN=a.COMPRESSED_PUBKEY_HEX_LEN;exports.HEX_RE=a.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=a.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=a.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=a.TXID_RE;exports.X_ONLY_PUBKEY_HEX_LEN=a.X_ONLY_PUBKEY_HEX_LEN;exports.waitForTransactionReceiptSmartAware=n.waitForTransactionReceiptSmartAware;exports.BitcoinScriptType=e.BitcoinScriptType;exports.applyChangeOutputPolicy=e.applyChangeOutputPolicy;exports.computeChangeOutputFeeSats=e.computeChangeOutputFeeSats;exports.computeMaxDeposit=e.computeMaxDeposit;exports.computePeginBaseFeeSats=e.computePeginBaseFeeSats;exports.getDustThreshold=e.getDustThreshold;exports.getPsbtInputFields=e.getPsbtInputFields;exports.getScriptType=e.getScriptType;exports.selectUtxosForPegin=e.selectUtxosForPegin;exports.shouldAddChangeOutput=e.shouldAddChangeOutput;exports.BTC_DUST_SAT=t.BTC_DUST_SAT;exports.DUST_THRESHOLD=t.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=t.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=t.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=t.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=t.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=t.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=t.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=t.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=t.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=t.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=t.fundPeginTransaction;exports.parseUnfundedWasmTransaction=t.parseUnfundedWasmTransaction;exports.peginOutputCount=t.peginOutputCount;exports.rateBasedTxBufferFee=t.rateBasedTxBufferFee;exports.UtxoNotAvailableError=_.UtxoNotAvailableError;exports.assertUtxosAvailable=_.assertUtxosAvailable;exports.extractInputsFromTransaction=_.extractInputsFromTransaction;exports.findOverlappingPendingVaults=_.findOverlappingPendingVaults;exports.validateUtxosAvailable=_.validateUtxosAvailable;exports.getNetwork=r.getNetwork;exports.calculateBtcTxHash=T.calculateBtcTxHash;
2
2
  //# sourceMappingURL=index.cjs.map