@daimo/sdk 1.8.0-beta.0 → 1.8.2

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 (249) hide show
  1. package/README.md +17 -0
  2. package/dist/client/createDaimoClient.d.ts +9 -1
  3. package/dist/client/createDaimoClient.d.ts.map +1 -1
  4. package/dist/client/createDaimoClient.js +23 -0
  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/frameReadiness.d.ts +22 -0
  11. package/dist/common/frameReadiness.d.ts.map +1 -0
  12. package/dist/common/frameReadiness.js +33 -0
  13. package/dist/common/frameReadiness.js.map +1 -0
  14. package/dist/common/frameReadiness.test.d.ts +2 -0
  15. package/dist/common/frameReadiness.test.d.ts.map +1 -0
  16. package/dist/common/frameReadiness.test.js +76 -0
  17. package/dist/common/frameReadiness.test.js.map +1 -0
  18. package/dist/native/DaimoFrameRN.d.ts +3 -2
  19. package/dist/native/DaimoFrameRN.d.ts.map +1 -1
  20. package/dist/native/DaimoFrameRN.js +22 -14
  21. package/dist/native/DaimoFrameRN.js.map +1 -1
  22. package/dist/version.d.ts +1 -1
  23. package/dist/version.d.ts.map +1 -1
  24. package/dist/version.js +1 -1
  25. package/dist/version.js.map +1 -1
  26. package/dist/web/api/navTree.d.ts +3 -1
  27. package/dist/web/api/navTree.d.ts.map +1 -1
  28. package/dist/web/components/ChooseOptionPage.d.ts +2 -1
  29. package/dist/web/components/ChooseOptionPage.d.ts.map +1 -1
  30. package/dist/web/components/ChooseOptionPage.js +3 -4
  31. package/dist/web/components/ChooseOptionPage.js.map +1 -1
  32. package/dist/web/components/ChooseOptionPage.test.d.ts +2 -0
  33. package/dist/web/components/ChooseOptionPage.test.d.ts.map +1 -0
  34. package/dist/web/components/ChooseOptionPage.test.js +29 -0
  35. package/dist/web/components/ChooseOptionPage.test.js.map +1 -0
  36. package/dist/web/components/Countdown.d.ts +4 -1
  37. package/dist/web/components/Countdown.d.ts.map +1 -1
  38. package/dist/web/components/Countdown.js +24 -10
  39. package/dist/web/components/Countdown.js.map +1 -1
  40. package/dist/web/components/Countdown.test.d.ts +2 -0
  41. package/dist/web/components/Countdown.test.d.ts.map +1 -0
  42. package/dist/web/components/Countdown.test.js +16 -0
  43. package/dist/web/components/Countdown.test.js.map +1 -0
  44. package/dist/web/components/DaimoFrame.d.ts +3 -2
  45. package/dist/web/components/DaimoFrame.d.ts.map +1 -1
  46. package/dist/web/components/DaimoFrame.js +42 -19
  47. package/dist/web/components/DaimoFrame.js.map +1 -1
  48. package/dist/web/components/DaimoModal.d.ts.map +1 -1
  49. package/dist/web/components/DaimoModal.js +45 -32
  50. package/dist/web/components/DaimoModal.js.map +1 -1
  51. package/dist/web/components/ProgressPulse.d.ts +14 -0
  52. package/dist/web/components/ProgressPulse.d.ts.map +1 -0
  53. package/dist/web/components/ProgressPulse.js +15 -0
  54. package/dist/web/components/ProgressPulse.js.map +1 -0
  55. package/dist/web/components/account/AccountApplePayPage.d.ts +4 -3
  56. package/dist/web/components/account/AccountApplePayPage.d.ts.map +1 -1
  57. package/dist/web/components/account/AccountApplePayPage.js +75 -40
  58. package/dist/web/components/account/AccountApplePayPage.js.map +1 -1
  59. package/dist/web/components/account/AccountApprovalPage.d.ts +34 -0
  60. package/dist/web/components/account/AccountApprovalPage.d.ts.map +1 -0
  61. package/dist/web/components/account/AccountApprovalPage.js +145 -0
  62. package/dist/web/components/account/AccountApprovalPage.js.map +1 -0
  63. package/dist/web/components/account/AccountBankDetailsPage.d.ts +4 -3
  64. package/dist/web/components/account/AccountBankDetailsPage.d.ts.map +1 -1
  65. package/dist/web/components/account/AccountBankDetailsPage.js +12 -10
  66. package/dist/web/components/account/AccountBankDetailsPage.js.map +1 -1
  67. package/dist/web/components/account/AccountBankPickerPage.d.ts +6 -9
  68. package/dist/web/components/account/AccountBankPickerPage.d.ts.map +1 -1
  69. package/dist/web/components/account/AccountBankPickerPage.js +52 -23
  70. package/dist/web/components/account/AccountBankPickerPage.js.map +1 -1
  71. package/dist/web/components/account/AccountBankTransferSubmittedPage.d.ts +15 -0
  72. package/dist/web/components/account/AccountBankTransferSubmittedPage.d.ts.map +1 -0
  73. package/dist/web/components/account/AccountBankTransferSubmittedPage.js +33 -0
  74. package/dist/web/components/account/AccountBankTransferSubmittedPage.js.map +1 -0
  75. package/dist/web/components/account/AccountDeeplinkPage.d.ts +3 -1
  76. package/dist/web/components/account/AccountDeeplinkPage.d.ts.map +1 -1
  77. package/dist/web/components/account/AccountDeeplinkPage.js +17 -9
  78. package/dist/web/components/account/AccountDeeplinkPage.js.map +1 -1
  79. package/dist/web/components/account/AccountEnrollmentPage.d.ts +1 -4
  80. package/dist/web/components/account/AccountEnrollmentPage.d.ts.map +1 -1
  81. package/dist/web/components/account/AccountEnrollmentPage.js +270 -236
  82. package/dist/web/components/account/AccountEnrollmentPage.js.map +1 -1
  83. package/dist/web/components/account/AccountInteracConfirmPage.d.ts +4 -3
  84. package/dist/web/components/account/AccountInteracConfirmPage.d.ts.map +1 -1
  85. package/dist/web/components/account/AccountInteracConfirmPage.js +15 -23
  86. package/dist/web/components/account/AccountInteracConfirmPage.js.map +1 -1
  87. package/dist/web/components/account/AccountOtpCodeEntry.d.ts +2 -1
  88. package/dist/web/components/account/AccountOtpCodeEntry.d.ts.map +1 -1
  89. package/dist/web/components/account/AccountOtpCodeEntry.js +25 -6
  90. package/dist/web/components/account/AccountOtpCodeEntry.js.map +1 -1
  91. package/dist/web/components/account/AccountPaymentPage.d.ts +3 -2
  92. package/dist/web/components/account/AccountPaymentPage.d.ts.map +1 -1
  93. package/dist/web/components/account/AccountPaymentPage.js +10 -5
  94. package/dist/web/components/account/AccountPaymentPage.js.map +1 -1
  95. package/dist/web/components/account/AccountPaymentResumePage.d.ts +8 -0
  96. package/dist/web/components/account/AccountPaymentResumePage.d.ts.map +1 -0
  97. package/dist/web/components/account/AccountPaymentResumePage.js +42 -0
  98. package/dist/web/components/account/AccountPaymentResumePage.js.map +1 -0
  99. package/dist/web/components/account/AccountPhoneOtpPage.d.ts +1 -3
  100. package/dist/web/components/account/AccountPhoneOtpPage.d.ts.map +1 -1
  101. package/dist/web/components/account/AccountPhoneOtpPage.js +3 -40
  102. package/dist/web/components/account/AccountPhoneOtpPage.js.map +1 -1
  103. package/dist/web/components/account/AccountPhonePage.d.ts +1 -2
  104. package/dist/web/components/account/AccountPhonePage.d.ts.map +1 -1
  105. package/dist/web/components/account/AccountPhonePage.js +1 -2
  106. package/dist/web/components/account/AccountPhonePage.js.map +1 -1
  107. package/dist/web/components/account/AccountReadyPage.d.ts +2 -0
  108. package/dist/web/components/account/AccountReadyPage.d.ts.map +1 -0
  109. package/dist/web/components/account/AccountReadyPage.js +7 -0
  110. package/dist/web/components/account/AccountReadyPage.js.map +1 -0
  111. package/dist/web/components/account/AccountRequestToPayPage.d.ts +28 -0
  112. package/dist/web/components/account/AccountRequestToPayPage.d.ts.map +1 -0
  113. package/dist/web/components/account/AccountRequestToPayPage.js +79 -0
  114. package/dist/web/components/account/AccountRequestToPayPage.js.map +1 -0
  115. package/dist/web/components/account/AccountRipioOtpPage.d.ts +7 -0
  116. package/dist/web/components/account/AccountRipioOtpPage.d.ts.map +1 -0
  117. package/dist/web/components/account/AccountRipioOtpPage.js +53 -0
  118. package/dist/web/components/account/AccountRipioOtpPage.js.map +1 -0
  119. package/dist/web/components/account/PaginatedEnrollmentForm.d.ts +4 -1
  120. package/dist/web/components/account/PaginatedEnrollmentForm.d.ts.map +1 -1
  121. package/dist/web/components/account/PaginatedEnrollmentForm.js +74 -8
  122. package/dist/web/components/account/PaginatedEnrollmentForm.js.map +1 -1
  123. package/dist/web/components/account/PaginatedEnrollmentForm.test.d.ts +2 -0
  124. package/dist/web/components/account/PaginatedEnrollmentForm.test.d.ts.map +1 -0
  125. package/dist/web/components/account/PaginatedEnrollmentForm.test.js +67 -0
  126. package/dist/web/components/account/PaginatedEnrollmentForm.test.js.map +1 -0
  127. package/dist/web/components/account/accountNav.d.ts +14 -10
  128. package/dist/web/components/account/accountNav.d.ts.map +1 -1
  129. package/dist/web/components/account/accountNav.js +60 -34
  130. package/dist/web/components/account/accountNav.js.map +1 -1
  131. package/dist/web/components/account/accountNav.test.js +148 -17
  132. package/dist/web/components/account/accountNav.test.js.map +1 -1
  133. package/dist/web/components/account/accountPaymentCompatibility.d.ts +40 -0
  134. package/dist/web/components/account/accountPaymentCompatibility.d.ts.map +1 -0
  135. package/dist/web/components/account/accountPaymentCompatibility.js +319 -0
  136. package/dist/web/components/account/accountPaymentCompatibility.js.map +1 -0
  137. package/dist/web/components/account/accountSessionRecreate.d.ts +15 -0
  138. package/dist/web/components/account/accountSessionRecreate.d.ts.map +1 -0
  139. package/dist/web/components/account/accountSessionRecreate.js +24 -0
  140. package/dist/web/components/account/accountSessionRecreate.js.map +1 -0
  141. package/dist/web/components/account/accountSessionRecreate.test.d.ts +2 -0
  142. package/dist/web/components/account/accountSessionRecreate.test.d.ts.map +1 -0
  143. package/dist/web/components/account/accountSessionRecreate.test.js +75 -0
  144. package/dist/web/components/account/accountSessionRecreate.test.js.map +1 -0
  145. package/dist/web/components/account/approvalInteractions.test.d.ts +2 -0
  146. package/dist/web/components/account/approvalInteractions.test.d.ts.map +1 -0
  147. package/dist/web/components/account/approvalInteractions.test.js +209 -0
  148. package/dist/web/components/account/approvalInteractions.test.js.map +1 -0
  149. package/dist/web/components/account/enrollmentProtocol.d.ts +76 -0
  150. package/dist/web/components/account/enrollmentProtocol.d.ts.map +1 -0
  151. package/dist/web/components/account/enrollmentProtocol.js +323 -0
  152. package/dist/web/components/account/enrollmentProtocol.js.map +1 -0
  153. package/dist/web/components/account/enrollmentProtocol.test.d.ts +2 -0
  154. package/dist/web/components/account/enrollmentProtocol.test.d.ts.map +1 -0
  155. package/dist/web/components/account/enrollmentProtocol.test.js +544 -0
  156. package/dist/web/components/account/enrollmentProtocol.test.js.map +1 -0
  157. package/dist/web/components/account/fiatPopup.d.ts +7 -2
  158. package/dist/web/components/account/fiatPopup.d.ts.map +1 -1
  159. package/dist/web/components/account/fiatPopup.js +16 -6
  160. package/dist/web/components/account/fiatPopup.js.map +1 -1
  161. package/dist/web/components/account/fiatPopup.test.js +8 -6
  162. package/dist/web/components/account/fiatPopup.test.js.map +1 -1
  163. package/dist/web/components/account/formSchemas.d.ts +6 -6
  164. package/dist/web/components/account/requestToPay.test.d.ts +2 -0
  165. package/dist/web/components/account/requestToPay.test.d.ts.map +1 -0
  166. package/dist/web/components/account/requestToPay.test.js +117 -0
  167. package/dist/web/components/account/requestToPay.test.js.map +1 -0
  168. package/dist/web/components/account/walletPayDetails.d.ts +8 -0
  169. package/dist/web/components/account/walletPayDetails.d.ts.map +1 -0
  170. package/dist/web/components/account/walletPayDetails.js +46 -0
  171. package/dist/web/components/account/walletPayDetails.js.map +1 -0
  172. package/dist/web/components/account/walletPayDetails.test.d.ts +2 -0
  173. package/dist/web/components/account/walletPayDetails.test.d.ts.map +1 -0
  174. package/dist/web/components/account/walletPayDetails.test.js +87 -0
  175. package/dist/web/components/account/walletPayDetails.test.js.map +1 -0
  176. package/dist/web/components/account/walletPayName.d.ts +8 -0
  177. package/dist/web/components/account/walletPayName.d.ts.map +1 -0
  178. package/dist/web/components/account/walletPayName.js +12 -0
  179. package/dist/web/components/account/walletPayName.js.map +1 -0
  180. package/dist/web/components/account/walletPayName.test.d.ts +2 -0
  181. package/dist/web/components/account/walletPayName.test.d.ts.map +1 -0
  182. package/dist/web/components/account/walletPayName.test.js +15 -0
  183. package/dist/web/components/account/walletPayName.test.js.map +1 -0
  184. package/dist/web/components/shared.d.ts.map +1 -1
  185. package/dist/web/components/shared.js +1 -1
  186. package/dist/web/components/shared.js.map +1 -1
  187. package/dist/web/hooks/accountAuthNav.d.ts.map +1 -1
  188. package/dist/web/hooks/accountAuthNav.js +1 -6
  189. package/dist/web/hooks/accountAuthNav.js.map +1 -1
  190. package/dist/web/hooks/accountAuthNav.test.js +9 -15
  191. package/dist/web/hooks/accountAuthNav.test.js.map +1 -1
  192. package/dist/web/hooks/locales/en.d.ts +3 -2
  193. package/dist/web/hooks/locales/en.d.ts.map +1 -1
  194. package/dist/web/hooks/locales/en.js +4 -3
  195. package/dist/web/hooks/locales/en.js.map +1 -1
  196. package/dist/web/hooks/locales/es.d.ts.map +1 -1
  197. package/dist/web/hooks/locales/es.js +4 -3
  198. package/dist/web/hooks/locales/es.js.map +1 -1
  199. package/dist/web/hooks/locales/ja.d.ts.map +1 -1
  200. package/dist/web/hooks/locales/ja.js +4 -3
  201. package/dist/web/hooks/locales/ja.js.map +1 -1
  202. package/dist/web/hooks/locales/ko.d.ts.map +1 -1
  203. package/dist/web/hooks/locales/ko.js +4 -3
  204. package/dist/web/hooks/locales/ko.js.map +1 -1
  205. package/dist/web/hooks/locales/pt.d.ts.map +1 -1
  206. package/dist/web/hooks/locales/pt.js +4 -3
  207. package/dist/web/hooks/locales/pt.js.map +1 -1
  208. package/dist/web/hooks/locales/zh.d.ts.map +1 -1
  209. package/dist/web/hooks/locales/zh.js +4 -3
  210. package/dist/web/hooks/locales/zh.js.map +1 -1
  211. package/dist/web/hooks/types.d.ts +15 -8
  212. package/dist/web/hooks/types.d.ts.map +1 -1
  213. package/dist/web/hooks/types.js.map +1 -1
  214. package/dist/web/hooks/useAccountFlow.d.ts +3 -9
  215. package/dist/web/hooks/useAccountFlow.d.ts.map +1 -1
  216. package/dist/web/hooks/useAccountFlow.js +0 -12
  217. package/dist/web/hooks/useAccountFlow.js.map +1 -1
  218. package/dist/web/hooks/useCreateDeposit.d.ts +20 -0
  219. package/dist/web/hooks/useCreateDeposit.d.ts.map +1 -0
  220. package/dist/web/hooks/useCreateDeposit.js +54 -0
  221. package/dist/web/hooks/useCreateDeposit.js.map +1 -0
  222. package/dist/web/hooks/useDepositPoller.js +1 -1
  223. package/dist/web/hooks/useDepositPoller.js.map +1 -1
  224. package/dist/web/hooks/useDraftDeposit.d.ts +3 -2
  225. package/dist/web/hooks/useDraftDeposit.d.ts.map +1 -1
  226. package/dist/web/hooks/useDraftDeposit.js +12 -5
  227. package/dist/web/hooks/useDraftDeposit.js.map +1 -1
  228. package/dist/web/hooks/useMediaQuery.d.ts +3 -0
  229. package/dist/web/hooks/useMediaQuery.d.ts.map +1 -0
  230. package/dist/web/hooks/useMediaQuery.js +11 -0
  231. package/dist/web/hooks/useMediaQuery.js.map +1 -0
  232. package/dist/web/hooks/useRequestToPayDeposit.d.ts +26 -0
  233. package/dist/web/hooks/useRequestToPayDeposit.d.ts.map +1 -0
  234. package/dist/web/hooks/useRequestToPayDeposit.js +81 -0
  235. package/dist/web/hooks/useRequestToPayDeposit.js.map +1 -0
  236. package/dist/web/hooks/useSessionNav.d.ts +5 -1
  237. package/dist/web/hooks/useSessionNav.d.ts.map +1 -1
  238. package/dist/web/hooks/useSessionNav.js +150 -21
  239. package/dist/web/hooks/useSessionNav.js.map +1 -1
  240. package/dist/web/isDesktopBrowser.d.ts +2 -0
  241. package/dist/web/isDesktopBrowser.d.ts.map +1 -0
  242. package/dist/web/isDesktopBrowser.js +6 -0
  243. package/dist/web/isDesktopBrowser.js.map +1 -0
  244. package/dist/web/styles.css +1 -1
  245. package/dist/web/theme.css +1 -1
  246. package/dist/web/theme.d.ts.map +1 -1
  247. package/dist/web/theme.js +3 -1
  248. package/dist/web/theme.js.map +1 -1
  249. package/package.json +1 -1
package/README.md CHANGED
@@ -20,3 +20,20 @@ See [docs.daimo.com](https://docs.daimo.com) for more.
20
20
  Import `@daimo/sdk/web/theme.css` for the built-in web UI. The distributed stylesheet namespaces internal classes with `daimo-` so it can coexist with a host app's Tailwind build.
21
21
 
22
22
  `@daimo/sdk/web/styles.css` remains available as an equivalent alias.
23
+
24
+ ### Account enrollment interactions
25
+
26
+ The built-in account flow is a thin renderer over the versioned
27
+ `EnrollmentInteraction` contract. The server selects the next semantic
28
+ interaction, localized copy, typed form revision, opaque submission action,
29
+ hosted return behavior, and bounded polling policy. The SDK exhaustively renders
30
+ form, OTP/resend, account-phone verification, hosted action, wait/review,
31
+ retry, terminal, and active states without branching on a rail or provider.
32
+
33
+ `DaimoClient.account.getEnrollmentInteraction` and
34
+ `submitEnrollmentAction` are the primary client methods. The older
35
+ `startEnrollment` and specialized form/OTP methods remain available during the
36
+ supported compatibility window. The built-in renderer falls back to those
37
+ legacy routes only when a server does not yet expose the additive generic HTTP
38
+ routes; remove that adapter after one full supported release window shows no
39
+ route-absence fallback in telemetry.
@@ -1,4 +1,4 @@
1
- import type { AccountRail, CreateAccountResponse, CreateDepositResponse, DepositConstraints, EnrollmentOtpRequest, EnrollmentOtpResendRequest, EnrollmentFormSubmitRequest, EnrollmentUpdateRequest, AccountEnrollmentUpdate, EnrollmentResponse, GetAccountResponse, GetDepositResponse, RoutingSignDataResponse, StartEnrollmentRequest } from "../common/account.js";
1
+ import type { AccountRail, CreateAccountResponse, CreateDepositResponse, DepositConstraints, DepositPreCreatePaymentInput, EnrollmentActionSubmitRequest, EnrollmentInteraction, EnrollmentOtpRequest, EnrollmentOtpResendRequest, EnrollmentFormSubmitRequest, EnrollmentUpdateRequest, AccountEnrollmentUpdate, EnrollmentResponse, GetAccountResponse, GetDepositResponse, RoutingSignDataResponse, StartEnrollmentRequest } from "../common/account.js";
2
2
  import type { CheckSessionRequest, CheckSessionResponse, CreatePaymentMethodRequest, CreatePaymentMethodResponse, LogNavEventRequest, RetrieveSessionResponse, TokenOptionsRequest, TokenOptionsResponse } from "../common/api.js";
3
3
  import type { DaimoCountryCode, RecreateSessionWithNavResponse, RetrieveSessionWithNavResponse, WalletOptionsResponse } from "../web/api/index.js";
4
4
  import { type TransportConfig } from "./transport.js";
@@ -25,6 +25,7 @@ export type UpsertDepositRequest = {
25
25
  deliverySigData?: Record<string, unknown>;
26
26
  routingSig?: string;
27
27
  routingSigData?: Record<string, unknown>;
28
+ paymentInput?: DepositPreCreatePaymentInput;
28
29
  };
29
30
  export type DaimoClient = {
30
31
  account: {
@@ -39,6 +40,13 @@ export type DaimoClient = {
39
40
  * provider-specific setup changes.
40
41
  */
41
42
  startEnrollment(input: StartEnrollmentRequest, auth: BearerAuth): Promise<EnrollmentResponse>;
43
+ /** Get the next versioned, provider-agnostic enrollment interaction. */
44
+ getEnrollmentInteraction(input: {
45
+ rail: AccountRail;
46
+ locale?: string;
47
+ }, auth: BearerAuth): Promise<EnrollmentInteraction>;
48
+ /** Submit one opaque interaction action and receive the next interaction. */
49
+ submitEnrollmentAction(input: EnrollmentActionSubmitRequest, auth: BearerAuth): Promise<EnrollmentInteraction>;
42
50
  /** Submit a provider-owned OTP for account enrollment. */
43
51
  submitEnrollmentOtp(input: EnrollmentOtpRequest, auth: BearerAuth): Promise<EnrollmentResponse>;
44
52
  /** Submit a backend-driven enrollment form. */
@@ -1 +1 @@
1
- {"version":3,"file":"createDaimoClient.d.ts","sourceRoot":"","sources":["../../src/client/createDaimoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,gBAAgB,EAChB,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEvE,KAAK,UAAU,GAAG;IAAE,WAAW,EAAE,MAA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,EAAE,MAAM,CAAC;aACxB,GACA,OAAO,CAAC,qBAAqB,CAAC,CAAC;YAClC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;SAC1E,CAAC;KACH,CAAC;CACH,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CAwOtE"}
@@ -1,3 +1,4 @@
1
+ import { zEnrollmentActionSubmitRequest, zEnrollmentInteraction, } from "../common/account.js";
1
2
  import { getLocale } from "../web/hooks/locale.js";
2
3
  import { createTransport } from "./transport.js";
3
4
  function authHeaders(auth) {
@@ -31,6 +32,28 @@ export function createDaimoClient(config) {
31
32
  headers: authHeaders(auth),
32
33
  });
33
34
  },
35
+ async getEnrollmentInteraction(input, auth) {
36
+ const result = await transport.request({
37
+ method: "POST",
38
+ path: "/v1/internal/account/enrollment/interaction",
39
+ body: { ...input, locale: input.locale ?? getLocale() },
40
+ headers: authHeaders(auth),
41
+ });
42
+ return zEnrollmentInteraction.parse(result);
43
+ },
44
+ async submitEnrollmentAction(input, auth) {
45
+ const body = zEnrollmentActionSubmitRequest.parse({
46
+ ...input,
47
+ locale: input.locale ?? getLocale(),
48
+ });
49
+ const result = await transport.request({
50
+ method: "POST",
51
+ path: "/v1/internal/account/enrollment/action",
52
+ body,
53
+ headers: authHeaders(auth),
54
+ });
55
+ return zEnrollmentInteraction.parse(result);
56
+ },
34
57
  submitEnrollmentOtp(input, auth) {
35
58
  return transport.request({
36
59
  method: "POST",
@@ -1 +1 @@
1
- {"version":3,"file":"createDaimoClient.js","sourceRoot":"","sources":["../../src/client/createDaimoClient.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAwB,MAAM,gBAAgB,CAAC;AAIvE,SAAS,WAAW,CAAC,IAAgB;IACnC,OAAO,EAAE,aAAa,EAAE,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C,OAAO,CAAiC;wBACvD,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,gBAAgB,SAAS,eAAe;wBAC9C,KAAK,EAAE;4BACL,YAAY;4BACZ,MAAM,EAAE,SAAS,EAAE;4BACnB,OAAO,EAAE,MAAM,EAAE,WAAW;yBAC7B;qBACF,CAAC,CAAC;gBACL,CAAC;gBACD,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM;oBAC5C,OAAO,SAAS,CAAC,OAAO,CAAiC;wBACvD,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,gBAAgB,SAAS,oBAAoB;wBACnD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE;wBACvC,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;qBAC5C,CAAC,CAAC;gBACL,CAAC;gBACD,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM;oBACnC,OAAO,SAAS,CAAC,OAAO,CAAwB;wBAC9C,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,gBAAgB,SAAS,yBAAyB;wBACxD,KAAK,EAAE;4BACL,YAAY,EAAE,MAAM,CAAC,YAAY;4BACjC,UAAU,EAAE,MAAM,CAAC,UAAU;4BAC7B,aAAa,EAAE,MAAM,CAAC,aAAa;yBACpC;qBACF,CAAC,CAAC;gBACL,CAAC;gBACD,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK;oBAChC,MAAM,SAAS,CAAC,OAAO,CAAO;wBAC5B,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,gBAAgB,SAAS,eAAe;wBAC9C,IAAI,EAAE,KAAK;qBACZ,CAAC,CAAC;gBACL,CAAC;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -59,6 +59,20 @@ export type EnrollmentFormSelectField = {
59
59
  label: string;
60
60
  }[];
61
61
  };
62
+ export type EnrollmentFormDependentSelectField = {
63
+ key: string;
64
+ type: "dependent-select";
65
+ label: string;
66
+ required: boolean;
67
+ description?: string;
68
+ placeholder?: string;
69
+ defaultValue?: string;
70
+ dependsOn: string;
71
+ optionsByValue: Record<string, {
72
+ value: string;
73
+ label: string;
74
+ }[]>;
75
+ };
62
76
  export type EnrollmentFormDateField = {
63
77
  key: string;
64
78
  type: "date";
@@ -78,7 +92,7 @@ export type EnrollmentFormBooleanField = {
78
92
  trueLabel?: string;
79
93
  falseLabel?: string;
80
94
  };
81
- export type EnrollmentFormField = EnrollmentFormTextField | EnrollmentFormSelectField | EnrollmentFormDateField | EnrollmentFormBooleanField;
95
+ export type EnrollmentFormField = EnrollmentFormTextField | EnrollmentFormSelectField | EnrollmentFormDependentSelectField | EnrollmentFormDateField | EnrollmentFormBooleanField;
82
96
  export type EnrollmentForm = {
83
97
  id: string;
84
98
  revision: string;
@@ -142,12 +156,11 @@ export type AccountEnrollmentUpdateApplePayEnhancedVerification = {
142
156
  export type NextAction = "create_account" | "enrollment" | "enrollment_update" | "ready_for_payment" | "suspended";
143
157
  export type ExistingAccountNextAction = Exclude<NextAction, "create_account">;
144
158
  /**
145
- * Enrollment state machine response from startEnrollment.
159
+ * Legacy enrollment response retained for old-server compatibility.
146
160
  *
147
161
  * The SDK renders localized copy per action by default. The server may
148
- * optionally override the title, description, or button label for a specific
149
- * hosted step (e.g. partner-specific wording). Overrides are not localized, so
150
- * prefer leaving them unset and adding copy to the SDK locale files.
162
+ * New integrations use `EnrollmentInteraction`, which owns semantic rendering,
163
+ * polling, action identity, and server-localized hosted copy.
151
164
  */
152
165
  type LinkOutEnrollmentResponse = {
153
166
  url: string;
@@ -213,6 +226,220 @@ export type EnrollmentResponse = ({
213
226
  message: string;
214
227
  retryable: boolean;
215
228
  };
229
+ export declare const ENROLLMENT_INTERACTION_VERSION: 1;
230
+ export type EnrollmentInteractionAction = {
231
+ /** Opaque identity for exactly one enrollment checkpoint and input kind. */
232
+ id: string;
233
+ /** Semantic action/form revision. Return this unchanged when submitting. */
234
+ revision: string;
235
+ };
236
+ export type EnrollmentInteractionPolling = {
237
+ status: "none";
238
+ } | {
239
+ status: "poll";
240
+ delayMs: number;
241
+ };
242
+ type EnrollmentInteractionBase = {
243
+ version: typeof ENROLLMENT_INTERACTION_VERSION;
244
+ polling: EnrollmentInteractionPolling;
245
+ };
246
+ export type EnrollmentHostedCopy = {
247
+ title: string;
248
+ description: string;
249
+ openExternalLabel: string;
250
+ };
251
+ export type EnrollmentInteraction = (EnrollmentInteractionBase & {
252
+ kind: "form";
253
+ action: EnrollmentInteractionAction;
254
+ form: EnrollmentForm;
255
+ }) | (EnrollmentInteractionBase & {
256
+ kind: "otp";
257
+ destination: "email";
258
+ copy: ProviderOtpCopy;
259
+ submitAction: EnrollmentInteractionAction;
260
+ resend: {
261
+ status: "available";
262
+ delayMs: number;
263
+ action: EnrollmentInteractionAction;
264
+ };
265
+ }) | (EnrollmentInteractionBase & {
266
+ kind: "account-phone-verification";
267
+ reason?: string;
268
+ returnBehavior: {
269
+ kind: "refresh";
270
+ };
271
+ }) | (EnrollmentInteractionBase & {
272
+ kind: "hosted";
273
+ mode: "link" | "hosted";
274
+ purpose: "identity-verification" | "agreement";
275
+ url: string;
276
+ copy: EnrollmentHostedCopy;
277
+ returnBehavior: {
278
+ kind: "submit";
279
+ action: EnrollmentInteractionAction;
280
+ autoSubmitDelayMs?: number;
281
+ };
282
+ }) | (EnrollmentInteractionBase & {
283
+ kind: "wait";
284
+ reason: "processing" | "review";
285
+ }) | (EnrollmentInteractionBase & {
286
+ kind: "retry";
287
+ reason: string;
288
+ action: EnrollmentInteractionAction;
289
+ link?: {
290
+ url: string;
291
+ copy: EnrollmentHostedCopy;
292
+ };
293
+ }) | (EnrollmentInteractionBase & {
294
+ kind: "rejection";
295
+ reason: string;
296
+ }) | (EnrollmentInteractionBase & {
297
+ kind: "ineligible";
298
+ reason: string;
299
+ }) | (EnrollmentInteractionBase & {
300
+ kind: "suspended";
301
+ reason: string;
302
+ }) | (EnrollmentInteractionBase & {
303
+ kind: "error";
304
+ message: string;
305
+ retryable: boolean;
306
+ retryAction?: EnrollmentInteractionAction;
307
+ }) | (EnrollmentInteractionBase & {
308
+ kind: "active";
309
+ });
310
+ /** Runtime validation for the closed, server-provided interaction vocabulary. */
311
+ export declare const zEnrollmentInteraction: z.ZodType<EnrollmentInteraction>;
312
+ export declare const zEnrollmentActionInput: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
313
+ kind: z.ZodLiteral<"form">;
314
+ formId: z.ZodString;
315
+ revision: z.ZodString;
316
+ values: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean]>>, Record<string, string | boolean>, Record<string, string | boolean>>;
317
+ }, "strict", z.ZodTypeAny, {
318
+ values: Record<string, string | boolean>;
319
+ formId: string;
320
+ revision: string;
321
+ kind: "form";
322
+ }, {
323
+ values: Record<string, string | boolean>;
324
+ formId: string;
325
+ revision: string;
326
+ kind: "form";
327
+ }>, z.ZodObject<{
328
+ kind: z.ZodLiteral<"otp">;
329
+ code: z.ZodString;
330
+ }, "strict", z.ZodTypeAny, {
331
+ code: string;
332
+ kind: "otp";
333
+ }, {
334
+ code: string;
335
+ kind: "otp";
336
+ }>, z.ZodObject<{
337
+ kind: z.ZodLiteral<"resend-otp">;
338
+ }, "strict", z.ZodTypeAny, {
339
+ kind: "resend-otp";
340
+ }, {
341
+ kind: "resend-otp";
342
+ }>, z.ZodObject<{
343
+ kind: z.ZodLiteral<"continue">;
344
+ }, "strict", z.ZodTypeAny, {
345
+ kind: "continue";
346
+ }, {
347
+ kind: "continue";
348
+ }>, z.ZodObject<{
349
+ kind: z.ZodLiteral<"retry">;
350
+ }, "strict", z.ZodTypeAny, {
351
+ kind: "retry";
352
+ }, {
353
+ kind: "retry";
354
+ }>]>;
355
+ export type EnrollmentActionInput = z.infer<typeof zEnrollmentActionInput>;
356
+ export declare const zEnrollmentActionSubmitRequest: z.ZodObject<{
357
+ rail: z.ZodEnum<["interac", "ach", "sepa", "apple_pay", "jpyc", "ars"]>;
358
+ actionId: z.ZodString;
359
+ input: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
360
+ kind: z.ZodLiteral<"form">;
361
+ formId: z.ZodString;
362
+ revision: z.ZodString;
363
+ values: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean]>>, Record<string, string | boolean>, Record<string, string | boolean>>;
364
+ }, "strict", z.ZodTypeAny, {
365
+ values: Record<string, string | boolean>;
366
+ formId: string;
367
+ revision: string;
368
+ kind: "form";
369
+ }, {
370
+ values: Record<string, string | boolean>;
371
+ formId: string;
372
+ revision: string;
373
+ kind: "form";
374
+ }>, z.ZodObject<{
375
+ kind: z.ZodLiteral<"otp">;
376
+ code: z.ZodString;
377
+ }, "strict", z.ZodTypeAny, {
378
+ code: string;
379
+ kind: "otp";
380
+ }, {
381
+ code: string;
382
+ kind: "otp";
383
+ }>, z.ZodObject<{
384
+ kind: z.ZodLiteral<"resend-otp">;
385
+ }, "strict", z.ZodTypeAny, {
386
+ kind: "resend-otp";
387
+ }, {
388
+ kind: "resend-otp";
389
+ }>, z.ZodObject<{
390
+ kind: z.ZodLiteral<"continue">;
391
+ }, "strict", z.ZodTypeAny, {
392
+ kind: "continue";
393
+ }, {
394
+ kind: "continue";
395
+ }>, z.ZodObject<{
396
+ kind: z.ZodLiteral<"retry">;
397
+ }, "strict", z.ZodTypeAny, {
398
+ kind: "retry";
399
+ }, {
400
+ kind: "retry";
401
+ }>]>;
402
+ locale: z.ZodOptional<z.ZodString>;
403
+ }, "strict", z.ZodTypeAny, {
404
+ input: {
405
+ values: Record<string, string | boolean>;
406
+ formId: string;
407
+ revision: string;
408
+ kind: "form";
409
+ } | {
410
+ code: string;
411
+ kind: "otp";
412
+ } | {
413
+ kind: "resend-otp";
414
+ } | {
415
+ kind: "continue";
416
+ } | {
417
+ kind: "retry";
418
+ };
419
+ rail: "interac" | "ach" | "sepa" | "apple_pay" | "jpyc" | "ars";
420
+ actionId: string;
421
+ locale?: string | undefined;
422
+ }, {
423
+ input: {
424
+ values: Record<string, string | boolean>;
425
+ formId: string;
426
+ revision: string;
427
+ kind: "form";
428
+ } | {
429
+ code: string;
430
+ kind: "otp";
431
+ } | {
432
+ kind: "resend-otp";
433
+ } | {
434
+ kind: "continue";
435
+ } | {
436
+ kind: "retry";
437
+ };
438
+ rail: "interac" | "ach" | "sepa" | "apple_pay" | "jpyc" | "ars";
439
+ actionId: string;
440
+ locale?: string | undefined;
441
+ }>;
442
+ export type EnrollmentActionSubmitRequest = z.infer<typeof zEnrollmentActionSubmitRequest>;
216
443
  /** Account public info returned by the API. */
217
444
  export interface AccountInfo {
218
445
  id: string;
@@ -242,8 +469,13 @@ export type DepositConstraints = {
242
469
  code: string;
243
470
  symbol: string;
244
471
  };
245
- minAmount: string;
246
- maxAmount: string;
472
+ /** Static per-deposit amount bounds in fiat units. */
473
+ amountRange: {
474
+ min: string;
475
+ max: string;
476
+ };
477
+ /** Dynamic rail/account quotas with remaining capacity. */
478
+ usageLimits?: DepositLimit[];
247
479
  /**
248
480
  * Destination stablecoin for this rail.
249
481
  */
@@ -259,6 +491,29 @@ export type DepositConstraints = {
259
491
  alt: string;
260
492
  };
261
493
  };
494
+ export type DepositLimitUnit = "fiat" | "count";
495
+ export type DepositLimitPeriod = "transaction" | "day" | "week" | "month" | "lifetime";
496
+ export type DepositLimitUpgradeStatus = "available" | "retry" | "pending" | "complete" | "unavailable";
497
+ export type DepositLimit = {
498
+ /** Stable machine key, e.g. "amount.weekly". */
499
+ key: string;
500
+ label: string;
501
+ unit: DepositLimitUnit;
502
+ /** Limit in display units, or null when unbounded. */
503
+ limit: string | null;
504
+ /** Remaining amount/count in display units, or null when unbounded. */
505
+ remaining: string | null;
506
+ period?: DepositLimitPeriod;
507
+ currency?: {
508
+ code: string;
509
+ symbol: string;
510
+ };
511
+ checkedAt?: string;
512
+ upgrade?: {
513
+ status: DepositLimitUpgradeStatus;
514
+ fields?: string[];
515
+ };
516
+ };
262
517
  /** Deposit status progression. */
263
518
  export type AccountDepositStatus = "initiated" | "awaiting_payment" | "payment_received" | "token_delivered" | "completed" | "expired" | "failed";
264
519
  /** User-facing ETA strings for each account deposit phase. */
@@ -315,8 +570,8 @@ export type DepositDeeplink = {
315
570
  /** Hidden form fields to submit. */
316
571
  formFields: Record<string, string>;
317
572
  };
318
- /** A financial institution the user can pay through. */
319
- export type DepositInstitution = {
573
+ /** One opaque institution option from a server-owned pre-create catalog. */
574
+ export type DepositInstitutionCatalogEntry = {
320
575
  /** Stable institution identifier. Server must always provide this. */
321
576
  id: string;
322
577
  name: string;
@@ -324,6 +579,9 @@ export type DepositInstitution = {
324
579
  logoURI: string | null;
325
580
  /** When true, shown as a prominent tile (vs. text-only list item). */
326
581
  featured?: boolean;
582
+ };
583
+ /** A financial institution the user can pay through after provider creation. */
584
+ export type DepositInstitution = DepositInstitutionCatalogEntry & {
327
585
  deeplink: DepositDeeplink;
328
586
  };
329
587
  export type DepositPaymentField = {
@@ -332,6 +590,93 @@ export type DepositPaymentField = {
332
590
  value: string;
333
591
  emphasized?: boolean;
334
592
  };
593
+ /** Closed semantic vocabulary shared by pre-create navigation and payment info. */
594
+ export declare const depositPaymentInteractions: readonly ["bank-picker", "bank-transfer", "directions", "external-app-approval", "hosted-approval", "institution-picker", "request-to-pay", "wallet-pay-widget"];
595
+ export type DepositPaymentInteraction = (typeof depositPaymentInteractions)[number];
596
+ /** Server-owned copy and actions for an institution-picker payment surface. */
597
+ export type DepositInstitutionPaymentUi = {
598
+ picker: DepositInstitutionPickerUi;
599
+ review: {
600
+ title: string;
601
+ description: string;
602
+ fields: DepositPaymentField[];
603
+ institutionLabel: string;
604
+ /** Optional fields rendered after the client-selected institution. */
605
+ fieldsAfterInstitution?: DepositPaymentField[];
606
+ openInstitutionLabel: string;
607
+ openFallbackLabel: string;
608
+ };
609
+ waiting: {
610
+ title: string;
611
+ instructions: string;
612
+ openInstitutionLabel: string;
613
+ openFallbackLabel: string;
614
+ };
615
+ };
616
+ /** Server-owned copy for a required pre-create institution selection. */
617
+ export type DepositInstitutionPickerUi = {
618
+ title: string;
619
+ searchPlaceholder: string;
620
+ otherInstitutionsLabel: string;
621
+ };
622
+ /** Opaque action binding issued with one exact institution catalog. */
623
+ export type DepositPreCreateAction = {
624
+ id: string;
625
+ revision: string;
626
+ inputKind: "institution";
627
+ catalogRevision: string;
628
+ };
629
+ /** Typed user input submitted with the signed provider-create attempt. */
630
+ export type DepositPreCreatePaymentInput = {
631
+ kind: "institution";
632
+ actionId: string;
633
+ revision: string;
634
+ catalogRevision: string;
635
+ institutionId: string;
636
+ };
637
+ /** Server-owned semantic copy for an expiring request-to-pay surface. */
638
+ export type DepositRequestToPayUi = {
639
+ title: string;
640
+ codeLabel: string;
641
+ actionLabel: string;
642
+ actionCompletedLabel: string;
643
+ expiredTitle: string;
644
+ expiredInstructions: string;
645
+ retryLabel: string;
646
+ retryingLabel: string;
647
+ };
648
+ /** Closed recovery behavior for an expired request-to-pay interaction. */
649
+ export type DepositRequestToPayRetry = {
650
+ type: "recreate-session";
651
+ };
652
+ export type DepositApprovalPolling = {
653
+ type: "poll";
654
+ delayMs: number;
655
+ };
656
+ export type DepositHostedApprovalUi = {
657
+ title: string;
658
+ instructions: string;
659
+ openLabel: string;
660
+ reopenLabel: string;
661
+ expiredTitle: string;
662
+ expiredInstructions: string;
663
+ retryLabel: string;
664
+ retryingLabel: string;
665
+ };
666
+ export type DepositExternalAppApprovalUi = {
667
+ title: string;
668
+ instructions: string;
669
+ destinationLabel: string;
670
+ expiredTitle: string;
671
+ expiredInstructions: string;
672
+ retryLabel: string;
673
+ retryingLabel: string;
674
+ };
675
+ export type DepositExternalApprovalAction = {
676
+ type: "open-url";
677
+ url: string;
678
+ label: string;
679
+ };
335
680
  export type DepositPaymentStep = {
336
681
  title: string;
337
682
  description: string;
@@ -378,25 +723,86 @@ export type DepositPaymentOnchainTransfer = {
378
723
  /**
379
724
  * Server-provided payment flow configuration.
380
725
  * - `bank-picker`: user picks an institution, then continues in their bank flow
726
+ * - `institution-picker`: user chooses an opaque institution before creation
727
+ * - `hosted-approval`: user approves through a provider-hosted URL
728
+ * - `external-app-approval`: user approves in an external app, optionally linked
729
+ * - `request-to-pay`: user pays an exact expiring fiat request by QR or code
381
730
  * - `wallet-pay-widget`: user completes payment in an embedded wallet-pay widget
382
731
  */
383
732
  export type DepositPaymentInfo = (DepositConstraints & {
384
- flow: "bank-picker";
733
+ flow: Extract<DepositPaymentInteraction, "bank-picker">;
385
734
  instructions: string;
386
735
  institutions: DepositInstitution[];
387
736
  qrUrl: string | null;
737
+ /** Added by interaction-driven servers; absent only for compatibility. */
738
+ institutionPaymentUi?: DepositInstitutionPaymentUi;
739
+ /** Provider-defined fallback action; old servers only return `qrUrl`. */
740
+ fallbackDeeplink?: DepositDeeplink;
388
741
  }) | (DepositConstraints & {
389
- flow: "bank-transfer";
742
+ flow: Extract<DepositPaymentInteraction, "bank-transfer">;
390
743
  instructions: string;
391
744
  fields: DepositPaymentField[];
392
745
  }) | (DepositConstraints & {
393
- flow: "directions";
746
+ flow: Extract<DepositPaymentInteraction, "directions">;
394
747
  instructions: string;
395
748
  steps: DepositPaymentStep[];
396
749
  onchainTransfer: DepositPaymentOnchainTransfer;
397
750
  reference?: DepositPaymentReference;
398
751
  }) | (DepositConstraints & {
399
- flow: "wallet-pay-widget";
752
+ flow: Extract<DepositPaymentInteraction, "institution-picker">;
753
+ instructions: string;
754
+ institutions: DepositInstitutionCatalogEntry[];
755
+ ui: DepositInstitutionPickerUi;
756
+ /** Exact fiat amount the user will approve, in decimal fiat units (F). */
757
+ payableAmount: string;
758
+ /** Exact settlement-token amount covered by routing signatures (S). */
759
+ expectedSettlementAmount: string;
760
+ action: DepositPreCreateAction;
761
+ }) | (DepositConstraints & {
762
+ flow: Extract<DepositPaymentInteraction, "hosted-approval">;
763
+ ui: DepositHostedApprovalUi;
764
+ /** Absolute provider-hosted approval URL. */
765
+ approvalUrl: string;
766
+ payableAmount: string;
767
+ expectedSettlementAmount: string;
768
+ expiresAt: number;
769
+ returnBehavior: {
770
+ type: "poll";
771
+ };
772
+ reopen: {
773
+ type: "same-url";
774
+ };
775
+ polling: DepositApprovalPolling;
776
+ retry: DepositRequestToPayRetry;
777
+ }) | (DepositConstraints & {
778
+ flow: Extract<DepositPaymentInteraction, "external-app-approval">;
779
+ ui: DepositExternalAppApprovalUi;
780
+ payableAmount: string;
781
+ expectedSettlementAmount: string;
782
+ /** Display-safe masked phone, handle, or destination. */
783
+ maskedDestination: string;
784
+ action?: DepositExternalApprovalAction;
785
+ expiresAt: number;
786
+ polling: DepositApprovalPolling;
787
+ retry: DepositRequestToPayRetry;
788
+ }) | (DepositConstraints & {
789
+ flow: Extract<DepositPaymentInteraction, "request-to-pay">;
790
+ ui: DepositRequestToPayUi;
791
+ instructions: string;
792
+ /** Exact fiat amount to pay, in decimal fiat units (F). */
793
+ payableAmount: string;
794
+ /** Opaque provider payment code. Render only in the active payment view. */
795
+ paymentCode: string;
796
+ /** Absolute request expiry as Unix seconds. No client default applies. */
797
+ expiresAt: number;
798
+ /**
799
+ * Expected destination-token settlement in token units (S). Routing
800
+ * signatures must authorize exactly this amount, never payableAmount.
801
+ */
802
+ expectedSettlementAmount: string;
803
+ retry: DepositRequestToPayRetry;
804
+ }) | (DepositConstraints & {
805
+ flow: Extract<DepositPaymentInteraction, "wallet-pay-widget">;
400
806
  instructions: string;
401
807
  paymentLinkUrl: string;
402
808
  paymentLinkKind: "apple_pay" | "google_pay";