@daimo/pay 1.7.7 → 1.8.0
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/build/index.d.ts +25 -18
- package/build/index.js +953 -602
- package/build/index.js.map +1 -1
- package/package.json +4 -4
package/build/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
4
4
|
import { CreateConfigParameters } from '@wagmi/core';
|
|
5
5
|
import { CreateConnectorFn } from 'wagmi';
|
|
6
6
|
import { CoinbaseWalletParameters } from 'wagmi/connectors';
|
|
7
|
-
import { DaimoPayOrderView, PaymentStartedEvent, PaymentCompletedEvent, PaymentBouncedEvent, DaimoPayUserMetadata, DaimoPayIntentStatus, DaimoPayOrderMode, DepositAddressPaymentOptionMetadata, PlatformType, ExternalPaymentOptionMetadata, WalletPaymentOption, DaimoPayOrderWithOrg, ExternalPaymentOptions, DepositAddressPaymentOptions, DepositAddressPaymentOptionData, SolanaPublicKey } from '@daimo/pay-common';
|
|
7
|
+
import { DaimoPayOrderView, PaymentStartedEvent, PaymentCompletedEvent, PaymentBouncedEvent, ExternalPaymentOptionsString, DaimoPayUserMetadata, DaimoPayIntentStatus, DaimoPayOrderMode, DepositAddressPaymentOptionMetadata, PlatformType, ExternalPaymentOptionMetadata, WalletPaymentOption, DaimoPayOrderWithOrg, ExternalPaymentOptions, DepositAddressPaymentOptions, DepositAddressPaymentOptionData, SolanaPublicKey } from '@daimo/pay-common';
|
|
8
8
|
import { Address, Hex } from 'viem';
|
|
9
9
|
import { WalletName } from '@solana/wallet-adapter-base';
|
|
10
10
|
import { AppRouter } from '@daimo/pay-api';
|
|
@@ -70,8 +70,6 @@ type DaimoPayModalOptions = {
|
|
|
70
70
|
closeOnSuccess?: boolean;
|
|
71
71
|
resetOnSuccess?: boolean;
|
|
72
72
|
};
|
|
73
|
-
/** Additional payment options. Onchain payments are always enabled. */
|
|
74
|
-
type PaymentOption = "Daimo" | "Coinbase" | "Binance" | "RampNetwork" | "Solana" | "ExternalChains" | "Lemon";
|
|
75
73
|
|
|
76
74
|
type types_All = All;
|
|
77
75
|
type types_CustomAvatarProps = CustomAvatarProps;
|
|
@@ -80,10 +78,9 @@ type types_DaimoPayContextOptions = DaimoPayContextOptions;
|
|
|
80
78
|
type types_DaimoPayModalOptions = DaimoPayModalOptions;
|
|
81
79
|
type types_Languages = Languages;
|
|
82
80
|
type types_Mode = Mode;
|
|
83
|
-
type types_PaymentOption = PaymentOption;
|
|
84
81
|
type types_Theme = Theme;
|
|
85
82
|
declare namespace types {
|
|
86
|
-
export type { types_All as All, types_CustomAvatarProps as CustomAvatarProps, types_CustomTheme as CustomTheme, types_DaimoPayContextOptions as DaimoPayContextOptions, types_DaimoPayModalOptions as DaimoPayModalOptions, types_Languages as Languages, types_Mode as Mode,
|
|
83
|
+
export type { types_All as All, types_CustomAvatarProps as CustomAvatarProps, types_CustomTheme as CustomTheme, types_DaimoPayContextOptions as DaimoPayContextOptions, types_DaimoPayModalOptions as DaimoPayModalOptions, types_Languages as Languages, types_Mode as Mode, types_Theme as Theme };
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
type useConnectCallbackProps = {
|
|
@@ -168,7 +165,7 @@ type PayButtonPaymentProps = {
|
|
|
168
165
|
/**
|
|
169
166
|
* Payment options. By default, all are enabled.
|
|
170
167
|
*/
|
|
171
|
-
paymentOptions?:
|
|
168
|
+
paymentOptions?: ExternalPaymentOptionsString[];
|
|
172
169
|
/**
|
|
173
170
|
* Preferred chain IDs. Assets on these chains will appear first.
|
|
174
171
|
*/
|
|
@@ -199,6 +196,10 @@ type PayButtonPaymentProps = {
|
|
|
199
196
|
} | {
|
|
200
197
|
/** The payment ID, generated via the Daimo Pay API. Replaces params above. */
|
|
201
198
|
payId: string;
|
|
199
|
+
/**
|
|
200
|
+
* Payment options. By default, all are enabled.
|
|
201
|
+
*/
|
|
202
|
+
paymentOptions?: ExternalPaymentOptionsString[];
|
|
202
203
|
};
|
|
203
204
|
type PayButtonCommonProps = PayButtonPaymentProps & {
|
|
204
205
|
/** Called when user sends payment and transaction is seen on chain */
|
|
@@ -291,7 +292,10 @@ declare enum ROUTES {
|
|
|
291
292
|
SELECT_AMOUNT = "daimoPaySelectAmount",
|
|
292
293
|
SELECT_EXTERNAL_AMOUNT = "daimoPaySelectExternalAmount",
|
|
293
294
|
SELECT_DEPOSIT_ADDRESS_AMOUNT = "daimoPaySelectDepositAddressAmount",
|
|
295
|
+
SELECT_WALLET_AMOUNT = "daimoPaySelectWalletAmount",
|
|
296
|
+
SELECT_ZKP2P = "daimoPaySelectZKP2P",
|
|
294
297
|
WAITING_EXTERNAL = "daimoPayWaitingExternal",
|
|
298
|
+
WAITING_WALLET = "daimoPayWaitingWallet",
|
|
295
299
|
SELECT_DEPOSIT_ADDRESS_CHAIN = "daimoPaySelectDepositAddressChain",
|
|
296
300
|
WAITING_DEPOSIT_ADDRESS = "daimoPayWaitingDepositAddress",
|
|
297
301
|
PAY_WITH_TOKEN = "daimoPayPayWithToken",
|
|
@@ -310,11 +314,6 @@ declare enum ROUTES {
|
|
|
310
314
|
SWITCHNETWORKS = "switchNetworks"
|
|
311
315
|
}
|
|
312
316
|
|
|
313
|
-
/**
|
|
314
|
-
* EIP-6963: Multi Injected Provider Discovery
|
|
315
|
-
* https://eips.ethereum.org/EIPS/eip-6963
|
|
316
|
-
*
|
|
317
|
-
*/
|
|
318
317
|
type WalletConfigProps = {
|
|
319
318
|
name?: string;
|
|
320
319
|
shortName?: string;
|
|
@@ -335,7 +334,8 @@ type WalletConfigProps = {
|
|
|
335
334
|
safari?: string;
|
|
336
335
|
};
|
|
337
336
|
getWalletConnectDeeplink?: (uri: string) => string;
|
|
338
|
-
|
|
337
|
+
deeplinkScheme?: string;
|
|
338
|
+
getDaimoPayDeeplink?: (payId: string) => string;
|
|
339
339
|
shouldDeeplinkDesktop?: boolean;
|
|
340
340
|
showInMobileConnectors?: boolean;
|
|
341
341
|
isWcMobileConnector?: boolean;
|
|
@@ -359,7 +359,7 @@ declare function useExternalPaymentOptions({ trpc, filterIds, platform, usdRequi
|
|
|
359
359
|
usdRequired: number | undefined;
|
|
360
360
|
mode: DaimoPayOrderMode | undefined;
|
|
361
361
|
}): {
|
|
362
|
-
options: ExternalPaymentOptionMetadata[]
|
|
362
|
+
options: Map<"external" | "zkp2p", ExternalPaymentOptionMetadata[]>;
|
|
363
363
|
loading: boolean;
|
|
364
364
|
};
|
|
365
365
|
|
|
@@ -413,7 +413,7 @@ interface PayParams {
|
|
|
413
413
|
/** The intent verb, such as Pay, Deposit, or Purchase. Default: Pay */
|
|
414
414
|
intent?: string;
|
|
415
415
|
/** Payment options. By default, all are enabled. */
|
|
416
|
-
paymentOptions?:
|
|
416
|
+
paymentOptions?: ExternalPaymentOptionsString[];
|
|
417
417
|
/** Preferred chain IDs. */
|
|
418
418
|
preferredChains?: number[];
|
|
419
419
|
/** Preferred tokens. These appear first in the token list. */
|
|
@@ -432,15 +432,19 @@ interface PayParams {
|
|
|
432
432
|
}
|
|
433
433
|
/** Creates (or loads) a payment and manages the corresponding modal. */
|
|
434
434
|
interface PaymentState {
|
|
435
|
-
setPayId: (id: string | undefined) => void;
|
|
436
|
-
setPayParams: (payParams: PayParams | undefined) => void;
|
|
437
|
-
payParams: PayParams | undefined;
|
|
438
435
|
generatePreviewOrder: (payParams: PayParams) => void;
|
|
439
436
|
resetOrder: () => void;
|
|
437
|
+
buttonProps: PayButtonPaymentProps | undefined;
|
|
438
|
+
setButtonProps: (props: PayButtonPaymentProps | undefined) => void;
|
|
439
|
+
setPayId: (id: string | undefined) => void;
|
|
440
|
+
payParams: PayParams | undefined;
|
|
441
|
+
setPayParams: (payParams: PayParams | undefined) => void;
|
|
440
442
|
daimoPayOrder: DaimoPayOrderWithOrg | undefined;
|
|
441
443
|
isDepositFlow: boolean;
|
|
442
444
|
paymentWaitingMessage: string | undefined;
|
|
443
445
|
externalPaymentOptions: ReturnType<typeof useExternalPaymentOptions>;
|
|
446
|
+
selectedWallet: WalletConfigProps | undefined;
|
|
447
|
+
selectedWalletDeepLink: string | undefined;
|
|
444
448
|
showSolanaPaymentMethod: boolean;
|
|
445
449
|
walletPaymentOptions: ReturnType<typeof useWalletPaymentOptions>;
|
|
446
450
|
solanaPaymentOptions: ReturnType<typeof useSolanaPaymentOptions>;
|
|
@@ -451,6 +455,8 @@ interface PaymentState {
|
|
|
451
455
|
selectedDepositAddressOption: DepositAddressPaymentOptionMetadata | undefined;
|
|
452
456
|
getOrderUsdLimit: () => number;
|
|
453
457
|
setPaymentWaitingMessage: (message: string | undefined) => void;
|
|
458
|
+
setSelectedWallet: (wallet: WalletConfigProps | undefined) => void;
|
|
459
|
+
setSelectedWalletDeepLink: (deepLink: string | undefined) => void;
|
|
454
460
|
setSelectedExternalOption: (option: ExternalPaymentOptionMetadata | undefined) => void;
|
|
455
461
|
setSelectedTokenOption: (option: WalletPaymentOption | undefined) => void;
|
|
456
462
|
setSelectedSolanaTokenOption: (option: WalletPaymentOption | undefined) => void;
|
|
@@ -460,6 +466,7 @@ interface PaymentState {
|
|
|
460
466
|
payWithExternal: (option: ExternalPaymentOptions) => Promise<string>;
|
|
461
467
|
payWithDepositAddress: (option: DepositAddressPaymentOptions) => Promise<DepositAddressPaymentOptionData | null>;
|
|
462
468
|
payWithSolanaToken: (inputToken: SolanaPublicKey) => Promise<string | undefined>;
|
|
469
|
+
payWithWallet: (wallet?: WalletConfigProps, amountUsd?: number) => Promise<void>;
|
|
463
470
|
refreshOrder: () => Promise<void>;
|
|
464
471
|
senderEnsName: string | undefined;
|
|
465
472
|
}
|
|
@@ -520,4 +527,4 @@ type PayContextValue = {
|
|
|
520
527
|
} & useConnectCallbackProps;
|
|
521
528
|
|
|
522
529
|
export { Avatar, Chain as ChainIcon, DaimoPayButton, PayContext as DaimoPayContext, DaimoPayProvider, types as Types, daimoPayVersion, defaultConfig as getDefaultConfig, useDaimoPayStatus, usePayContext, wallets };
|
|
523
|
-
export type { All, CustomAvatarProps, CustomTheme, DaimoPayButtonCustomProps, DaimoPayButtonProps, DaimoPayContextOptions, DaimoPayModalOptions, DaimoPayment, Languages, Mode,
|
|
530
|
+
export type { All, CustomAvatarProps, CustomTheme, DaimoPayButtonCustomProps, DaimoPayButtonProps, DaimoPayContextOptions, DaimoPayModalOptions, DaimoPayment, Languages, Mode, Theme };
|