@daimo/pay 1.16.1 → 1.16.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 (210) hide show
  1. package/build/index.d.ts +5 -3
  2. package/build/package.json.js +2 -2
  3. package/build/src/components/Common/SelectAnotherMethodButton/index.js +15 -3
  4. package/build/src/components/Common/SelectAnotherMethodButton/index.js.map +1 -1
  5. package/build/src/components/DaimoPayButton/index.js +2 -1
  6. package/build/src/components/DaimoPayButton/index.js.map +1 -1
  7. package/build/src/components/Pages/SelectMethod/index.js +0 -1
  8. package/build/src/components/Pages/SelectMethod/index.js.map +1 -1
  9. package/build/src/payment/paymentFsm.js.map +1 -1
  10. package/package.json +3 -3
  11. package/build/assets/MobileWithLogos.d.ts +0 -2
  12. package/build/assets/ScanIconWithLogos.d.ts +0 -6
  13. package/build/assets/browsers.d.ts +0 -10
  14. package/build/assets/chains.d.ts +0 -28
  15. package/build/assets/coins.d.ts +0 -2
  16. package/build/assets/crepe.d.ts +0 -3
  17. package/build/assets/icons.d.ts +0 -35
  18. package/build/assets/logos.d.ts +0 -207
  19. package/build/assets/wallet.d.ts +0 -3
  20. package/build/assets/wave.d.ts +0 -2
  21. package/build/components/Common/Alert/index.d.ts +0 -6
  22. package/build/components/Common/Alert/styles.d.ts +0 -2
  23. package/build/components/Common/Alert/types.d.ts +0 -5
  24. package/build/components/Common/AmountInput/AmountInputField.d.ts +0 -8
  25. package/build/components/Common/AmountInput/index.d.ts +0 -9
  26. package/build/components/Common/Avatar/index.d.ts +0 -17
  27. package/build/components/Common/Avatar/styles.d.ts +0 -2
  28. package/build/components/Common/BrowserIcon/index.d.ts +0 -4
  29. package/build/components/Common/BrowserIcon/styles.d.ts +0 -1
  30. package/build/components/Common/BrowserIcon/types.d.ts +0 -3
  31. package/build/components/Common/Button/index.d.ts +0 -4
  32. package/build/components/Common/Button/styles.d.ts +0 -10
  33. package/build/components/Common/Button/types.d.ts +0 -15
  34. package/build/components/Common/Chain/index.d.ts +0 -9
  35. package/build/components/Common/Chain/styles.d.ts +0 -4
  36. package/build/components/Common/ChainSelectList/index.d.ts +0 -4
  37. package/build/components/Common/ChainSelectList/styles.d.ts +0 -9
  38. package/build/components/Common/CircleTimer.d.ts +0 -17
  39. package/build/components/Common/ConnectorList/index.d.ts +0 -2
  40. package/build/components/Common/ConnectorList/styles.d.ts +0 -8
  41. package/build/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +0 -6
  42. package/build/components/Common/CopyToClipboard/index.d.ts +0 -7
  43. package/build/components/Common/CustomQRCode/QRCode.d.ts +0 -12
  44. package/build/components/Common/CustomQRCode/index.d.ts +0 -6
  45. package/build/components/Common/CustomQRCode/styles.d.ts +0 -6
  46. package/build/components/Common/CustomQRCode/types.d.ts +0 -11
  47. package/build/components/Common/DynamicContainer/index.d.ts +0 -7
  48. package/build/components/Common/FitText/index.d.ts +0 -8
  49. package/build/components/Common/LazyImage/index.d.ts +0 -8
  50. package/build/components/Common/Logo/index.d.ts +0 -8
  51. package/build/components/Common/Logo/styles.d.ts +0 -3
  52. package/build/components/Common/Modal/index.d.ts +0 -25
  53. package/build/components/Common/Modal/styles.d.ts +0 -25
  54. package/build/components/Common/OptionsList/index.d.ts +0 -17
  55. package/build/components/Common/OptionsList/styles.d.ts +0 -5
  56. package/build/components/Common/OrderHeader/index.d.ts +0 -5
  57. package/build/components/Common/PaymentBreakdown/index.d.ts +0 -6
  58. package/build/components/Common/Portal/index.d.ts +0 -2
  59. package/build/components/Common/PoweredByFooter/index.d.ts +0 -5
  60. package/build/components/Common/ScrollArea/index.d.ts +0 -9
  61. package/build/components/Common/ScrollArea/styles.d.ts +0 -3
  62. package/build/components/Common/SelectAnotherMethodButton/index.d.ts +0 -1
  63. package/build/components/Common/Spinner/index.d.ts +0 -1
  64. package/build/components/Common/Spinner/styles.d.ts +0 -1
  65. package/build/components/Common/SquareTimer.d.ts +0 -19
  66. package/build/components/Common/SwitchButton/index.d.ts +0 -6
  67. package/build/components/Common/ThemedButton/index.d.ts +0 -15
  68. package/build/components/Common/ThemedButton/styles.d.ts +0 -2
  69. package/build/components/Common/TokenChainLogo/index.d.ts +0 -7
  70. package/build/components/Common/Tooltip/index.d.ts +0 -4
  71. package/build/components/Common/Tooltip/styles.d.ts +0 -3
  72. package/build/components/Common/Tooltip/types.d.ts +0 -9
  73. package/build/components/Common/WalletChainLogo/index.d.ts +0 -6
  74. package/build/components/DaimoPayButton/index.d.ts +0 -149
  75. package/build/components/DaimoPayButton/styles.d.ts +0 -4
  76. package/build/components/DaimoPayModal/ConnectUsing.d.ts +0 -2
  77. package/build/components/DaimoPayModal/ConnectWithInjector/index.d.ts +0 -15
  78. package/build/components/DaimoPayModal/ConnectWithInjector/styles.d.ts +0 -6
  79. package/build/components/DaimoPayModal/ConnectWithQRCode.d.ts +0 -12
  80. package/build/components/DaimoPayModal/index.d.ts +0 -8
  81. package/build/components/DaimoPayThemeProvider/DaimoPayThemeProvider.d.ts +0 -16
  82. package/build/components/Pages/About/graphics.d.ts +0 -11
  83. package/build/components/Pages/About/index.d.ts +0 -3
  84. package/build/components/Pages/About/styles.d.ts +0 -8
  85. package/build/components/Pages/Confirmation/index.d.ts +0 -3
  86. package/build/components/Pages/Connectors/index.d.ts +0 -3
  87. package/build/components/Pages/Connectors/styles.d.ts +0 -9
  88. package/build/components/Pages/DownloadApp/index.d.ts +0 -2
  89. package/build/components/Pages/Error/index.d.ts +0 -1
  90. package/build/components/Pages/MobileConnectors/index.d.ts +0 -3
  91. package/build/components/Pages/MobileConnectors/styles.d.ts +0 -5
  92. package/build/components/Pages/Onboarding/index.d.ts +0 -3
  93. package/build/components/Pages/Onboarding/styles.d.ts +0 -9
  94. package/build/components/Pages/PayWithToken/index.d.ts +0 -3
  95. package/build/components/Pages/SelectAmount/index.d.ts +0 -3
  96. package/build/components/Pages/SelectDepositAddressAmount/index.d.ts +0 -3
  97. package/build/components/Pages/SelectDepositAddressChain/index.d.ts +0 -3
  98. package/build/components/Pages/SelectExchange/index.d.ts +0 -3
  99. package/build/components/Pages/SelectExternalAmount/index.d.ts +0 -3
  100. package/build/components/Pages/SelectMethod/index.d.ts +0 -1
  101. package/build/components/Pages/SelectMethod/styles.d.ts +0 -9
  102. package/build/components/Pages/SelectToken/index.d.ts +0 -1
  103. package/build/components/Pages/SelectWalletAmount/index.d.ts +0 -3
  104. package/build/components/Pages/SelectWalletChain/index.d.ts +0 -3
  105. package/build/components/Pages/SelectZKP/index.d.ts +0 -3
  106. package/build/components/Pages/Solana/ConnectorSolana/index.d.ts +0 -4
  107. package/build/components/Pages/Solana/PayWithSolanaToken/index.d.ts +0 -3
  108. package/build/components/Pages/Solana/SelectSolanaAmount/index.d.ts +0 -3
  109. package/build/components/Pages/SwitchNetworks/index.d.ts +0 -3
  110. package/build/components/Pages/WaitingDepositAddress/index.d.ts +0 -1
  111. package/build/components/Pages/WaitingExternal/index.d.ts +0 -3
  112. package/build/components/Pages/WaitingWallet/index.d.ts +0 -3
  113. package/build/components/Spinners/CircleSpinner/index.d.ts +0 -9
  114. package/build/components/Spinners/CircleSpinner/styles.d.ts +0 -5
  115. package/build/components/Spinners/ExternalPaymentSpinner/index.d.ts +0 -5
  116. package/build/components/Spinners/SquircleSpinner/index.d.ts +0 -5
  117. package/build/components/Spinners/SquircleSpinner/styles.d.ts +0 -4
  118. package/build/components/Spinners/TokenLogoSpinner/index.d.ts +0 -5
  119. package/build/components/Spinners/TokenLogoSpinner/styles.d.ts +0 -1
  120. package/build/components/Spinners/WalletPaymentSpinner/index.d.ts +0 -5
  121. package/build/components/Spinners/styles.d.ts +0 -2
  122. package/build/constants/defaultTheme.d.ts +0 -4
  123. package/build/constants/routes.d.ts +0 -28
  124. package/build/defaultConfig.d.ts +0 -17
  125. package/build/defaultConnectors.d.ts +0 -14
  126. package/build/hooks/useChainIsSupported.d.ts +0 -2
  127. package/build/hooks/useChains.d.ts +0 -3
  128. package/build/hooks/useConnect.d.ts +0 -110
  129. package/build/hooks/useConnectCallback.d.ts +0 -8
  130. package/build/hooks/useConnectors.d.ts +0 -3
  131. package/build/hooks/useDaimoPay.d.ts +0 -94
  132. package/build/hooks/useDaimoPayStatus.d.ts +0 -15
  133. package/build/hooks/useDaimoPayUI.d.ts +0 -6
  134. package/build/hooks/useDepositAddressOptions.d.ts +0 -10
  135. package/build/hooks/useEnsFallbackConfig.d.ts +0 -2
  136. package/build/hooks/useExternalPaymentOptions.d.ts +0 -12
  137. package/build/hooks/useFitText.d.ts +0 -14
  138. package/build/hooks/useFocusTrap.d.ts +0 -1
  139. package/build/hooks/useGoogleFont.d.ts +0 -3
  140. package/build/hooks/useIsMobile.d.ts +0 -5
  141. package/build/hooks/useIsMounted.d.ts +0 -3
  142. package/build/hooks/useLastConnector.d.ts +0 -4
  143. package/build/hooks/useLocalStorage.d.ts +0 -7
  144. package/build/hooks/useLocales.d.ts +0 -2
  145. package/build/hooks/useLockBodyScroll.d.ts +0 -1
  146. package/build/hooks/useModal.d.ts +0 -8
  147. package/build/hooks/useOrderUsdLimits.d.ts +0 -7
  148. package/build/hooks/usePayContext.d.ts +0 -2
  149. package/build/hooks/usePaymentState.d.ts +0 -67
  150. package/build/hooks/usePrevious.d.ts +0 -1
  151. package/build/hooks/useSolanaPaymentOptions.d.ts +0 -13
  152. package/build/hooks/useTokenOptions.d.ts +0 -5
  153. package/build/hooks/useUntronAvailability.d.ts +0 -14
  154. package/build/hooks/useWalletPaymentOptions.d.ts +0 -31
  155. package/build/hooks/useWindowSize.d.ts +0 -4
  156. package/build/localizations/index.d.ts +0 -2
  157. package/build/localizations/locales/ar-AE.d.ts +0 -3
  158. package/build/localizations/locales/ca-AD.d.ts +0 -3
  159. package/build/localizations/locales/ee-EE.d.ts +0 -3
  160. package/build/localizations/locales/en-US.d.ts +0 -128
  161. package/build/localizations/locales/es-ES.d.ts +0 -3
  162. package/build/localizations/locales/fa-IR.d.ts +0 -3
  163. package/build/localizations/locales/fr-FR.d.ts +0 -3
  164. package/build/localizations/locales/index.d.ts +0 -3
  165. package/build/localizations/locales/ja-JP.d.ts +0 -91
  166. package/build/localizations/locales/pt-BR.d.ts +0 -3
  167. package/build/localizations/locales/ru-RU.d.ts +0 -3
  168. package/build/localizations/locales/tr-TR.d.ts +0 -3
  169. package/build/localizations/locales/vi-VN.d.ts +0 -3
  170. package/build/localizations/locales/zh-CN.d.ts +0 -3
  171. package/build/payment/paymentEffects.d.ts +0 -12
  172. package/build/payment/paymentFsm.d.ts +0 -131
  173. package/build/payment/paymentStore.d.ts +0 -14
  174. package/build/payment/paymentUtils.d.ts +0 -6
  175. package/build/provider/DaimoPayProvider.d.ts +0 -24
  176. package/build/provider/PayContext.d.ts +0 -66
  177. package/build/provider/PaymentProvider.d.ts +0 -8
  178. package/build/provider/SolanaContextProvider.d.ts +0 -6
  179. package/build/provider/Web3ContextProvider.d.ts +0 -24
  180. package/build/stateStore.d.ts +0 -66
  181. package/build/styles/defaultTheme.d.ts +0 -3
  182. package/build/styles/index.d.ts +0 -1
  183. package/build/styles/styled/index.d.ts +0 -12
  184. package/build/styles/themes/base.d.ts +0 -129
  185. package/build/styles/themes/index.d.ts +0 -673
  186. package/build/styles/themes/midnight.d.ts +0 -74
  187. package/build/styles/themes/minimal.d.ts +0 -94
  188. package/build/styles/themes/nouns.d.ts +0 -79
  189. package/build/styles/themes/retro.d.ts +0 -89
  190. package/build/styles/themes/rounded.d.ts +0 -86
  191. package/build/styles/themes/soft.d.ts +0 -69
  192. package/build/styles/themes/web95.d.ts +0 -91
  193. package/build/styles/types.d.ts +0 -80
  194. package/build/types.d.ts +0 -46
  195. package/build/utils/exports.d.ts +0 -1
  196. package/build/utils/format.d.ts +0 -49
  197. package/build/utils/index.d.ts +0 -17
  198. package/build/utils/localstorage.d.ts +0 -9
  199. package/build/utils/p3.d.ts +0 -2
  200. package/build/utils/platform.d.ts +0 -2
  201. package/build/utils/polling.d.ts +0 -13
  202. package/build/utils/supportUrl.d.ts +0 -2
  203. package/build/utils/trpc.d.ts +0 -4
  204. package/build/utils/validateInput.d.ts +0 -16
  205. package/build/utils/wallets.d.ts +0 -24
  206. package/build/wallets/index.d.ts +0 -5
  207. package/build/wallets/useWallets.d.ts +0 -16
  208. package/build/wallets/walletConfigs.d.ts +0 -29
  209. package/build/world-mini-app/WorldPayButton.d.ts +0 -84
  210. package/build/world-mini-app/promptWorldPayment.d.ts +0 -9
@@ -1,3 +0,0 @@
1
- import { LocaleProps } from "./";
2
- declare const frFR: LocaleProps;
3
- export default frFR;
@@ -1,3 +0,0 @@
1
- import enUS from "./en-US";
2
- export type LocaleFull = typeof enUS;
3
- export type LocaleProps = Partial<typeof enUS>;
@@ -1,91 +0,0 @@
1
- declare const _default: {
2
- connectWallet: string;
3
- disconnect: string;
4
- connected: string;
5
- wrongNetwork: string;
6
- switchNetworks: string;
7
- chainNetwork: string;
8
- copyToClipboard: string;
9
- copyCode: string;
10
- moreInformation: string;
11
- back: string;
12
- close: string;
13
- or: string;
14
- more: string;
15
- tryAgain: string;
16
- tryAgainQuestion: string;
17
- dontHaveTheApp: string;
18
- scanTheQRCode: string;
19
- useModal: string;
20
- installTheExtension: string;
21
- getWalletName: string;
22
- otherWallets: string;
23
- learnMore: string;
24
- getWallet: string;
25
- approveInWallet: string;
26
- confirmInWallet: string;
27
- awaitingConfirmation: string;
28
- signIn: string;
29
- signOut: string;
30
- signedIn: string;
31
- signedOut: string;
32
- walletNotConnected: string;
33
- warnings_walletSwitchingUnsupported: string;
34
- warnings_walletSwitchingUnsupportedResolve: string;
35
- warnings_chainUnsupported: string;
36
- warnings_chainUnsupportedResolve: string;
37
- onboardingScreen_heading: string;
38
- onboardingScreen_h1: string;
39
- onboardingScreen_p: string;
40
- onboardingScreen_ctaText: string;
41
- onboardingScreen_ctaUrl: string;
42
- aboutScreen_heading: string;
43
- aboutScreen_a_h1: string;
44
- aboutScreen_a_p: string;
45
- aboutScreen_b_h1: string;
46
- aboutScreen_b_p: string;
47
- aboutScreen_c_h1: string;
48
- aboutScreen_c_p: string;
49
- aboutScreen_ctaText: string;
50
- aboutScreen_ctaUrl: string;
51
- connectorsScreen_heading: string;
52
- connectorsScreen_newcomer: string;
53
- connectorsScreen_h1: string;
54
- connectorsScreen_p: string;
55
- mobileConnectorsScreen_heading: string;
56
- scanScreen_heading: string;
57
- scanScreen_heading_withConnector: string;
58
- scanScreen_tooltip_default: string;
59
- downloadAppScreen_heading: string;
60
- downloadAppScreen_iosAndroid: string;
61
- downloadAppScreen_ios: string;
62
- downloadAppScreen_android: string;
63
- injectionScreen_unavailable_h1: string;
64
- injectionScreen_unavailable_p: string;
65
- injectionScreen_install_h1: string;
66
- injectionScreen_install_p: string;
67
- injectionScreen_connecting_h1: string;
68
- injectionScreen_connecting_p: string;
69
- injectionScreen_connecting_injected_h1: string;
70
- injectionScreen_connecting_injected_p: string;
71
- injectionScreen_connected_h1: string;
72
- injectionScreen_connected_p: string;
73
- injectionScreen_rejected_h1: string;
74
- injectionScreen_rejected_p: string;
75
- injectionScreen_failed_h1: string;
76
- injectionScreen_failed_p: string;
77
- injectionScreen_notconnected_h1: string;
78
- injectionScreen_notconnected_p: string;
79
- profileScreen_heading: string;
80
- switchNetworkScreen_heading: string;
81
- signInWithEthereumScreen_tooltip: string;
82
- signInWithEthereumScreen_signedOut_heading: string;
83
- signInWithEthereumScreen_signedOut_h1: string;
84
- signInWithEthereumScreen_signedOut_p: string;
85
- signInWithEthereumScreen_signedOut_button: string;
86
- signInWithEthereumScreen_signedIn_heading: string;
87
- signInWithEthereumScreen_signedIn_h1: string;
88
- signInWithEthereumScreen_signedIn_p: string;
89
- signInWithEthereumScreen_signedIn_button: string;
90
- };
91
- export default _default;
@@ -1,3 +0,0 @@
1
- import { LocaleProps } from "./";
2
- declare const ptBR: LocaleProps;
3
- export default ptBR;
@@ -1,3 +0,0 @@
1
- import { LocaleProps } from "./";
2
- declare const ruRU: LocaleProps;
3
- export default ruRU;
@@ -1,3 +0,0 @@
1
- import { LocaleProps } from "./";
2
- declare const trTR: LocaleProps;
3
- export default trTR;
@@ -1,3 +0,0 @@
1
- import { LocaleProps } from "./";
2
- declare const viVN: LocaleProps;
3
- export default viVN;
@@ -1,3 +0,0 @@
1
- import { LocaleProps } from "./";
2
- declare const zhCN: LocaleProps;
3
- export default zhCN;
@@ -1,12 +0,0 @@
1
- import { TrpcClient } from "../utils/trpc";
2
- import { PaymentStore } from "./paymentStore";
3
- /**
4
- * Add a subscriber to the payment store that runs side effects in response to
5
- * events.
6
- *
7
- * @param store The payment store to subscribe to.
8
- * @param trpc TRPC client pointing to the Daimo Pay API.
9
- * @param log The logger to use for logging.
10
- * @returns A function that can be used to unsubscribe from the store.
11
- */
12
- export declare function attachPaymentEffectHandlers(store: PaymentStore, trpc: TrpcClient, log: (msg: string) => void): () => void;
@@ -1,131 +0,0 @@
1
- import { DaimoPayHydratedOrderWithOrg, DaimoPayOrder, DaimoPayOrderID, DaimoPayOrderWithOrg, DaimoPayUserMetadata, ExternalPaymentOptionsString, SolanaPublicKey } from "@daimo/pay-common";
2
- import { Address, Hex } from "viem";
3
- /** Payment parameters. The payment is created only after user taps pay. */
4
- export interface PayParams {
5
- /** App ID, for authentication. */
6
- appId: string;
7
- /** Destination chain ID. */
8
- toChain: number;
9
- /** The destination token to send. */
10
- toToken: Address;
11
- /**
12
- * The amount of the token to send.
13
- * If not provided, the user will be prompted to enter an amount.
14
- */
15
- toUnits?: string;
16
- /** The final address to transfer to or contract to call. */
17
- toAddress: Address;
18
- /** Calldata for final call, or empty data for transfer. */
19
- toCallData?: Hex;
20
- /** The intent verb, such as Pay, Deposit, or Purchase. Default: Pay */
21
- intent?: string;
22
- /** Payment options. By default, all are enabled. */
23
- paymentOptions?: ExternalPaymentOptionsString[];
24
- /** Preferred chain IDs. */
25
- preferredChains?: number[];
26
- /** Preferred tokens. These appear first in the token list. */
27
- preferredTokens?: {
28
- chain: number;
29
- address: Address;
30
- }[];
31
- /** Only allow payments on these EVM chains. */
32
- evmChains?: number[];
33
- /** External ID. E.g. a correlation ID. */
34
- externalId?: string;
35
- /** Developer metadata. E.g. correlation ID. */
36
- metadata?: DaimoPayUserMetadata;
37
- /** The address to refund to if the payment bounces or a refund is requested. */
38
- refundAddress?: Address;
39
- /** Pass-through tokens. If the user pays via these tokens, they're sent directly without swapping. */
40
- passthroughTokens?: {
41
- chain: number;
42
- address: Address;
43
- }[];
44
- }
45
- export type PaymentState = {
46
- type: "idle";
47
- } | {
48
- type: "preview";
49
- order: DaimoPayOrderWithOrg;
50
- payParamsData: PayParamsData;
51
- } | {
52
- type: "unhydrated";
53
- order: DaimoPayOrderWithOrg;
54
- } | {
55
- type: "payment_unpaid";
56
- order: DaimoPayHydratedOrderWithOrg;
57
- } | {
58
- type: "payment_started";
59
- order: DaimoPayHydratedOrderWithOrg;
60
- } | {
61
- type: "payment_completed";
62
- order: DaimoPayHydratedOrderWithOrg;
63
- } | {
64
- type: "payment_bounced";
65
- order: DaimoPayHydratedOrderWithOrg;
66
- } | {
67
- type: "error";
68
- order: DaimoPayOrder | undefined;
69
- message: string;
70
- };
71
- export type PaymentStateType = PaymentState["type"];
72
- export declare const initialPaymentState: PaymentState;
73
- export type PaymentEvent = {
74
- type: "set_pay_params";
75
- payParams: PayParams;
76
- } | {
77
- type: "set_pay_id";
78
- payId: DaimoPayOrderID;
79
- } | {
80
- type: "set_chosen_usd";
81
- usd: number;
82
- } | {
83
- type: "hydrate_order";
84
- refundAddress?: Address;
85
- } | {
86
- type: "pay_source";
87
- } | {
88
- type: "pay_ethereum_source";
89
- paymentTxHash: Hex;
90
- sourceChainId: number;
91
- payerAddress: Address;
92
- sourceToken: Address;
93
- sourceAmount: bigint;
94
- } | {
95
- type: "pay_solana_source";
96
- paymentTxHash: string;
97
- sourceToken: SolanaPublicKey;
98
- } | {
99
- type: "preview_generated";
100
- order: DaimoPayOrderWithOrg;
101
- payParamsData: PayParamsData;
102
- } | {
103
- type: "order_loaded";
104
- order: DaimoPayOrderWithOrg;
105
- } | {
106
- type: "order_hydrated";
107
- order: DaimoPayHydratedOrderWithOrg;
108
- } | {
109
- type: "payment_verified";
110
- order: DaimoPayHydratedOrderWithOrg;
111
- } | {
112
- type: "order_refreshed";
113
- order: DaimoPayOrderWithOrg | DaimoPayHydratedOrderWithOrg;
114
- } | {
115
- type: "dest_processed";
116
- order: DaimoPayHydratedOrderWithOrg;
117
- } | {
118
- type: "error";
119
- order: DaimoPayOrder | undefined;
120
- message: string;
121
- } | {
122
- type: "reset";
123
- };
124
- type PayParamsData = {
125
- appId: string;
126
- };
127
- /**
128
- * Master payment reducer.
129
- */
130
- export declare function paymentReducer(state: PaymentState, event: PaymentEvent): PaymentState;
131
- export {};
@@ -1,14 +0,0 @@
1
- import { createStore } from "../stateStore";
2
- import { PaymentEvent, PaymentState } from "./paymentFsm";
3
- export type PaymentStore = ReturnType<typeof createStore<PaymentState, PaymentEvent>>;
4
- export declare function createPaymentStore(): PaymentStore;
5
- /**
6
- * Wait for the `PaymentStore` to enter a state matching any of `validTypes`,
7
- * or reject as soon as it hits the `"error"` state.
8
- *
9
- * @returns Promise<T> resolving with the first matching state or rejecting with
10
- * the error message
11
- */
12
- export declare function waitForPaymentState<const T extends readonly PaymentState["type"][]>(store: PaymentStore, ...validTypes: T): Promise<Extract<PaymentState, {
13
- type: T[number];
14
- }>>;
@@ -1,6 +0,0 @@
1
- import { DaimoPayHydratedOrder } from "@daimo/pay-common";
2
- /**
3
- * Display payments as "expired" 1h before their actual expiration.
4
- * This ensures that users don't send payments that may arrive post-expiry.
5
- */
6
- export declare function getDisplayExpiresAt(order: DaimoPayHydratedOrder): number;
@@ -1,24 +0,0 @@
1
- import React from "react";
2
- import { useConnectCallbackProps } from "../hooks/useConnectCallback";
3
- import { CustomTheme, DaimoPayContextOptions, Mode, Theme } from "../types";
4
- type DaimoPayProviderProps = {
5
- children?: React.ReactNode;
6
- theme?: Theme;
7
- mode?: Mode;
8
- customTheme?: CustomTheme;
9
- options?: DaimoPayContextOptions;
10
- debugMode?: boolean;
11
- /**
12
- * Be careful with this endpoint, some endpoints (incl. Alchemy) don't support
13
- * `signatureSubscribe` which leads to txes behaving erratically
14
- * (ex. successful txes take minutes to confirm instead of seconds)
15
- */
16
- solanaRpcUrl?: string;
17
- /** Custom Pay API, useful for test and staging. */
18
- payApiUrl?: string;
19
- } & useConnectCallbackProps;
20
- /**
21
- * Provides context for DaimoPayButton and hooks. Place in app root or layout.
22
- */
23
- export declare const DaimoPayProvider: (props: DaimoPayProviderProps) => import("react/jsx-runtime").JSX.Element;
24
- export {};
@@ -1,66 +0,0 @@
1
- import React from "react";
2
- import { ROUTES } from "../constants/routes";
3
- import { useConnectCallbackProps } from "../hooks/useConnectCallback";
4
- import { PaymentState } from "../hooks/usePaymentState";
5
- import { CustomTheme, DaimoPayContextOptions, DaimoPayModalOptions, Languages, Mode, Theme } from "../types";
6
- import { SolanaWalletName } from "./SolanaContextProvider";
7
- /** Meant for internal use. This will be non-exported in a future SDK version. */
8
- export declare const PayContext: React.Context<PayContextValue | null>;
9
- export type PayLogFn = (message: string, ...props: any[]) => void;
10
- /** Daimo Pay internal context. */
11
- export type PayContextValue = {
12
- theme: Theme;
13
- setTheme: React.Dispatch<React.SetStateAction<Theme>>;
14
- mode: Mode;
15
- setMode: React.Dispatch<React.SetStateAction<Mode>>;
16
- customTheme: CustomTheme | undefined;
17
- setCustomTheme: React.Dispatch<React.SetStateAction<CustomTheme | undefined>>;
18
- lang: Languages;
19
- setLang: React.Dispatch<React.SetStateAction<Languages>>;
20
- disableMobileInjector: boolean;
21
- setDisableMobileInjector: React.Dispatch<React.SetStateAction<boolean>>;
22
- setOnOpen: (fn?: () => void) => void;
23
- setOnClose: (fn?: () => void) => void;
24
- open: boolean;
25
- setOpen: (open: boolean, meta?: Record<string, any>) => void;
26
- route: string;
27
- setRoute: (route: ROUTES, data?: Record<string, any>) => void;
28
- errorMessage: string | React.ReactNode | null;
29
- debugMode?: boolean;
30
- log: PayLogFn;
31
- displayError: (message: string | React.ReactNode | null, code?: any) => void;
32
- resize: number;
33
- triggerResize: () => void;
34
- uniquePaymentMethodPage: ROUTES;
35
- setUniquePaymentMethodPage: React.Dispatch<React.SetStateAction<ROUTES>>;
36
- /** Session ID. */
37
- sessionId: string;
38
- /** EVM pending connector */
39
- pendingConnectorId: string | undefined;
40
- setPendingConnectorId: (id: string) => void;
41
- /** Chosen Solana wallet, eg Phantom.*/
42
- solanaConnector: SolanaWalletName | undefined;
43
- setSolanaConnector: React.Dispatch<React.SetStateAction<SolanaWalletName | undefined>>;
44
- /** Global options, across all pay buttons and payments. */
45
- options?: DaimoPayContextOptions;
46
- /** Loads a payment, then shows the modal to complete payment. */
47
- showPayment: (modalOptions: DaimoPayModalOptions) => Promise<void>;
48
- /** Payment status & callbacks. */
49
- paymentState: PaymentState;
50
- /** TRPC API client. Internal use only. */
51
- trpc: any;
52
- /** Callback to call when the payment is successful. */
53
- onSuccess: () => void;
54
- /**
55
- * Whether to show the contact support button. Used specifically for
56
- * WorldPayButton on iOS since links are broken on iOS in World App.
57
- */
58
- showContactSupport: boolean;
59
- setShowContactSupport: React.Dispatch<React.SetStateAction<boolean>>;
60
- /** Custom message to display on confirmation page. */
61
- confirmationMessage?: string;
62
- setConfirmationMessage: React.Dispatch<React.SetStateAction<string | undefined>>;
63
- /** Redirect URL to return to the app. E.g. after Coinbase, Binance, RampNetwork. */
64
- redirectReturnUrl?: string;
65
- setRedirectReturnUrl: React.Dispatch<React.SetStateAction<string | undefined>>;
66
- } & useConnectCallbackProps;
@@ -1,8 +0,0 @@
1
- export declare const PaymentContext: import("react").Context<import("../stateStore").Store<import("../payment/paymentFsm").PaymentState, import("../payment/paymentFsm").PaymentEvent> | null>;
2
- type PaymentProviderProps = {
3
- children: React.ReactNode;
4
- payApiUrl: string;
5
- log?: (msg: string) => void;
6
- };
7
- export declare function PaymentProvider({ children, payApiUrl, log, }: PaymentProviderProps): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,6 +0,0 @@
1
- import { WalletName } from "@solana/wallet-adapter-base";
2
- export type SolanaWalletName = WalletName<string>;
3
- export declare const SolanaContextProvider: ({ children, solanaRpcUrl, }: {
4
- children: React.ReactNode;
5
- solanaRpcUrl?: string;
6
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,24 +0,0 @@
1
- /**
2
- * This provider is responsible for handling reusable web3 logic across the app.
3
- */
4
- import React from "react";
5
- import { Address, Chain } from "viem";
6
- type Web3Context = {
7
- connect: {
8
- getUri: (id?: string) => string;
9
- };
10
- dapp: {
11
- chains: Chain[];
12
- };
13
- account?: {
14
- chain: Chain;
15
- chainIsSupported: boolean;
16
- address: Address;
17
- };
18
- };
19
- declare const Web3Context: React.Context<Web3Context>;
20
- export declare const Web3ContextProvider: ({ children, }: {
21
- children: React.ReactNode;
22
- }) => import("react/jsx-runtime").JSX.Element;
23
- export declare const useWeb3: () => Web3Context;
24
- export {};
@@ -1,66 +0,0 @@
1
- /**
2
- * A store that manages state and dispatches events to a list of subscribers.
3
- * - getState: Returns the current state of the store.
4
- * - dispatch: Transition to a new state by applying the reducer function to
5
- * the current state and the event.
6
- * - subscribe: Takes a function as an argument and adds it to the list of
7
- * subscribers. When the state changes, all subscribers will be called. The
8
- * function returns a function that can be used to unsubscribe from the store.
9
- *
10
- * @template S The type of the state.
11
- * @template E The type of the events.
12
- */
13
- export interface Store<S, E> {
14
- getState: () => S;
15
- dispatch: (e: E) => void;
16
- subscribe: (l: listener<S, E>) => () => void;
17
- }
18
- type listener<S, E> = ({ prev, next, event, }: {
19
- prev: S;
20
- next: S;
21
- event: E;
22
- }) => void;
23
- /**
24
- * Creates a store that manages state and dispatches events to a list of
25
- * subscribers.
26
- *
27
- * @param reducer The reducer function that takes the current state and an event
28
- * and deterministically returns a new state.
29
- * @param init The initial state of the store.
30
- * @returns An object with three methods:
31
- * - getState: Returns the current state of the store.
32
- * - dispatch: Transition to a new state by applying the reducer function to
33
- * the current state and the event.
34
- * - subscribe: Takes a function as an argument and adds it to the list of
35
- * subscribers. When the state changes, all subscribers will be called. The
36
- * function returns a function that can be used to unsubscribe from the store.
37
- */
38
- export declare function createStore<S, E>(reducer: (s: S, e: E) => S, init: S): Store<S, E>;
39
- /**
40
- * Wait until the store enters any state that satisfies the given predicate(s),
41
- * or reject on error.
42
- *
43
- * @returns
44
- * `Promise<T>` resolving with the first state where `predicate` is true,
45
- * or rejecting if `isError` ever returns true.
46
- *
47
- * @example After hydrating an order, wait for the payment FSM to transition to
48
- * the new state before returning the updated order.
49
- *
50
- * // 1. Kick off the preview transition
51
- * store.dispatch({ type: "hydrate_order" });
52
- *
53
- * // 2. Pause until the order is successfully hydrated or errors
54
- * const newState = await waitForState(
55
- * store,
56
- * (s): s is NewState => s.type === "payment_unpaid",
57
- * s => s.type === "error",
58
- * s => (s as ErrorState).message
59
- * );
60
- *
61
- * // 3. Now newState.order is updated with the hydrated order
62
- * return newState.order;
63
- * ```
64
- */
65
- export declare function waitForState<S, E, T extends S>(store: Store<S, E>, predicates: ((s: S) => s is T) | ReadonlyArray<(s: S) => s is T>, isError?: (s: S) => boolean, getErrorMessage?: (s: S) => string): Promise<T>;
66
- export {};
@@ -1,3 +0,0 @@
1
- import { CustomTheme } from "./types";
2
- declare const defaultTheme: CustomTheme;
3
- export default defaultTheme;
@@ -1 +0,0 @@
1
- export declare const ResetContainer: any;
@@ -1,12 +0,0 @@
1
- /**
2
- *
3
- * IMPORTANT NOTE: This file is a workaround for the following issue:
4
- *
5
- * When using rollup with styled-components to build into an ES module, styled components decides to move all of it’s DOM elements into "styled.default" rather than just within "styled"
6
- *
7
- * We're unsure as to why this issue occurs, if you have any ideas or a better solution please let us know by opening a discussion on our GitHub repo:
8
- * https://github.com/family/connectkit/discussions/new
9
- *
10
- */
11
- declare const _default: any;
12
- export default _default;
@@ -1,129 +0,0 @@
1
- declare const _default: {
2
- light: {
3
- /** Connect Wallet Button */
4
- "--ck-connectbutton-font-size": string;
5
- "--ck-connectbutton-color": string;
6
- "--ck-connectbutton-background": string;
7
- "--ck-connectbutton-background-secondary": string;
8
- "--ck-connectbutton-hover-color": string;
9
- "--ck-connectbutton-hover-background": string;
10
- "--ck-connectbutton-active-color": string;
11
- "--ck-connectbutton-active-background": string;
12
- "--ck-connectbutton-balance-color": string;
13
- "--ck-connectbutton-balance-background": string;
14
- "--ck-connectbutton-balance-box-shadow": string;
15
- "--ck-connectbutton-balance-hover-background": string;
16
- "--ck-connectbutton-balance-hover-box-shadow": string;
17
- "--ck-connectbutton-balance-active-background": string;
18
- "--ck-connectbutton-balance-active-box-shadow": string;
19
- /** Primary Button */
20
- "--ck-primary-button-border-radius": string;
21
- "--ck-primary-button-color": string;
22
- "--ck-primary-button-background": string;
23
- "--ck-primary-button-font-weight": string;
24
- "--ck-primary-button-hover-color": string;
25
- "--ck-primary-button-hover-background": string;
26
- /** Secondary Button */
27
- "--ck-secondary-button-border-radius": string;
28
- "--ck-secondary-button-color": string;
29
- "--ck-secondary-button-background": string;
30
- /** Tertiary Button */
31
- "--ck-tertiary-button-background": string;
32
- "--ck-secondary-button-hover-background": string;
33
- /** Modal */
34
- "--ck-modal-box-shadow": string;
35
- "--ck-overlay-background": string;
36
- "--ck-body-color": string;
37
- "--ck-body-color-muted": string;
38
- "--ck-body-color-muted-hover": string;
39
- "--ck-body-background": string;
40
- "--ck-body-background-transparent": string;
41
- "--ck-body-background-secondary": string;
42
- "--ck-body-background-secondary-hover-background": string;
43
- "--ck-body-background-secondary-hover-outline": string;
44
- "--ck-body-background-tertiary": string;
45
- "--ck-body-action-color": string;
46
- "--ck-body-divider": string;
47
- "--ck-body-divider-secondary": string;
48
- "--ck-body-color-danger": string;
49
- "--ck-body-color-valid": string;
50
- "--ck-siwe-border": string;
51
- /** Disclaimer */
52
- "--ck-body-disclaimer-color": string;
53
- "--ck-body-disclaimer-link-color": string;
54
- "--ck-body-disclaimer-link-hover-color": string;
55
- /** Tooltips */
56
- "--ck-tooltip-background": string;
57
- "--ck-tooltip-background-secondary": string;
58
- "--ck-tooltip-color": string;
59
- "--ck-tooltip-shadow": string;
60
- /** Network dropdown */
61
- "--ck-dropdown-button-color": string;
62
- "--ck-dropdown-button-box-shadow": string;
63
- "--ck-dropdown-button-background": string;
64
- "--ck-dropdown-button-hover-color": string;
65
- "--ck-dropdown-button-hover-background": string;
66
- /** QR Code */
67
- "--ck-qr-dot-color": string;
68
- "--ck-qr-border-color": string;
69
- /** Misc. */
70
- "--ck-focus-color": string;
71
- "--ck-spinner-color": string;
72
- "--ck-copytoclipboard-stroke": string;
73
- };
74
- dark: {
75
- "--ck-connectbutton-font-size": string;
76
- "--ck-connectbutton-color": string;
77
- "--ck-connectbutton-background": string;
78
- "--ck-connectbutton-background-secondary": string;
79
- "--ck-connectbutton-hover-background": string;
80
- "--ck-connectbutton-active-background": string;
81
- "--ck-connectbutton-balance-color": string;
82
- "--ck-connectbutton-balance-background": string;
83
- "--ck-connectbutton-balance-box-shadow": string;
84
- "--ck-connectbutton-balance-hover-background": string;
85
- "--ck-connectbutton-balance-hover-box-shadow": string;
86
- "--ck-connectbutton-balance-active-background": string;
87
- "--ck-connectbutton-balance-active-box-shadow": string;
88
- "--ck-primary-button-color": string;
89
- "--ck-primary-button-background": string;
90
- "--ck-primary-button-border-radius": string;
91
- "--ck-primary-button-font-weight": string;
92
- "--ck-primary-button-hover-background": string;
93
- "--ck-primary-button-active-border-radius": string;
94
- "--ck-secondary-button-color": string;
95
- "--ck-secondary-button-background": string;
96
- "--ck-secondary-button-hover-background": string;
97
- /** Tertiary Button */
98
- "--ck-tertiary-button-background": string;
99
- "--ck-focus-color": string;
100
- "--ck-overlay-background": string;
101
- "--ck-body-color": string;
102
- "--ck-body-color-muted": string;
103
- "--ck-body-color-muted-hover": string;
104
- "--ck-body-background": string;
105
- "--ck-body-background-transparent": string;
106
- "--ck-body-background-secondary": string;
107
- "--ck-body-background-secondary-hover-background": string;
108
- "--ck-body-background-secondary-hover-outline": string;
109
- "--ck-body-background-tertiary": string;
110
- "--ck-body-action-color": string;
111
- "--ck-body-divider": string;
112
- "--ck-body-color-danger": string;
113
- "--ck-body-disclaimer-color": string;
114
- "--ck-body-disclaimer-link-color": string;
115
- "--ck-body-disclaimer-link-hover-color": string;
116
- "--ck-modal-box-shadow": string;
117
- "--ck-copytoclipboard-stroke": string;
118
- "--ck-tooltip-background": string;
119
- "--ck-tooltip-background-secondary": string;
120
- "--ck-tooltip-color": string;
121
- "--ck-tooltip-shadow": string;
122
- /** Network dropdown */
123
- "--ck-dropdown-button-color": string;
124
- "--ck-spinner-color": string;
125
- "--ck-qr-dot-color": string;
126
- "--ck-qr-border-color": string;
127
- };
128
- };
129
- export default _default;