@gvnrdao/dh-lit-actions 0.0.60 → 0.0.63

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 (233) hide show
  1. package/package.json +3 -3
  2. package/pkg-dist/pkg-src/constants/chunks/contract-deployments.d.ts.map +1 -0
  3. package/pkg-dist/pkg-src/constants/chunks/contract-deployments.js.map +1 -0
  4. package/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.d.ts.map +1 -0
  5. package/pkg-dist/pkg-src/constants/chunks/lit-actions-registry.js.map +1 -0
  6. package/pkg-dist/pkg-src/constants/chunks/package-registry.d.ts.map +1 -0
  7. package/pkg-dist/pkg-src/constants/chunks/package-registry.js.map +1 -0
  8. package/pkg-dist/pkg-src/constants/index.d.ts.map +1 -0
  9. package/pkg-dist/pkg-src/constants/index.js.map +1 -0
  10. package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.d.ts +40 -0
  11. package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.d.ts.map +1 -0
  12. package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.js +102 -0
  13. package/pkg-dist/pkg-src/executors/chunks/vault-snapshot-executor.js.map +1 -0
  14. package/pkg-dist/pkg-src/executors/index.d.ts +43 -0
  15. package/pkg-dist/pkg-src/executors/index.d.ts.map +1 -0
  16. package/pkg-dist/pkg-src/executors/index.js +48 -0
  17. package/pkg-dist/pkg-src/executors/index.js.map +1 -0
  18. package/pkg-dist/pkg-src/index.d.ts.map +1 -0
  19. package/pkg-dist/pkg-src/index.js.map +1 -0
  20. package/pkg-dist/pkg-src/interfaces/chunks/diamond-hands-lit-actions.i.d.ts.map +1 -0
  21. package/pkg-dist/pkg-src/interfaces/chunks/diamond-hands-lit-actions.i.js.map +1 -0
  22. package/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.d.ts.map +1 -0
  23. package/pkg-dist/pkg-src/interfaces/chunks/lit-action-config.i.js.map +1 -0
  24. package/pkg-dist/pkg-src/interfaces/chunks/lit-action-name.i.d.ts.map +1 -0
  25. package/pkg-dist/pkg-src/interfaces/chunks/lit-action-name.i.js.map +1 -0
  26. package/pkg-dist/pkg-src/interfaces/chunks/lit-action-registry.i.d.ts.map +1 -0
  27. package/pkg-dist/pkg-src/interfaces/chunks/lit-action-registry.i.js.map +1 -0
  28. package/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.d.ts.map +1 -0
  29. package/pkg-dist/pkg-src/interfaces/chunks/pkp-info.i.js.map +1 -0
  30. package/pkg-dist/pkg-src/interfaces/deployments.d.ts.map +1 -0
  31. package/pkg-dist/pkg-src/interfaces/deployments.js.map +1 -0
  32. package/pkg-dist/pkg-src/interfaces/index.d.ts.map +1 -0
  33. package/pkg-dist/pkg-src/interfaces/index.js.map +1 -0
  34. package/pkg-dist/pkg-src/utils/chunks/cid-utils.d.ts.map +1 -0
  35. package/pkg-dist/pkg-src/utils/chunks/cid-utils.js.map +1 -0
  36. package/pkg-dist/pkg-src/utils/chunks/connection-helpers.d.ts.map +1 -0
  37. package/pkg-dist/pkg-src/utils/chunks/connection-helpers.js.map +1 -0
  38. package/pkg-dist/pkg-src/utils/chunks/debug-logger.d.ts.map +1 -0
  39. package/pkg-dist/pkg-src/utils/chunks/debug-logger.js.map +1 -0
  40. package/pkg-dist/pkg-src/utils/chunks/error-classification.d.ts.map +1 -0
  41. package/pkg-dist/pkg-src/utils/chunks/error-classification.js.map +1 -0
  42. package/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.d.ts.map +1 -0
  43. package/pkg-dist/pkg-src/utils/chunks/lit-action-helpers.js.map +1 -0
  44. package/pkg-dist/pkg-src/utils/chunks/pkp-setup.d.ts.map +1 -0
  45. package/pkg-dist/pkg-src/utils/chunks/pkp-setup.js.map +1 -0
  46. package/pkg-dist/pkg-src/utils/chunks/session-signature-cache.d.ts.map +1 -0
  47. package/pkg-dist/pkg-src/utils/chunks/session-signature-cache.js.map +1 -0
  48. package/pkg-dist/pkg-src/utils/index.d.ts.map +1 -0
  49. package/pkg-dist/pkg-src/utils/index.js.map +1 -0
  50. package/pkg-dist/src/constants/chunks/bitcoin-network-config.d.ts +130 -0
  51. package/pkg-dist/src/constants/chunks/bitcoin-network-config.d.ts.map +1 -0
  52. package/pkg-dist/src/constants/chunks/bitcoin-network-config.js +244 -0
  53. package/pkg-dist/src/constants/chunks/bitcoin-network-config.js.map +1 -0
  54. package/pkg-dist/src/constants/chunks/bitcoin.d.ts +42 -0
  55. package/pkg-dist/src/constants/chunks/bitcoin.d.ts.map +1 -0
  56. package/pkg-dist/src/constants/chunks/bitcoin.js +45 -0
  57. package/pkg-dist/src/constants/chunks/bitcoin.js.map +1 -0
  58. package/pkg-dist/src/constants/chunks/decimals.d.ts +44 -0
  59. package/pkg-dist/src/constants/chunks/decimals.d.ts.map +1 -0
  60. package/pkg-dist/src/constants/chunks/decimals.js +47 -0
  61. package/pkg-dist/src/constants/chunks/decimals.js.map +1 -0
  62. package/pkg-dist/src/constants/chunks/liquidation.d.ts +51 -0
  63. package/pkg-dist/src/constants/chunks/liquidation.d.ts.map +1 -0
  64. package/pkg-dist/src/constants/chunks/liquidation.js +54 -0
  65. package/pkg-dist/src/constants/chunks/liquidation.js.map +1 -0
  66. package/pkg-dist/src/constants/chunks/loan-status.d.ts +57 -0
  67. package/pkg-dist/src/constants/chunks/loan-status.d.ts.map +1 -0
  68. package/pkg-dist/src/constants/chunks/loan-status.js +95 -0
  69. package/pkg-dist/src/constants/chunks/loan-status.js.map +1 -0
  70. package/pkg-dist/src/constants/chunks/price-oracle.d.ts +46 -0
  71. package/pkg-dist/src/constants/chunks/price-oracle.d.ts.map +1 -0
  72. package/pkg-dist/src/constants/chunks/price-oracle.js +49 -0
  73. package/pkg-dist/src/constants/chunks/price-oracle.js.map +1 -0
  74. package/pkg-dist/src/constants/chunks/quantum-time.d.ts +63 -0
  75. package/pkg-dist/src/constants/chunks/quantum-time.d.ts.map +1 -0
  76. package/pkg-dist/src/constants/chunks/quantum-time.js +66 -0
  77. package/pkg-dist/src/constants/chunks/quantum-time.js.map +1 -0
  78. package/pkg-dist/src/constants/index.d.ts +16 -0
  79. package/pkg-dist/src/constants/index.d.ts.map +1 -0
  80. package/pkg-dist/src/constants/index.js +57 -0
  81. package/pkg-dist/src/constants/index.js.map +1 -0
  82. package/pkg-dist/src/interfaces/chunks/authorization.i.d.ts +19 -0
  83. package/pkg-dist/src/interfaces/chunks/authorization.i.d.ts.map +1 -0
  84. package/pkg-dist/src/interfaces/chunks/authorization.i.js +3 -0
  85. package/pkg-dist/src/interfaces/chunks/authorization.i.js.map +1 -0
  86. package/pkg-dist/src/interfaces/chunks/bitcoin-data-provider.i.d.ts +60 -0
  87. package/pkg-dist/src/interfaces/chunks/bitcoin-data-provider.i.d.ts.map +1 -0
  88. package/pkg-dist/src/interfaces/chunks/bitcoin-data-provider.i.js +3 -0
  89. package/pkg-dist/src/interfaces/chunks/bitcoin-data-provider.i.js.map +1 -0
  90. package/pkg-dist/src/interfaces/chunks/circuit-breaker.i.d.ts +18 -0
  91. package/pkg-dist/src/interfaces/chunks/circuit-breaker.i.d.ts.map +1 -0
  92. package/pkg-dist/src/interfaces/chunks/circuit-breaker.i.js +8 -0
  93. package/pkg-dist/src/interfaces/chunks/circuit-breaker.i.js.map +1 -0
  94. package/pkg-dist/src/interfaces/chunks/mint-authorization.i.d.ts +24 -0
  95. package/pkg-dist/src/interfaces/chunks/mint-authorization.i.d.ts.map +1 -0
  96. package/pkg-dist/src/interfaces/chunks/mint-authorization.i.js +5 -0
  97. package/pkg-dist/src/interfaces/chunks/mint-authorization.i.js.map +1 -0
  98. package/pkg-dist/src/interfaces/chunks/owner-authorization.d.ts +60 -0
  99. package/pkg-dist/src/interfaces/chunks/owner-authorization.d.ts.map +1 -0
  100. package/pkg-dist/src/interfaces/chunks/owner-authorization.js +8 -0
  101. package/pkg-dist/src/interfaces/chunks/owner-authorization.js.map +1 -0
  102. package/pkg-dist/src/interfaces/chunks/price-oracle.i.d.ts +26 -0
  103. package/pkg-dist/src/interfaces/chunks/price-oracle.i.d.ts.map +1 -0
  104. package/pkg-dist/src/interfaces/chunks/price-oracle.i.js +3 -0
  105. package/pkg-dist/src/interfaces/chunks/price-oracle.i.js.map +1 -0
  106. package/pkg-dist/src/interfaces/chunks/vault-balance-module.i.d.ts +23 -0
  107. package/pkg-dist/src/interfaces/chunks/vault-balance-module.i.d.ts.map +1 -0
  108. package/pkg-dist/src/interfaces/chunks/vault-balance-module.i.js +3 -0
  109. package/pkg-dist/src/interfaces/chunks/vault-balance-module.i.js.map +1 -0
  110. package/pkg-dist/src/interfaces/chunks/vault-balance.i.d.ts +63 -0
  111. package/pkg-dist/src/interfaces/chunks/vault-balance.i.d.ts.map +1 -0
  112. package/pkg-dist/src/interfaces/chunks/vault-balance.i.js +3 -0
  113. package/pkg-dist/src/interfaces/chunks/vault-balance.i.js.map +1 -0
  114. package/pkg-dist/src/interfaces/chunks/vault-snapshot.i.d.ts +51 -0
  115. package/pkg-dist/src/interfaces/chunks/vault-snapshot.i.d.ts.map +1 -0
  116. package/pkg-dist/src/interfaces/chunks/vault-snapshot.i.js +3 -0
  117. package/pkg-dist/src/interfaces/chunks/vault-snapshot.i.js.map +1 -0
  118. package/pkg-dist/src/interfaces/index.d.ts +15 -0
  119. package/pkg-dist/src/interfaces/index.d.ts.map +1 -0
  120. package/pkg-dist/src/interfaces/index.js +30 -0
  121. package/pkg-dist/src/interfaces/index.js.map +1 -0
  122. package/pkg-dist/src/modules/authorization.module.d.ts +160 -0
  123. package/pkg-dist/src/modules/authorization.module.d.ts.map +1 -0
  124. package/pkg-dist/src/modules/authorization.module.js +317 -0
  125. package/pkg-dist/src/modules/authorization.module.js.map +1 -0
  126. package/pkg-dist/src/modules/bitcoin-data-provider.module.d.ts +91 -0
  127. package/pkg-dist/src/modules/bitcoin-data-provider.module.d.ts.map +1 -0
  128. package/pkg-dist/src/modules/bitcoin-data-provider.module.js +261 -0
  129. package/pkg-dist/src/modules/bitcoin-data-provider.module.js.map +1 -0
  130. package/pkg-dist/src/modules/business-rules-math.module.d.ts +155 -0
  131. package/pkg-dist/src/modules/business-rules-math.module.d.ts.map +1 -0
  132. package/pkg-dist/src/modules/business-rules-math.module.js +309 -0
  133. package/pkg-dist/src/modules/business-rules-math.module.js.map +1 -0
  134. package/pkg-dist/src/modules/price-oracle.module.d.ts +29 -0
  135. package/pkg-dist/src/modules/price-oracle.module.d.ts.map +1 -0
  136. package/pkg-dist/src/modules/price-oracle.module.js +223 -0
  137. package/pkg-dist/src/modules/price-oracle.module.js.map +1 -0
  138. package/pkg-dist/src/modules/protocol-parameters.module.d.ts +58 -0
  139. package/pkg-dist/src/modules/protocol-parameters.module.d.ts.map +1 -0
  140. package/pkg-dist/src/modules/protocol-parameters.module.js +125 -0
  141. package/pkg-dist/src/modules/protocol-parameters.module.js.map +1 -0
  142. package/pkg-dist/src/modules/quantum-time.module.d.ts +149 -0
  143. package/pkg-dist/src/modules/quantum-time.module.d.ts.map +1 -0
  144. package/pkg-dist/src/modules/quantum-time.module.js +240 -0
  145. package/pkg-dist/src/modules/quantum-time.module.js.map +1 -0
  146. package/pkg-dist/src/modules/vault-balance.module.d.ts +172 -0
  147. package/pkg-dist/src/modules/vault-balance.module.d.ts.map +1 -0
  148. package/pkg-dist/src/modules/vault-balance.module.js +318 -0
  149. package/pkg-dist/src/modules/vault-balance.module.js.map +1 -0
  150. package/pkg-dist/src/modules/vault-snapshot.d.ts +168 -0
  151. package/pkg-dist/src/modules/vault-snapshot.d.ts.map +1 -0
  152. package/pkg-dist/src/modules/vault-snapshot.js +370 -0
  153. package/pkg-dist/src/modules/vault-snapshot.js.map +1 -0
  154. package/pkg-dist/constants/chunks/contract-deployments.d.ts.map +0 -1
  155. package/pkg-dist/constants/chunks/contract-deployments.js.map +0 -1
  156. package/pkg-dist/constants/chunks/lit-actions-registry.d.ts.map +0 -1
  157. package/pkg-dist/constants/chunks/lit-actions-registry.js.map +0 -1
  158. package/pkg-dist/constants/chunks/package-registry.d.ts.map +0 -1
  159. package/pkg-dist/constants/chunks/package-registry.js.map +0 -1
  160. package/pkg-dist/constants/index.d.ts.map +0 -1
  161. package/pkg-dist/constants/index.js.map +0 -1
  162. package/pkg-dist/index.d.ts.map +0 -1
  163. package/pkg-dist/index.js.map +0 -1
  164. package/pkg-dist/interfaces/chunks/diamond-hands-lit-actions.i.d.ts.map +0 -1
  165. package/pkg-dist/interfaces/chunks/diamond-hands-lit-actions.i.js.map +0 -1
  166. package/pkg-dist/interfaces/chunks/lit-action-config.i.d.ts.map +0 -1
  167. package/pkg-dist/interfaces/chunks/lit-action-config.i.js.map +0 -1
  168. package/pkg-dist/interfaces/chunks/lit-action-name.i.d.ts.map +0 -1
  169. package/pkg-dist/interfaces/chunks/lit-action-name.i.js.map +0 -1
  170. package/pkg-dist/interfaces/chunks/lit-action-registry.i.d.ts.map +0 -1
  171. package/pkg-dist/interfaces/chunks/lit-action-registry.i.js.map +0 -1
  172. package/pkg-dist/interfaces/chunks/pkp-info.i.d.ts.map +0 -1
  173. package/pkg-dist/interfaces/chunks/pkp-info.i.js.map +0 -1
  174. package/pkg-dist/interfaces/deployments.d.ts.map +0 -1
  175. package/pkg-dist/interfaces/deployments.js.map +0 -1
  176. package/pkg-dist/interfaces/index.d.ts.map +0 -1
  177. package/pkg-dist/interfaces/index.js.map +0 -1
  178. package/pkg-dist/utils/chunks/cid-utils.d.ts.map +0 -1
  179. package/pkg-dist/utils/chunks/cid-utils.js.map +0 -1
  180. package/pkg-dist/utils/chunks/connection-helpers.d.ts.map +0 -1
  181. package/pkg-dist/utils/chunks/connection-helpers.js.map +0 -1
  182. package/pkg-dist/utils/chunks/debug-logger.d.ts.map +0 -1
  183. package/pkg-dist/utils/chunks/debug-logger.js.map +0 -1
  184. package/pkg-dist/utils/chunks/error-classification.d.ts.map +0 -1
  185. package/pkg-dist/utils/chunks/error-classification.js.map +0 -1
  186. package/pkg-dist/utils/chunks/lit-action-helpers.d.ts.map +0 -1
  187. package/pkg-dist/utils/chunks/lit-action-helpers.js.map +0 -1
  188. package/pkg-dist/utils/chunks/pkp-setup.d.ts.map +0 -1
  189. package/pkg-dist/utils/chunks/pkp-setup.js.map +0 -1
  190. package/pkg-dist/utils/chunks/session-signature-cache.d.ts.map +0 -1
  191. package/pkg-dist/utils/chunks/session-signature-cache.js.map +0 -1
  192. package/pkg-dist/utils/index.d.ts.map +0 -1
  193. package/pkg-dist/utils/index.js.map +0 -1
  194. /package/pkg-dist/{constants → pkg-src/constants}/chunks/contract-deployments.d.ts +0 -0
  195. /package/pkg-dist/{constants → pkg-src/constants}/chunks/contract-deployments.js +0 -0
  196. /package/pkg-dist/{constants → pkg-src/constants}/chunks/lit-actions-registry.d.ts +0 -0
  197. /package/pkg-dist/{constants → pkg-src/constants}/chunks/lit-actions-registry.js +0 -0
  198. /package/pkg-dist/{constants → pkg-src/constants}/chunks/package-registry.d.ts +0 -0
  199. /package/pkg-dist/{constants → pkg-src/constants}/chunks/package-registry.js +0 -0
  200. /package/pkg-dist/{constants → pkg-src/constants}/index.d.ts +0 -0
  201. /package/pkg-dist/{constants → pkg-src/constants}/index.js +0 -0
  202. /package/pkg-dist/{index.d.ts → pkg-src/index.d.ts} +0 -0
  203. /package/pkg-dist/{index.js → pkg-src/index.js} +0 -0
  204. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/diamond-hands-lit-actions.i.d.ts +0 -0
  205. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/diamond-hands-lit-actions.i.js +0 -0
  206. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/lit-action-config.i.d.ts +0 -0
  207. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/lit-action-config.i.js +0 -0
  208. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/lit-action-name.i.d.ts +0 -0
  209. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/lit-action-name.i.js +0 -0
  210. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/lit-action-registry.i.d.ts +0 -0
  211. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/lit-action-registry.i.js +0 -0
  212. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/pkp-info.i.d.ts +0 -0
  213. /package/pkg-dist/{interfaces → pkg-src/interfaces}/chunks/pkp-info.i.js +0 -0
  214. /package/pkg-dist/{interfaces → pkg-src/interfaces}/deployments.d.ts +0 -0
  215. /package/pkg-dist/{interfaces → pkg-src/interfaces}/deployments.js +0 -0
  216. /package/pkg-dist/{interfaces → pkg-src/interfaces}/index.d.ts +0 -0
  217. /package/pkg-dist/{interfaces → pkg-src/interfaces}/index.js +0 -0
  218. /package/pkg-dist/{utils → pkg-src/utils}/chunks/cid-utils.d.ts +0 -0
  219. /package/pkg-dist/{utils → pkg-src/utils}/chunks/cid-utils.js +0 -0
  220. /package/pkg-dist/{utils → pkg-src/utils}/chunks/connection-helpers.d.ts +0 -0
  221. /package/pkg-dist/{utils → pkg-src/utils}/chunks/connection-helpers.js +0 -0
  222. /package/pkg-dist/{utils → pkg-src/utils}/chunks/debug-logger.d.ts +0 -0
  223. /package/pkg-dist/{utils → pkg-src/utils}/chunks/debug-logger.js +0 -0
  224. /package/pkg-dist/{utils → pkg-src/utils}/chunks/error-classification.d.ts +0 -0
  225. /package/pkg-dist/{utils → pkg-src/utils}/chunks/error-classification.js +0 -0
  226. /package/pkg-dist/{utils → pkg-src/utils}/chunks/lit-action-helpers.d.ts +0 -0
  227. /package/pkg-dist/{utils → pkg-src/utils}/chunks/lit-action-helpers.js +0 -0
  228. /package/pkg-dist/{utils → pkg-src/utils}/chunks/pkp-setup.d.ts +0 -0
  229. /package/pkg-dist/{utils → pkg-src/utils}/chunks/pkp-setup.js +0 -0
  230. /package/pkg-dist/{utils → pkg-src/utils}/chunks/session-signature-cache.d.ts +0 -0
  231. /package/pkg-dist/{utils → pkg-src/utils}/chunks/session-signature-cache.js +0 -0
  232. /package/pkg-dist/{utils → pkg-src/utils}/index.d.ts +0 -0
  233. /package/pkg-dist/{utils → pkg-src/utils}/index.js +0 -0
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Bitcoin Network Configuration
3
+ *
4
+ * Defines approved Bitcoin RPC providers and network mappings for the protocol.
5
+ * This ensures LIT actions only use vetted, reliable Bitcoin data sources.
6
+ *
7
+ * CRITICAL: Only approved providers should be added to this configuration.
8
+ */
9
+ /**
10
+ * Supported EVM chains
11
+ */
12
+ export declare enum EVMChain {
13
+ /** Ethereum Sepolia testnet */
14
+ SEPOLIA = "sepolia",
15
+ /** Ethereum mainnet */
16
+ ETHEREUM = "ethereum",
17
+ /** Hardhat local testnet */
18
+ HARDHAT = "hardhat"
19
+ }
20
+ /**
21
+ * Bitcoin network types
22
+ */
23
+ export declare enum BitcoinNetwork {
24
+ /** Bitcoin testnet */
25
+ TESTNET = "testnet",
26
+ /** Bitcoin mainnet */
27
+ MAINNET = "mainnet",
28
+ /** Bitcoin regtest (local/testing) */
29
+ REGTEST = "regtest"
30
+ }
31
+ /**
32
+ * Bitcoin provider configuration
33
+ */
34
+ export interface BitcoinProviderConfig {
35
+ /** Provider API URL */
36
+ url: string;
37
+ /** Bitcoin network (testnet or mainnet) */
38
+ network: BitcoinNetwork;
39
+ /** Minimum confirmations required for this provider/network */
40
+ minConfirmations: number;
41
+ /** Human-readable provider name */
42
+ name: string;
43
+ }
44
+ /**
45
+ * Mapping from EVM chain to Bitcoin network
46
+ *
47
+ * - Sepolia (testnet) → Bitcoin Testnet
48
+ * - Ethereum (mainnet) → Bitcoin Mainnet
49
+ */
50
+ export declare const CHAIN_TO_BITCOIN_NETWORK: Record<EVMChain, BitcoinNetwork>;
51
+ /**
52
+ * Mapping from EVM chain to chain ID
53
+ *
54
+ * - Ethereum mainnet: 1
55
+ * - Sepolia testnet: 11155111
56
+ * - Hardhat local: 31337
57
+ */
58
+ export declare const CHAIN_TO_CHAIN_ID: Record<EVMChain, number>;
59
+ /**
60
+ * Approved Bitcoin RPC providers per network
61
+ *
62
+ * Only providers in this whitelist can be used by LIT actions.
63
+ * Each provider has specific min confirmation requirements.
64
+ *
65
+ * TESTNET: Lower confirmation requirements (1 block)
66
+ * REGTEST: Lower confirmation requirements (1 block)
67
+ * MAINNET: Higher confirmation requirements (6 blocks - industry standard)
68
+ */
69
+ export declare const APPROVED_BITCOIN_PROVIDERS: Record<BitcoinNetwork, BitcoinProviderConfig[]>;
70
+ /**
71
+ * Validate and normalize EVM chain input
72
+ *
73
+ * @param chain Chain identifier (case-insensitive)
74
+ * @returns Validated EVMChain enum value
75
+ * @throws Error if chain is not supported
76
+ */
77
+ export declare function validateChain(chain: string): EVMChain;
78
+ /**
79
+ * Get Bitcoin network for EVM chain
80
+ *
81
+ * @param chain EVM chain
82
+ * @returns Corresponding Bitcoin network
83
+ */
84
+ export declare function getBitcoinNetworkForChain(chain: EVMChain): BitcoinNetwork;
85
+ /**
86
+ * Get chain ID for EVM chain
87
+ *
88
+ * @param chain EVM chain
89
+ * @returns Corresponding chain ID
90
+ */
91
+ export declare function getChainIdForChain(chain: EVMChain): number;
92
+ /**
93
+ * Validate Bitcoin provider is approved for network
94
+ *
95
+ * @param providerUrl Bitcoin provider URL
96
+ * @param bitcoinNetwork Bitcoin network (testnet or mainnet)
97
+ * @returns Provider configuration if approved
98
+ * @throws Error if provider is not approved for network
99
+ */
100
+ export declare function validateBitcoinProvider(providerUrl: string, bitcoinNetwork: BitcoinNetwork): BitcoinProviderConfig;
101
+ /**
102
+ * Validate Bitcoin provider is approved (DEV MODE)
103
+ *
104
+ * In development mode, we don't enforce chain → Bitcoin network mapping.
105
+ * The caller decides which Bitcoin network to use for any EVM chain.
106
+ * We only validate that the provider URL is in our approved list.
107
+ *
108
+ * @param providerUrl Bitcoin provider URL
109
+ * @returns Provider configuration with network auto-detected
110
+ * @throws Error if provider is not approved for any network
111
+ */
112
+ export declare function getBitcoinProviderConfig(providerUrl: string): BitcoinProviderConfig;
113
+ /**
114
+ * Get list of approved provider URLs for a chain
115
+ *
116
+ * Useful for displaying options to users or validating inputs.
117
+ *
118
+ * @param chain EVM chain
119
+ * @returns Array of approved provider URLs for that chain's Bitcoin network
120
+ */
121
+ export declare function getApprovedProvidersForChain(chain: EVMChain): string[];
122
+ /**
123
+ * Get human-readable provider name from URL
124
+ *
125
+ * @param providerUrl Provider URL
126
+ * @param bitcoinNetwork Bitcoin network
127
+ * @returns Provider name or URL if not found
128
+ */
129
+ export declare function getProviderName(providerUrl: string, bitcoinNetwork: BitcoinNetwork): string;
130
+ //# sourceMappingURL=bitcoin-network-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitcoin-network-config.d.ts","sourceRoot":"","sources":["../../../../src/constants/chunks/bitcoin-network-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,oBAAY,QAAQ;IAClB,+BAA+B;IAC/B,OAAO,YAAY;IAEnB,uBAAuB;IACvB,QAAQ,aAAa;IAErB,4BAA4B;IAC5B,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,sBAAsB;IACtB,OAAO,YAAY;IAEnB,sBAAsB;IACtB,OAAO,YAAY;IAEnB,sCAAsC;IACtC,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IAEZ,2CAA2C;IAC3C,OAAO,EAAE,cAAc,CAAC;IAExB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IAEzB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,QAAQ,EAAE,cAAc,CAIrE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAItD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,cAAc,EACd,qBAAqB,EAAE,CAwDxB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAmBrD;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,GAC7B,qBAAqB,CAgBvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,GAClB,qBAAqB,CAwBvB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,EAAE,CAGtE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,GAC7B,MAAM,CAKR"}
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+ /**
3
+ * Bitcoin Network Configuration
4
+ *
5
+ * Defines approved Bitcoin RPC providers and network mappings for the protocol.
6
+ * This ensures LIT actions only use vetted, reliable Bitcoin data sources.
7
+ *
8
+ * CRITICAL: Only approved providers should be added to this configuration.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.APPROVED_BITCOIN_PROVIDERS = exports.CHAIN_TO_CHAIN_ID = exports.CHAIN_TO_BITCOIN_NETWORK = exports.BitcoinNetwork = exports.EVMChain = void 0;
12
+ exports.validateChain = validateChain;
13
+ exports.getBitcoinNetworkForChain = getBitcoinNetworkForChain;
14
+ exports.getChainIdForChain = getChainIdForChain;
15
+ exports.validateBitcoinProvider = validateBitcoinProvider;
16
+ exports.getBitcoinProviderConfig = getBitcoinProviderConfig;
17
+ exports.getApprovedProvidersForChain = getApprovedProvidersForChain;
18
+ exports.getProviderName = getProviderName;
19
+ /**
20
+ * Supported EVM chains
21
+ */
22
+ var EVMChain;
23
+ (function (EVMChain) {
24
+ /** Ethereum Sepolia testnet */
25
+ EVMChain["SEPOLIA"] = "sepolia";
26
+ /** Ethereum mainnet */
27
+ EVMChain["ETHEREUM"] = "ethereum";
28
+ /** Hardhat local testnet */
29
+ EVMChain["HARDHAT"] = "hardhat";
30
+ })(EVMChain || (exports.EVMChain = EVMChain = {}));
31
+ /**
32
+ * Bitcoin network types
33
+ */
34
+ var BitcoinNetwork;
35
+ (function (BitcoinNetwork) {
36
+ /** Bitcoin testnet */
37
+ BitcoinNetwork["TESTNET"] = "testnet";
38
+ /** Bitcoin mainnet */
39
+ BitcoinNetwork["MAINNET"] = "mainnet";
40
+ /** Bitcoin regtest (local/testing) */
41
+ BitcoinNetwork["REGTEST"] = "regtest";
42
+ })(BitcoinNetwork || (exports.BitcoinNetwork = BitcoinNetwork = {}));
43
+ /**
44
+ * Mapping from EVM chain to Bitcoin network
45
+ *
46
+ * - Sepolia (testnet) → Bitcoin Testnet
47
+ * - Ethereum (mainnet) → Bitcoin Mainnet
48
+ */
49
+ exports.CHAIN_TO_BITCOIN_NETWORK = {
50
+ [EVMChain.SEPOLIA]: BitcoinNetwork.TESTNET,
51
+ [EVMChain.ETHEREUM]: BitcoinNetwork.MAINNET,
52
+ [EVMChain.HARDHAT]: BitcoinNetwork.REGTEST, // Local development
53
+ };
54
+ /**
55
+ * Mapping from EVM chain to chain ID
56
+ *
57
+ * - Ethereum mainnet: 1
58
+ * - Sepolia testnet: 11155111
59
+ * - Hardhat local: 31337
60
+ */
61
+ exports.CHAIN_TO_CHAIN_ID = {
62
+ [EVMChain.ETHEREUM]: 1,
63
+ [EVMChain.SEPOLIA]: 11155111,
64
+ [EVMChain.HARDHAT]: 31337,
65
+ };
66
+ /**
67
+ * Approved Bitcoin RPC providers per network
68
+ *
69
+ * Only providers in this whitelist can be used by LIT actions.
70
+ * Each provider has specific min confirmation requirements.
71
+ *
72
+ * TESTNET: Lower confirmation requirements (1 block)
73
+ * REGTEST: Lower confirmation requirements (1 block)
74
+ * MAINNET: Higher confirmation requirements (6 blocks - industry standard)
75
+ */
76
+ exports.APPROVED_BITCOIN_PROVIDERS = {
77
+ [BitcoinNetwork.REGTEST]: [
78
+ {
79
+ url: "https://diamond-hands-btc-faucet-6b39a1072059.herokuapp.com/api",
80
+ network: BitcoinNetwork.REGTEST,
81
+ minConfirmations: 1,
82
+ name: "Diamond Hands",
83
+ },
84
+ {
85
+ url: "http://diamond-hands-btc-faucet-6b39a1072059.herokuapp.com/api",
86
+ network: BitcoinNetwork.REGTEST,
87
+ minConfirmations: 1,
88
+ name: "Diamond Hands",
89
+ },
90
+ {
91
+ url: "http://127.0.0.1:18443",
92
+ network: BitcoinNetwork.REGTEST,
93
+ minConfirmations: 1,
94
+ name: "Local Regtest",
95
+ },
96
+ {
97
+ url: "https://313561dc30c5.ngrok-free.app",
98
+ network: BitcoinNetwork.REGTEST,
99
+ minConfirmations: 1,
100
+ name: "Ngrok Bitcoin Tunnel",
101
+ },
102
+ ],
103
+ [BitcoinNetwork.TESTNET]: [
104
+ {
105
+ url: "https://diamond-hands-btc-faucet-6b39a1072059.herokuapp.com/api",
106
+ network: BitcoinNetwork.TESTNET,
107
+ minConfirmations: 1,
108
+ name: "Diamond Hands",
109
+ },
110
+ {
111
+ url: "http://diamond-hands-btc-faucet-6b39a1072059.herokuapp.com/api",
112
+ network: BitcoinNetwork.TESTNET,
113
+ minConfirmations: 1,
114
+ name: "Diamond Hands",
115
+ },
116
+ ],
117
+ [BitcoinNetwork.MAINNET]: [
118
+ {
119
+ url: "https://blockstream.info/api",
120
+ network: BitcoinNetwork.MAINNET,
121
+ minConfirmations: 6,
122
+ name: "Blockstream Mainnet",
123
+ },
124
+ {
125
+ url: "https://mempool.space/api",
126
+ network: BitcoinNetwork.MAINNET,
127
+ minConfirmations: 6,
128
+ name: "Mempool.space Mainnet",
129
+ },
130
+ ],
131
+ };
132
+ /**
133
+ * Validate and normalize EVM chain input
134
+ *
135
+ * @param chain Chain identifier (case-insensitive)
136
+ * @returns Validated EVMChain enum value
137
+ * @throws Error if chain is not supported
138
+ */
139
+ function validateChain(chain) {
140
+ const normalized = chain.toLowerCase().trim();
141
+ if (normalized === "sepolia") {
142
+ return EVMChain.SEPOLIA;
143
+ }
144
+ if (normalized === "ethereum" || normalized === "mainnet") {
145
+ return EVMChain.ETHEREUM;
146
+ }
147
+ if (normalized === "hardhat") {
148
+ return EVMChain.HARDHAT;
149
+ }
150
+ throw new Error(`Unsupported EVM chain: "${chain}". ` +
151
+ `Supported chains: ${Object.values(EVMChain).join(", ")}`);
152
+ }
153
+ /**
154
+ * Get Bitcoin network for EVM chain
155
+ *
156
+ * @param chain EVM chain
157
+ * @returns Corresponding Bitcoin network
158
+ */
159
+ function getBitcoinNetworkForChain(chain) {
160
+ return exports.CHAIN_TO_BITCOIN_NETWORK[chain];
161
+ }
162
+ /**
163
+ * Get chain ID for EVM chain
164
+ *
165
+ * @param chain EVM chain
166
+ * @returns Corresponding chain ID
167
+ */
168
+ function getChainIdForChain(chain) {
169
+ return exports.CHAIN_TO_CHAIN_ID[chain];
170
+ }
171
+ /**
172
+ * Validate Bitcoin provider is approved for network
173
+ *
174
+ * @param providerUrl Bitcoin provider URL
175
+ * @param bitcoinNetwork Bitcoin network (testnet or mainnet)
176
+ * @returns Provider configuration if approved
177
+ * @throws Error if provider is not approved for network
178
+ */
179
+ function validateBitcoinProvider(providerUrl, bitcoinNetwork) {
180
+ const providers = exports.APPROVED_BITCOIN_PROVIDERS[bitcoinNetwork];
181
+ const config = providers.find((p) => p.url === providerUrl);
182
+ if (!config) {
183
+ const approvedUrls = providers
184
+ .map((p) => `${p.name} (${p.url})`)
185
+ .join(", ");
186
+ throw new Error(`Bitcoin provider not approved for ${bitcoinNetwork}. ` +
187
+ `Provided URL: ${providerUrl}. ` +
188
+ `Approved providers: ${approvedUrls}`);
189
+ }
190
+ return config;
191
+ }
192
+ /**
193
+ * Validate Bitcoin provider is approved (DEV MODE)
194
+ *
195
+ * In development mode, we don't enforce chain → Bitcoin network mapping.
196
+ * The caller decides which Bitcoin network to use for any EVM chain.
197
+ * We only validate that the provider URL is in our approved list.
198
+ *
199
+ * @param providerUrl Bitcoin provider URL
200
+ * @returns Provider configuration with network auto-detected
201
+ * @throws Error if provider is not approved for any network
202
+ */
203
+ function getBitcoinProviderConfig(providerUrl) {
204
+ // Search across ALL networks to find this provider
205
+ for (const network of Object.values(BitcoinNetwork)) {
206
+ const providers = exports.APPROVED_BITCOIN_PROVIDERS[network];
207
+ const config = providers.find((p) => p.url === providerUrl);
208
+ if (config) {
209
+ // Found it - return with network detected
210
+ return config;
211
+ }
212
+ }
213
+ // Provider not found in any network
214
+ const allProviders = Object.entries(exports.APPROVED_BITCOIN_PROVIDERS)
215
+ .flatMap(([network, providers]) => providers.map((p) => `${network}: ${p.name} (${p.url})`))
216
+ .join(", ");
217
+ throw new Error(`Bitcoin provider not approved. ` +
218
+ `Provided URL: ${providerUrl}. ` +
219
+ `Approved providers: ${allProviders}`);
220
+ }
221
+ /**
222
+ * Get list of approved provider URLs for a chain
223
+ *
224
+ * Useful for displaying options to users or validating inputs.
225
+ *
226
+ * @param chain EVM chain
227
+ * @returns Array of approved provider URLs for that chain's Bitcoin network
228
+ */
229
+ function getApprovedProvidersForChain(chain) {
230
+ const bitcoinNetwork = getBitcoinNetworkForChain(chain);
231
+ return exports.APPROVED_BITCOIN_PROVIDERS[bitcoinNetwork].map((p) => p.url);
232
+ }
233
+ /**
234
+ * Get human-readable provider name from URL
235
+ *
236
+ * @param providerUrl Provider URL
237
+ * @param bitcoinNetwork Bitcoin network
238
+ * @returns Provider name or URL if not found
239
+ */
240
+ function getProviderName(providerUrl, bitcoinNetwork) {
241
+ const config = exports.APPROVED_BITCOIN_PROVIDERS[bitcoinNetwork].find((p) => p.url === providerUrl);
242
+ return config ? config.name : providerUrl;
243
+ }
244
+ //# sourceMappingURL=bitcoin-network-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitcoin-network-config.js","sourceRoot":"","sources":["../../../../src/constants/chunks/bitcoin-network-config.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAqJH,sCAmBC;AAQD,8DAEC;AAQD,gDAEC;AAUD,0DAmBC;AAaD,4DA0BC;AAUD,oEAGC;AASD,0CAQC;AA5RD;;GAEG;AACH,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,+BAA+B;IAC/B,+BAAmB,CAAA;IAEnB,uBAAuB;IACvB,iCAAqB,CAAA;IAErB,4BAA4B;IAC5B,+BAAmB,CAAA;AACrB,CAAC,EATW,QAAQ,wBAAR,QAAQ,QASnB;AAED;;GAEG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACxB,sBAAsB;IACtB,qCAAmB,CAAA;IAEnB,sBAAsB;IACtB,qCAAmB,CAAA;IAEnB,sCAAsC;IACtC,qCAAmB,CAAA;AACrB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAmBD;;;;;GAKG;AACU,QAAA,wBAAwB,GAAqC;IACxE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO;IAC1C,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,OAAO;IAC3C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,oBAAoB;CACjE,CAAC;AAEF;;;;;;GAMG;AACU,QAAA,iBAAiB,GAA6B;IACzD,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IACtB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ;IAC5B,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK;CAC1B,CAAC;AAEF;;;;;;;;;GASG;AACU,QAAA,0BAA0B,GAGnC;IACF,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;QACxB;Y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,kCAA0B,CAAC,cAAc,CAAC,CAAC,IAAI,CAC5D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,WAAW,CAC7B,CAAC;IACF,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Bitcoin Network Protocol Constants
3
+ *
4
+ * These constants define Bitcoin network parameters used by the protocol
5
+ * for UTXO validation and security.
6
+ *
7
+ * CRITICAL: Changes to these values affect Bitcoin security guarantees.
8
+ */
9
+ /**
10
+ * Default Minimum Confirmations for UTXO Validity
11
+ *
12
+ * Number of block confirmations required before considering a UTXO as "confirmed".
13
+ * Value: 6 confirmations (~60 minutes on Bitcoin mainnet)
14
+ *
15
+ * Bitcoin security standard:
16
+ * - 1 confirmation: ~10 minutes, low security
17
+ * - 3 confirmations: ~30 minutes, medium security
18
+ * - 6 confirmations: ~60 minutes, high security (industry standard)
19
+ *
20
+ * This can be overridden for specific use cases (e.g., higher value requires more confirmations).
21
+ *
22
+ * Governance-adjustable: YES
23
+ */
24
+ export declare const BITCOIN_DEFAULT_MIN_CONFIRMATIONS = 6;
25
+ /**
26
+ * Maximum BTC Amount Validation
27
+ *
28
+ * Maximum reasonable BTC amount in satoshis.
29
+ * Value: 25,000,000 BTC * 1e8 satoshis = 2.5e15 satoshis
30
+ *
31
+ * Bitcoin total supply is 21M BTC. Setting to 25M provides safety margin
32
+ * to account for future protocol needs while preventing overflow attacks.
33
+ *
34
+ * This validation prevents:
35
+ * - Malicious/corrupted data from oracle manipulation
36
+ * - Integer overflow attacks
37
+ * - Unrealistic balance claims
38
+ *
39
+ * Governance-adjustable: YES (requires contract upgrade)
40
+ */
41
+ export declare const MAX_BTC_AMOUNT: number;
42
+ //# sourceMappingURL=bitcoin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../../src/constants/chunks/bitcoin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,QAAmB,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * Bitcoin Network Protocol Constants
4
+ *
5
+ * These constants define Bitcoin network parameters used by the protocol
6
+ * for UTXO validation and security.
7
+ *
8
+ * CRITICAL: Changes to these values affect Bitcoin security guarantees.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.MAX_BTC_AMOUNT = exports.BITCOIN_DEFAULT_MIN_CONFIRMATIONS = void 0;
12
+ /**
13
+ * Default Minimum Confirmations for UTXO Validity
14
+ *
15
+ * Number of block confirmations required before considering a UTXO as "confirmed".
16
+ * Value: 6 confirmations (~60 minutes on Bitcoin mainnet)
17
+ *
18
+ * Bitcoin security standard:
19
+ * - 1 confirmation: ~10 minutes, low security
20
+ * - 3 confirmations: ~30 minutes, medium security
21
+ * - 6 confirmations: ~60 minutes, high security (industry standard)
22
+ *
23
+ * This can be overridden for specific use cases (e.g., higher value requires more confirmations).
24
+ *
25
+ * Governance-adjustable: YES
26
+ */
27
+ exports.BITCOIN_DEFAULT_MIN_CONFIRMATIONS = 6;
28
+ /**
29
+ * Maximum BTC Amount Validation
30
+ *
31
+ * Maximum reasonable BTC amount in satoshis.
32
+ * Value: 25,000,000 BTC * 1e8 satoshis = 2.5e15 satoshis
33
+ *
34
+ * Bitcoin total supply is 21M BTC. Setting to 25M provides safety margin
35
+ * to account for future protocol needs while preventing overflow attacks.
36
+ *
37
+ * This validation prevents:
38
+ * - Malicious/corrupted data from oracle manipulation
39
+ * - Integer overflow attacks
40
+ * - Unrealistic balance claims
41
+ *
42
+ * Governance-adjustable: YES (requires contract upgrade)
43
+ */
44
+ exports.MAX_BTC_AMOUNT = 25000000 * 1e8; // 2.5e15 satoshis
45
+ //# sourceMappingURL=bitcoin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitcoin.js","sourceRoot":"","sources":["../../../../src/constants/chunks/bitcoin.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH;;;;;;;;;;;;;;GAcG;AACU,QAAA,iCAAiC,GAAG,CAAC,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACU,QAAA,cAAc,GAAG,QAAU,GAAG,GAAG,CAAC,CAAC,kBAAkB"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Decimal Precision Constants
3
+ *
4
+ * These constants define the decimal precision for various assets and calculations
5
+ * in the Diamond Hands Protocol. They ensure consistent precision across all modules.
6
+ *
7
+ * CRITICAL: These values MUST match contract implementations.
8
+ */
9
+ /**
10
+ * Satoshis per Bitcoin
11
+ *
12
+ * Bitcoin's smallest unit is a satoshi (sat).
13
+ * 1 BTC = 100,000,000 satoshis
14
+ *
15
+ * This constant is used for BTC <-> satoshi conversions.
16
+ *
17
+ * Governance-adjustable: NO (Bitcoin protocol constant)
18
+ */
19
+ export declare const SATOSHIS_PER_BITCOIN = 100000000n;
20
+ /**
21
+ * Price Oracle Decimal Precision
22
+ *
23
+ * BTC/USD price is stored with 8 decimal places.
24
+ * Example: $100,000.00 = 10000000000000n (100000 * 10^8)
25
+ *
26
+ * This matches Bitcoin's satoshi precision and allows for sub-cent pricing.
27
+ *
28
+ * Governance-adjustable: NO (System design constant)
29
+ */
30
+ export declare const PRICE_ORACLE_DECIMALS = 100000000n;
31
+ /**
32
+ * UCD Token Decimal Precision
33
+ *
34
+ * UCD is an ERC20 token with 18 decimals (standard for stablecoins).
35
+ * 1 UCD = 10^18 wei
36
+ *
37
+ * This constant is used for all UCD amount calculations.
38
+ *
39
+ * CRITICAL: Must match UCD token contract decimals.
40
+ *
41
+ * Governance-adjustable: NO (Contract constant)
42
+ */
43
+ export declare const UCD_TOKEN_DECIMALS = 1000000000000000000n;
44
+ //# sourceMappingURL=decimals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimals.d.ts","sourceRoot":"","sources":["../../../../src/constants/chunks/decimals.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,aAAe,CAAC;AAEjD;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,aAAe,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,uBAA6B,CAAC"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Decimal Precision Constants
4
+ *
5
+ * These constants define the decimal precision for various assets and calculations
6
+ * in the Diamond Hands Protocol. They ensure consistent precision across all modules.
7
+ *
8
+ * CRITICAL: These values MUST match contract implementations.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.UCD_TOKEN_DECIMALS = exports.PRICE_ORACLE_DECIMALS = exports.SATOSHIS_PER_BITCOIN = void 0;
12
+ /**
13
+ * Satoshis per Bitcoin
14
+ *
15
+ * Bitcoin's smallest unit is a satoshi (sat).
16
+ * 1 BTC = 100,000,000 satoshis
17
+ *
18
+ * This constant is used for BTC <-> satoshi conversions.
19
+ *
20
+ * Governance-adjustable: NO (Bitcoin protocol constant)
21
+ */
22
+ exports.SATOSHIS_PER_BITCOIN = 100000000n;
23
+ /**
24
+ * Price Oracle Decimal Precision
25
+ *
26
+ * BTC/USD price is stored with 8 decimal places.
27
+ * Example: $100,000.00 = 10000000000000n (100000 * 10^8)
28
+ *
29
+ * This matches Bitcoin's satoshi precision and allows for sub-cent pricing.
30
+ *
31
+ * Governance-adjustable: NO (System design constant)
32
+ */
33
+ exports.PRICE_ORACLE_DECIMALS = 100000000n;
34
+ /**
35
+ * UCD Token Decimal Precision
36
+ *
37
+ * UCD is an ERC20 token with 18 decimals (standard for stablecoins).
38
+ * 1 UCD = 10^18 wei
39
+ *
40
+ * This constant is used for all UCD amount calculations.
41
+ *
42
+ * CRITICAL: Must match UCD token contract decimals.
43
+ *
44
+ * Governance-adjustable: NO (Contract constant)
45
+ */
46
+ exports.UCD_TOKEN_DECIMALS = 1000000000000000000n;
47
+ //# sourceMappingURL=decimals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimals.js","sourceRoot":"","sources":["../../../../src/constants/chunks/decimals.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH;;;;;;;;;GASG;AACU,QAAA,oBAAoB,GAAG,UAAY,CAAC;AAEjD;;;;;;;;;GASG;AACU,QAAA,qBAAqB,GAAG,UAAY,CAAC;AAElD;;;;;;;;;;;GAWG;AACU,QAAA,kBAAkB,GAAG,oBAA0B,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Liquidation Protocol Constants
3
+ *
4
+ * These constants define the liquidation thresholds and grace period escalation
5
+ * for the Diamond Hands Protocol. They are governance-adjustable parameters.
6
+ *
7
+ * CRITICAL: Changes to these values affect protocol security and user positions.
8
+ */
9
+ /**
10
+ * Active Loan Liquidation Threshold
11
+ *
12
+ * Minimum collateral ratio required for active (non-expired) loans.
13
+ * Value: 130% (13000 basis points)
14
+ *
15
+ * Governance-adjustable: YES
16
+ */
17
+ export declare const ACTIVE_LOAN_LIQUIDATION_THRESHOLD_BPS = 13000;
18
+ /**
19
+ * Expired Loan Minimum Liquidation Threshold
20
+ *
21
+ * Starting liquidation threshold when loan expires (day 0 of grace period).
22
+ * Value: 110% (11000 basis points)
23
+ *
24
+ * The threshold escalates from this value to MAX over the grace period.
25
+ *
26
+ * Governance-adjustable: YES
27
+ */
28
+ export declare const EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11000;
29
+ /**
30
+ * Expired Loan Maximum Liquidation Threshold
31
+ *
32
+ * Maximum liquidation threshold reached at end of grace period (day 30).
33
+ * Value: 200% (20000 basis points)
34
+ *
35
+ * The threshold escalates from MIN to this value over the grace period.
36
+ *
37
+ * Governance-adjustable: YES
38
+ */
39
+ export declare const EXPIRED_LOAN_MAX_LIQUIDATION_THRESHOLD_BPS = 20000;
40
+ /**
41
+ * Grace Period Duration
42
+ *
43
+ * Number of days after loan expiry before maximum liquidation threshold is reached.
44
+ * Value: 30 days
45
+ *
46
+ * During this period, liquidation threshold escalates quadratically from MIN to MAX.
47
+ *
48
+ * Governance-adjustable: YES
49
+ */
50
+ export declare const GRACE_PERIOD_DAYS = 30;
51
+ //# sourceMappingURL=liquidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liquidation.d.ts","sourceRoot":"","sources":["../../../../src/constants/chunks/liquidation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,QAAQ,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,0CAA0C,QAAQ,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,0CAA0C,QAAQ,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC"}