astra-modal-test 1.0.10 → 1.0.12

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 (171) hide show
  1. package/README.md +206 -134
  2. package/dist/{SwapController-DyormRqe.js → SwapController-mYFErPzx.js} +1 -1
  3. package/dist/{add-C1zIRxeS.js → add-CXtFvysR.js} +1 -1
  4. package/dist/{all-wallets-5a2U9fLw.js → all-wallets-B9fFXw5x.js} +1 -1
  5. package/dist/{app-store-2IKrZeLe.js → app-store-BXf1yvR8.js} +1 -1
  6. package/dist/{apple-DH9ESSKX.js → apple-DtcOcX1n.js} +1 -1
  7. package/dist/{arrow-bottom-BxAPS43J.js → arrow-bottom-BXeLKqSV.js} +1 -1
  8. package/dist/{arrow-bottom-circle-Cy5Gjca4.js → arrow-bottom-circle-BVUU200N.js} +1 -1
  9. package/dist/{arrow-left-CBX7JaHB.js → arrow-left-LguJPyNR.js} +1 -1
  10. package/dist/{arrow-right-G72bt1-M.js → arrow-right-D9kKZzGG.js} +1 -1
  11. package/dist/{arrow-top-DCkQG0Dq.js → arrow-top-C5JcaCqz.js} +1 -1
  12. package/dist/{bank-FNxAUs8r.js → bank-DgbCzr0A.js} +1 -1
  13. package/dist/{bin-B-c2CIPW.js → bin-ykHym2bC.js} +1 -1
  14. package/dist/{bitcoin-jk4NLDu1.js → bitcoin-B8jzy_uV.js} +1 -1
  15. package/dist/{browser-D6w0J78l.js → browser-Bk8u8PAA.js} +1 -1
  16. package/dist/{card-BLWRKU-r.js → card-DcwQMUca.js} +1 -1
  17. package/dist/ccip-CwJvuExU.js +239 -0
  18. package/dist/{checkmark-C1pTfaGr.js → checkmark-D3aEYZ8B.js} +1 -1
  19. package/dist/{checkmark-bold-UzogCu8g.js → checkmark-bold-5H7N-CDG.js} +1 -1
  20. package/dist/{chevron-bottom-w_rMAO7x.js → chevron-bottom-BA3C4MR1.js} +1 -1
  21. package/dist/{chevron-left-DGNJGxiP.js → chevron-left-BX18UWKM.js} +1 -1
  22. package/dist/{chevron-right-VFQCvCyG.js → chevron-right-DG7ovxTe.js} +1 -1
  23. package/dist/{chevron-top-DVhFmsKp.js → chevron-top-DHfev7lV.js} +1 -1
  24. package/dist/{chrome-store-BkYX3All.js → chrome-store-BSVzpGdu.js} +1 -1
  25. package/dist/{circle-B1A3j4eP.js → circle-SYFB9f2-.js} +1 -1
  26. package/dist/{clock-BKr-VHDU.js → clock-Cygqlf1g.js} +1 -1
  27. package/dist/{close-BEacRQ8Q.js → close-B43cuuko.js} +1 -1
  28. package/dist/{coinPlaceholder-0ZwtMAHl.js → coinPlaceholder-BHdR6bKb.js} +1 -1
  29. package/dist/{compass-pulK-BFi.js → compass-7S6b6wyA.js} +1 -1
  30. package/dist/{copy-MWCQE0T4.js → copy-CT53bEwd.js} +1 -1
  31. package/dist/{cursor-transparent-Co_5p0du.js → cursor-transparent-LmjzjsFm.js} +1 -1
  32. package/dist/{cursor-C2GVfUuM.js → cursor-vtqRnrF7.js} +1 -1
  33. package/dist/{desktop-C91EoSqM.js → desktop-Doa7TQsq.js} +1 -1
  34. package/dist/{disconnect-BWg1-rml.js → disconnect-C5G6Ncu_.js} +1 -1
  35. package/dist/{discord-Bi0Bfa_e.js → discord-DX7Cl3Ko.js} +1 -1
  36. package/dist/{email-U2WCRPFh.js → email-CyHWh9wL.js} +1 -1
  37. package/dist/{embedded-wallet-B6P0kU9A.js → embedded-wallet-BZQImi7s.js} +8 -8
  38. package/dist/{ethereum-BeZyayQW.js → ethereum-Bwvtk5-_.js} +1 -1
  39. package/dist/{etherscan-BQTsufjv.js → etherscan-CyVRICvw.js} +1 -1
  40. package/dist/{exclamation-triangle-JT-YKNXX.js → exclamation-triangle-BDbPL3nL.js} +1 -1
  41. package/dist/{extension-TnYLHoFA.js → extension-Cx3t2k-R.js} +1 -1
  42. package/dist/{external-link-Dhgai9sc.js → external-link-DZCYpOZI.js} +1 -1
  43. package/dist/{facebook-C6XFGRDw.js → facebook-BEnPrhG3.js} +1 -1
  44. package/dist/{farcaster-CvYbxZQq.js → farcaster-DyBPLb_k.js} +1 -1
  45. package/dist/{filters-DwVRjAav.js → filters-CTwxivn_.js} +1 -1
  46. package/dist/{github-BVZSx-z9.js → github-kzQb61pT.js} +1 -1
  47. package/dist/{google-NbJiQLc5.js → google-DSC-rYNu.js} +1 -1
  48. package/dist/{help-circle-Cum2UOMJ.js → help-circle-C5XfimVx.js} +1 -1
  49. package/dist/{id-kRR6YgVc.js → id-B9fQOT4E.js} +1 -1
  50. package/dist/{image-BWUCRAmp.js → image-1CCj36XM.js} +1 -1
  51. package/dist/{index-RFYbqmu0.js → index-Bjik7E9u.js} +1 -1
  52. package/dist/{index-DQ5AZLMt.js → index-C1fgrzi0.js} +16 -16
  53. package/dist/{index-BZZHE-1t.js → index-CyeGBcX0.js} +1 -1
  54. package/dist/{index-Dq0LIBEh.js → index-DKEMW9N8.js} +25 -25
  55. package/dist/{index-2vYoun4O.js → index-LucuShOc.js} +45292 -56275
  56. package/dist/{info-Br-SBtj3.js → info-Begf9tO0.js} +1 -1
  57. package/dist/{info-circle-Ew4RoR_Q.js → info-circle-Bo1H2OXh.js} +1 -1
  58. package/dist/{lightbulb-BRBVOE_b.js → lightbulb-C-SU_z2I.js} +1 -1
  59. package/dist/{mail-Dzi4AncY.js → mail-CXsYiNAT.js} +1 -1
  60. package/dist/{mobile-BGGxQ5be.js → mobile-C7bUjgog.js} +1 -1
  61. package/dist/{more-BmNaKbYJ.js → more-29BC-wmy.js} +1 -1
  62. package/dist/{network-placeholder-EMiMf4q1.js → network-placeholder-B-x3-6jN.js} +1 -1
  63. package/dist/{nftPlaceholder-CvSqy3Sd.js → nftPlaceholder-pM-Hmswq.js} +1 -1
  64. package/dist/nodeflow-sdk.es.js +15 -0
  65. package/dist/{off-DF9uz0Nc.js → off-DEa_uc7_.js} +1 -1
  66. package/dist/{onramp-cKzTmKku.js → onramp-ZXqyloYt.js} +10 -10
  67. package/dist/{play-store-CGxW4MgL.js → play-store-WgSEpEI1.js} +1 -1
  68. package/dist/{plus-CQ6wWkN0.js → plus-u4UZhYAg.js} +1 -1
  69. package/dist/{qr-code-VBqx9nAF.js → qr-code-DxZGxoPE.js} +1 -1
  70. package/dist/{receive-CVzkHmKR.js → receive-Ct_mQWzk.js} +1 -1
  71. package/dist/{recycle-horizontal-Oq1YtvUx.js → recycle-horizontal-BWVpmHJc.js} +1 -1
  72. package/dist/{refresh-BDlGAzmY.js → refresh-gi4TfgEU.js} +1 -1
  73. package/dist/{reown-logo-BlIpXIlG.js → reown-logo-Bg731n4w.js} +1 -1
  74. package/dist/{search-DfmCmp0m.js → search-BQv7DVJG.js} +1 -1
  75. package/dist/{send-BXudz514.js → send-BzmnFT2p.js} +1 -1
  76. package/dist/{send-Cz0L5LmE.js → send-CyxKtrQ9.js} +17 -17
  77. package/dist/{socials-CDOh8MRf.js → socials-vziOn4zi.js} +5 -5
  78. package/dist/{solana-CbiyOE-8.js → solana-Dz48awbr.js} +1 -1
  79. package/dist/{swapHorizontal-DyU1TH_e.js → swapHorizontal-Cwe1PoMp.js} +1 -1
  80. package/dist/{swapHorizontalBold-CGXW7Ocj.js → swapHorizontalBold-Dxu58sRG.js} +1 -1
  81. package/dist/{swapHorizontalMedium-2KTcj67d.js → swapHorizontalMedium-DOZZthlB.js} +1 -1
  82. package/dist/{swapHorizontalRoundedBold-TxFtmmda.js → swapHorizontalRoundedBold-BkIZQXnD.js} +1 -1
  83. package/dist/{swapVertical-BKD6lxM3.js → swapVertical-LSq66ctC.js} +1 -1
  84. package/dist/{swaps-BuGsEQaI.js → swaps-C2EO6dQA.js} +9 -9
  85. package/dist/{telegram-CAsl9DeG.js → telegram-ITq9s69Y.js} +1 -1
  86. package/dist/{three-dots-BoE2aHZi.js → three-dots-JH3A1TFR.js} +1 -1
  87. package/dist/{transactions-C1NtsnD6.js → transactions-DpMVZVap.js} +1 -1
  88. package/dist/{twitch-CvkZZxgT.js → twitch-BKs5FlDf.js} +1 -1
  89. package/dist/{twitterIcon-CrhnOl_O.js → twitterIcon-CCXEj_Nv.js} +1 -1
  90. package/dist/{ui-BJcuThPA.js → ui-D5ULRvGt.js} +6 -6
  91. package/dist/{user-BZRWUXG7.js → user-CBgAUjZv.js} +1 -1
  92. package/dist/{verify-y9F4DcJ4.js → verify-BPlPPkhG.js} +1 -1
  93. package/dist/{verify-filled-X_8-BhMk.js → verify-filled-qTRg0OWM.js} +1 -1
  94. package/dist/{w3m-modal-BX--v1Nc.js → w3m-modal-DSdDfy32.js} +27 -27
  95. package/dist/{wallet-CIaVVkjQ.js → wallet-BuDEi_8z.js} +1 -1
  96. package/dist/{wallet-placeholder-Cq1ofde1.js → wallet-placeholder-D4DKTuB_.js} +1 -1
  97. package/dist/{walletconnect-CINzSCJ3.js → walletconnect-Dt3q5XFc.js} +1 -1
  98. package/dist/{warning-circle-BvBNhMKH.js → warning-circle-B8Fkc0_4.js} +1 -1
  99. package/dist/{x-xHY7JehW.js → x-Cm_V3zUI.js} +1 -1
  100. package/dist/{x-mark-DEmnBt6u.js → x-mark-BVvwdxda.js} +1 -1
  101. package/package.json +11 -10
  102. package/.github/workflows/code-quality.yml +0 -43
  103. package/.github/workflows/publish.yml +0 -64
  104. package/dist/astra-sdk.es.js +0 -9
  105. package/dist/ccip-DkYvh7hg.js +0 -149
  106. package/dist/clsx.m-DCYaa4RU.js +0 -20
  107. package/dist/index-BDE-2VTp.js +0 -315
  108. package/dist/index-BjLIiJQa.js +0 -21034
  109. package/dist/index-CIr4zlVp.js +0 -386
  110. package/dist/index-ChxXyuZj.js +0 -572
  111. package/dist/index-D-T7kk3G.js +0 -15911
  112. package/dist/index-DSX3HrTS.js +0 -10785
  113. package/dist/secp256k1-CsKSDHNi.js +0 -1257
  114. package/eslint.config.mjs +0 -41
  115. package/index.html +0 -13
  116. package/public/font/ClashDisplay-Variable.ttf +0 -0
  117. package/public/font/ClashDisplay-Variable.woff +0 -0
  118. package/public/font/ClashDisplay-Variable.woff2 +0 -0
  119. package/public/vite.svg +0 -1
  120. package/src/App.css +0 -170
  121. package/src/apis/lspApi.js +0 -82
  122. package/src/apis/request.js +0 -59
  123. package/src/assets/arrow-right.svg +0 -3
  124. package/src/assets/astr.svg +0 -13
  125. package/src/assets/bridge-loading.png +0 -0
  126. package/src/assets/ln.png +0 -0
  127. package/src/assets/network/Arbitrum.png +0 -0
  128. package/src/assets/network/Polygon.png +0 -0
  129. package/src/assets/network/Solana.png +0 -0
  130. package/src/assets/network/base.png +0 -0
  131. package/src/assets/network/botanix.png +0 -0
  132. package/src/assets/network/bsc.svg +0 -13
  133. package/src/assets/network/eth.png +0 -0
  134. package/src/assets/network/lighting.png +0 -0
  135. package/src/assets/network/ligtning.svg +0 -22
  136. package/src/assets/network/solona.png +0 -0
  137. package/src/assets/pay.png +0 -0
  138. package/src/assets/powerby.svg +0 -14
  139. package/src/assets/react.svg +0 -1
  140. package/src/assets/success.svg +0 -3
  141. package/src/assets/tip.svg +0 -5
  142. package/src/assets/tokens/sol.png +0 -0
  143. package/src/assets/tokens/usdc.png +0 -0
  144. package/src/assets/tokens/usdt.png +0 -0
  145. package/src/comps/AstraImage.jsx +0 -37
  146. package/src/comps/AstraModal.jsx +0 -202
  147. package/src/comps/AstraModalLogo.jsx +0 -29
  148. package/src/comps/AstraNetwork.jsx +0 -261
  149. package/src/comps/CheckErc20Button.jsx +0 -28
  150. package/src/comps/CommonStyle.jsx +0 -4
  151. package/src/comps/ConnectButton.jsx +0 -19
  152. package/src/comps/EllipsisMiddle.jsx +0 -42
  153. package/src/comps/ResultModal.jsx +0 -312
  154. package/src/comps/ToLightning.jsx +0 -653
  155. package/src/comps/ToToken.jsx +0 -550
  156. package/src/constants/index.js +0 -21
  157. package/src/font/ClashDisplay-Variable.ttf +0 -0
  158. package/src/font/ClashDisplay-Variable.woff +0 -0
  159. package/src/font/ClashDisplay-Variable.woff2 +0 -0
  160. package/src/hooks/useContract.js +0 -179
  161. package/src/hooks/useGetMinAndMax.js +0 -48
  162. package/src/hooks/useLspApi.js +0 -70
  163. package/src/hooks/useParseInvoice.js +0 -95
  164. package/src/index.css +0 -69
  165. package/src/index.jsx +0 -161
  166. package/src/lib/bolt11.min.js +0 -1
  167. package/src/main.jsx +0 -75
  168. package/src/store/index.js +0 -25
  169. package/src/theme.js +0 -108
  170. package/src/utils/index.js +0 -267
  171. package/vite.config.js +0 -50
package/README.md CHANGED
@@ -1,204 +1,276 @@
1
- # Astra SDK
1
+ # NodeFlow SDK
2
2
 
3
- Astra SDK is a powerful React library that enables seamless asset bridging between EVM-compatible blockchains and the Bitcoin Lightning Network. Built with modern web technologies, it provides developers with an easy-to-integrate solution for cross-chain liquidity and payments.
3
+ NodeFlow SDK is a React library that enables seamless asset bridging between EVM chains and the Bitcoin Lightning Network.
4
4
 
5
- ## Features
5
+ ## Features
6
6
 
7
7
  - **Cross-Chain Bridge**: Bridge assets between EVM chains and Lightning Network
8
- - **Multi-Chain Support**: Support for Ethereum, Base, BSC, Botanix testnet, and more
9
- - **Wallet Integration**: Built-in support for WalletConnect and popular Web3 wallets
10
- - **TypeScript Ready**: Full TypeScript support with type definitions
11
- - **Responsive Design**: Mobile-first design with responsive UI components
12
- - **Real-time Updates**: Live transaction status and balance updates
13
- - **Customizable Theme**: Dark theme with customizable styling
8
+ - **Multi-Chain Support**: Base, BSC, and more
9
+ - **Wallet Integration**: Built-in WalletConnect support
10
+ - **Dynamic Configuration**: Auto-detects supported networks from API
11
+ - **Responsive UI**: Dark theme with customizable modal
14
12
 
15
- ## 🚀 Quick Start
16
-
17
- ### Installation
13
+ ## Installation
18
14
 
19
15
  ```bash
20
- npm install astra-modal
16
+ yarn add @lnfi-network/nodeflow-sdk
21
17
  # or
22
- yarn add astra-modal
18
+ npm install @lnfi-network/nodeflow-sdk
23
19
  ```
24
20
 
25
- ### Basic Usage
21
+ > Peer dependencies (wagmi, viem, @reown/appkit, etc.) will be installed automatically.
22
+
23
+ ## Configuration
24
+
25
+ | Item | Value | Description |
26
+ | :--- | :--- | :--- |
27
+ | **Project ID** | Get from [WalletConnect](https://cloud.walletconnect.com/) | Required for wallet connection |
28
+ | **Dev API URL** | `<API_BASE_URL>` | Development/Testnet |
29
+ | **Prod API URL** | *(Contact support)* | Production |
30
+
31
+ ---
32
+
33
+ ## Quick Start
26
34
 
27
35
  ```jsx
28
- import React from 'react';
29
- import { AstraProvider, AstraModal, astraSend, astraReceive } from 'astra-modal';
36
+ import {
37
+ NodeFlowProvider,
38
+ NodeFlowModal,
39
+ nodeFlowSend,
40
+ nodeFlowReceive,
41
+ useNodeFlowPairs // Hook to get available asset pairs
42
+ } from '@lnfi-network/nodeflow-sdk';
30
43
 
31
44
  function App() {
32
45
  return (
33
- <AstraProvider
34
- projectId="your-project-id"
46
+ <NodeFlowProvider
47
+ projectId="your-walletconnect-project-id"
48
+ apiUrl="<API_BASE_URL>"
35
49
  >
36
- <AstraModal />
37
-
38
- {/* Lightning to EVM */}
39
- <button onClick={() => astraSend({
40
- assetId: "your-asset-id",
41
- amount: 1000
50
+ <NodeFlowModal />
51
+ <MyBridgeUI />
52
+ </NodeFlowProvider>
53
+ );
54
+ }
55
+
56
+ function MyBridgeUI() {
57
+ // Get available trading pairs dynamically - no hardcoded asset IDs needed!
58
+ const { pairs, defaultAssetId, isReady } = useNodeFlowPairs();
59
+
60
+ if (!isReady) return <div>Loading...</div>;
61
+
62
+ return (
63
+ <div>
64
+ {/* Lightning → EVM: Get tokens by paying LN invoice */}
65
+ <button onClick={() => nodeFlowSend({
66
+ assetId: defaultAssetId, // Use dynamic asset ID
67
+ amount: 1000, // Amount in sats
68
+ onSuccess: (result) => console.log('Success!', result)
42
69
  })}>
43
- Bridge from Lightning
70
+ Get Tokens (Pay Lightning)
44
71
  </button>
45
72
 
46
- {/* EVM to Lightning */}
47
- <button onClick={() => astraReceive({
48
- assetId: "your-asset-id",
49
- invoice: "lnbc..."
73
+ {/* EVM Lightning: Pay LN invoice with tokens */}
74
+ <button onClick={() => nodeFlowReceive({
75
+ assetId: defaultAssetId,
76
+ invoice: "lnbc...", // Lightning invoice to pay
77
+ onSuccess: (result) => console.log('Paid!', result)
50
78
  })}>
51
- Bridge to Lightning
79
+ Pay Invoice (Use Tokens)
52
80
  </button>
53
- </AstraProvider>
81
+ </div>
54
82
  );
55
83
  }
56
84
  ```
57
85
 
58
- ## 📖 API Reference
86
+ ---
59
87
 
60
- ### AstraProvider
88
+ ## How It Works
61
89
 
62
- The main provider component that wraps your application.
90
+ ### Lightning EVM (Get Tokens)
91
+
92
+ User pays a Lightning invoice to receive EVM tokens.
63
93
 
64
- ```jsx
65
- <AstraProvider
66
- projectId={string} // WalletConnect project ID (required)
67
- >
68
- {children}
69
- </AstraProvider>
94
+ ```
95
+ ┌─────────────────────────────────────────────────────────────────────────────┐
96
+ │ Lightning EVM (nodeFlowSend)
97
+ └─────────────────────────────────────────────────────────────────────────────┘
98
+
99
+ User SDK LSP Node
100
+ │ │ │
101
+ │ nodeFlowSend({ │ │
102
+ │ assetId, amount │ │
103
+ │ }) │ │
104
+ ├─────────────────────────────►│ │
105
+ │ │ │
106
+ │ │ Request Quote & Invoice │
107
+ │ ├──────────────────────────────►│
108
+ │ │ ◄── { invoice } │
109
+ │ │ │
110
+ │ Show Invoice QR │ │
111
+ ◄──────────────────────────────│ │
112
+ │ │ │
113
+ │ User pays via LN wallet │ │
114
+ ├──────────────────────────────┼──────────────────────────────►│
115
+ │ │ │
116
+ │ │ LSP releases tokens on-chain │
117
+ │ │ ◄──────────────────────────────
118
+ │ │ │
119
+ │ ✅ Tokens received! │ │
120
+ ◄──────────────────────────────│ │
70
121
  ```
71
122
 
72
- ### astraSend
123
+ ### EVM → Lightning (Pay Invoice)
73
124
 
74
- Bridge assets from Lightning Network to EVM chains.
125
+ User pays a Lightning invoice using their EVM tokens.
75
126
 
76
- ```jsx
77
- astraSend({
78
- assetId: string, // Asset identifier
79
- amount: number, // Amount to bridge (in satoshis)
80
- onAstraInvoice?: (invoice, tx, txUrl) => void, // Callback for invoice
81
- });
127
+ ```
128
+ ┌─────────────────────────────────────────────────────────────────────────────┐
129
+ │ EVM Lightning (nodeFlowReceive) │
130
+ └─────────────────────────────────────────────────────────────────────────────┘
131
+
132
+ User SDK LSP Node
133
+ │ │ │
134
+ │ nodeFlowReceive({ │ │
135
+ │ assetId, invoice │ │
136
+ │ }) │ │
137
+ ├─────────────────────────────►│ │
138
+ │ │ │
139
+ │ Show quote & confirm │ │
140
+ ◄──────────────────────────────│ │
141
+ │ │ │
142
+ │ Approve & Deposit tokens │ │
143
+ ├─────────────────────────────►│ │
144
+ │ │ │
145
+ │ │ Lock tokens in contract │
146
+ │ ├──────────────────────────────►│
147
+ │ │ │
148
+ │ │ LSP pays LN invoice │
149
+ │ │ ◄──────────────────────────────
150
+ │ │ │
151
+ │ ✅ Invoice paid! │ │
152
+ ◄──────────────────────────────│ │
82
153
  ```
83
154
 
84
- ### astraReceive
85
-
86
- Bridge assets from EVM chains to Lightning Network.
155
+ ---
87
156
 
88
- ```jsx
89
- astraReceive({
90
- assetId: string, // Asset identifier
91
- invoice: string // Lightning invoice
92
- });
93
- ```
157
+ ## API Reference
94
158
 
95
- ## 🏗️ Development
159
+ ### Components
96
160
 
97
- ### Prerequisites
161
+ #### `<NodeFlowProvider>`
98
162
 
99
- - Node.js 16+
100
- - npm or yarn
101
- - React 18+
163
+ Main provider component. Wrap your app with this.
102
164
 
103
- ### Local Development
165
+ | Prop | Type | Required | Description |
166
+ | :--- | :--- | :--- | :--- |
167
+ | `projectId` | `string` | ✅ | WalletConnect Project ID |
168
+ | `apiUrl` | `string` | ✅ | NodeFlow API URL |
169
+ | `themeMode` | `'dark' \| 'light'` | - | Theme mode (default: `'dark'`) |
170
+ | `customNetworks` | `Network[]` | - | Custom network configuration |
104
171
 
105
- ```bash
106
- # Clone the repository
107
- git clone <repository-url>
108
- cd astrasdk
172
+ #### `<NodeFlowModal>`
109
173
 
110
- # Install dependencies (use npm only)
111
- npm install
174
+ Modal component for transaction UI. Add once inside the provider.
112
175
 
113
- # Start development server
114
- npm run dev
176
+ ---
115
177
 
116
- # Build for production
117
- npm run build
178
+ ### Functions
118
179
 
119
- # Run linter
120
- npm run lint
121
- ```
180
+ #### `nodeFlowSend(options)`
122
181
 
123
- **Note**: This project uses npm as the package manager. Please avoid using yarn to prevent compatibility issues.
182
+ Lightning EVM: Get tokens by paying a Lightning invoice.
124
183
 
125
- ### Environment Configuration
184
+ | Option | Type | Description |
185
+ | :--- | :--- | :--- |
186
+ | `assetId` | `string` | Asset ID (get from `useNodeFlowPairs`) |
187
+ | `amount` | `number` | Amount in satoshis |
188
+ | `onProgress` | `(step, data) => void` | Progress callback |
189
+ | `onSuccess` | `(result) => void` | Success callback |
190
+ | `onError` | `(error) => void` | Error callback |
126
191
 
127
- For development, you can use the provided test configuration:
192
+ **Progress steps**: `'init'` `'signature'` `'deposit'` `'pending'` → `'complete'`
128
193
 
129
- ```jsx
130
- const projectId = "your-test-project-id";
194
+ ```javascript
195
+ const result = await nodeFlowSend({
196
+ assetId: defaultAssetId,
197
+ amount: 1000,
198
+ onProgress: (step) => console.log('Step:', step),
199
+ onSuccess: (result) => console.log('Success:', result),
200
+ });
131
201
  ```
132
202
 
133
- ## 🔧 Technical Stack
203
+ #### `nodeFlowReceive(options)`
134
204
 
135
- - **React 18** - UI library
136
- - **Wagmi** - React hooks for Ethereum
137
- - **Viem** - TypeScript interface for Ethereum
138
- - **Reown AppKit** - Wallet connection
139
- - **Ant Design** - UI components
140
- - **Styled Components** - CSS-in-JS styling
141
- - **Zustand** - State management
142
- - **Axios** - HTTP client
143
- - **Decimal.js** - Precise decimal arithmetic
205
+ EVM Lightning: Pay a Lightning invoice using tokens.
144
206
 
145
- ## 🌐 Supported Networks
207
+ | Option | Type | Description |
208
+ | :--- | :--- | :--- |
209
+ | `assetId` | `string` | Asset ID (get from `useNodeFlowPairs`) |
210
+ | `invoice` | `string` | Lightning invoice to pay |
211
+ | `onProgress` | `(step, data) => void` | Progress callback |
212
+ | `onSuccess` | `(result) => void` | Success callback |
213
+ | `onError` | `(error) => void` | Error callback |
146
214
 
147
- ### Production Networks
148
- - **BSC** - Binance Smart Chain
149
- - **Base** - Coinbase Layer 2
215
+ **Progress steps**: `'init'` → `'approve'` → `'deposit'` → `'complete'`
150
216
 
151
- ### Development Networks
152
- - **Sepolia** - Ethereum testnet
153
- - **Base Sepolia** - Base testnet
154
- - **Botanix** - Bitcoin EVM testnet
217
+ ```javascript
218
+ const result = await nodeFlowReceive({
219
+ assetId: defaultAssetId,
220
+ invoice: 'lnbc...',
221
+ onSuccess: (result) => console.log('Paid:', result),
222
+ });
223
+ ```
155
224
 
156
- ## 📱 Mobile Support
225
+ ---
157
226
 
158
- The SDK is fully responsive and optimized for mobile devices with:
159
- - Touch-friendly interfaces
160
- - Responsive modal design
161
- - Mobile wallet compatibility
162
- - Optimized font sizes and spacing
227
+ ### Hooks
163
228
 
164
- ## 🔐 Security Features
229
+ #### `useNodeFlowPairs()`
165
230
 
166
- - Secure wallet connections via WalletConnect
167
- - Transaction validation and verification
168
- - Real-time status monitoring
169
- - Error handling and user feedback
170
- - Safe contract interactions
231
+ Get available trading pairs for the current chain.
171
232
 
172
- ## 📄 License
233
+ ```javascript
234
+ const {
235
+ pairs, // All available pairs
236
+ defaultAssetId, // First pair's asset ID
237
+ currentPair, // Currently selected pair
238
+ setCurrentPair, // Set current pair
239
+ isReady // Whether pairs are loaded
240
+ } = useNodeFlowPairs();
241
+ ```
173
242
 
174
- MIT License - see [LICENSE](LICENSE) file for details.
243
+ #### `useNodeFlowState()`
175
244
 
176
- ## 🤝 Contributing
245
+ Get SDK configuration state.
177
246
 
178
- We welcome contributions! Please see our contributing guidelines:
247
+ ```javascript
248
+ const {
249
+ supportedChainIds, // Supported chain IDs from backend
250
+ isConfigReady, // Config loaded
251
+ apiUrl, // Current API URL
252
+ targetNetwork // Current network
253
+ } = useNodeFlowState();
254
+ ```
179
255
 
180
- 1. Fork the repository
181
- 2. Create a feature branch
182
- 3. Make your changes
183
- 4. Add tests if applicable
184
- 5. Submit a pull request
256
+ ---
185
257
 
186
- ## 📞 Support
258
+ ## Using NodeFlowConfig (Existing Wagmi Setup)
187
259
 
188
- For support and questions:
189
- - Create an issue in the GitHub repository
190
- - Check the documentation
191
- - Review example implementations
260
+ If you already have Wagmi configured in your app, use `NodeFlowConfig` instead:
192
261
 
193
- ## 🔄 Changelog
262
+ ```jsx
263
+ import { NodeFlowConfig, NodeFlowModal } from '@lnfi-network/nodeflow-sdk';
194
264
 
195
- ### v1.0.34
196
- - Initial public release
197
- - EVM ↔ Lightning bridge functionality
198
- - Multi-chain support
199
- - Wallet integration
200
- - Responsive design
265
+ // Inside your existing WagmiProvider
266
+ <NodeFlowConfig apiUrl="<API_BASE_URL>">
267
+ <NodeFlowModal />
268
+ <YourApp />
269
+ </NodeFlowConfig>
270
+ ```
201
271
 
202
272
  ---
203
273
 
204
- Built with ❤️ by the Astra Labs team
274
+ ## License
275
+
276
+ MIT
@@ -1,4 +1,4 @@
1
- import { N as l, L as G, M as O, R as f, S as g, O as E, P as S, Q as U, T as D, U as B, V as P, X as b, Y as M, Z as C, _ as z, $ as R, a0 as V, a1 as x, a2 as H, a3 as $, a4 as Q, a5 as q } from "./index-2vYoun4O.js";
1
+ import { N as l, L as G, M as O, R as f, S as g, O as E, P as S, Q as U, T as D, U as B, V as P, X as b, Y as M, Z as C, _ as z, $ as R, a0 as V, a1 as x, a2 as H, a3 as $, a4 as Q, a5 as q } from "./index-LucuShOc.js";
2
2
  const I = {
3
3
  getGasPriceInEther(n, t) {
4
4
  const o = t * n;
@@ -1,4 +1,4 @@
1
- import { D as l } from "./index-2vYoun4O.js";
1
+ import { D as l } from "./index-LucuShOc.js";
2
2
  const o = l`<svg
3
3
  width="14"
4
4
  height="14"
@@ -1,4 +1,4 @@
1
- import { D as a } from "./index-2vYoun4O.js";
1
+ import { D as a } from "./index-LucuShOc.js";
2
2
  const o = a`<svg fill="none" viewBox="0 0 24 24">
3
3
  <path
4
4
  style="fill: var(--wui-color-accent-100);"
@@ -1,4 +1,4 @@
1
- import { D as a } from "./index-2vYoun4O.js";
1
+ import { D as a } from "./index-LucuShOc.js";
2
2
  const e = a`
3
3
  <svg width="36" height="36">
4
4
  <path
@@ -1,4 +1,4 @@
1
- import { D as l } from "./index-2vYoun4O.js";
1
+ import { D as l } from "./index-LucuShOc.js";
2
2
  const f = l`<svg fill="none" viewBox="0 0 40 40">
3
3
  <g clip-path="url(#a)">
4
4
  <g clip-path="url(#b)">
@@ -1,4 +1,4 @@
1
- import { D as o } from "./index-2vYoun4O.js";
1
+ import { D as o } from "./index-LucuShOc.js";
2
2
  const e = o`<svg fill="none" viewBox="0 0 14 15">
3
3
  <path
4
4
  fill="currentColor"
@@ -1,4 +1,4 @@
1
- import { D as C } from "./index-2vYoun4O.js";
1
+ import { D as C } from "./index-LucuShOc.js";
2
2
  const e = C`<svg
3
3
  fill="none"
4
4
  viewBox="0 0 21 20"
@@ -1,4 +1,4 @@
1
- import { D as e } from "./index-2vYoun4O.js";
1
+ import { D as e } from "./index-LucuShOc.js";
2
2
  const o = e`<svg fill="none" viewBox="0 0 14 15">
3
3
  <path
4
4
  fill="currentColor"
@@ -1,4 +1,4 @@
1
- import { D as l } from "./index-2vYoun4O.js";
1
+ import { D as l } from "./index-LucuShOc.js";
2
2
  const e = l`<svg fill="none" viewBox="0 0 14 15">
3
3
  <path
4
4
  fill="currentColor"
@@ -1,4 +1,4 @@
1
- import { D as o } from "./index-2vYoun4O.js";
1
+ import { D as o } from "./index-LucuShOc.js";
2
2
  const e = o`<svg fill="none" viewBox="0 0 14 15">
3
3
  <path
4
4
  fill="currentColor"
@@ -1,4 +1,4 @@
1
- import { D as e } from "./index-2vYoun4O.js";
1
+ import { D as e } from "./index-LucuShOc.js";
2
2
  const o = e`<svg
3
3
  xmlns="http://www.w3.org/2000/svg"
4
4
  width="12"
@@ -1,4 +1,4 @@
1
- import { D as C } from "./index-2vYoun4O.js";
1
+ import { D as C } from "./index-LucuShOc.js";
2
2
  const o = C`<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
3
3
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.90029 1.71429C4.09883 0.736183 4.96358 0 6.00028 0C7.03698 0 7.90173 0.736183 8.10027 1.71429H9.41533C9.42361 1.71417 9.4319 1.71417 9.44022 1.71429H10.286C10.7594 1.71429 11.1431 2.09804 11.1431 2.57143C11.1431 3.04482 10.7594 3.42857 10.286 3.42857H10.1855L9.73675 7.01877C9.6785 7.48493 9.6279 7.88983 9.55601 8.22075C9.47948 8.57304 9.36472 8.91574 9.13613 9.22925C8.91553 9.53181 8.63151 9.78254 8.30392 9.96392C7.96448 10.1519 7.61019 10.2232 7.25112 10.2555C6.91385 10.2858 6.50581 10.2857 6.03603 10.2857H5.96453C5.49475 10.2857 5.08671 10.2858 4.74944 10.2555C4.39037 10.2232 4.03608 10.1519 3.69664 9.96392C3.36905 9.78254 3.08503 9.53181 2.86442 9.22925C2.63583 8.91574 2.52108 8.57304 2.44455 8.22075C2.37266 7.88984 2.32206 7.48496 2.26382 7.0188L1.81504 3.42857H1.71456C1.24118 3.42857 0.857422 3.04482 0.857422 2.57143C0.857422 2.09804 1.24118 1.71429 1.71456 1.71429H2.56034C2.56866 1.71417 2.57695 1.71417 2.58522 1.71429H3.90029ZM3.54266 3.42857L3.96043 6.77068C4.02441 7.2825 4.06617 7.61016 4.11976 7.85681C4.17051 8.09045 4.21726 8.17492 4.2496 8.21928C4.32314 8.32013 4.41781 8.4037 4.52701 8.46416C4.57504 8.49076 4.66465 8.52666 4.90278 8.54805C5.15417 8.57063 5.48448 8.57143 6.00028 8.57143C6.51608 8.57143 6.84638 8.57063 7.09778 8.54805C7.33591 8.52666 7.42552 8.49076 7.47355 8.46416C7.58275 8.4037 7.67742 8.32013 7.75096 8.21928C7.7833 8.17491 7.83005 8.09045 7.8808 7.85681C7.93439 7.61016 7.97615 7.2825 8.04013 6.77068L8.4579 3.42857H3.54266Z" fill="currentColor"/>
4
4
  </svg>
@@ -1,4 +1,4 @@
1
- import { D as L } from "./index-2vYoun4O.js";
1
+ import { D as L } from "./index-LucuShOc.js";
2
2
  const i = L`
3
3
  <svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
4
4
  <g clip-path="url(#clip0_24458_3947)">
@@ -1,4 +1,4 @@
1
- import { D as l } from "./index-2vYoun4O.js";
1
+ import { D as l } from "./index-LucuShOc.js";
2
2
  const a = l`<svg fill="none" viewBox="0 0 20 20">
3
3
  <path
4
4
  fill="currentColor"
@@ -1,4 +1,4 @@
1
- import { D as C } from "./index-2vYoun4O.js";
1
+ import { D as C } from "./index-LucuShOc.js";
2
2
  const l = C`<svg
3
3
  xmlns="http://www.w3.org/2000/svg"
4
4
  width="12"