@daimo/sdk 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/README.md +18 -0
  2. package/dist/client/createDaimoClient.d.ts +16 -4
  3. package/dist/client/createDaimoClient.d.ts.map +1 -1
  4. package/dist/client/createDaimoClient.js +31 -3
  5. package/dist/client/createDaimoClient.js.map +1 -1
  6. package/dist/common/account.d.ts +419 -13
  7. package/dist/common/account.d.ts.map +1 -1
  8. package/dist/common/account.js +278 -0
  9. package/dist/common/account.js.map +1 -1
  10. package/dist/common/api.d.ts +7 -5
  11. package/dist/common/api.d.ts.map +1 -1
  12. package/dist/common/api.js +13 -12
  13. package/dist/common/api.js.map +1 -1
  14. package/dist/common/api.test.d.ts +2 -0
  15. package/dist/common/api.test.d.ts.map +1 -0
  16. package/dist/common/api.test.js +21 -0
  17. package/dist/common/api.test.js.map +1 -0
  18. package/dist/common/constants.d.ts +5 -0
  19. package/dist/common/constants.d.ts.map +1 -0
  20. package/dist/common/constants.js +5 -0
  21. package/dist/common/constants.js.map +1 -0
  22. package/dist/common/frameMessages.d.ts +26 -0
  23. package/dist/common/frameMessages.d.ts.map +1 -0
  24. package/dist/common/frameMessages.js +54 -0
  25. package/dist/common/frameMessages.js.map +1 -0
  26. package/dist/common/frameMessages.test.d.ts +2 -0
  27. package/dist/common/frameMessages.test.d.ts.map +1 -0
  28. package/dist/common/frameMessages.test.js +42 -0
  29. package/dist/common/frameMessages.test.js.map +1 -0
  30. package/dist/common/frameReadiness.d.ts +22 -0
  31. package/dist/common/frameReadiness.d.ts.map +1 -0
  32. package/dist/common/frameReadiness.js +33 -0
  33. package/dist/common/frameReadiness.js.map +1 -0
  34. package/dist/common/frameReadiness.test.d.ts +2 -0
  35. package/dist/common/frameReadiness.test.d.ts.map +1 -0
  36. package/dist/common/frameReadiness.test.js +76 -0
  37. package/dist/common/frameReadiness.test.js.map +1 -0
  38. package/dist/native/DaimoFrameRN.d.ts +72 -0
  39. package/dist/native/DaimoFrameRN.d.ts.map +1 -0
  40. package/dist/native/DaimoFrameRN.js +244 -0
  41. package/dist/native/DaimoFrameRN.js.map +1 -0
  42. package/dist/native/index.d.ts +5 -0
  43. package/dist/native/index.d.ts.map +1 -0
  44. package/dist/native/index.js +10 -0
  45. package/dist/native/index.js.map +1 -0
  46. package/dist/version.d.ts +1 -1
  47. package/dist/version.js +1 -1
  48. package/dist/web/api/index.d.ts +24 -0
  49. package/dist/web/api/index.d.ts.map +1 -1
  50. package/dist/web/api/index.js +6 -1
  51. package/dist/web/api/index.js.map +1 -1
  52. package/dist/web/api/navTree.d.ts +5 -2
  53. package/dist/web/api/navTree.d.ts.map +1 -1
  54. package/dist/web/components/BankLogo.d.ts +8 -0
  55. package/dist/web/components/BankLogo.d.ts.map +1 -0
  56. package/dist/web/components/BankLogo.js +9 -0
  57. package/dist/web/components/BankLogo.js.map +1 -0
  58. package/dist/web/components/ChooseOptionPage.d.ts +2 -1
  59. package/dist/web/components/ChooseOptionPage.d.ts.map +1 -1
  60. package/dist/web/components/ChooseOptionPage.js +7 -4
  61. package/dist/web/components/ChooseOptionPage.js.map +1 -1
  62. package/dist/web/components/ChooseOptionPage.test.d.ts +2 -0
  63. package/dist/web/components/ChooseOptionPage.test.d.ts.map +1 -0
  64. package/dist/web/components/ChooseOptionPage.test.js +29 -0
  65. package/dist/web/components/ChooseOptionPage.test.js.map +1 -0
  66. package/dist/web/components/Countdown.d.ts +4 -1
  67. package/dist/web/components/Countdown.d.ts.map +1 -1
  68. package/dist/web/components/Countdown.js +24 -10
  69. package/dist/web/components/Countdown.js.map +1 -1
  70. package/dist/web/components/Countdown.test.d.ts +2 -0
  71. package/dist/web/components/Countdown.test.d.ts.map +1 -0
  72. package/dist/web/components/Countdown.test.js +16 -0
  73. package/dist/web/components/Countdown.test.js.map +1 -0
  74. package/dist/web/components/DaimoFrame.d.ts +3 -2
  75. package/dist/web/components/DaimoFrame.d.ts.map +1 -1
  76. package/dist/web/components/DaimoFrame.js +36 -18
  77. package/dist/web/components/DaimoFrame.js.map +1 -1
  78. package/dist/web/components/DaimoModal.d.ts +16 -1
  79. package/dist/web/components/DaimoModal.d.ts.map +1 -1
  80. package/dist/web/components/DaimoModal.js +147 -64
  81. package/dist/web/components/DaimoModal.js.map +1 -1
  82. package/dist/web/components/DaimoRampPreview.d.ts +12 -0
  83. package/dist/web/components/DaimoRampPreview.d.ts.map +1 -0
  84. package/dist/web/components/DaimoRampPreview.js +21 -0
  85. package/dist/web/components/DaimoRampPreview.js.map +1 -0
  86. package/dist/web/components/ExchangePage.d.ts.map +1 -1
  87. package/dist/web/components/ExchangePage.js +6 -1
  88. package/dist/web/components/ExchangePage.js.map +1 -1
  89. package/dist/web/components/ExternalPaymentPage.d.ts.map +1 -1
  90. package/dist/web/components/ExternalPaymentPage.js +3 -2
  91. package/dist/web/components/ExternalPaymentPage.js.map +1 -1
  92. package/dist/web/components/ModalChrome.d.ts +9 -12
  93. package/dist/web/components/ModalChrome.d.ts.map +1 -1
  94. package/dist/web/components/ModalChrome.js +40 -41
  95. package/dist/web/components/ModalChrome.js.map +1 -1
  96. package/dist/web/components/account/AccountApplePayPage.d.ts +4 -3
  97. package/dist/web/components/account/AccountApplePayPage.d.ts.map +1 -1
  98. package/dist/web/components/account/AccountApplePayPage.js +85 -50
  99. package/dist/web/components/account/AccountApplePayPage.js.map +1 -1
  100. package/dist/web/components/account/AccountApprovalPage.d.ts +34 -0
  101. package/dist/web/components/account/AccountApprovalPage.d.ts.map +1 -0
  102. package/dist/web/components/account/AccountApprovalPage.js +145 -0
  103. package/dist/web/components/account/AccountApprovalPage.js.map +1 -0
  104. package/dist/web/components/account/AccountBankDetailsPage.d.ts +4 -3
  105. package/dist/web/components/account/AccountBankDetailsPage.d.ts.map +1 -1
  106. package/dist/web/components/account/AccountBankDetailsPage.js +12 -10
  107. package/dist/web/components/account/AccountBankDetailsPage.js.map +1 -1
  108. package/dist/web/components/account/AccountBankPickerPage.d.ts +6 -9
  109. package/dist/web/components/account/AccountBankPickerPage.d.ts.map +1 -1
  110. package/dist/web/components/account/AccountBankPickerPage.js +52 -23
  111. package/dist/web/components/account/AccountBankPickerPage.js.map +1 -1
  112. package/dist/web/components/account/AccountDeeplinkPage.d.ts +3 -1
  113. package/dist/web/components/account/AccountDeeplinkPage.d.ts.map +1 -1
  114. package/dist/web/components/account/AccountDeeplinkPage.js +17 -9
  115. package/dist/web/components/account/AccountDeeplinkPage.js.map +1 -1
  116. package/dist/web/components/account/AccountEmailPage.d.ts +2 -1
  117. package/dist/web/components/account/AccountEmailPage.d.ts.map +1 -1
  118. package/dist/web/components/account/AccountEmailPage.js +2 -2
  119. package/dist/web/components/account/AccountEmailPage.js.map +1 -1
  120. package/dist/web/components/account/AccountEnrollmentPage.d.ts +1 -4
  121. package/dist/web/components/account/AccountEnrollmentPage.d.ts.map +1 -1
  122. package/dist/web/components/account/AccountEnrollmentPage.js +270 -236
  123. package/dist/web/components/account/AccountEnrollmentPage.js.map +1 -1
  124. package/dist/web/components/account/AccountEnrollmentUpdatePage.d.ts.map +1 -1
  125. package/dist/web/components/account/AccountEnrollmentUpdatePage.js +2 -1
  126. package/dist/web/components/account/AccountEnrollmentUpdatePage.js.map +1 -1
  127. package/dist/web/components/account/AccountFlowProvider.d.ts +8 -1
  128. package/dist/web/components/account/AccountFlowProvider.d.ts.map +1 -1
  129. package/dist/web/components/account/AccountFlowProvider.js +38 -3
  130. package/dist/web/components/account/AccountFlowProvider.js.map +1 -1
  131. package/dist/web/components/account/AccountInteracConfirmPage.d.ts +4 -3
  132. package/dist/web/components/account/AccountInteracConfirmPage.d.ts.map +1 -1
  133. package/dist/web/components/account/AccountInteracConfirmPage.js +15 -23
  134. package/dist/web/components/account/AccountInteracConfirmPage.js.map +1 -1
  135. package/dist/web/components/account/AccountOtpCodeEntry.d.ts +2 -1
  136. package/dist/web/components/account/AccountOtpCodeEntry.d.ts.map +1 -1
  137. package/dist/web/components/account/AccountOtpCodeEntry.js +25 -6
  138. package/dist/web/components/account/AccountOtpCodeEntry.js.map +1 -1
  139. package/dist/web/components/account/AccountOtpPage.d.ts +1 -1
  140. package/dist/web/components/account/AccountOtpPage.d.ts.map +1 -1
  141. package/dist/web/components/account/AccountOtpPage.js +4 -2
  142. package/dist/web/components/account/AccountOtpPage.js.map +1 -1
  143. package/dist/web/components/account/AccountPaymentPage.d.ts +3 -2
  144. package/dist/web/components/account/AccountPaymentPage.d.ts.map +1 -1
  145. package/dist/web/components/account/AccountPaymentPage.js +10 -5
  146. package/dist/web/components/account/AccountPaymentPage.js.map +1 -1
  147. package/dist/web/components/account/AccountPaymentResumePage.d.ts +8 -0
  148. package/dist/web/components/account/AccountPaymentResumePage.d.ts.map +1 -0
  149. package/dist/web/components/account/AccountPaymentResumePage.js +42 -0
  150. package/dist/web/components/account/AccountPaymentResumePage.js.map +1 -0
  151. package/dist/web/components/account/AccountPhoneOtpPage.d.ts +1 -3
  152. package/dist/web/components/account/AccountPhoneOtpPage.d.ts.map +1 -1
  153. package/dist/web/components/account/AccountPhoneOtpPage.js +3 -40
  154. package/dist/web/components/account/AccountPhoneOtpPage.js.map +1 -1
  155. package/dist/web/components/account/AccountPhonePage.d.ts +1 -2
  156. package/dist/web/components/account/AccountPhonePage.d.ts.map +1 -1
  157. package/dist/web/components/account/AccountPhonePage.js +1 -2
  158. package/dist/web/components/account/AccountPhonePage.js.map +1 -1
  159. package/dist/web/components/account/AccountRequestToPayPage.d.ts +28 -0
  160. package/dist/web/components/account/AccountRequestToPayPage.d.ts.map +1 -0
  161. package/dist/web/components/account/AccountRequestToPayPage.js +79 -0
  162. package/dist/web/components/account/AccountRequestToPayPage.js.map +1 -0
  163. package/dist/web/components/account/AccountStatusPage.d.ts +4 -1
  164. package/dist/web/components/account/AccountStatusPage.d.ts.map +1 -1
  165. package/dist/web/components/account/AccountStatusPage.js +2 -2
  166. package/dist/web/components/account/AccountStatusPage.js.map +1 -1
  167. package/dist/web/components/account/PaginatedEnrollmentForm.d.ts +4 -1
  168. package/dist/web/components/account/PaginatedEnrollmentForm.d.ts.map +1 -1
  169. package/dist/web/components/account/PaginatedEnrollmentForm.js +74 -8
  170. package/dist/web/components/account/PaginatedEnrollmentForm.js.map +1 -1
  171. package/dist/web/components/account/PaginatedEnrollmentForm.test.d.ts +2 -0
  172. package/dist/web/components/account/PaginatedEnrollmentForm.test.d.ts.map +1 -0
  173. package/dist/web/components/account/PaginatedEnrollmentForm.test.js +67 -0
  174. package/dist/web/components/account/PaginatedEnrollmentForm.test.js.map +1 -0
  175. package/dist/web/components/account/accountNav.d.ts +19 -9
  176. package/dist/web/components/account/accountNav.d.ts.map +1 -1
  177. package/dist/web/components/account/accountNav.js +76 -32
  178. package/dist/web/components/account/accountNav.js.map +1 -1
  179. package/dist/web/components/account/accountNav.test.js +180 -15
  180. package/dist/web/components/account/accountNav.test.js.map +1 -1
  181. package/dist/web/components/account/accountPaymentCompatibility.d.ts +40 -0
  182. package/dist/web/components/account/accountPaymentCompatibility.d.ts.map +1 -0
  183. package/dist/web/components/account/accountPaymentCompatibility.js +319 -0
  184. package/dist/web/components/account/accountPaymentCompatibility.js.map +1 -0
  185. package/dist/web/components/account/accountSessionRecreate.d.ts +15 -0
  186. package/dist/web/components/account/accountSessionRecreate.d.ts.map +1 -0
  187. package/dist/web/components/account/accountSessionRecreate.js +24 -0
  188. package/dist/web/components/account/accountSessionRecreate.js.map +1 -0
  189. package/dist/web/components/account/accountSessionRecreate.test.d.ts +2 -0
  190. package/dist/web/components/account/accountSessionRecreate.test.d.ts.map +1 -0
  191. package/dist/web/components/account/accountSessionRecreate.test.js +75 -0
  192. package/dist/web/components/account/accountSessionRecreate.test.js.map +1 -0
  193. package/dist/web/components/account/approvalInteractions.test.d.ts +2 -0
  194. package/dist/web/components/account/approvalInteractions.test.d.ts.map +1 -0
  195. package/dist/web/components/account/approvalInteractions.test.js +209 -0
  196. package/dist/web/components/account/approvalInteractions.test.js.map +1 -0
  197. package/dist/web/components/account/enrollmentProtocol.d.ts +76 -0
  198. package/dist/web/components/account/enrollmentProtocol.d.ts.map +1 -0
  199. package/dist/web/components/account/enrollmentProtocol.js +323 -0
  200. package/dist/web/components/account/enrollmentProtocol.js.map +1 -0
  201. package/dist/web/components/account/enrollmentProtocol.test.d.ts +2 -0
  202. package/dist/web/components/account/enrollmentProtocol.test.d.ts.map +1 -0
  203. package/dist/web/components/account/enrollmentProtocol.test.js +544 -0
  204. package/dist/web/components/account/enrollmentProtocol.test.js.map +1 -0
  205. package/dist/web/components/account/fiatPopup.d.ts +7 -2
  206. package/dist/web/components/account/fiatPopup.d.ts.map +1 -1
  207. package/dist/web/components/account/fiatPopup.js +16 -6
  208. package/dist/web/components/account/fiatPopup.js.map +1 -1
  209. package/dist/web/components/account/fiatPopup.test.js +8 -6
  210. package/dist/web/components/account/fiatPopup.test.js.map +1 -1
  211. package/dist/web/components/account/formSchemas.d.ts +6 -6
  212. package/dist/web/components/account/requestToPay.test.d.ts +2 -0
  213. package/dist/web/components/account/requestToPay.test.d.ts.map +1 -0
  214. package/dist/web/components/account/requestToPay.test.js +117 -0
  215. package/dist/web/components/account/requestToPay.test.js.map +1 -0
  216. package/dist/web/components/account/walletPayDetails.d.ts +8 -0
  217. package/dist/web/components/account/walletPayDetails.d.ts.map +1 -0
  218. package/dist/web/components/account/walletPayDetails.js +46 -0
  219. package/dist/web/components/account/walletPayDetails.js.map +1 -0
  220. package/dist/web/components/account/walletPayDetails.test.d.ts +2 -0
  221. package/dist/web/components/account/walletPayDetails.test.d.ts.map +1 -0
  222. package/dist/web/components/account/walletPayDetails.test.js +87 -0
  223. package/dist/web/components/account/walletPayDetails.test.js.map +1 -0
  224. package/dist/web/components/account/walletPayName.d.ts +8 -0
  225. package/dist/web/components/account/walletPayName.d.ts.map +1 -0
  226. package/dist/web/components/account/walletPayName.js +12 -0
  227. package/dist/web/components/account/walletPayName.js.map +1 -0
  228. package/dist/web/components/account/walletPayName.test.d.ts +2 -0
  229. package/dist/web/components/account/walletPayName.test.d.ts.map +1 -0
  230. package/dist/web/components/account/walletPayName.test.js +15 -0
  231. package/dist/web/components/account/walletPayName.test.js.map +1 -0
  232. package/dist/web/components/frameMessages.d.ts +2 -28
  233. package/dist/web/components/frameMessages.d.ts.map +1 -1
  234. package/dist/web/components/frameMessages.js +4 -61
  235. package/dist/web/components/frameMessages.js.map +1 -1
  236. package/dist/web/components/shared.d.ts.map +1 -1
  237. package/dist/web/components/shared.js +7 -2
  238. package/dist/web/components/shared.js.map +1 -1
  239. package/dist/web/hooks/accountAuthNav.d.ts.map +1 -1
  240. package/dist/web/hooks/accountAuthNav.js +1 -6
  241. package/dist/web/hooks/accountAuthNav.js.map +1 -1
  242. package/dist/web/hooks/accountAuthNav.test.js +9 -15
  243. package/dist/web/hooks/accountAuthNav.test.js.map +1 -1
  244. package/dist/web/hooks/formatUserError.d.ts.map +1 -1
  245. package/dist/web/hooks/formatUserError.js +10 -0
  246. package/dist/web/hooks/formatUserError.js.map +1 -1
  247. package/dist/web/hooks/formatUserError.test.d.ts +2 -0
  248. package/dist/web/hooks/formatUserError.test.d.ts.map +1 -0
  249. package/dist/web/hooks/formatUserError.test.js +36 -0
  250. package/dist/web/hooks/formatUserError.test.js.map +1 -0
  251. package/dist/web/hooks/locales/en.d.ts +8 -2
  252. package/dist/web/hooks/locales/en.d.ts.map +1 -1
  253. package/dist/web/hooks/locales/en.js +13 -7
  254. package/dist/web/hooks/locales/en.js.map +1 -1
  255. package/dist/web/hooks/locales/es.d.ts.map +1 -1
  256. package/dist/web/hooks/locales/es.js +13 -7
  257. package/dist/web/hooks/locales/es.js.map +1 -1
  258. package/dist/web/hooks/locales/ja.d.ts.map +1 -1
  259. package/dist/web/hooks/locales/ja.js +13 -7
  260. package/dist/web/hooks/locales/ja.js.map +1 -1
  261. package/dist/web/hooks/locales/ko.d.ts.map +1 -1
  262. package/dist/web/hooks/locales/ko.js +13 -7
  263. package/dist/web/hooks/locales/ko.js.map +1 -1
  264. package/dist/web/hooks/locales/pt.d.ts.map +1 -1
  265. package/dist/web/hooks/locales/pt.js +13 -7
  266. package/dist/web/hooks/locales/pt.js.map +1 -1
  267. package/dist/web/hooks/locales/zh.d.ts.map +1 -1
  268. package/dist/web/hooks/locales/zh.js +13 -7
  269. package/dist/web/hooks/locales/zh.js.map +1 -1
  270. package/dist/web/hooks/types.d.ts +16 -8
  271. package/dist/web/hooks/types.d.ts.map +1 -1
  272. package/dist/web/hooks/types.js.map +1 -1
  273. package/dist/web/hooks/useAccountFlow.d.ts +3 -9
  274. package/dist/web/hooks/useAccountFlow.d.ts.map +1 -1
  275. package/dist/web/hooks/useAccountFlow.js +0 -12
  276. package/dist/web/hooks/useAccountFlow.js.map +1 -1
  277. package/dist/web/hooks/useDepositPoller.js +1 -1
  278. package/dist/web/hooks/useDepositPoller.js.map +1 -1
  279. package/dist/web/hooks/useDraftDeposit.d.ts +3 -2
  280. package/dist/web/hooks/useDraftDeposit.d.ts.map +1 -1
  281. package/dist/web/hooks/useDraftDeposit.js +12 -5
  282. package/dist/web/hooks/useDraftDeposit.js.map +1 -1
  283. package/dist/web/hooks/useRequestToPayDeposit.d.ts +26 -0
  284. package/dist/web/hooks/useRequestToPayDeposit.d.ts.map +1 -0
  285. package/dist/web/hooks/useRequestToPayDeposit.js +81 -0
  286. package/dist/web/hooks/useRequestToPayDeposit.js.map +1 -0
  287. package/dist/web/hooks/useSessionNav.d.ts +11 -2
  288. package/dist/web/hooks/useSessionNav.d.ts.map +1 -1
  289. package/dist/web/hooks/useSessionNav.js +199 -36
  290. package/dist/web/hooks/useSessionNav.js.map +1 -1
  291. package/dist/web/index.d.ts +2 -0
  292. package/dist/web/index.d.ts.map +1 -1
  293. package/dist/web/index.js +1 -0
  294. package/dist/web/index.js.map +1 -1
  295. package/dist/web/styles.css +1 -1
  296. package/dist/web/theme.css +1 -1
  297. package/dist/web/theme.d.ts.map +1 -1
  298. package/dist/web/theme.js +3 -1
  299. package/dist/web/theme.js.map +1 -1
  300. package/package.json +18 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameReadiness.d.ts","sourceRoot":"","sources":["../../src/common/frameReadiness.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG;IAC3B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,SAAS,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,kBAAkB,CAAC;CAC5B,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,CAO1E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAErE;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,MAAM,GACb,cAAc,CAGhB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAEpE"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Host-side reveal gating for DaimoFrame / DaimoFrameRN.
3
+ *
4
+ * The hosted webview may report height while still applying the org theme, and
5
+ * may signal `ready` before the first layout measurement. Reveal only once both
6
+ * have arrived so the host never paints default (unthemed) colors.
7
+ */
8
+ export function createFrameReadiness(initialHeight) {
9
+ return {
10
+ gotReady: false,
11
+ gotHeight: false,
12
+ height: initialHeight,
13
+ status: "loading",
14
+ };
15
+ }
16
+ export function applyFrameReady(state) {
17
+ return finalize({ ...state, gotReady: true });
18
+ }
19
+ export function applyFrameHeight(state, height) {
20
+ if (height <= 0)
21
+ return state;
22
+ return finalize({ ...state, gotHeight: true, height });
23
+ }
24
+ export function markFrameError(state) {
25
+ return { ...state, status: "error" };
26
+ }
27
+ function finalize(state) {
28
+ if (state.status === "error")
29
+ return state;
30
+ const loaded = state.gotReady && state.gotHeight;
31
+ return { ...state, status: loaded ? "loaded" : "loading" };
32
+ }
33
+ //# sourceMappingURL=frameReadiness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameReadiness.js","sourceRoot":"","sources":["../../src/common/frameReadiness.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,MAAM,UAAU,oBAAoB,CAAC,aAAqB;IACxD,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAqB;IACnD,OAAO,QAAQ,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,KAAqB,EACrB,MAAc;IAEd,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9B,OAAO,QAAQ,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAqB;IACrC,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3C,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC;IACjD,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=frameReadiness.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameReadiness.test.d.ts","sourceRoot":"","sources":["../../src/common/frameReadiness.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,76 @@
1
+ import { describe, expect, test } from "vitest";
2
+ import { applyFrameHeight, applyFrameReady, createFrameReadiness, markFrameError, } from "./frameReadiness.js";
3
+ const INITIAL = 420;
4
+ describe("frameReadiness", () => {
5
+ test("stays loading when height arrives before ready", () => {
6
+ let state = createFrameReadiness(INITIAL);
7
+ state = applyFrameHeight(state, 360);
8
+ expect(state).toMatchObject({
9
+ gotReady: false,
10
+ gotHeight: true,
11
+ height: 360,
12
+ status: "loading",
13
+ });
14
+ });
15
+ test("stays loading when ready arrives before height", () => {
16
+ let state = createFrameReadiness(INITIAL);
17
+ state = applyFrameReady(state);
18
+ expect(state).toMatchObject({
19
+ gotReady: true,
20
+ gotHeight: false,
21
+ height: INITIAL,
22
+ status: "loading",
23
+ });
24
+ });
25
+ test("loads once both ready and a positive height have arrived", () => {
26
+ let state = createFrameReadiness(INITIAL);
27
+ state = applyFrameHeight(state, 360);
28
+ state = applyFrameReady(state);
29
+ expect(state.status).toBe("loaded");
30
+ expect(state.height).toBe(360);
31
+ state = createFrameReadiness(INITIAL);
32
+ state = applyFrameReady(state);
33
+ state = applyFrameHeight(state, 480);
34
+ expect(state.status).toBe("loaded");
35
+ expect(state.height).toBe(480);
36
+ });
37
+ test("ignores non-positive heights", () => {
38
+ let state = applyFrameReady(createFrameReadiness(INITIAL));
39
+ state = applyFrameHeight(state, 0);
40
+ state = applyFrameHeight(state, -10);
41
+ expect(state).toMatchObject({
42
+ gotHeight: false,
43
+ height: INITIAL,
44
+ status: "loading",
45
+ });
46
+ });
47
+ test("height messages only resize after loaded", () => {
48
+ let state = applyFrameReady(createFrameReadiness(INITIAL));
49
+ state = applyFrameHeight(state, 360);
50
+ expect(state.status).toBe("loaded");
51
+ state = applyFrameHeight(state, 520);
52
+ expect(state).toMatchObject({ height: 520, status: "loaded" });
53
+ });
54
+ test("reset via createFrameReadiness clears prior readiness", () => {
55
+ let state = applyFrameReady(createFrameReadiness(INITIAL));
56
+ state = applyFrameHeight(state, 360);
57
+ expect(state.status).toBe("loaded");
58
+ state = createFrameReadiness(INITIAL);
59
+ expect(state).toEqual({
60
+ gotReady: false,
61
+ gotHeight: false,
62
+ height: INITIAL,
63
+ status: "loading",
64
+ });
65
+ });
66
+ test("timeout/error wins over subsequent ready or height", () => {
67
+ let state = markFrameError(createFrameReadiness(INITIAL));
68
+ state = applyFrameReady(state);
69
+ state = applyFrameHeight(state, 400);
70
+ expect(state.status).toBe("error");
71
+ expect(state.gotReady).toBe(true);
72
+ expect(state.gotHeight).toBe(true);
73
+ expect(state.height).toBe(400);
74
+ });
75
+ });
76
+ //# sourceMappingURL=frameReadiness.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameReadiness.test.js","sourceRoot":"","sources":["../../src/common/frameReadiness.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,GAAG,GAAG,CAAC;AAEpB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;QAC1D,IAAI,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC1C,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;YAC1B,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,GAAG;YACX,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;QAC1D,I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oB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1D,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Presentation layout.
3
+ * - `"modal"` (default): a dimmed, full-screen overlay with a rounded bottom
4
+ * sheet sized to the content.
5
+ * - `"embed"`: the WebView inline at the component's position. Fills the
6
+ * container's width; height follows the content. The host owns all chrome,
7
+ * including the dismiss affordance.
8
+ */
9
+ export type DaimoFrameRNLayout = "modal" | "embed";
10
+ export type DaimoFrameRNProps = {
11
+ /** Session ID, created server-side via `POST /v1/sessions`. */
12
+ sessionId: string;
13
+ /** Client secret returned alongside the session. */
14
+ clientSecret: string;
15
+ /** Presentation layout. Defaults to `"modal"`. */
16
+ layout?: DaimoFrameRNLayout;
17
+ /**
18
+ * Base URL of the hosted flow. Defaults to `https://daimo.com`.
19
+ * Override only for staging / self-hosted environments.
20
+ */
21
+ baseUrl?: string;
22
+ /** Called when the flow reports it has opened. */
23
+ onOpen?: () => void;
24
+ /** Called when the user dismisses the flow. */
25
+ onClose?: () => void;
26
+ /** Called when the user's deposit transaction is detected. */
27
+ onPaymentStarted?: () => void;
28
+ /** Called when funds are delivered to the destination. */
29
+ onPaymentCompleted?: () => void;
30
+ /**
31
+ * Called when the flow needs to leave the WebView — Apple Pay, a wallet
32
+ * deeplink, or a hosted fiat provider. Defaults to `Linking.openURL`, which
33
+ * hands the URL to the system browser (where Apple Pay works with no host-app
34
+ * certification). Pass `expo-web-browser`'s `openBrowserAsync` for an in-app
35
+ * Safari sheet.
36
+ */
37
+ onOpenExternalUrl?: (url: string) => void;
38
+ /**
39
+ * Corner radius of the modal sheet and its WebView, in points. Defaults to
40
+ * {@link DEFAULT_BORDER_RADIUS} — larger than the web `DaimoFrame` so the sheet
41
+ * nests neatly inside the device's rounded screen corners.
42
+ */
43
+ borderRadius?: number;
44
+ };
45
+ /**
46
+ * Hosted Daimo deposit flow, embedded in a React Native `WebView`.
47
+ *
48
+ * `DaimoFrameRN` loads `/webview` in content-only (`embed`) mode and sizes the
49
+ * WebView to the height the content reports over the `postMessage` bridge. No
50
+ * wallet libraries or app providers required. The surface stays hidden until
51
+ * the flow reports both `ready` (theme resolved) and a positive content height;
52
+ * if nothing loads within {@link LOAD_TIMEOUT_MS}, a dismissable error card
53
+ * is shown instead.
54
+ *
55
+ * Apple Pay, wallet deeplinks, and hosted fiat providers cannot run inside the
56
+ * message-bridged WebView (WKWebView disables Apple Pay JS once scripts are
57
+ * injected). `DaimoFrameRN` intercepts those navigations and opens them outside
58
+ * the WebView via {@link DaimoFrameRNProps.onOpenExternalUrl}, so the embedding
59
+ * app needs no Apple Pay merchant ID or entitlement.
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ * <DaimoFrameRN
64
+ * layout="modal"
65
+ * sessionId={sessionId}
66
+ * clientSecret={clientSecret}
67
+ * onClose={() => setOpen(false)}
68
+ * />
69
+ * ```
70
+ */
71
+ export declare function DaimoFrameRN({ sessionId, clientSecret, layout, baseUrl, onOpen, onClose, onPaymentStarted, onPaymentCompleted, onOpenExternalUrl, borderRadius, }: DaimoFrameRNProps): import("react/jsx-runtime").JSX.Element;
72
+ //# sourceMappingURL=DaimoFrameRN.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DaimoFrameRN.d.ts","sourceRoot":"","sources":["../../src/native/DaimoFrameRN.tsx"],"names":[],"mappings":"AAqCA;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,YAAY,EACZ,MAAgB,EAChB,OAAwB,EACxB,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,YAAoC,GACrC,EAAE,iBAAiB,2CAyKnB"}
@@ -0,0 +1,244 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { Keyboard, Linking, Modal, Platform, Pressable, StyleSheet, Text, View, } from "react-native";
4
+ import { WebView } from "react-native-webview";
5
+ import { DAIMO_BASE_URL, DAIMO_SUPPORT_EMAIL } from "../common/constants.js";
6
+ import { applyFrameHeight, applyFrameReady, createFrameReadiness, markFrameError, } from "../common/frameReadiness.js";
7
+ import { parseDaimoFrameMessage } from "../common/frameMessages.js";
8
+ const INITIAL_HEIGHT = 420;
9
+ /** Show the error fallback if the WebView reports no content within this. */
10
+ const LOAD_TIMEOUT_MS = 15000;
11
+ // Route every navigation through onShouldStartLoadWithRequest so external links
12
+ // are handed off consistently on iOS and Android; the handler, not the WebView,
13
+ // decides what stays in-frame.
14
+ const ORIGIN_WHITELIST = ["*"];
15
+ // Larger than the web DaimoFrame's 24 so the modal sheet nests concentrically
16
+ // inside the rounded screen corners of current phones (~62pt on Pro-class
17
+ // devices, minus the 20pt scrim inset). Tunable via the `borderRadius` prop;
18
+ // there is no dependency-free way to read the exact per-device screen radius.
19
+ const DEFAULT_BORDER_RADIUS = 42;
20
+ // Inset from the screen edges to the modal sheet (left / right / bottom).
21
+ const SCRIM_INSET = 20;
22
+ /**
23
+ * Hosted Daimo deposit flow, embedded in a React Native `WebView`.
24
+ *
25
+ * `DaimoFrameRN` loads `/webview` in content-only (`embed`) mode and sizes the
26
+ * WebView to the height the content reports over the `postMessage` bridge. No
27
+ * wallet libraries or app providers required. The surface stays hidden until
28
+ * the flow reports both `ready` (theme resolved) and a positive content height;
29
+ * if nothing loads within {@link LOAD_TIMEOUT_MS}, a dismissable error card
30
+ * is shown instead.
31
+ *
32
+ * Apple Pay, wallet deeplinks, and hosted fiat providers cannot run inside the
33
+ * message-bridged WebView (WKWebView disables Apple Pay JS once scripts are
34
+ * injected). `DaimoFrameRN` intercepts those navigations and opens them outside
35
+ * the WebView via {@link DaimoFrameRNProps.onOpenExternalUrl}, so the embedding
36
+ * app needs no Apple Pay merchant ID or entitlement.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * <DaimoFrameRN
41
+ * layout="modal"
42
+ * sessionId={sessionId}
43
+ * clientSecret={clientSecret}
44
+ * onClose={() => setOpen(false)}
45
+ * />
46
+ * ```
47
+ */
48
+ export function DaimoFrameRN({ sessionId, clientSecret, layout = "modal", baseUrl = DAIMO_BASE_URL, onOpen, onClose, onPaymentStarted, onPaymentCompleted, onOpenExternalUrl, borderRadius = DEFAULT_BORDER_RADIUS, }) {
49
+ const [readiness, setReadiness] = useState(() => createFrameReadiness(INITIAL_HEIGHT));
50
+ const [keyboardHeight, setKeyboardHeight] = useState(0);
51
+ const origin = normalizeOrigin(baseUrl);
52
+ const src = getFrameSrc(origin, sessionId, clientSecret);
53
+ // New session / frame URL: hide again until the next ready + height pair.
54
+ useEffect(() => {
55
+ setReadiness(createFrameReadiness(INITIAL_HEIGHT));
56
+ }, [src]);
57
+ // Fall back to the error card if the flow never becomes revealable.
58
+ useEffect(() => {
59
+ if (readiness.status !== "loading")
60
+ return;
61
+ const id = setTimeout(() => setReadiness((s) => markFrameError(s)), LOAD_TIMEOUT_MS);
62
+ return () => clearTimeout(id);
63
+ }, [readiness.status, src]);
64
+ // Lift the modal sheet above the on-screen keyboard. Inputs live inside the
65
+ // WebView, but iOS/Android still raise the system keyboard and fire these
66
+ // events. The sheet is inside a RN `<Modal>` (its own window), so the host
67
+ // can't wrap it — the component avoids the keyboard itself. Embed layout: the
68
+ // host owns the container and handles this.
69
+ useEffect(() => {
70
+ if (layout !== "modal")
71
+ return;
72
+ const onShow = (e) => setKeyboardHeight(e.endCoordinates.height);
73
+ const onHide = () => setKeyboardHeight(0);
74
+ const subs = Platform.OS === "ios"
75
+ ? [
76
+ Keyboard.addListener("keyboardWillShow", onShow),
77
+ Keyboard.addListener("keyboardWillHide", onHide),
78
+ ]
79
+ : [
80
+ Keyboard.addListener("keyboardDidShow", onShow),
81
+ Keyboard.addListener("keyboardDidHide", onHide),
82
+ ];
83
+ return () => subs.forEach((s) => s.remove());
84
+ }, [layout]);
85
+ const openExternal = (url) => {
86
+ if (onOpenExternalUrl)
87
+ return onOpenExternalUrl(url);
88
+ Linking.openURL(url).catch(() => { });
89
+ };
90
+ // onMessage only fires for our own WebView's content, so no origin check is
91
+ // needed here (unlike the web iframe, which shares a window message bus).
92
+ const handleMessage = (event) => {
93
+ let data;
94
+ try {
95
+ data = JSON.parse(event.nativeEvent.data);
96
+ }
97
+ catch {
98
+ return;
99
+ }
100
+ const message = parseDaimoFrameMessage(data);
101
+ if (!message)
102
+ return;
103
+ switch (message.type) {
104
+ case "ready":
105
+ setReadiness((s) => applyFrameReady(s));
106
+ break;
107
+ case "modalOpened":
108
+ onOpen?.();
109
+ break;
110
+ case "modalClosed":
111
+ onClose?.();
112
+ break;
113
+ case "paymentStarted":
114
+ onPaymentStarted?.();
115
+ break;
116
+ case "paymentCompleted":
117
+ onPaymentCompleted?.();
118
+ break;
119
+ case "contentHeightChanged":
120
+ setReadiness((s) => applyFrameHeight(s, message.payload.height));
121
+ break;
122
+ }
123
+ };
124
+ // Keep the checkout flow inside the WebView: allow sub-frames (the flow's
125
+ // third-party iframes — Privy, Coinbase, KYC, etc.) and same-origin top-frame
126
+ // navigations. Hand everything else (wallet deeplinks and provider redirects
127
+ // the flow navigates to expecting the host to open them) off to the host.
128
+ const handleShouldStart = (request) => {
129
+ if (request.isTopFrame === false)
130
+ return true;
131
+ if (isInternalUrl(request.url, origin))
132
+ return true;
133
+ openExternal(request.url);
134
+ return false;
135
+ };
136
+ // `WebViewOpenWindowEvent` isn't re-exported from the package root, so type
137
+ // just the field we read.
138
+ const handleOpenWindow = (event) => {
139
+ openExternal(event.nativeEvent.targetUrl);
140
+ };
141
+ const { height, status } = readiness;
142
+ const webView = (_jsx(WebView, { source: { uri: src }, originWhitelist: ORIGIN_WHITELIST, onMessage: handleMessage, onShouldStartLoadWithRequest: handleShouldStart, onOpenWindow: handleOpenWindow, onError: () => setReadiness((s) => markFrameError(s)), scrollEnabled: layout === "modal", javaScriptEnabled: true, domStorageEnabled: true, style: [styles.webView, { borderRadius }] }));
143
+ if (layout === "embed") {
144
+ if (status === "error") {
145
+ return _jsx(DaimoFrameRNError, { sessionId: sessionId, onClose: onClose });
146
+ }
147
+ return (_jsx(View, { style: [
148
+ styles.embed,
149
+ { height, opacity: status === "loaded" ? 1 : 0 },
150
+ ], children: webView }));
151
+ }
152
+ return (_jsx(Modal, { transparent: true, visible: true, statusBarTranslucent: true, animationType: "slide", onRequestClose: () => onClose?.(), children: _jsx(View, { style: [styles.scrim, { paddingBottom: keyboardHeight + SCRIM_INSET }], children: status === "error" ? (_jsx(DaimoFrameRNError, { sessionId: sessionId, onClose: onClose })) : (_jsx(View, { style: [
153
+ styles.bubble,
154
+ { height, opacity: status === "loaded" ? 1 : 0, borderRadius },
155
+ ], children: webView })) }) }));
156
+ }
157
+ function getFrameSrc(origin, sessionId, clientSecret) {
158
+ const params = [
159
+ `session=${encodeURIComponent(sessionId)}`,
160
+ `cs=${encodeURIComponent(clientSecret)}`,
161
+ "layout=embed",
162
+ // Ask the hosted flow to render its own close button (embed normally hides
163
+ // it, assuming host chrome). We have no chrome, so the flow owns dismissal.
164
+ "close=1",
165
+ ].join("&");
166
+ return `${origin}/webview?${params}`;
167
+ }
168
+ /** Strip any path/trailing slash so `baseUrl` compares as an origin. */
169
+ function normalizeOrigin(baseUrl) {
170
+ return baseUrl.replace(/\/+$/, "");
171
+ }
172
+ function isInternalUrl(url, origin) {
173
+ if (url === "about:blank" || url.startsWith("data:"))
174
+ return true;
175
+ return url === origin || url.startsWith(`${origin}/`);
176
+ }
177
+ /** Dismissable "couldn't load" card with a contact-support mailto link. */
178
+ function DaimoFrameRNError({ sessionId, onClose, }) {
179
+ const mailto = `mailto:${DAIMO_SUPPORT_EMAIL}` +
180
+ `?subject=${encodeURIComponent("Couldn't load Daimo")}` +
181
+ `&body=${encodeURIComponent(`sessionId: ${sessionId}`)}`;
182
+ return (_jsxs(View, { style: styles.errorCard, children: [_jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Close", onPress: () => onClose?.(), style: styles.closeButton, children: _jsx(Text, { style: styles.closeIcon, children: "\u2715" }) }), _jsx(Text, { style: styles.errorText, children: "Couldn't load. Offline?" }), _jsx(Pressable, { accessibilityRole: "button", onPress: () => Linking.openURL(mailto).catch(() => { }), children: _jsx(Text, { style: styles.supportText, children: "Contact support" }) })] }));
183
+ }
184
+ const styles = StyleSheet.create({
185
+ webView: {
186
+ flex: 1,
187
+ width: "100%",
188
+ backgroundColor: "transparent",
189
+ },
190
+ embed: {
191
+ width: "100%",
192
+ overflow: "hidden",
193
+ },
194
+ scrim: {
195
+ flex: 1,
196
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
197
+ justifyContent: "flex-end",
198
+ alignItems: "center",
199
+ padding: SCRIM_INSET,
200
+ },
201
+ bubble: {
202
+ width: "100%",
203
+ maxWidth: 440,
204
+ maxHeight: "90%",
205
+ overflow: "hidden",
206
+ backgroundColor: "#ffffff",
207
+ },
208
+ errorCard: {
209
+ width: "100%",
210
+ maxWidth: 440,
211
+ borderRadius: DEFAULT_BORDER_RADIUS,
212
+ backgroundColor: "#ffffff",
213
+ paddingHorizontal: 24,
214
+ paddingTop: 44,
215
+ paddingBottom: 28,
216
+ alignItems: "center",
217
+ gap: 20,
218
+ },
219
+ closeButton: {
220
+ position: "absolute",
221
+ top: 12,
222
+ right: 12,
223
+ width: 32,
224
+ height: 32,
225
+ alignItems: "center",
226
+ justifyContent: "center",
227
+ },
228
+ closeIcon: {
229
+ fontSize: 16,
230
+ color: "#8a8a8a",
231
+ },
232
+ errorText: {
233
+ fontSize: 15,
234
+ lineHeight: 22,
235
+ textAlign: "center",
236
+ color: "#4a4a4a",
237
+ },
238
+ supportText: {
239
+ fontSize: 15,
240
+ fontWeight: "600",
241
+ color: "#009110",
242
+ },
243
+ });
244
+ //# sourceMappingURL=DaimoFrameRN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DaimoFrameRN.js","sourceRoot":"","sources":["../../src/native/DaimoFrameRN.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS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AS;KACjB;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { DaimoFrameRN } from "./DaimoFrameRN.js";
2
+ export type { DaimoFrameRNProps, DaimoFrameRNLayout, } from "./DaimoFrameRN.js";
3
+ export type { DaimoFrameMessage } from "../common/frameMessages.js";
4
+ export { parseDaimoFrameMessage } from "../common/frameMessages.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,10 @@
1
+ // React Native entry point for the Daimo SDK.
2
+ //
3
+ // Ships a single component, `DaimoFrameRN`, that renders the hosted deposit
4
+ // flow in a `react-native-webview`. This entry point is deliberately isolated
5
+ // from `@daimo/sdk/web`: it imports only React, React Native,
6
+ // react-native-webview, and pure helpers from `@daimo/sdk/common`, so React
7
+ // Native apps never pull in the web build's DOM or wallet dependencies.
8
+ export { DaimoFrameRN } from "./DaimoFrameRN.js";
9
+ export { parseDaimoFrameMessage } from "../common/frameMessages.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native/index.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,8DAA8D;AAC9D,4EAA4E;AAC5E,wEAAwE;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "1.7.0";
1
+ export declare const SDK_VERSION = "1.8.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/genVersion.mjs — do not edit
2
- export const SDK_VERSION = "1.7.0";
2
+ export const SDK_VERSION = "1.8.1";
3
3
  //# sourceMappingURL=version.js.map
@@ -12,13 +12,37 @@ export type AccountAuthConfig = AccountAuthHint & {
12
12
  /** Embedded auth app ID used for account deposit flows. */
13
13
  privyAppId: string;
14
14
  };
15
+ declare const daimoCountryCodeBrand: unique symbol;
16
+ /** Normalized ISO-3166 alpha-2 country code used by Daimo location controls. */
17
+ export type DaimoCountryCode = string & {
18
+ readonly [daimoCountryCodeBrand]: true;
19
+ };
20
+ export declare function parseDaimoCountryCode(value: string | null | undefined): DaimoCountryCode | null;
21
+ export type NavLocation = {
22
+ countryCode: DaimoCountryCode | null;
23
+ countryName: string;
24
+ emoji: string;
25
+ };
26
+ export type NavLocationOption = {
27
+ countryCode: DaimoCountryCode;
28
+ countryName: string;
29
+ emoji: string;
30
+ };
15
31
  export type RetrieveSessionWithNavResponse = {
16
32
  session: SessionNavInfo;
33
+ /** Server-effective location used to build the nav tree. */
34
+ location: NavLocation;
35
+ /** Curated locations that can be selected in the modal country picker. */
36
+ locationOptions: NavLocationOption[];
17
37
  /** Account auth config, present when the nav tree includes Fiat. */
18
38
  accountAuth?: AccountAuthConfig;
19
39
  };
20
40
  export type RecreateSessionWithNavResponse = {
21
41
  session: SessionWithNav;
42
+ /** Server-effective location used to build the nav tree. */
43
+ location: NavLocation;
44
+ /** Curated locations that can be selected in the modal country picker. */
45
+ locationOptions: NavLocationOption[];
22
46
  /** Account auth config, present when the nav tree includes Fiat. */
23
47
  accountAuth?: AccountAuthConfig;
24
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web/api/index.ts"],"names":[],"mappings":"AAAA,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AC1E,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,oEAAoE;IACpE,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,cAAc,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,EAAE,WAAW,CAAC;IACtB,0EAA0E;IAC1E,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,oEAAoE;IACpE,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,EAAE,CAAC"}
@@ -1,2 +1,7 @@
1
- export {};
1
+ export function parseDaimoCountryCode(value) {
2
+ const code = value?.trim().toUpperCase();
3
+ if (!code || code === "XX" || code === "T1")
4
+ return null;
5
+ return /^[A-Z]{2}$/.test(code) ? code : null;
6
+ }
2
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/web/api/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/web/api/index.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,qBAAqB,CACnC,KAAgC;IAEhC,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzC,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACzD,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAyB,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Address } from "viem";
2
- import type { AccountRail } from "../../common/account.js";
2
+ import type { AccountRail, DepositPaymentInteraction } from "../../common/account.js";
3
+ import type { ExchangeId } from "../../common/api.js";
3
4
  import type { SessionPublicInfo } from "../../common/session.js";
4
5
  /** Session plus server-defined modal navigation data. */
5
6
  export type SessionNavInfo = SessionPublicInfo & {
@@ -63,7 +64,7 @@ export type NavNodeDeeplink = NavNodeCommon & {
63
64
  };
64
65
  export type NavNodeExchange = NavNodeCommon & {
65
66
  type: "Exchange";
66
- exchangeId: "Coinbase" | "Binance" | "Lemon" | "BitgetExchange" | "BybitExchange" | "MtPelerin";
67
+ exchangeId: ExchangeId;
67
68
  icon?: string;
68
69
  requiredUsd?: number;
69
70
  minimumUsd: number;
@@ -99,6 +100,8 @@ export type NavNodeConnectedWallet = NavNodeCommon & {
99
100
  export type NavNodeFiat = NavNodeCommon & {
100
101
  type: "Fiat";
101
102
  fiatMethod: AccountRail;
103
+ /** Semantic entry flow. Optional only while old servers remain supported. */
104
+ paymentInteraction?: DepositPaymentInteraction;
102
105
  icon?: string;
103
106
  kycRequirement?: NavNodeKycRequirement;
104
107
  };
@@ -1 +1 @@
1
- {"version":3,"file":"navTree.d.ts","sourceRoot":"","sources":["../../../src/web/api/navTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,yDAAyD;AACzD,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAC/C,yBAAyB;IACzB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAA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AI,CAAC,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,WAAW,CAAC;IACxB,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,qBAAqB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,OAAO,GACf,mBAAmB,GACnB,qBAAqB,GACrB,eAAe,GACf,eAAe,GACf,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,sBAAsB,GACtB,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from "react";
2
+ export declare function isBankLogo(icon: string): boolean;
3
+ export declare function BankLogo({ alt, className, style, }: {
4
+ alt: string;
5
+ className: string;
6
+ style?: CSSProperties;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=BankLogo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BankLogo.d.ts","sourceRoot":"","sources":["../../../src/web/components/BankLogo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,QAAQ,CAAC,EACvB,GAAG,EACH,SAAS,EACT,KAAK,GACN,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,2CAwBA"}