@babylonlabs-io/ts-sdk 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +0 -1
  2. package/dist/{BTCVaultRegistry.abi-Cq9-JlqT.js → BTCVaultRegistry.abi-Chs4AFBj.js} +125 -2
  3. package/dist/BTCVaultRegistry.abi-Chs4AFBj.js.map +1 -0
  4. package/dist/{BTCVaultRegistry.abi-CHFGevwa.cjs → BTCVaultRegistry.abi-JdeqLz4x.cjs} +2 -2
  5. package/dist/BTCVaultRegistry.abi-JdeqLz4x.cjs.map +1 -0
  6. package/dist/{PeginManager-BezsAEDe.js → PeginManager-CFGjwYtC.js} +4 -4
  7. package/dist/{PeginManager-BezsAEDe.js.map → PeginManager-CFGjwYtC.js.map} +1 -1
  8. package/dist/{PeginManager-D-8vmqzq.cjs → PeginManager-CL1Esl1c.cjs} +2 -2
  9. package/dist/{PeginManager-D-8vmqzq.cjs.map → PeginManager-CL1Esl1c.cjs.map} +1 -1
  10. package/dist/{buildAndBroadcastRefund-37Bs7-V1.js → buildAndBroadcastRefund-CZj2z7PJ.js} +2 -2
  11. package/dist/{buildAndBroadcastRefund-37Bs7-V1.js.map → buildAndBroadcastRefund-CZj2z7PJ.js.map} +1 -1
  12. package/dist/{buildAndBroadcastRefund-DbcNEsOv.cjs → buildAndBroadcastRefund-Ux587SFf.cjs} +2 -2
  13. package/dist/{buildAndBroadcastRefund-DbcNEsOv.cjs.map → buildAndBroadcastRefund-Ux587SFf.cjs.map} +1 -1
  14. package/dist/{errors-CznAK5NB.js → errors-Blc-JWnI.js} +71 -46
  15. package/dist/errors-Blc-JWnI.js.map +1 -0
  16. package/dist/errors-CGcNP0rV.cjs +2 -0
  17. package/dist/errors-CGcNP0rV.cjs.map +1 -0
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.js +106 -107
  20. package/dist/{mempoolApi-CknccHKg.cjs → mempoolApi-DcHws8jJ.cjs} +2 -2
  21. package/dist/{mempoolApi-CknccHKg.cjs.map → mempoolApi-DcHws8jJ.cjs.map} +1 -1
  22. package/dist/{mempoolApi-DI9HISqi.js → mempoolApi-DnP7d084.js} +2 -2
  23. package/dist/{mempoolApi-DI9HISqi.js.map → mempoolApi-DnP7d084.js.map} +1 -1
  24. package/dist/primeVpAuth-BihAGyNf.cjs +2 -0
  25. package/dist/{primeVpAuth-Duds3vAO.cjs.map → primeVpAuth-BihAGyNf.cjs.map} +1 -1
  26. package/dist/{primeVpAuth-qEC9TTO_.js → primeVpAuth-DXl9wGBR.js} +361 -341
  27. package/dist/{primeVpAuth-qEC9TTO_.js.map → primeVpAuth-DXl9wGBR.js.map} +1 -1
  28. package/dist/reservation-BxvKbQH2.js +107 -0
  29. package/dist/reservation-BxvKbQH2.js.map +1 -0
  30. package/dist/reservation-xTL2a9Q-.cjs +2 -0
  31. package/dist/reservation-xTL2a9Q-.cjs.map +1 -0
  32. package/dist/tbv/core/clients/index.cjs +1 -1
  33. package/dist/tbv/core/clients/index.js +2 -2
  34. package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts +12 -0
  35. package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts.map +1 -1
  36. package/dist/tbv/core/clients/vault-provider/auth/innerTokenClient.d.ts +8 -0
  37. package/dist/tbv/core/clients/vault-provider/auth/innerTokenClient.d.ts.map +1 -1
  38. package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts +42 -13
  39. package/dist/tbv/core/clients/vault-provider/auth/tokenProvider.d.ts.map +1 -1
  40. package/dist/tbv/core/clients/vault-provider/auth/tokenRegistry.d.ts.map +1 -1
  41. package/dist/tbv/core/contracts/__tests__/errors.test.d.ts +2 -0
  42. package/dist/tbv/core/contracts/__tests__/errors.test.d.ts.map +1 -0
  43. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +292 -0
  44. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  45. package/dist/tbv/core/contracts/errors.d.ts.map +1 -1
  46. package/dist/tbv/core/contracts/index.cjs +1 -1
  47. package/dist/tbv/core/contracts/index.js +2 -2
  48. package/dist/tbv/core/index.cjs +1 -1
  49. package/dist/tbv/core/index.js +102 -103
  50. package/dist/tbv/core/managers/index.cjs +1 -1
  51. package/dist/tbv/core/managers/index.js +1 -1
  52. package/dist/tbv/core/services/index.cjs +1 -1
  53. package/dist/tbv/core/services/index.js +1 -1
  54. package/dist/tbv/core/utils/index.cjs +1 -1
  55. package/dist/tbv/core/utils/index.js +32 -33
  56. package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts +0 -1
  57. package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts.map +1 -1
  58. package/dist/tbv/core/utils/utxo/availability.d.ts +22 -1
  59. package/dist/tbv/core/utils/utxo/availability.d.ts.map +1 -1
  60. package/dist/tbv/core/utils/utxo/reservation.d.ts +11 -86
  61. package/dist/tbv/core/utils/utxo/reservation.d.ts.map +1 -1
  62. package/dist/tbv/index.cjs +1 -1
  63. package/dist/tbv/index.js +102 -103
  64. package/package.json +1 -1
  65. package/dist/BTCVaultRegistry.abi-CHFGevwa.cjs.map +0 -1
  66. package/dist/BTCVaultRegistry.abi-Cq9-JlqT.js.map +0 -1
  67. package/dist/errors-BP73_stm.cjs +0 -2
  68. package/dist/errors-BP73_stm.cjs.map +0 -1
  69. package/dist/errors-CznAK5NB.js.map +0 -1
  70. package/dist/primeVpAuth-Duds3vAO.cjs +0 -2
  71. package/dist/reservation-Cwf2u4vu.cjs +0 -2
  72. package/dist/reservation-Cwf2u4vu.cjs.map +0 -1
  73. package/dist/reservation-DNOGLBt4.js +0 -143
  74. package/dist/reservation-DNOGLBt4.js.map +0 -1
@@ -1,99 +1,24 @@
1
- /**
2
- * UTXO reservation utilities for vault deposits.
3
- *
4
- * Handles tracking which UTXOs are already in use by pending deposits
5
- * and selecting available UTXOs with smart fallback logic.
6
- */
7
- /** A txid:vout pair uniquely identifying a UTXO (outpoint). */
8
- export interface UtxoRef {
9
- txid: string;
10
- vout: number;
11
- }
12
- /** Narrow structural type for pending pegin data. */
1
+ import { UtxoRef } from './availability';
2
+ /** Locally-known pending pegin. `id` is the bytes32 vault id. */
13
3
  export interface PendingPeginLike {
14
- /**
15
- * Optional vault id. When present, used to skip pending pegins that are
16
- * already indexed on-chain so the canonical vault copy wins over a
17
- * tamperable off-chain entry.
18
- */
19
4
  id?: string;
20
- selectedUTXOs?: Array<{
21
- txid: string;
22
- vout: number;
23
- }>;
24
5
  unsignedTxHex?: string;
25
6
  }
26
- /** Narrow structural type for vault data. */
7
+ /** On-chain vault row from the indexer. */
27
8
  export interface VaultLike {
28
- /**
29
- * Optional vault id. When present, enables on-chain correlation with
30
- * pending pegins sharing the same id.
31
- */
32
9
  id?: string;
33
10
  status: number;
34
11
  unsignedPrePeginTx: string;
35
12
  }
36
- export interface SelectUtxosForDepositParams<T extends {
37
- txid: string;
38
- vout: number;
39
- value: number;
40
- }> {
41
- /** All available UTXOs from the wallet. */
42
- availableUtxos: T[];
43
- /** UTXOs that are reserved/in-flight and should be avoided if possible. */
44
- reservedUtxoRefs: UtxoRef[];
45
- /** Required deposit amount in satoshis (excluding fees). */
46
- requiredAmount: bigint;
47
- /** Fee rate in sat/vB. Used to estimate fee buffer for sufficiency check. */
48
- feeRate: number;
49
- }
50
- /** Narrow structural type for early UTXO reservations (pre-ETH-registration). */
51
- export interface UtxoReservationLike {
52
- outpoints: ReadonlyArray<{
53
- txid: string;
54
- vout: number;
55
- }>;
13
+ export interface FindOverlappingPendingVaultsParams {
14
+ selectedOutpoints: ReadonlyArray<UtxoRef>;
15
+ vaults?: ReadonlyArray<VaultLike>;
16
+ pendingPegins?: ReadonlyArray<PendingPeginLike>;
56
17
  }
57
- export interface CollectReservedUtxoRefsParams {
58
- vaults?: VaultLike[];
59
- pendingPegins?: PendingPeginLike[];
60
- utxoReservations?: UtxoReservationLike[];
61
- }
62
- /**
63
- * Collect UTXO refs from in-flight deposits (PENDING/VERIFIED vaults and
64
- * pending pegins).
65
- *
66
- * On-chain vault data is canonical: for any pending pegin whose `id` matches
67
- * an indexed on-chain vault, the pending-pegin copy is ignored entirely —
68
- * the `vaults` branch below extracts refs from the indexer-supplied
69
- * `unsignedPrePeginTx` so tampered off-chain data cannot poison the
70
- * reservation set once the vault is indexed.
71
- *
72
- * For pegins not yet indexed, refs are derived from the stored
73
- * `unsignedTxHex` only. The `selectedUTXOs` sidecar is NOT used for
74
- * reservation: if it disagreed with the transaction's inputs (e.g. because
75
- * the off-chain source was tampered), trusting it would poison the reserved
76
- * set. The transaction hex must be validated at the source boundary before
77
- * being handed to this function; parsing and using its inputs is the single
78
- * source of truth here.
79
- */
80
- export declare function collectReservedUtxoRefs(params: CollectReservedUtxoRefsParams): UtxoRef[];
81
18
  /**
82
- * Select UTXOs for a deposit, filtering out reserved ones.
83
- *
84
- * Logic:
85
- * 1. Filter out reserved UTXOs from the available pool
86
- * 2. If unreserved UTXOs are sufficient for the required amount + estimated fee, return them
87
- * 3. Otherwise, throw — never silently reuse reserved UTXOs, as this risks double-spend
88
- * failures that strand registered-but-unbroadcastable vaults
89
- *
90
- * @param params - Selection parameters
91
- * @returns Array of unreserved UTXOs to use for the deposit
92
- * @throws When all UTXOs are reserved or unreserved UTXOs are insufficient
19
+ * Return the ids of pending vaults whose committed Pre-PegIn inputs
20
+ * overlap any of the just-selected outpoints. On-chain `PENDING` vaults
21
+ * take precedence over a same-id local pegin entry.
93
22
  */
94
- export declare function selectUtxosForDeposit<T extends {
95
- txid: string;
96
- vout: number;
97
- value: number;
98
- }>(params: SelectUtxosForDepositParams<T>): T[];
23
+ export declare function findOverlappingPendingVaults(params: FindOverlappingPendingVaultsParams): string[];
99
24
  //# sourceMappingURL=reservation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reservation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/reservation.ts"],"names":[],"mappings":"AAAA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AgB,uBAAuB,CACrC,MAAM,EAAE,6BAA6B,GACpC,OAAO,EAAE,CA0CX;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAuC7C"}
1
+ {"version":3,"file":"reservation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/reservation.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kCAAkC;IACjD,iBAAiB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACjD;AAkBD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,kCAAkC,GACzC,MAAM,EAAE,CAkCV"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../challengeAssert-Cmj_OG6V.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../assertPsbtUnsignedTxMatches-CABhEADu.cjs"),p=require("../peginInput-DH6X4ITS.cjs"),S=require("../noPayout-DliaHuc6.cjs"),t=require("../bitcoin-CHfKAhcI.cjs"),g=require("../signing-Bnsro0hE.cjs"),d=require("../validation-u8W7Lp2x.cjs"),n=require("../PeginManager-D-8vmqzq.cjs"),A=require("../PayoutManager-BwYlPF2C.cjs"),_=require("../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../BTCVaultRegistry.abi-CHFGevwa.cjs"),P=require("../errors-BP73_stm.cjs"),o=require("../waitForTransactionReceiptSmartAware-BFMQFEzj.cjs"),r=require("../fundPeginTransaction-C8qsXxNV.cjs"),c=require("../reservation-Cwf2u4vu.cjs"),a=require("../mempoolApi-CknccHKg.cjs"),i=require("../primeVpAuth-Duds3vAO.cjs"),s=require("../types-eYlq0p1o.cjs"),R=require("../errors-Bu0H-dZD.cjs"),e=require("../buildAndBroadcastRefund-DbcNEsOv.cjs"),T=require("../peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.buildPeginInputPsbt=p.buildPeginInputPsbt;exports.extractPeginInputSignature=p.extractPeginInputSignature;exports.finalizePeginInputPsbt=p.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=S.buildNoPayoutPsbt;exports.buildRefundPsbt=S.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=t.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=t.deriveNativeSegwitAddress;exports.deriveTaprootAddress=t.deriveTaprootAddress;exports.ensureHexPrefix=t.ensureHexPrefix;exports.formatSatoshisToBtc=t.formatSatoshisToBtc;exports.getNetwork=t.getNetwork;exports.getSortedXOnlyPubkeys=t.getSortedXOnlyPubkeys;exports.hexToUint8Array=t.hexToUint8Array;exports.isAddressFromPublicKey=t.isAddressFromPublicKey;exports.isValidHex=t.isValidHex;exports.processPublicKeyToXOnly=t.processPublicKeyToXOnly;exports.stripHexPrefix=t.stripHexPrefix;exports.toXOnly=t.toXOnly;exports.uint8ArrayToHex=t.uint8ArrayToHex;exports.validateWalletPubkey=t.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=g.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=d.BITCOIN_ADDRESS_RE;exports.HEX_RE=d.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=d.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=d.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=d.TXID_RE;exports.PeginManager=n.PeginManager;exports.VAULT_APP_NAME=n.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=n.buildFundingOutpointsCommitment;exports.buildVaultContext=n.buildVaultContext;exports.computeWotsBlockPublicKeysHash=n.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=n.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=n.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=n.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=A.PayoutManager;exports.computeHashlock=A.computeHashlock;exports.validateSecretAgainstHashlock=A.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=P.CONTRACT_ERRORS;exports.extractErrorData=P.extractErrorData;exports.getContractErrorMessage=P.getContractErrorMessage;exports.handleContractError=P.handleContractError;exports.isKnownContractError=P.isKnownContractError;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=r.BTC_DUST_SAT;exports.DUST_THRESHOLD=r.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=r.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=r.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=r.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=r.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=r.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=r.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=r.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=r.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=r.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=r.fundPeginTransaction;exports.parseUnfundedWasmTransaction=r.parseUnfundedWasmTransaction;exports.peginOutputCount=r.peginOutputCount;exports.rateBasedTxBufferFee=r.rateBasedTxBufferFee;exports.UtxoNotAvailableError=c.UtxoNotAvailableError;exports.assertUtxosAvailable=c.assertUtxosAvailable;exports.collectReservedUtxoRefs=c.collectReservedUtxoRefs;exports.extractInputsFromTransaction=c.extractInputsFromTransaction;exports.selectUtxosForDeposit=c.selectUtxosForDeposit;exports.validateUtxosAvailable=c.validateUtxosAvailable;exports.MEMPOOL_API_URLS=a.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=a.ViemVaultRegistryReader;exports.getAddressTxs=a.getAddressTxs;exports.getAddressUtxos=a.getAddressUtxos;exports.getMempoolApiUrl=a.getMempoolApiUrl;exports.getNetworkFees=a.getNetworkFees;exports.getTipHeight=a.getTipHeight;exports.getTxHex=a.getTxHex;exports.getTxInfo=a.getTxInfo;exports.getUtxoInfo=a.getUtxoInfo;exports.pushTx=a.pushTx;exports.validateOffchainParams=a.validateOffchainParams;exports.validatePegInConfiguration=a.validatePegInConfiguration;exports.validateTBVProtocolParams=a.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=R.isWotsMismatchError;exports.parseFundingOutpointsFromTx=R.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../challengeAssert-Cmj_OG6V.cjs"),l=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../assertPsbtUnsignedTxMatches-CABhEADu.cjs"),p=require("../peginInput-DH6X4ITS.cjs"),S=require("../noPayout-DliaHuc6.cjs"),t=require("../bitcoin-CHfKAhcI.cjs"),R=require("../signing-Bnsro0hE.cjs"),d=require("../validation-u8W7Lp2x.cjs"),n=require("../PeginManager-CL1Esl1c.cjs"),A=require("../PayoutManager-BwYlPF2C.cjs"),g=require("../ApplicationRegistry.abi-BAPhJch3.cjs"),m=require("../BTCVaultRegistry.abi-JdeqLz4x.cjs"),c=require("../errors-CGcNP0rV.cjs"),o=require("../waitForTransactionReceiptSmartAware-BFMQFEzj.cjs"),r=require("../fundPeginTransaction-C8qsXxNV.cjs"),P=require("../reservation-xTL2a9Q-.cjs"),a=require("../mempoolApi-DcHws8jJ.cjs"),i=require("../primeVpAuth-BihAGyNf.cjs"),s=require("../types-eYlq0p1o.cjs"),_=require("../errors-Bu0H-dZD.cjs"),e=require("../buildAndBroadcastRefund-Ux587SFf.cjs"),T=require("../peginState-BijNNT15.cjs");exports.buildChallengeAssertPsbt=E.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=E.buildDepositorPayoutPsbt;exports.computeNumLocalChallengers=E.computeNumLocalChallengers;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>l.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>l.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>l.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>l.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>l.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>l.expandWotsSeed});exports.PsbtSubstitutionError=u.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=u.assertPsbtUnsignedTxMatches;exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=u.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=u.buildPrePeginPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.buildPeginInputPsbt=p.buildPeginInputPsbt;exports.extractPeginInputSignature=p.extractPeginInputSignature;exports.finalizePeginInputPsbt=p.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=S.buildNoPayoutPsbt;exports.buildRefundPsbt=S.buildRefundPsbt;exports.deriveBip86ScriptPubKeyHex=t.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=t.deriveNativeSegwitAddress;exports.deriveTaprootAddress=t.deriveTaprootAddress;exports.ensureHexPrefix=t.ensureHexPrefix;exports.formatSatoshisToBtc=t.formatSatoshisToBtc;exports.getNetwork=t.getNetwork;exports.getSortedXOnlyPubkeys=t.getSortedXOnlyPubkeys;exports.hexToUint8Array=t.hexToUint8Array;exports.isAddressFromPublicKey=t.isAddressFromPublicKey;exports.isValidHex=t.isValidHex;exports.processPublicKeyToXOnly=t.processPublicKeyToXOnly;exports.stripHexPrefix=t.stripHexPrefix;exports.toXOnly=t.toXOnly;exports.uint8ArrayToHex=t.uint8ArrayToHex;exports.validateWalletPubkey=t.validateWalletPubkey;exports.createTaprootScriptPathSignOptions=R.createTaprootScriptPathSignOptions;exports.BITCOIN_ADDRESS_RE=d.BITCOIN_ADDRESS_RE;exports.HEX_RE=d.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=d.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=d.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=d.TXID_RE;exports.PeginManager=n.PeginManager;exports.VAULT_APP_NAME=n.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=n.buildFundingOutpointsCommitment;exports.buildVaultContext=n.buildVaultContext;exports.computeWotsBlockPublicKeysHash=n.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=n.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=n.deriveWotsBlocksFromSeed;exports.estimateSubmitPeginRequestBatchGas=n.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=A.PayoutManager;exports.computeHashlock=A.computeHashlock;exports.validateSecretAgainstHashlock=A.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=g.ApplicationRegistryABI;exports.ProtocolParamsABI=g.ProtocolParamsABI;exports.BTCVaultRegistryABI=m.BTCVaultRegistryABI;exports.CONTRACT_ERRORS=c.CONTRACT_ERRORS;exports.extractErrorData=c.extractErrorData;exports.getContractErrorMessage=c.getContractErrorMessage;exports.handleContractError=c.handleContractError;exports.isKnownContractError=c.isKnownContractError;exports.BitcoinScriptType=o.BitcoinScriptType;exports.applyChangeOutputPolicy=o.applyChangeOutputPolicy;exports.calculateBtcTxHash=o.calculateBtcTxHash;exports.computeChangeOutputFeeSats=o.computeChangeOutputFeeSats;exports.computeMaxDeposit=o.computeMaxDeposit;exports.computePeginBaseFeeSats=o.computePeginBaseFeeSats;exports.getDustThreshold=o.getDustThreshold;exports.getPsbtInputFields=o.getPsbtInputFields;exports.getScriptType=o.getScriptType;exports.selectUtxosForPegin=o.selectUtxosForPegin;exports.shouldAddChangeOutput=o.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=o.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=r.BTC_DUST_SAT;exports.DUST_THRESHOLD=r.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=r.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=r.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=r.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=r.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=r.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=r.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=r.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=r.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=r.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=r.fundPeginTransaction;exports.parseUnfundedWasmTransaction=r.parseUnfundedWasmTransaction;exports.peginOutputCount=r.peginOutputCount;exports.rateBasedTxBufferFee=r.rateBasedTxBufferFee;exports.UtxoNotAvailableError=P.UtxoNotAvailableError;exports.assertUtxosAvailable=P.assertUtxosAvailable;exports.extractInputsFromTransaction=P.extractInputsFromTransaction;exports.findOverlappingPendingVaults=P.findOverlappingPendingVaults;exports.validateUtxosAvailable=P.validateUtxosAvailable;exports.MEMPOOL_API_URLS=a.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=a.ViemVaultRegistryReader;exports.getAddressTxs=a.getAddressTxs;exports.getAddressUtxos=a.getAddressUtxos;exports.getMempoolApiUrl=a.getMempoolApiUrl;exports.getNetworkFees=a.getNetworkFees;exports.getTipHeight=a.getTipHeight;exports.getTxHex=a.getTxHex;exports.getTxInfo=a.getTxInfo;exports.getUtxoInfo=a.getUtxoInfo;exports.pushTx=a.pushTx;exports.validateOffchainParams=a.validateOffchainParams;exports.validatePegInConfiguration=a.validatePegInConfiguration;exports.validateTBVProtocolParams=a.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_EXPIRED_DATA_KIND=s.AUTH_EXPIRED_DATA_KIND;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=s.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=s.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;exports.isWotsMismatchError=_.isWotsMismatchError;exports.parseFundingOutpointsFromTx=_.parseFundingOutpointsFromTx;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/tbv/index.js CHANGED
@@ -1,88 +1,88 @@
1
1
  import { a as s, b as t, c as r } from "../challengeAssert-ChqnvtRg.js";
2
2
  import { computeMinClaimValue as i, computeMinPeginFee as n, deriveVaultId as u, expandAuthAnchor as l, expandHashlockSecret as p, expandWotsSeed as d } from "@babylonlabs-io/babylon-tbv-rust-wasm";
3
- import { P as c, d as T, c as E, a as A, b as S, f as R, e as _ } from "../assertPsbtUnsignedTxMatches-GHobJP-d.js";
3
+ import { P as c, d as T, c as E, a as A, b as S, f as _, e as g } from "../assertPsbtUnsignedTxMatches-GHobJP-d.js";
4
4
  import { b as m, e as x, f } from "../peginInput-BPRB9tUi.js";
5
- import { a as I, b as v } from "../noPayout-BtP-R-b-.js";
6
- import { d as F, a as O, b as V, e as U, f as h, j as y, g as N, h as D, i as B, c as M, p as H, s as L, t as X, u as k, v as W } from "../bitcoin-B5aNKtsk.js";
5
+ import { a as I, b as O } from "../noPayout-BtP-R-b-.js";
6
+ import { d as v, a as C, b as F, e as h, f as U, j as y, g as N, h as D, i as B, c as M, p as H, s as L, t as X, u as k, v as W } from "../bitcoin-B5aNKtsk.js";
7
7
  import { c as w } from "../signing-DaLvGwQe.js";
8
8
  import { B as Y, H as Z, K as J, M as j, T as q } from "../validation-CxqROCno.js";
9
- import { P as Q, V as $, b as aa, a as ea, c as sa, f as ta, d as ra, e as oa } from "../PeginManager-BezsAEDe.js";
9
+ import { P as Q, V as $, b as aa, a as ea, c as sa, f as ta, d as ra, e as oa } from "../PeginManager-CFGjwYtC.js";
10
10
  import { P as na, c as ua, v as la } from "../PayoutManager-CXDccwDN.js";
11
11
  import { A as da, P as Pa } from "../ApplicationRegistry.abi-Dn2qk6JG.js";
12
- import { B as Ta } from "../BTCVaultRegistry.abi-Cq9-JlqT.js";
13
- import { C as Aa, e as Sa, g as Ra, h as _a, i as ga } from "../errors-CznAK5NB.js";
14
- import { B as xa, a as fa, f as ba, c as Ia, b as va, d as Ca, g as Fa, i as Oa, h as Va, s as Ua, e as ha, w as ya } from "../waitForTransactionReceiptSmartAware-Dt5VcMK0.js";
12
+ import { B as Ta } from "../BTCVaultRegistry.abi-Chs4AFBj.js";
13
+ import { C as Aa, e as Sa, g as _a, h as ga, i as Ra } from "../errors-Blc-JWnI.js";
14
+ import { B as xa, a as fa, f as ba, c as Ia, b as Oa, d as Va, g as va, i as Ca, h as Fa, s as ha, e as Ua, w as ya } from "../waitForTransactionReceiptSmartAware-Dt5VcMK0.js";
15
15
  import { B as Da, D as Ba, F as Ma, L as Ha, M as La, P as Xa, b as ka, a as Wa, S as Ka, T as wa, W as Ga, f as Ya, c as Za, p as Ja, r as ja } from "../fundPeginTransaction-C11tYf6I.js";
16
- import { U as za, a as Qa, c as $a, e as ae, s as ee, v as se } from "../reservation-DNOGLBt4.js";
17
- import { M as re, V as oe, g as ie, a as ne, b as ue, c as le, d as pe, e as de, f as Pe, h as ce, p as Te, v as Ee, i as Ae, j as Se } from "../mempoolApi-DI9HISqi.js";
18
- import { O as _e, S as ge, V as me, g as xe, h as fe, i as be, a as Ie, d as ve, b as Ce, f as Fe, p as Oe, r as Ve, v as Ue, c as he, e as ye } from "../primeVpAuth-qEC9TTO_.js";
19
- import { A as De, D as Be, b as Me, J as He, a as Le, d as Xe, P as ke, R as We, e as Ke, c as we, V as Ge } from "../types-BqGAMOZM.js";
20
- import { i as Ze, p as Je } from "../errors-9AkghWyk.js";
21
- import { B as qe, C as ze, p as Qe, q as $e, t as as, u as es, R as ss, a as ts, n as rs, o as os, i as is, m as ns, l as us, j as ls, r as ps, b as ds, s as Ps, v as cs, g as Ts, h as Es, d as As, c as Ss, e as Rs, f as _s, k as gs, w as ms } from "../buildAndBroadcastRefund-37Bs7-V1.js";
22
- import { C as fs, P as bs, c as Is, g as vs } from "../peginState-CBAlxgXk.js";
16
+ import { U as za, a as Qa, e as $a, f as ae, v as ee } from "../reservation-BxvKbQH2.js";
17
+ import { M as te, V as re, g as oe, a as ie, b as ne, c as ue, d as le, e as pe, f as de, h as Pe, p as ce, v as Te, i as Ee, j as Ae } from "../mempoolApi-DnP7d084.js";
18
+ import { O as _e, S as ge, V as Re, g as me, h as xe, i as fe, a as be, d as Ie, b as Oe, f as Ve, p as ve, r as Ce, v as Fe, c as he, e as Ue } from "../primeVpAuth-DXl9wGBR.js";
19
+ import { A as Ne, D as De, b as Be, J as Me, a as He, d as Le, P as Xe, R as ke, e as We, c as Ke, V as we } from "../types-BqGAMOZM.js";
20
+ import { i as Ye, p as Ze } from "../errors-9AkghWyk.js";
21
+ import { B as je, C as qe, p as ze, q as Qe, t as $e, u as as, R as es, a as ss, n as ts, o as rs, i as os, m as is, l as ns, j as us, r as ls, b as ps, s as ds, v as Ps, g as cs, h as Ts, d as Es, c as As, e as Ss, f as _s, k as gs, w as Rs } from "../buildAndBroadcastRefund-CZj2z7PJ.js";
22
+ import { C as xs, P as fs, c as bs, g as Is } from "../peginState-CBAlxgXk.js";
23
23
  export {
24
- De as AUTH_EXPIRED_DATA_KIND,
24
+ Ne as AUTH_EXPIRED_DATA_KIND,
25
25
  da as ApplicationRegistryABI,
26
- qe as BIP68NotMatureError,
26
+ je as BIP68NotMatureError,
27
27
  Y as BITCOIN_ADDRESS_RE,
28
28
  Ta as BTCVaultRegistryABI,
29
29
  Da as BTC_DUST_SAT,
30
30
  xa as BitcoinScriptType,
31
31
  Aa as CONTRACT_ERRORS,
32
- ze as ClaimerPegoutStatusValue,
33
- fs as ContractStatus,
32
+ qe as ClaimerPegoutStatusValue,
33
+ xs as ContractStatus,
34
34
  Ba as DUST_THRESHOLD,
35
- Be as DaemonStatus,
35
+ De as DaemonStatus,
36
36
  Ma as FEE_SAFETY_MARGIN,
37
37
  Z as HEX_RE,
38
- Me as JSON_RPC_ERROR_CODES,
39
- He as JsonRpcClient,
40
- Le as JsonRpcError,
38
+ Be as JSON_RPC_ERROR_CODES,
39
+ Me as JsonRpcClient,
40
+ He as JsonRpcError,
41
41
  J as KNOWN_SCRIPT_PREFIXES,
42
42
  Ha as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
43
43
  La as MAX_NON_LEGACY_OUTPUT_SIZE,
44
44
  j as MAX_REASONABLE_FEE_SATS,
45
- re as MEMPOOL_API_URLS,
45
+ te as MEMPOOL_API_URLS,
46
46
  _e as OnChainBtcVaultStatus,
47
47
  Xa as P2TR_INPUT_SIZE,
48
48
  ka as PEGIN_AUTH_ANCHOR_OUTPUTS,
49
49
  Wa as PEGIN_FIXED_OUTPUTS,
50
- Xe as POST_WOTS_STATUSES,
51
- ke as PRE_DEPOSITOR_SIGNATURES_STATES,
50
+ Le as POST_WOTS_STATUSES,
51
+ Xe as PRE_DEPOSITOR_SIGNATURES_STATES,
52
52
  na as PayoutManager,
53
- bs as PeginAction,
53
+ fs as PeginAction,
54
54
  Q as PeginManager,
55
55
  Pa as ProtocolParamsABI,
56
56
  c as PsbtSubstitutionError,
57
- Qe as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
58
- $e as REFUND_MAX_FEE_FRACTION_NUMERATOR,
59
- as as REFUND_MAX_FEE_RATE_SATS_VB,
60
- es as REFUND_VSIZE,
61
- ss as RegisteredVaultVersionMismatchError,
62
- We as RpcErrorCode,
57
+ ze as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
58
+ Qe as REFUND_MAX_FEE_FRACTION_NUMERATOR,
59
+ $e as REFUND_MAX_FEE_RATE_SATS_VB,
60
+ as as REFUND_VSIZE,
61
+ es as RegisteredVaultVersionMismatchError,
62
+ ke as RpcErrorCode,
63
63
  Ka as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
64
64
  ge as ServerIdentityError,
65
65
  q as TXID_RE,
66
66
  wa as TX_BUFFER_SIZE_OVERHEAD,
67
67
  za as UtxoNotAvailableError,
68
68
  $ as VAULT_APP_NAME,
69
- Ke as VP_BATCH_MAX_SIZE,
70
- we as VP_TERMINAL_FAILURE_STATUSES,
71
- Ge as VP_TRANSIENT_STATUSES,
72
- me as VaultProviderRpcClient,
73
- xe as ViemProtocolParamsReader,
74
- fe as ViemUniversalChallengerReader,
75
- be as ViemVaultKeeperReader,
76
- oe as ViemVaultRegistryReader,
77
- Ie as VpResponseValidationError,
78
- ve as VpTokenRegistry,
69
+ We as VP_BATCH_MAX_SIZE,
70
+ Ke as VP_TERMINAL_FAILURE_STATUSES,
71
+ we as VP_TRANSIENT_STATUSES,
72
+ Re as VaultProviderRpcClient,
73
+ me as ViemProtocolParamsReader,
74
+ xe as ViemUniversalChallengerReader,
75
+ fe as ViemVaultKeeperReader,
76
+ re as ViemVaultRegistryReader,
77
+ be as VpResponseValidationError,
78
+ Ie as VpTokenRegistry,
79
79
  Ga as WALLET_RELAY_FEE_RATE_THRESHOLD,
80
- ts as activateVault,
80
+ ss as activateVault,
81
81
  fa as applyChangeOutputPolicy,
82
82
  T as assertPsbtUnsignedTxMatches,
83
83
  Qa as assertUtxosAvailable,
84
- Ce as batchPollByProvider,
85
- rs as buildAndBroadcastRefund,
84
+ Oe as batchPollByProvider,
85
+ ts as buildAndBroadcastRefund,
86
86
  s as buildChallengeAssertPsbt,
87
87
  t as buildDepositorPayoutPsbt,
88
88
  aa as buildFundingOutpointsCommitment,
@@ -91,101 +91,100 @@ export {
91
91
  m as buildPeginInputPsbt,
92
92
  A as buildPeginTxFromFundedPrePegin,
93
93
  S as buildPrePeginPsbt,
94
- v as buildRefundPsbt,
94
+ O as buildRefundPsbt,
95
95
  ea as buildVaultContext,
96
96
  ba as calculateBtcTxHash,
97
- Is as canPerformAction,
98
- $a as collectReservedUtxoRefs,
97
+ bs as canPerformAction,
99
98
  Ia as computeChangeOutputFeeSats,
100
99
  ua as computeHashlock,
101
- va as computeMaxDeposit,
100
+ Oa as computeMaxDeposit,
102
101
  i as computeMinClaimValue,
103
102
  n as computeMinPeginFee,
104
103
  r as computeNumLocalChallengers,
105
- Ca as computePeginBaseFeeSats,
104
+ Va as computePeginBaseFeeSats,
106
105
  sa as computeWotsBlockPublicKeysHash,
107
- Fe as createAuthenticatedVpClient,
108
- R as createPayoutScript,
106
+ Ve as createAuthenticatedVpClient,
107
+ _ as createPayoutScript,
109
108
  w as createTaprootScriptPathSignOptions,
110
- F as deriveBip86ScriptPubKeyHex,
111
- O as deriveNativeSegwitAddress,
112
- V as deriveTaprootAddress,
109
+ v as deriveBip86ScriptPubKeyHex,
110
+ C as deriveNativeSegwitAddress,
111
+ F as deriveTaprootAddress,
113
112
  u as deriveVaultId,
114
113
  ta as deriveVaultRoot,
115
114
  ra as deriveWotsBlocksFromSeed,
116
- U as ensureHexPrefix,
117
- os as estimateRefundFeeSats,
115
+ h as ensureHexPrefix,
116
+ rs as estimateRefundFeeSats,
118
117
  oa as estimateSubmitPeginRequestBatchGas,
119
118
  l as expandAuthAnchor,
120
119
  p as expandHashlockSecret,
121
120
  d as expandWotsSeed,
122
121
  Sa as extractErrorData,
123
- ae as extractInputsFromTransaction,
124
- _ as extractPayoutSignature,
122
+ $a as extractInputsFromTransaction,
123
+ g as extractPayoutSignature,
125
124
  x as extractPeginInputSignature,
126
125
  f as finalizePeginInputPsbt,
127
- h as formatSatoshisToBtc,
126
+ ae as findOverlappingPendingVaults,
127
+ U as formatSatoshisToBtc,
128
128
  Ya as fundPeginTransaction,
129
- ie as getAddressTxs,
130
- ne as getAddressUtxos,
131
- Ra as getContractErrorMessage,
132
- Fa as getDustThreshold,
133
- ue as getMempoolApiUrl,
129
+ oe as getAddressTxs,
130
+ ie as getAddressUtxos,
131
+ _a as getContractErrorMessage,
132
+ va as getDustThreshold,
133
+ ne as getMempoolApiUrl,
134
134
  y as getNetwork,
135
- le as getNetworkFees,
136
- vs as getPeginProtocolState,
137
- Oa as getPsbtInputFields,
138
- Va as getScriptType,
135
+ ue as getNetworkFees,
136
+ Is as getPeginProtocolState,
137
+ Ca as getPsbtInputFields,
138
+ Fa as getScriptType,
139
139
  N as getSortedXOnlyPubkeys,
140
- pe as getTipHeight,
141
- de as getTxHex,
142
- Pe as getTxInfo,
143
- ce as getUtxoInfo,
144
- _a as handleContractError,
140
+ le as getTipHeight,
141
+ pe as getTxHex,
142
+ de as getTxInfo,
143
+ Pe as getUtxoInfo,
144
+ ga as handleContractError,
145
145
  D as hexToUint8Array,
146
146
  B as isAddressFromPublicKey,
147
- is as isDepositAmountValid,
148
- ga as isKnownContractError,
149
- ns as isPegoutTerminalStatus,
150
- us as isRecognizedPegoutStatus,
151
- ls as isRegisteredVaultVersionMismatchError,
147
+ os as isDepositAmountValid,
148
+ Ra as isKnownContractError,
149
+ is as isPegoutTerminalStatus,
150
+ ns as isRecognizedPegoutStatus,
151
+ us as isRegisteredVaultVersionMismatchError,
152
152
  M as isValidHex,
153
- Ze as isWotsMismatchError,
154
- Je as parseFundingOutpointsFromTx,
153
+ Ye as isWotsMismatchError,
154
+ Ze as parseFundingOutpointsFromTx,
155
155
  Za as parseUnfundedWasmTransaction,
156
156
  Ja as peginOutputCount,
157
- Oe as primeVpTokenRegistry,
157
+ ve as primeVpTokenRegistry,
158
158
  H as processPublicKeyToXOnly,
159
- Te as pushTx,
159
+ ce as pushTx,
160
160
  ja as rateBasedTxBufferFee,
161
- Ve as resolveProtocolAddresses,
162
- ps as runDepositorPresignFlow,
163
- ee as selectUtxosForDeposit,
164
- Ua as selectUtxosForPegin,
165
- ha as shouldAddChangeOutput,
166
- ds as signDepositorGraph,
161
+ Ce as resolveProtocolAddresses,
162
+ ls as runDepositorPresignFlow,
163
+ ha as selectUtxosForPegin,
164
+ Ua as shouldAddChangeOutput,
165
+ ps as signDepositorGraph,
167
166
  L as stripHexPrefix,
168
- Ps as submitWotsPublicKey,
167
+ ds as submitWotsPublicKey,
169
168
  X as toXOnly,
170
169
  k as uint8ArrayToHex,
171
- cs as validateDepositAmount,
172
- Ts as validateMultiVaultDepositInputs,
173
- Ee as validateOffchainParams,
174
- Es as validateOnChainParticipantKeys,
175
- Ae as validatePegInConfiguration,
176
- As as validateProviderSelection,
177
- Ss as validateRemainingCapacity,
178
- Ue as validateRequestDepositorClaimerArtifactsResponse,
170
+ Ps as validateDepositAmount,
171
+ cs as validateMultiVaultDepositInputs,
172
+ Te as validateOffchainParams,
173
+ Ts as validateOnChainParticipantKeys,
174
+ Ee as validatePegInConfiguration,
175
+ Es as validateProviderSelection,
176
+ As as validateRemainingCapacity,
177
+ Fe as validateRequestDepositorClaimerArtifactsResponse,
179
178
  la as validateSecretAgainstHashlock,
180
- Se as validateTBVProtocolParams,
181
- se as validateUtxosAvailable,
182
- Rs as validateVaultAmounts,
179
+ Ae as validateTBVProtocolParams,
180
+ ee as validateUtxosAvailable,
181
+ Ss as validateVaultAmounts,
183
182
  _s as validateVaultProviderPubkey,
184
183
  W as validateWalletPubkey,
185
184
  gs as verifyRegisteredVaultVersions,
186
185
  he as verifyServerIdentity,
187
- ye as vpTokenRegistry,
188
- ms as waitForPeginStatus,
186
+ Ue as vpTokenRegistry,
187
+ Rs as waitForPeginStatus,
189
188
  ya as waitForTransactionReceiptSmartAware
190
189
  };
191
190
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonlabs-io/ts-sdk",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- {"version":3,"file":"BTCVaultRegistry.abi-CHFGevwa.cjs","sources":["../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"sourcesContent":["/**\n * BTCVaultRegistry Contract ABI\n *\n * Minimal ABI containing only the functions needed by the SDK.\n * Full ABI is available in the vault service package.\n *\n * @module contracts/abis/BTCVaultRegistry\n */\n\n/**\n * Minimal ABI for BTCVaultRegistry contract.\n * Contains submitPeginRequest, submitPeginRequestBatch, activateVaultWithSecret, getPegInFee, getBtcVaultBasicInfo, and getVaultProviderCommission.\n */\nexport const BTCVaultRegistryABI = [\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequestBatch\",\n inputs: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n { name: \"vaultProvider\", type: \"address\", internalType: \"address\" },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"requests\",\n type: \"tuple[]\",\n internalType: \"struct BTCVaultRegistryTypes.BatchPeginRequest[]\",\n components: [\n { name: \"depositorBtcPubKey\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"btcPopSignature\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"unsignedPrePeginTx\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"depositorSignedPeginTx\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"hashlock\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"htlcVout\", type: \"uint8\", internalType: \"uint8\" },\n { name: \"referralCode\", type: \"uint32\", internalType: \"uint32\" },\n { name: \"depositorPayoutBtcAddress\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"depositorWotsPkHash\", type: \"bytes32\", internalType: \"bytes32\" },\n ],\n },\n ],\n outputs: [\n { name: \"vaultIds\", type: \"bytes32[]\", internalType: \"bytes32[]\" },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"activateVaultWithSecret\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"activationMetadata\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"getPegInFee\",\n inputs: [\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n ],\n outputs: [\n {\n name: \"totalFee\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderBTCKey\",\n inputs: [\n { name: \"vpAddr\", type: \"address\", internalType: \"address\" },\n ],\n outputs: [\n { name: \"\", type: \"bytes32\", internalType: \"bytes32\" },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderCommission\",\n inputs: [\n { name: \"vpAddr\", type: \"address\", internalType: \"address\" },\n ],\n outputs: [\n { name: \"\", type: \"uint16\", internalType: \"uint16\" },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getBtcVaultBasicInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vBasic\",\n type: \"tuple\",\n internalType: \"struct BTCVaultTypes.BTCVaultBasicInfo\",\n components: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n { name: \"amount\", type: \"uint256\", internalType: \"uint256\" },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"status\",\n type: \"uint8\",\n internalType: \"enum IBTCVaultRegistry.BTCVaultStatus\",\n },\n {\n name: \"applicationEntryPoint\",\n type: \"address\",\n internalType: \"address\",\n },\n { name: \"createdAt\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"error\",\n name: \"InvalidPeginFee\",\n inputs: [\n {\n name: \"provided\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"required\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n ],\n },\n {\n type: \"error\",\n name: \"InvalidSecret\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"ActivationDeadlineExpired\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"InvalidHashlock\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"DuplicateHashlock\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"CapExceeded\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"InvalidOutputIndex\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"PeginSignaturesIncomplete\",\n inputs: [],\n },\n {\n type: \"function\",\n name: \"getBtcVaultProtocolInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vProtocol\",\n type: \"tuple\",\n internalType:\n \"struct BTCVaultRegistryTypes.BTCVaultProtocolInfo\",\n components: [\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"verifiedAt\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"prePeginTxHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"vaultProviderCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"claimExpiredUntil\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"protocolParams\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IProtocolParams\",\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"applicationRegistry\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IApplicationRegistry\",\n },\n ],\n stateMutability: \"view\",\n },\n] as const;\n"],"names":["BTCVaultRegistryABI"],"mappings":"aAaO,MAAMA,EAAsB,CACjC,CACE,KAAM,WACN,KAAM,qBACN,OAAQ,CACN,CACE,KAAM,YACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,qBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,kBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,qBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,yBACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,gBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,6BACN,KAAM,SACN,aAAc,QAAA,EAEhB,CACE,KAAM,WACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,WACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,4BACN,KAAM,QACN,aAAc,OAAA,EAEhB,CACE,KAAM,sBACN,KAAM,UACN,aAAc,SAAA,CAChB,EAEF,QAAS,CACP,CACE,KAAM,GACN,KAAM,UACN,aAAc,SAAA,CAChB,EAEF,gBAAiB,SAAA,EAEnB,CACE,KAAM,WACN,KAAM,qBACN,OAAQ,CACN,CACE,KAAM,YACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,qBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,kBACN,KAAM,QACN,aAAc,OAAA,EA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SAAA,EAEhB,CACE,KAAM,6BACN,KAAM,SACN,aAAc,QAAA,EAEhB,CACE,KAAM,oBACN,KAAM,UACN,aAAc,SAAA,EAEhB,CACE,KAAM,mBACN,KAAM,SACN,aAAc,QAAA,CAChB,CACF,CACF,EAEF,gBAAiB,MAAA,EAEnB,CACE,KAAM,WACN,KAAM,iBACN,OAAQ,CAAA,EACR,QAAS,CACP,CACE,KAAM,GACN,KAAM,UACN,aAAc,0BAAA,CAChB,EAEF,gBAAiB,MAAA,EAEnB,CACE,KAAM,WACN,KAAM,sBACN,OAAQ,CAAA,EACR,QAAS,CACP,CACE,KAAM,GACN,KAAM,UACN,aAAc,+BAAA,CAChB,EAEF,gBAAiB,MAAA,CAErB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BTCVaultRegistry.abi-Cq9-JlqT.js","sources":["../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"sourcesContent":["/**\n * BTCVaultRegistry Contract ABI\n *\n * Minimal ABI containing only the functions needed by the SDK.\n * Full ABI is available in the vault service package.\n *\n * @module contracts/abis/BTCVaultRegistry\n */\n\n/**\n * Minimal ABI for BTCVaultRegistry contract.\n * Contains submitPeginRequest, submitPeginRequestBatch, activateVaultWithSecret, getPegInFee, getBtcVaultBasicInfo, and getVaultProviderCommission.\n */\nexport const BTCVaultRegistryABI = [\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequest\",\n inputs: [\n {\n name: \"depositor\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"btcPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"unsignedPrePeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"referralCode\",\n type: \"uint32\",\n internalType: \"uint32\",\n },\n {\n name: \"depositorPayoutBtcAddress\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"submitPeginRequestBatch\",\n inputs: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n { name: \"vaultProvider\", type: \"address\", internalType: \"address\" },\n {\n name: \"maxAcceptableCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"requests\",\n type: \"tuple[]\",\n internalType: \"struct BTCVaultRegistryTypes.BatchPeginRequest[]\",\n components: [\n { name: \"depositorBtcPubKey\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"btcPopSignature\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"unsignedPrePeginTx\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"depositorSignedPeginTx\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"hashlock\", type: \"bytes32\", internalType: \"bytes32\" },\n { name: \"htlcVout\", type: \"uint8\", internalType: \"uint8\" },\n { name: \"referralCode\", type: \"uint32\", internalType: \"uint32\" },\n { name: \"depositorPayoutBtcAddress\", type: \"bytes\", internalType: \"bytes\" },\n { name: \"depositorWotsPkHash\", type: \"bytes32\", internalType: \"bytes32\" },\n ],\n },\n ],\n outputs: [\n { name: \"vaultIds\", type: \"bytes32[]\", internalType: \"bytes32[]\" },\n ],\n stateMutability: \"payable\",\n },\n {\n type: \"function\",\n name: \"activateVaultWithSecret\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"s\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"activationMetadata\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n ],\n outputs: [],\n stateMutability: \"nonpayable\",\n },\n {\n type: \"function\",\n name: \"getPegInFee\",\n inputs: [\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n ],\n outputs: [\n {\n name: \"totalFee\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderBTCKey\",\n inputs: [\n { name: \"vpAddr\", type: \"address\", internalType: \"address\" },\n ],\n outputs: [\n { name: \"\", type: \"bytes32\", internalType: \"bytes32\" },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getVaultProviderCommission\",\n inputs: [\n { name: \"vpAddr\", type: \"address\", internalType: \"address\" },\n ],\n outputs: [\n { name: \"\", type: \"uint16\", internalType: \"uint16\" },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"getBtcVaultBasicInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vBasic\",\n type: \"tuple\",\n internalType: \"struct BTCVaultTypes.BTCVaultBasicInfo\",\n components: [\n { name: \"depositor\", type: \"address\", internalType: \"address\" },\n {\n name: \"depositorBtcPubKey\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n { name: \"amount\", type: \"uint256\", internalType: \"uint256\" },\n {\n name: \"vaultProvider\",\n type: \"address\",\n internalType: \"address\",\n },\n {\n name: \"status\",\n type: \"uint8\",\n internalType: \"enum IBTCVaultRegistry.BTCVaultStatus\",\n },\n {\n name: \"applicationEntryPoint\",\n type: \"address\",\n internalType: \"address\",\n },\n { name: \"createdAt\", type: \"uint256\", internalType: \"uint256\" },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"error\",\n name: \"InvalidPeginFee\",\n inputs: [\n {\n name: \"provided\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"required\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n ],\n },\n {\n type: \"error\",\n name: \"InvalidSecret\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"ActivationDeadlineExpired\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"InvalidHashlock\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"DuplicateHashlock\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"CapExceeded\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"InvalidOutputIndex\",\n inputs: [],\n },\n {\n type: \"error\",\n name: \"PeginSignaturesIncomplete\",\n inputs: [],\n },\n {\n type: \"function\",\n name: \"getBtcVaultProtocolInfo\",\n inputs: [\n {\n name: \"vaultId\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n ],\n outputs: [\n {\n name: \"vProtocol\",\n type: \"tuple\",\n internalType:\n \"struct BTCVaultRegistryTypes.BTCVaultProtocolInfo\",\n components: [\n {\n name: \"depositorSignedPeginTx\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"universalChallengersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"appVaultKeepersVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"offchainParamsVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"verifiedAt\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"depositorWotsPkHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"hashlock\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"htlcVout\",\n type: \"uint8\",\n internalType: \"uint8\",\n },\n {\n name: \"depositorPopSignature\",\n type: \"bytes\",\n internalType: \"bytes\",\n },\n {\n name: \"prePeginTxHash\",\n type: \"bytes32\",\n internalType: \"bytes32\",\n },\n {\n name: \"vaultProviderCommissionBps\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n {\n name: \"claimExpiredUntil\",\n type: \"uint256\",\n internalType: \"uint256\",\n },\n {\n name: \"vaultCoreVersion\",\n type: \"uint16\",\n internalType: \"uint16\",\n },\n ],\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"protocolParams\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IProtocolParams\",\n },\n ],\n stateMutability: \"view\",\n },\n {\n type: \"function\",\n name: \"applicationRegistry\",\n inputs: [],\n outputs: [\n {\n name: \"\",\n type: \"address\",\n internalType: \"contract IApplicationRegistry\",\n },\n ],\n stateMutability: \"view\",\n },\n] as const;\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IAChB;AAAA,IAEF,iBAAiB;AAAA,EAAA;AAAA,EAEnB;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,QAAQ,CAAA;AAAA,IACR,SAAS;AAAA,MACP;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,QACN,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,IAEF,iBAAiB;AAAA,EAAA;AAErB;"}
@@ -1,2 +0,0 @@
1
- "use strict";const a={"0x04aabf33":"Vault already exists: This Bitcoin transaction has already been registered. Please select different UTXOs or use a different amount to create a unique transaction.","0x4fec082d":"Script mismatch: The Bitcoin transaction's taproot output does not match the expected vault script. This may be caused by incorrect vault participants or key configuration.","0x6cc363a5":"Invalid BTC proof of possession: The signature could not be verified. Please ensure you're signing with the correct Bitcoin wallet.","0x6c3f2bf6":"Invalid BTC public key: The Bitcoin public key format is invalid.","0x2c5211c6":"Invalid amount: The deposit amount is invalid or below the minimum required.","0x0405f772":"Application not registered: The application controller is not registered in the system.","0x24e165cc":"Invalid provider status: The vault provider is not in a valid state to accept deposits.","0xd92e233d":"Zero address: One of the required addresses is the zero address.","0x65aa7007":"BTC key mismatch: The Bitcoin public key does not match the expected key.","0x82b42900":"Unauthorized: You must be the depositor or vault provider to submit this transaction.","0x8baa579f":"Invalid signature: The BTC proof of possession signature could not be verified.","0x2f9d01e9":"Invalid BTC transaction: The Bitcoin transaction format is invalid.","0x5a3c6b3e":"Vault provider not registered: The selected vault provider is not registered.","0x979f4518":"Invalid pegin fee: The ETH fee sent does not match the required amount. This may indicate a fee rate change during the transaction.","0x5fad9694":"This pre-pegin output has already been used to activate another vault.","0x7ed061c9":"This pegin transaction has already been used to activate another vault."};function s(e){if(!e||typeof e!="object")return;const t=e;if(typeof t.data=="string"&&t.data.startsWith("0x"))return t.data;if(typeof t.details=="string"&&t.details.startsWith("0x"))return t.details;let r=t.cause,o=0;const n=5;for(;r&&typeof r=="object"&&o<n;){const i=r;if(typeof i.data=="string"&&i.data.startsWith("0x"))return i.data;r=i.cause,o++}const c=(typeof t.message=="string"?t.message:"").match(/\b(0x[a-fA-F0-9]{8})\b/);if(c)return c[1]}function d(e){const t=s(e);if(t){const r=t.substring(0,10);return a[t]??a[r]}}function l(e){const t=s(e);if(t===void 0)return!1;const r=t.substring(0,10);return t in a||r in a}function u(e){console.error("[Contract Error] Raw error:",e);const t=s(e);if(console.error("[Contract Error] Extracted error data:",t),t){const o=t.substring(0,10),n=a[t]??a[o];if(n)throw console.error("[Contract Error] Known error:",n),new Error(n)}const r=(e==null?void 0:e.message)||"";if(r.includes("gas limit too high")||r.includes("21000000")||r.includes("Internal JSON-RPC error")){const o=t?` (error code: ${t})`:"";throw console.error("[Contract Error] Transaction rejected. Error code:",t,"Message:",r),new Error(`Transaction failed: The contract rejected this transaction${o}. Possible causes: (1) Vault already exists for this transaction, (2) Invalid signature, (3) Unauthorized caller. Please check your transaction parameters and try again.`)}throw e instanceof Error?(console.error("[Contract Error] Unhandled error:",e.message),e):new Error(`Contract call failed: ${String(e)}`)}exports.CONTRACT_ERRORS=a;exports.extractErrorData=s;exports.getContractErrorMessage=d;exports.handleContractError=u;exports.isKnownContractError=l;
2
- //# sourceMappingURL=errors-BP73_stm.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-BP73_stm.cjs","sources":["../src/tbv/core/contracts/errors.ts"],"sourcesContent":["/**\n * Contract Error Handling Utilities\n *\n * Provides utilities for extracting and handling contract revert errors.\n * Maps known error selectors to user-friendly messages.\n *\n * @module contracts/errors\n */\n\n/**\n * Known contract error signatures mapped to user-friendly messages.\n *\n * Error selectors are the first 4 bytes of keccak256(error signature).\n * Example: keccak256(\"VaultAlreadyExists()\") = 0x04aabf33...\n */\nexport const CONTRACT_ERRORS: Record<string, string> = {\n // VaultAlreadyExists()\n \"0x04aabf33\":\n \"Vault already exists: This Bitcoin transaction has already been registered. \" +\n \"Please select different UTXOs or use a different amount to create a unique transaction.\",\n // ScriptPubKeyMismatch() - taproot output doesn't match expected script\n \"0x4fec082d\":\n \"Script mismatch: The Bitcoin transaction's taproot output does not match the expected vault script. \" +\n \"This may be caused by incorrect vault participants or key configuration.\",\n // InvalidBTCProofOfPossession()\n \"0x6cc363a5\":\n \"Invalid BTC proof of possession: The signature could not be verified. \" +\n \"Please ensure you're signing with the correct Bitcoin wallet.\",\n // InvalidBTCPublicKey()\n \"0x6c3f2bf6\":\n \"Invalid BTC public key: The Bitcoin public key format is invalid.\",\n // InvalidAmount()\n \"0x2c5211c6\":\n \"Invalid amount: The deposit amount is invalid or below the minimum required.\",\n // ApplicationNotRegistered()\n \"0x0405f772\":\n \"Application not registered: The application controller is not registered in the system.\",\n // InvalidProviderStatus()\n \"0x24e165cc\":\n \"Invalid provider status: The vault provider is not in a valid state to accept deposits.\",\n // ZeroAddress()\n \"0xd92e233d\":\n \"Zero address: One of the required addresses is the zero address.\",\n // BtcKeyMismatch()\n \"0x65aa7007\":\n \"BTC key mismatch: The Bitcoin public key does not match the expected key.\",\n // Unauthorized()\n \"0x82b42900\":\n \"Unauthorized: You must be the depositor or vault provider to submit this transaction.\",\n // InvalidSignature() - common signature verification error\n \"0x8baa579f\":\n \"Invalid signature: The BTC proof of possession signature could not be verified.\",\n // InvalidBtcTransaction()\n \"0x2f9d01e9\":\n \"Invalid BTC transaction: The Bitcoin transaction format is invalid.\",\n // VaultProviderNotRegistered()\n \"0x5a3c6b3e\":\n \"Vault provider not registered: The selected vault provider is not registered.\",\n // InvalidPeginFee(uint256,uint256)\n \"0x979f4518\":\n \"Invalid pegin fee: The ETH fee sent does not match the required amount. \" +\n \"This may indicate a fee rate change during the transaction.\",\n // PrePeginOutputAlreadyUsed()\n \"0x5fad9694\":\n \"This pre-pegin output has already been used to activate another vault.\",\n // PeginTransactionAlreadyUsed()\n \"0x7ed061c9\":\n \"This pegin transaction has already been used to activate another vault.\",\n};\n\n/**\n * Extract error data from various error formats.\n *\n * Viem and wallet providers wrap errors in multiple levels. This function\n * searches through the error chain to find the revert data.\n *\n * @param error - The error object to extract data from\n * @returns The error data (e.g., \"0x04aabf33\") or undefined\n */\nexport function extractErrorData(error: unknown): string | undefined {\n if (!error || typeof error !== \"object\") return undefined;\n\n const err = error as Record<string, unknown>;\n\n // Check direct properties first\n if (typeof err.data === \"string\" && err.data.startsWith(\"0x\")) {\n return err.data;\n }\n if (typeof err.details === \"string\" && err.details.startsWith(\"0x\")) {\n return err.details;\n }\n\n // Walk the cause chain (viem wraps errors multiple levels deep)\n let current: unknown = err.cause;\n let depth = 0;\n const maxDepth = 5;\n\n while (current && typeof current === \"object\" && depth < maxDepth) {\n const cause = current as Record<string, unknown>;\n if (typeof cause.data === \"string\" && cause.data.startsWith(\"0x\")) {\n return cause.data;\n }\n current = cause.cause;\n depth++;\n }\n\n // Check error message for embedded hex error selector\n const message = typeof err.message === \"string\" ? err.message : \"\";\n const hexMatch = message.match(/\\b(0x[a-fA-F0-9]{8})\\b/);\n if (hexMatch) {\n return hexMatch[1];\n }\n\n return undefined;\n}\n\n/**\n * Get a user-friendly error message for a contract error.\n *\n * @param error - The error object from a contract call\n * @returns A user-friendly error message, or undefined if error is not recognized\n */\nexport function getContractErrorMessage(error: unknown): string | undefined {\n const errorData = extractErrorData(error);\n if (errorData) {\n // Check exact match first, then match by 4-byte selector prefix.\n // Parametric errors (e.g. InvalidPeginFee(uint256,uint256)) return\n // the selector + ABI-encoded args, so the full string won't match.\n const selector = errorData.substring(0, 10); // \"0x\" + 4 bytes\n return CONTRACT_ERRORS[errorData] ?? CONTRACT_ERRORS[selector];\n }\n return undefined;\n}\n\n/**\n * Check if an error is a known contract error.\n *\n * @param error - The error object to check\n * @returns True if the error is a known contract error\n */\nexport function isKnownContractError(error: unknown): boolean {\n const errorData = extractErrorData(error);\n if (errorData === undefined) return false;\n const selector = errorData.substring(0, 10);\n return errorData in CONTRACT_ERRORS || selector in CONTRACT_ERRORS;\n}\n\n/**\n * Handle a contract error by throwing a user-friendly error.\n *\n * This function extracts error data, maps it to a user-friendly message,\n * and throws an appropriate error. Use this in catch blocks after contract calls.\n *\n * @param error - The error from a contract call\n * @throws Always throws an error with a descriptive message\n */\nexport function handleContractError(error: unknown): never {\n // Log full error for debugging\n console.error(\"[Contract Error] Raw error:\", error);\n\n // Extract error data from the error chain\n const errorData = extractErrorData(error);\n console.error(\"[Contract Error] Extracted error data:\", errorData);\n\n // Check for known contract error signatures (exact match or 4-byte selector prefix)\n if (errorData) {\n const selector = errorData.substring(0, 10);\n const knownError = CONTRACT_ERRORS[errorData] ?? CONTRACT_ERRORS[selector];\n if (knownError) {\n console.error(\"[Contract Error] Known error:\", knownError);\n throw new Error(knownError);\n }\n }\n\n // Check for gas estimation errors or internal JSON-RPC errors\n const errorMsg = (error as Error)?.message || \"\";\n if (\n errorMsg.includes(\"gas limit too high\") ||\n errorMsg.includes(\"21000000\") ||\n errorMsg.includes(\"Internal JSON-RPC error\")\n ) {\n // If we found error data but it's not in our known list, include it\n const errorHint = errorData ? ` (error code: ${errorData})` : \"\";\n console.error(\n \"[Contract Error] Transaction rejected. Error code:\",\n errorData,\n \"Message:\",\n errorMsg,\n );\n throw new Error(\n `Transaction failed: The contract rejected this transaction${errorHint}. ` +\n \"Possible causes: (1) Vault already exists for this transaction, \" +\n \"(2) Invalid signature, (3) Unauthorized caller. \" +\n \"Please check your transaction parameters and try again.\",\n );\n }\n\n // Default: re-throw original error with better context\n if (error instanceof Error) {\n console.error(\"[Contract Error] Unhandled error:\", error.message);\n throw error;\n }\n throw new Error(`Contract call failed: ${String(error)}`);\n}\n"],"names":["CONTRACT_ERRORS","extractErrorData","error","err","current","depth","maxDepth","cause","hexMatch","getContractErrorMessage","errorData","selector","isKnownContractError","handleContractError","knownError","errorMsg","errorHint"],"mappings":"aAeO,MAAMA,EAA0C,CAErD,aACE,sKAGF,aACE,+KAGF,aACE,sIAGF,aACE,oEAEF,aACE,+EAEF,aACE,0FAEF,aACE,0FAEF,aACE,mEAEF,aACE,4EAEF,aACE,wFAEF,aACE,kFAEF,aACE,sEAEF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