@daimo/pay 0.0.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.
- package/LICENSE +26 -0
- package/README.md +77 -0
- package/build/index.es.js +12076 -0
- package/build/index.es.js.map +1 -0
- package/build/packages/pay-api/src/db/codegen/dbPay.d.ts +69 -0
- package/build/packages/pay-api/src/db/db.d.ts +68 -0
- package/build/packages/pay-api/src/db/migrations/0.d.ts +2 -0
- package/build/packages/pay-api/src/db/migrations/1.d.ts +2 -0
- package/build/packages/pay-api/src/db/migrations/2.d.ts +2 -0
- package/build/packages/pay-api/src/db/migrations/3.d.ts +2 -0
- package/build/packages/pay-api/src/env.d.ts +10 -0
- package/build/packages/pay-api/src/index.d.ts +2 -0
- package/build/packages/pay-api/src/server/binanceClient.d.ts +14 -0
- package/build/packages/pay-api/src/server/constants.d.ts +3 -0
- package/build/packages/pay-api/src/server/dfsQuoter.d.ts +21 -0
- package/build/packages/pay-api/src/server/externalPaymentOptions.d.ts +21 -0
- package/build/packages/pay-api/src/server/orderProcessor.d.ts +48 -0
- package/build/packages/pay-api/src/server/orgManager.d.ts +22 -0
- package/build/packages/pay-api/src/server/router.d.ts +252 -0
- package/build/packages/pay-api/src/server/swap.d.ts +24 -0
- package/build/packages/pay-api/src/server/tokenBalances.d.ts +12 -0
- package/build/packages/pay-api/src/server/tokenRegistry.d.ts +16 -0
- package/build/packages/pay-api/src/server/viemChainClient.d.ts +252 -0
- package/build/packages/pay-api/src/server/viemClient.d.ts +19 -0
- package/build/packages/pay-api/src/trpc.d.ts +129 -0
- package/build/packages/pay-api/src/utils/clippy.d.ts +2 -0
- package/build/packages/pay-api/src/utils/request.d.ts +19 -0
- package/build/packages/paykit/packages/connectkit/src/assets/ScanIconWithLogos.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/assets/browsers.d.ts +10 -0
- package/build/packages/paykit/packages/connectkit/src/assets/chains.d.ts +67 -0
- package/build/packages/paykit/packages/connectkit/src/assets/coins.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/assets/icons.d.ts +33 -0
- package/build/packages/paykit/packages/connectkit/src/assets/logos.d.ts +179 -0
- package/build/packages/paykit/packages/connectkit/src/assets/wallet.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/assets/wave.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/BalanceButton/index.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Alert/index.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Alert/styles.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Alert/types.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Avatar/index.d.ts +16 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Avatar/styles.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/BrowserIcon/index.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/BrowserIcon/styles.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/BrowserIcon/types.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Button/index.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Button/styles.d.ts +10 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Button/types.d.ts +15 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Chain/index.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Chain/styles.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ChainSelect/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ChainSelectDropdown/index.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ChainSelectDropdown/styles.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ChainSelectList/index.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ChainSelectList/styles.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ConnectorList/index.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ConnectorList/styles.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/CopyToClipboard/index.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/CustomQRCode/QRCode.d.ts +12 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/CustomQRCode/index.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/CustomQRCode/styles.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/CustomQRCode/types.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/DynamicContainer/index.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/FitText/index.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/LazyImage/index.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Logo/index.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Logo/styles.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Modal/index.d.ts +25 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Modal/styles.d.ts +24 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/OptionsList/index.d.ts +14 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/OptionsList/styles.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/OrderHeader/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Portal/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ScrollArea/index.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ScrollArea/styles.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Spinner/index.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Spinner/styles.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ThemedButton/index.d.ts +15 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/ThemedButton/styles.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Tooltip/index.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Tooltip/styles.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Common/Tooltip/types.d.ts +10 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectButton/index.d.ts +36 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectButton/styles.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectKit.d.ts +85 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectKitThemeProvider/ConnectKitThemeProvider.d.ts +16 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectModal/ConnectUsing.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectModal/ConnectWithInjector/index.d.ts +15 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectModal/ConnectWithInjector/styles.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectModal/ConnectWithQRCode.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/ConnectModal/index.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/NetworkButton/index.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/About/graphics.d.ts +11 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/About/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/About/styles.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Confirmation/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Connectors/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Connectors/styles.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/DownloadApp/index.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/MobileConnectors/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/MobileConnectors/styles.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Onboarding/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Onboarding/styles.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/PayWithToken/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Profile/index.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/Profile/styles.d.ts +6 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/SelectMethod/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/SelectMethod/styles.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/SelectToken/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/SignInWithEthereum/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/SignInWithEthereum/styles.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/SwitchNetworks/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingOther/index.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingOther/styles.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Spinners/CircleSpinner/index.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/components/Spinners/CircleSpinner/styles.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Spinners/SquircleSpinner/index.d.ts +5 -0
- package/build/packages/paykit/packages/connectkit/src/components/Spinners/SquircleSpinner/styles.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/components/Standard/SIWE/index.d.ts +10 -0
- package/build/packages/paykit/packages/connectkit/src/components/Standard/SIWE/styles.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/components/contexts/web3/index.d.ts +25 -0
- package/build/packages/paykit/packages/connectkit/src/constants/chainConfigs.d.ts +18 -0
- package/build/packages/paykit/packages/connectkit/src/constants/defaultTheme.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/defaultConfig.d.ts +15 -0
- package/build/packages/paykit/packages/connectkit/src/defaultConnectors.d.ts +14 -0
- package/build/packages/paykit/packages/connectkit/src/defaultTransports.d.ts +15 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/connectors/useCoinbaseWalletUri.d.ts +0 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/connectors/useWalletConnectUri.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useChainIsSupported.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useChains.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useConnect.d.ts +119 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useConnectCallback.d.ts +8 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useConnectors.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useEnsFallbackConfig.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useFitText.d.ts +15 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useFocusTrap.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useGoogleFont.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useIsMobile.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useIsMounted.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useLastConnector.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useLocalStorage.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useLocales.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useLockBodyScroll.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useModal.d.ts +12 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/usePrevious.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useWalletConnectModal.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/hooks/useWindowSize.d.ts +4 -0
- package/build/packages/paykit/packages/connectkit/src/index.d.ts +16 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/index.d.ts +93 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/ar-AE.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/ca-AD.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/ee-EE.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/en-US.d.ts +93 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/es-ES.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/fa-IR.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/fr-FR.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/index.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/ja-JP.d.ts +93 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/pt-BR.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/ru-RU.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/tr-TR.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/vi-VN.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/localizations/locales/zh-CN.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/siwe/SIWEContext.d.ts +42 -0
- package/build/packages/paykit/packages/connectkit/src/siwe/SIWEProvider.d.ts +11 -0
- package/build/packages/paykit/packages/connectkit/src/siwe/index.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/siwe/useSIWE.d.ts +21 -0
- package/build/packages/paykit/packages/connectkit/src/styles/defaultTheme.d.ts +3 -0
- package/build/packages/paykit/packages/connectkit/src/styles/index.d.ts +1 -0
- package/build/packages/paykit/packages/connectkit/src/styles/styled/index.d.ts +12 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/base.d.ts +130 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/index.d.ts +680 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/midnight.d.ts +75 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/minimal.d.ts +95 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/nouns.d.ts +80 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/retro.d.ts +89 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/rounded.d.ts +87 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/soft.d.ts +70 -0
- package/build/packages/paykit/packages/connectkit/src/styles/themes/web95.d.ts +92 -0
- package/build/packages/paykit/packages/connectkit/src/styles/types.d.ts +80 -0
- package/build/packages/paykit/packages/connectkit/src/types.d.ts +13 -0
- package/build/packages/paykit/packages/connectkit/src/utils/getPaymentInfo.d.ts +101 -0
- package/build/packages/paykit/packages/connectkit/src/utils/index.d.ts +18 -0
- package/build/packages/paykit/packages/connectkit/src/utils/localstorage.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/utils/p3.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/utils/platform.d.ts +2 -0
- package/build/packages/paykit/packages/connectkit/src/utils/trpc.d.ts +957 -0
- package/build/packages/paykit/packages/connectkit/src/utils/wallets.d.ts +24 -0
- package/build/packages/paykit/packages/connectkit/src/wallets/index.d.ts +7 -0
- package/build/packages/paykit/packages/connectkit/src/wallets/useWallets.d.ts +9 -0
- package/build/packages/paykit/packages/connectkit/src/wallets/walletConfigs.d.ts +31 -0
- package/package.json +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ColumnType } from "kysely";
|
|
2
|
+
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U> ? ColumnType<S, I | undefined, U> : ColumnType<T, T | undefined, T>;
|
|
3
|
+
export type Numeric = ColumnType<string, number | string, number | string>;
|
|
4
|
+
export type Timestamp = ColumnType<Date, Date | string, Date | string>;
|
|
5
|
+
export interface DaimopayOrgApiKey {
|
|
6
|
+
api_key: string;
|
|
7
|
+
created_at: Generated<Timestamp>;
|
|
8
|
+
id: Generated<string>;
|
|
9
|
+
org_id: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DaimopayPayOrder {
|
|
12
|
+
created_at: Generated<Timestamp | null>;
|
|
13
|
+
dest_chain_id: Numeric;
|
|
14
|
+
dest_claim_tx_hash: string | null;
|
|
15
|
+
dest_domain: Numeric;
|
|
16
|
+
dest_fast_finish_tx_hash: string | null;
|
|
17
|
+
dest_final_call_data: string;
|
|
18
|
+
dest_final_call_to: string;
|
|
19
|
+
dest_final_call_token_addr: string;
|
|
20
|
+
dest_final_call_token_amount: Numeric | null;
|
|
21
|
+
dest_final_call_value: Numeric | null;
|
|
22
|
+
dest_mint_token_addr: string | null;
|
|
23
|
+
dest_mint_token_amount: Numeric | null;
|
|
24
|
+
dest_nonce: Numeric;
|
|
25
|
+
dest_refund_addr: string | null;
|
|
26
|
+
dest_status: string;
|
|
27
|
+
handoff_addr: string | null;
|
|
28
|
+
id: Numeric;
|
|
29
|
+
metadata_json: string | null;
|
|
30
|
+
mode: string;
|
|
31
|
+
org_id: string | null;
|
|
32
|
+
redirect_uri: string | null;
|
|
33
|
+
source_amount: Numeric | null;
|
|
34
|
+
source_chain_id: Numeric | null;
|
|
35
|
+
source_fulfiller_addr: string | null;
|
|
36
|
+
source_initiate_tx_hash: string | null;
|
|
37
|
+
source_start_tx_hash: string | null;
|
|
38
|
+
source_status: string;
|
|
39
|
+
source_token: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface DaimopayWebhookDelivery {
|
|
42
|
+
body: string | null;
|
|
43
|
+
created_at: Generated<Timestamp>;
|
|
44
|
+
event_id: string;
|
|
45
|
+
http_status: Numeric | null;
|
|
46
|
+
id: Generated<string>;
|
|
47
|
+
}
|
|
48
|
+
export interface DaimopayWebhookEndpoint {
|
|
49
|
+
created_at: Generated<Timestamp>;
|
|
50
|
+
deleted_at: Timestamp | null;
|
|
51
|
+
id: Generated<string>;
|
|
52
|
+
org_id: string;
|
|
53
|
+
token: string;
|
|
54
|
+
url: string;
|
|
55
|
+
}
|
|
56
|
+
export interface DaimopayWebhookEvent {
|
|
57
|
+
body: string;
|
|
58
|
+
created_at: Generated<Timestamp>;
|
|
59
|
+
endpoint_id: string;
|
|
60
|
+
id: Generated<string>;
|
|
61
|
+
status: string;
|
|
62
|
+
}
|
|
63
|
+
export interface DB {
|
|
64
|
+
"daimopay.org_api_key": DaimopayOrgApiKey;
|
|
65
|
+
"daimopay.pay_order": DaimopayPayOrder;
|
|
66
|
+
"daimopay.webhook_delivery": DaimopayWebhookDelivery;
|
|
67
|
+
"daimopay.webhook_endpoint": DaimopayWebhookEndpoint;
|
|
68
|
+
"daimopay.webhook_event": DaimopayWebhookEvent;
|
|
69
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { DaimoPayOrderMode, DaimoPayOrderStatusDest, DaimoPayOrderStatusSource, UUID, WebhookDelivery, WebhookEndpoint, WebhookEvent, WebhookEventStatus } from "@daimo/common";
|
|
2
|
+
import { PoolConfig } from "pg";
|
|
3
|
+
import { Address, Hex } from "viem";
|
|
4
|
+
export interface DaimoPayOrderRaw {
|
|
5
|
+
id: bigint;
|
|
6
|
+
mode: DaimoPayOrderMode;
|
|
7
|
+
handoffAddr: Address | null;
|
|
8
|
+
destChainId: number;
|
|
9
|
+
destDomain: number;
|
|
10
|
+
destMintTokenAddr: Address | null;
|
|
11
|
+
destMintTokenAmount: bigint | null;
|
|
12
|
+
destFinalCallTokenAddr: Address;
|
|
13
|
+
destFinalCallTokenAmount: bigint | null;
|
|
14
|
+
destFinalCallTo: Address;
|
|
15
|
+
destFinalCallValue: bigint | null;
|
|
16
|
+
destFinalCallData: Hex;
|
|
17
|
+
destRefundAddr: Address | null;
|
|
18
|
+
destNonce: bigint;
|
|
19
|
+
sourceChainId: number | null;
|
|
20
|
+
sourceFulfillerAddr: Address | null;
|
|
21
|
+
sourceToken: Address | null;
|
|
22
|
+
sourceAmount: bigint | null;
|
|
23
|
+
sourceInitiateTxHash: Hex | null;
|
|
24
|
+
sourceStartTxHash: Hex | null;
|
|
25
|
+
sourceStatus: DaimoPayOrderStatusSource;
|
|
26
|
+
destStatus: DaimoPayOrderStatusDest;
|
|
27
|
+
destFastFinishTxHash: Hex | null;
|
|
28
|
+
destClaimTxHash: Hex | null;
|
|
29
|
+
redirectUri: string | null;
|
|
30
|
+
createdAt: number | null;
|
|
31
|
+
orgId: string | null;
|
|
32
|
+
metadataJson: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class DB {
|
|
35
|
+
private pool;
|
|
36
|
+
private db;
|
|
37
|
+
constructor(poolConfig?: PoolConfig);
|
|
38
|
+
getStatus(): {
|
|
39
|
+
idleCount: number;
|
|
40
|
+
totalCount: number;
|
|
41
|
+
waitingCount: number;
|
|
42
|
+
};
|
|
43
|
+
migrateDB(): Promise<void>;
|
|
44
|
+
createOrderIfNotExists(order: DaimoPayOrderRaw): Promise<DaimoPayOrderRaw>;
|
|
45
|
+
getOrderRaw(id: bigint): Promise<DaimoPayOrderRaw | null>;
|
|
46
|
+
updateOrderRaw(id: bigint, updates: Partial<DaimoPayOrderRaw>): Promise<DaimoPayOrderRaw | null | undefined>;
|
|
47
|
+
getPendingClaimOrderRaws(): Promise<DaimoPayOrderRaw[]>;
|
|
48
|
+
getOrderRawsByOrg(orgId: string): Promise<DaimoPayOrderRaw[]>;
|
|
49
|
+
getOrgApiKey(orgId: string): Promise<string | null>;
|
|
50
|
+
deleteOrgApiKey(orgId: string, apiKey: string): Promise<void>;
|
|
51
|
+
createWebhookEndpoint(webhookEndpoint: Omit<WebhookEndpoint, "id" | "createdAt" | "deletedAt">): Promise<WebhookEndpoint>;
|
|
52
|
+
deleteWebhookEndpoint(id: UUID): Promise<void>;
|
|
53
|
+
fetchWebhookEndpoint(id: UUID): Promise<WebhookEndpoint | null>;
|
|
54
|
+
createWebhookEvent(webhookEvent: Omit<WebhookEvent, "id" | "createdAt">): Promise<WebhookEvent>;
|
|
55
|
+
updateWebhookEventStatus(id: UUID, status: WebhookEventStatus): Promise<WebhookEvent>;
|
|
56
|
+
fetchWebhookEvent(id: UUID): Promise<WebhookEvent | null>;
|
|
57
|
+
createWebhookDelivery(webhookDelivery: Omit<WebhookDelivery, "id" | "createdAt">): Promise<WebhookDelivery>;
|
|
58
|
+
fetchWebhookDeliveries(eventId: UUID): Promise<WebhookDelivery[]>;
|
|
59
|
+
fetchWebhookEndpointsToNotify(orgId: UUID): Promise<WebhookEndpoint[]>;
|
|
60
|
+
fetchWebhookEndpointsByToken(token: string): Promise<WebhookEndpoint[]>;
|
|
61
|
+
fetchWebhookEndpointByUrl(url: string): Promise<WebhookEndpoint | null>;
|
|
62
|
+
fetchRetryingEvents(): Promise<{
|
|
63
|
+
eventId: UUID;
|
|
64
|
+
latestDeliveryTime: Date;
|
|
65
|
+
deliveryCount: number;
|
|
66
|
+
}[]>;
|
|
67
|
+
fetchOrgIdByApiKey(apiKey: string): Promise<string | null>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function getEnvApi(): {
|
|
2
|
+
DAIMOPAY_API_PRIVATE_KEY: string;
|
|
3
|
+
ZEROX_API_KEY: string;
|
|
4
|
+
RPC_URL_MAPPING: string;
|
|
5
|
+
BINANCE_API_PRIVATE_KEY: string;
|
|
6
|
+
STYTCH_API_KEY: string;
|
|
7
|
+
STYTCH_PROJECT_ID: string;
|
|
8
|
+
PGURL?: string | undefined;
|
|
9
|
+
CLIPPY_WEBHOOK_URL?: string | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PlatformType } from "@daimo/common";
|
|
2
|
+
import { Address } from "viem";
|
|
3
|
+
export declare class BinanceClient {
|
|
4
|
+
private readonly BIPAY_API_ROOT;
|
|
5
|
+
private readonly PRIVATE_KEY;
|
|
6
|
+
constructor();
|
|
7
|
+
private generateNonce;
|
|
8
|
+
private signPayload;
|
|
9
|
+
private signRequest;
|
|
10
|
+
private signDeeplink;
|
|
11
|
+
private queryBinanceAPI;
|
|
12
|
+
private verifyBinanceAvailability;
|
|
13
|
+
createWithdrawalURL(addr: Address, platform: PlatformType, redirectUrl: string): Promise<string | undefined>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DaimoPayToken, DaimoPayTokenAmount } from "@daimo/common";
|
|
2
|
+
import { ForeignToken } from "@daimo/contract";
|
|
3
|
+
import { Address } from "viem";
|
|
4
|
+
import { ViemClient } from "./viemClient";
|
|
5
|
+
export declare class DFSQuoter {
|
|
6
|
+
private vc;
|
|
7
|
+
private foreignTokensByChain;
|
|
8
|
+
private priceCache;
|
|
9
|
+
private intervalId;
|
|
10
|
+
constructor(vc: ViemClient, foreignTokensByChain: Map<number, Map<Address, ForeignToken>>);
|
|
11
|
+
/**
|
|
12
|
+
* Start the DFSQuoter and refresh prices every intervalMs
|
|
13
|
+
*/
|
|
14
|
+
start(intervalMs?: number): Promise<void>;
|
|
15
|
+
stop(): void;
|
|
16
|
+
getDaimoPayToken(chainId: number, tokenAddress: Address): DaimoPayToken | undefined;
|
|
17
|
+
getDaimoPayTokenAmount(chainId: number, tokenAddress: Address, amount: bigint): DaimoPayTokenAmount | undefined;
|
|
18
|
+
getMintTokenAmountFromDollars(chainId: number, usdValue: number): DaimoPayTokenAmount | undefined;
|
|
19
|
+
getRequiredDaimoPayTokenAmount(chainId: number, tokenAddress: Address, usdValue: number): DaimoPayTokenAmount | undefined;
|
|
20
|
+
batchPriceTokens(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DaimoPayHydratedOrder, DaimoPayToken, ExternalPaymentOptionData, ExternalPaymentOptionMetadata, ExternalPaymentOptions, PlatformType } from "@daimo/common";
|
|
2
|
+
import { Address } from "viem";
|
|
3
|
+
import { DFSQuoter } from "./dfsQuoter";
|
|
4
|
+
import { BinanceClient } from "./binanceClient";
|
|
5
|
+
import { ViemClient } from "./viemClient";
|
|
6
|
+
export declare function getExternalPaymentOptions(dfsQuoter: DFSQuoter, usdRequired: number, platform: PlatformType): ExternalPaymentOptionMetadata[];
|
|
7
|
+
export declare function getExternalPaymentOptionData(binanceClient: BinanceClient, orderId: bigint, paymentOption: ExternalPaymentOptions, addr: Address, usdAmount: number, platform: PlatformType): Promise<ExternalPaymentOptionData>;
|
|
8
|
+
export declare function findExternalSourcePaymentForCoin(vc: ViemClient, order: DaimoPayHydratedOrder, coin: DaimoPayToken): Promise<{
|
|
9
|
+
sourceChainId: number;
|
|
10
|
+
sourceFulfillerAddr: `0x${string}`;
|
|
11
|
+
sourceAmount: bigint;
|
|
12
|
+
sourceToken: `0x${string}`;
|
|
13
|
+
sourceInitiateTxHash: `0x${string}`;
|
|
14
|
+
} | null>;
|
|
15
|
+
export declare function findExternalSourcePayment(vc: ViemClient, dfsQuoter: DFSQuoter, order: DaimoPayHydratedOrder): Promise<{
|
|
16
|
+
sourceChainId: number;
|
|
17
|
+
sourceFulfillerAddr: `0x${string}`;
|
|
18
|
+
sourceAmount: bigint;
|
|
19
|
+
sourceToken: `0x${string}`;
|
|
20
|
+
sourceInitiateTxHash: `0x${string}`;
|
|
21
|
+
} | null>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DaimoPayOrder, DaimoPayHydratedOrder, DaimoPayHydratedOrderWithoutHandoffAddr, DaimoPayDehydratedOrder, DaimoPayOrderUpdate } from "@daimo/common";
|
|
2
|
+
import { Address, Hex } from "viem";
|
|
3
|
+
import { DFSQuoter } from "./dfsQuoter";
|
|
4
|
+
import { ViemClient } from "./viemClient";
|
|
5
|
+
import { DB } from "../db/db";
|
|
6
|
+
export declare class OrderProcessor {
|
|
7
|
+
private readonly db;
|
|
8
|
+
private readonly vc;
|
|
9
|
+
private readonly dfsQuoter;
|
|
10
|
+
private orderUpdateListeners;
|
|
11
|
+
constructor(db: DB, vc: ViemClient, dfsQuoter: DFSQuoter);
|
|
12
|
+
private approveUSDCIfNeeded;
|
|
13
|
+
approveCrepeBotLp(): Promise<void>;
|
|
14
|
+
init(): Promise<void>;
|
|
15
|
+
private getSourceSwapCall;
|
|
16
|
+
private getDestinationSwapCall;
|
|
17
|
+
private getDestinationFromOrder;
|
|
18
|
+
private parseRawOrder;
|
|
19
|
+
private getRawOrder;
|
|
20
|
+
getOrder(id: bigint): Promise<DaimoPayOrder>;
|
|
21
|
+
createOrderIfNotExists(order: DaimoPayOrder): Promise<DaimoPayOrder>;
|
|
22
|
+
updateSource(id: bigint, source: {
|
|
23
|
+
sourceChainId: number;
|
|
24
|
+
sourceAmount: bigint;
|
|
25
|
+
sourceToken: Address;
|
|
26
|
+
sourceInitiateTxHash: Hex;
|
|
27
|
+
sourceFulfillerAddr: Address;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
tryProcessOrder(id: bigint): Promise<void>;
|
|
30
|
+
processOrder(id: bigint): Promise<void>;
|
|
31
|
+
private processSourceChain;
|
|
32
|
+
private processDestinationFastFinish;
|
|
33
|
+
/** Query the circle API for the attestation signature for a message. */
|
|
34
|
+
getAttestation(message: Hex): Promise<`0x${string}` | null>;
|
|
35
|
+
getMessageSent(order: DaimoPayHydratedOrder): Promise<`0x${string}` | null>;
|
|
36
|
+
getReceiveCall(order: DaimoPayHydratedOrder): Promise<{
|
|
37
|
+
to: `0x${string}`;
|
|
38
|
+
value: bigint;
|
|
39
|
+
data: `0x${string}`;
|
|
40
|
+
} | undefined>;
|
|
41
|
+
processDestinationClaimAction(order: DaimoPayHydratedOrder): Promise<void>;
|
|
42
|
+
computeHandoffAddress(partialOrder: DaimoPayHydratedOrderWithoutHandoffAddr): Promise<`0x${string}`>;
|
|
43
|
+
addOrderUpdateListener(callback: (order: DaimoPayOrder, type: DaimoPayOrderUpdate) => void): Promise<void>;
|
|
44
|
+
emitOrderUpdate(order: DaimoPayOrder, type: DaimoPayOrderUpdate): Promise<void>;
|
|
45
|
+
hydrateOrder(order: DaimoPayDehydratedOrder, chosenFinalTokenAmount: bigint | undefined, refundAddress: Address | undefined): Promise<DaimoPayHydratedOrder>;
|
|
46
|
+
getPayOrdersByOrg(orgId: string): Promise<DaimoPayOrder[]>;
|
|
47
|
+
processPendingClaims(): Promise<void>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { B2BClient } from "stytch";
|
|
2
|
+
import { DB } from "../db/db";
|
|
3
|
+
export declare const stytchClient: B2BClient;
|
|
4
|
+
/**
|
|
5
|
+
* Manage Daimo Pay organizations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class OrgManager {
|
|
8
|
+
private db;
|
|
9
|
+
constructor(db: DB);
|
|
10
|
+
/**
|
|
11
|
+
* Create a member in Stytch tied to an org. Returns the member ID.
|
|
12
|
+
*/
|
|
13
|
+
createMember(orgId: string, memberEmail: string, memberName: string): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Get all org members.
|
|
16
|
+
*/
|
|
17
|
+
getOrgMembers(orgId: string): Promise<import("stytch").Member[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Get org API key
|
|
20
|
+
*/
|
|
21
|
+
getOrgApiKey(orgId: string): Promise<string | null>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { DaimoPayOrderMode, DaimoPayTokenAmount, ExternalPaymentOptions } from "@daimo/common";
|
|
3
|
+
import { DB } from "../db/db";
|
|
4
|
+
import { DFSQuoter } from "./dfsQuoter";
|
|
5
|
+
import { OrderProcessor } from "./orderProcessor";
|
|
6
|
+
import { TokenRegistry } from "./tokenRegistry";
|
|
7
|
+
import { ViemClient } from "./viemClient";
|
|
8
|
+
import { BinanceClient } from "./binanceClient";
|
|
9
|
+
import { OrgManager } from "./orgManager";
|
|
10
|
+
export declare function createRouter(vc: ViemClient, db: DB, orderProcessor: OrderProcessor, dfsQuoter: DFSQuoter, tokenRegistry: TokenRegistry, binanceClient: BinanceClient, orgManager: OrgManager): import("@trpc/server/unstable-core-do-not-import").BuiltRouter<{
|
|
11
|
+
ctx: {
|
|
12
|
+
auth: {
|
|
13
|
+
organizationId: string;
|
|
14
|
+
memberId: string;
|
|
15
|
+
} | null;
|
|
16
|
+
req: import("http").IncomingMessage;
|
|
17
|
+
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
18
|
+
info: import("@trpc/server/unstable-core-do-not-import").TRPCRequestInfo;
|
|
19
|
+
};
|
|
20
|
+
meta: object;
|
|
21
|
+
errorShape: import("@trpc/server/unstable-core-do-not-import").DefaultErrorShape;
|
|
22
|
+
transformer: false;
|
|
23
|
+
}, {
|
|
24
|
+
health: import("@trpc/server").TRPCQueryProcedure<{
|
|
25
|
+
input: void;
|
|
26
|
+
output: {
|
|
27
|
+
status: string;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Get the DaimoPayToken data for a given token address and chainId
|
|
32
|
+
*/
|
|
33
|
+
getDaimoPayToken: import("@trpc/server").TRPCQueryProcedure<{
|
|
34
|
+
input: {
|
|
35
|
+
addr: string;
|
|
36
|
+
chainId: number;
|
|
37
|
+
};
|
|
38
|
+
output: import("@daimo/common").DaimoPayToken | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Get an order by handoff address
|
|
42
|
+
*/
|
|
43
|
+
getOrder: import("@trpc/server").TRPCQueryProcedure<{
|
|
44
|
+
input: {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
output: {
|
|
48
|
+
order: import("@daimo/common").DaimoPayOrder;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Gets all non-wallet payment options. CEXes, etc.
|
|
53
|
+
*/
|
|
54
|
+
getExternalPaymentOptions: import("@trpc/server").TRPCQueryProcedure<{
|
|
55
|
+
input: {
|
|
56
|
+
usdRequired: number;
|
|
57
|
+
platform: "ios" | "android" | "other";
|
|
58
|
+
};
|
|
59
|
+
output: import("@daimo/common").ExternalPaymentOptionMetadata[];
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Hydrate an order and fetch external payment option data, if requested
|
|
63
|
+
*/
|
|
64
|
+
hydrateOrder: import("@trpc/server").TRPCQueryProcedure<{
|
|
65
|
+
input: {
|
|
66
|
+
id: string;
|
|
67
|
+
platform: "ios" | "android" | "other";
|
|
68
|
+
externalPaymentOption?: ExternalPaymentOptions | undefined;
|
|
69
|
+
chosenFinalTokenAmount?: string | undefined;
|
|
70
|
+
refundAddress?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
output: {
|
|
73
|
+
hydratedOrder: import("@daimo/common").DaimoPayHydratedOrder;
|
|
74
|
+
externalPaymentOptionData: import("@daimo/common").ExternalPaymentOptionData | null;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Generate order from sale params
|
|
79
|
+
*/
|
|
80
|
+
generateOrder: import("@trpc/server").TRPCMutationProcedure<{
|
|
81
|
+
input: {
|
|
82
|
+
id: string;
|
|
83
|
+
mode: DaimoPayOrderMode.SALE | DaimoPayOrderMode.CHOOSE_AMOUNT;
|
|
84
|
+
destChainId: number;
|
|
85
|
+
destFinalTokenAddr: string;
|
|
86
|
+
destFinalTokenAmount: string | null;
|
|
87
|
+
destFinalCall: {
|
|
88
|
+
value: string;
|
|
89
|
+
to: string;
|
|
90
|
+
data: string;
|
|
91
|
+
};
|
|
92
|
+
destNonce: string;
|
|
93
|
+
intent: string;
|
|
94
|
+
items: {
|
|
95
|
+
description: string;
|
|
96
|
+
name: string;
|
|
97
|
+
image?: string | undefined;
|
|
98
|
+
}[];
|
|
99
|
+
apiKey: string;
|
|
100
|
+
paymentOptions?: string[] | undefined;
|
|
101
|
+
payer?: {
|
|
102
|
+
preferredChains?: number[] | undefined;
|
|
103
|
+
preferredTokens?: {
|
|
104
|
+
chain: number;
|
|
105
|
+
address: string;
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
redirectUri?: string | undefined;
|
|
109
|
+
};
|
|
110
|
+
output: import("@daimo/common").DaimoPayOrder;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Called once -- when the user has made a payment
|
|
114
|
+
*/
|
|
115
|
+
processSourcePayment: import("@trpc/server").TRPCMutationProcedure<{
|
|
116
|
+
input: {
|
|
117
|
+
orderId: string;
|
|
118
|
+
sourceInitiateTxHash: string;
|
|
119
|
+
sourceChainId: number;
|
|
120
|
+
sourceFulfillerAddr: string;
|
|
121
|
+
sourceToken: string;
|
|
122
|
+
sourceAmount: string;
|
|
123
|
+
};
|
|
124
|
+
output: void;
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* Useful for manual processing of orders, for example when 0x borks.
|
|
128
|
+
*/
|
|
129
|
+
processOrder: import("@trpc/server").TRPCQueryProcedure<{
|
|
130
|
+
input: {
|
|
131
|
+
orderId: string;
|
|
132
|
+
};
|
|
133
|
+
output: void;
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Called periodicially to check if the source payment has been made
|
|
137
|
+
* via one of the other payment methods (coinbase etc.)
|
|
138
|
+
*/
|
|
139
|
+
findSourcePayment: import("@trpc/server").TRPCQueryProcedure<{
|
|
140
|
+
input: {
|
|
141
|
+
orderId: string;
|
|
142
|
+
};
|
|
143
|
+
output: boolean;
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* Given a dollar amount, get payment options depending on payer address.
|
|
147
|
+
*
|
|
148
|
+
* Returns a list of payment options. Each payment option has the required
|
|
149
|
+
* TokenAmount and the latest balance of the payer's address.
|
|
150
|
+
*/
|
|
151
|
+
getWalletPaymentOptions: import("@trpc/server").TRPCQueryProcedure<{
|
|
152
|
+
input: {
|
|
153
|
+
usdRequired: number;
|
|
154
|
+
destChainId: number;
|
|
155
|
+
payerAddress: string;
|
|
156
|
+
preferredChains?: number[] | undefined;
|
|
157
|
+
preferredTokens?: {
|
|
158
|
+
chain: number;
|
|
159
|
+
address: string;
|
|
160
|
+
}[] | undefined;
|
|
161
|
+
};
|
|
162
|
+
output: {
|
|
163
|
+
required: DaimoPayTokenAmount;
|
|
164
|
+
balance: DaimoPayTokenAmount;
|
|
165
|
+
}[];
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* Get the list of available foreign tokens for the merchant generator
|
|
169
|
+
*/
|
|
170
|
+
getAvailableMerchantTokens: import("@trpc/server").TRPCQueryProcedure<{
|
|
171
|
+
input: {
|
|
172
|
+
isTestnet?: boolean | undefined;
|
|
173
|
+
};
|
|
174
|
+
output: import("@daimo/common").DaimoPayToken[];
|
|
175
|
+
}>;
|
|
176
|
+
/**
|
|
177
|
+
* Get all Daimo Pay pay orders for a given organization.
|
|
178
|
+
*/
|
|
179
|
+
getOrgPayOrders: import("@trpc/server").TRPCQueryProcedure<{
|
|
180
|
+
input: void;
|
|
181
|
+
output: import("@daimo/common").DaimoPayOrder[];
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* Get all details of an organization.
|
|
185
|
+
*/
|
|
186
|
+
getOrgDetails: import("@trpc/server").TRPCQueryProcedure<{
|
|
187
|
+
input: void;
|
|
188
|
+
output: {
|
|
189
|
+
members: import("stytch").Member[];
|
|
190
|
+
apiKey: string | null;
|
|
191
|
+
};
|
|
192
|
+
}>;
|
|
193
|
+
/**
|
|
194
|
+
* Delete an organization API key.
|
|
195
|
+
*/
|
|
196
|
+
deleteOrgApiKey: import("@trpc/server").TRPCMutationProcedure<{
|
|
197
|
+
input: {
|
|
198
|
+
apiKey: string;
|
|
199
|
+
};
|
|
200
|
+
output: void;
|
|
201
|
+
}>;
|
|
202
|
+
/**
|
|
203
|
+
* Add a member to an organization.
|
|
204
|
+
*/
|
|
205
|
+
addOrgMember: import("@trpc/server").TRPCMutationProcedure<{
|
|
206
|
+
input: {
|
|
207
|
+
memberEmail: string;
|
|
208
|
+
memberName: string;
|
|
209
|
+
};
|
|
210
|
+
output: string;
|
|
211
|
+
}>;
|
|
212
|
+
/**
|
|
213
|
+
* Create a webhook for an organization by API key.
|
|
214
|
+
*/
|
|
215
|
+
createWebhookByApiKey: import("@trpc/server").TRPCMutationProcedure<{
|
|
216
|
+
input: {
|
|
217
|
+
apiKey: string;
|
|
218
|
+
url: string;
|
|
219
|
+
idempotencyKey: string;
|
|
220
|
+
};
|
|
221
|
+
output: {
|
|
222
|
+
webhookEndpoint: null;
|
|
223
|
+
error: string;
|
|
224
|
+
} | {
|
|
225
|
+
webhookEndpoint: import("@daimo/common").WebhookEndpoint;
|
|
226
|
+
error: null;
|
|
227
|
+
};
|
|
228
|
+
}>;
|
|
229
|
+
/**
|
|
230
|
+
* Get a webhook by id using the API key.
|
|
231
|
+
*/
|
|
232
|
+
getWebhookByApiKey: import("@trpc/server").TRPCQueryProcedure<{
|
|
233
|
+
input: {
|
|
234
|
+
id: string;
|
|
235
|
+
apiKey: string;
|
|
236
|
+
};
|
|
237
|
+
output: import("@daimo/common").WebhookEndpoint;
|
|
238
|
+
}>;
|
|
239
|
+
/**
|
|
240
|
+
* Delete a webhook by id using the API key.
|
|
241
|
+
*/
|
|
242
|
+
deleteWebhookByApiKey: import("@trpc/server").TRPCMutationProcedure<{
|
|
243
|
+
input: {
|
|
244
|
+
id: string;
|
|
245
|
+
apiKey: string;
|
|
246
|
+
};
|
|
247
|
+
output: {
|
|
248
|
+
status: string;
|
|
249
|
+
error: null;
|
|
250
|
+
};
|
|
251
|
+
}>;
|
|
252
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OnChainCall } from "@daimo/common";
|
|
2
|
+
import { Address } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Make API call to 0x API to get a quote for the given sell token and buy token
|
|
5
|
+
* null means the token is the native token for the chain.
|
|
6
|
+
*/
|
|
7
|
+
export declare function get0xSwapCall(chainId: number, sell: Address, buy: Address, amount: bigint, type: "exactInput" | "exactOutput", feeRecipientTradeSurplus: Address): Promise<{
|
|
8
|
+
call: OnChainCall;
|
|
9
|
+
sellAmount: bigint;
|
|
10
|
+
buyAmount: bigint;
|
|
11
|
+
} | null>;
|
|
12
|
+
export declare function wrapSwapCallExactIO({ call, requiredTokenIn, suppliedTokenIn, requiredTokenOut, maxTip, }: {
|
|
13
|
+
call: OnChainCall;
|
|
14
|
+
requiredTokenIn: {
|
|
15
|
+
addr: Address;
|
|
16
|
+
amount: bigint;
|
|
17
|
+
};
|
|
18
|
+
suppliedTokenIn: bigint;
|
|
19
|
+
requiredTokenOut: {
|
|
20
|
+
addr: Address;
|
|
21
|
+
amount: bigint;
|
|
22
|
+
};
|
|
23
|
+
maxTip: bigint;
|
|
24
|
+
}): OnChainCall;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DaimoPayTokenAmount } from "@daimo/common";
|
|
2
|
+
import { Address } from "viem";
|
|
3
|
+
import { DFSQuoter } from "./dfsQuoter";
|
|
4
|
+
import { TokenRegistry } from "./tokenRegistry";
|
|
5
|
+
import { ViemClient } from "./viemClient";
|
|
6
|
+
export declare function getChainsTokenBalances({ vc, ownerAddress, tokenRegistry, dfsQuoter, destChainId, }: {
|
|
7
|
+
vc: ViemClient;
|
|
8
|
+
ownerAddress: Address;
|
|
9
|
+
tokenRegistry: TokenRegistry;
|
|
10
|
+
dfsQuoter: DFSQuoter;
|
|
11
|
+
destChainId: number;
|
|
12
|
+
}): Promise<Map<number, DaimoPayTokenAmount[]>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ForeignToken } from "@daimo/contract";
|
|
2
|
+
import { Address } from "viem";
|
|
3
|
+
/**
|
|
4
|
+
* Token Registry sorted by chain id.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TokenRegistry {
|
|
7
|
+
/** Map of chainId to token address to foreign token type. */
|
|
8
|
+
private foreignTokensByChain;
|
|
9
|
+
private chains;
|
|
10
|
+
private invalidTokensByChain;
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
getTokenList(chainId: number): Map<Address, ForeignToken>;
|
|
13
|
+
getForeignTokensByChain(): Map<number, Map<Address, ForeignToken>>;
|
|
14
|
+
getMainnetChainIds(): number[];
|
|
15
|
+
getTestnetChainIds(): number[];
|
|
16
|
+
}
|