@daimo/pay 1.8.5 → 1.9.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 +18 -12
- package/build/index.js +344 -133
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ import { CoinbaseWalletParameters } from 'wagmi/connectors';
|
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { DaimoPayOrderView, PaymentStartedEvent, PaymentCompletedEvent, PaymentBouncedEvent, ExternalPaymentOptionsString, DaimoPayUserMetadata, DaimoPayOrderWithOrg, DaimoPayHydratedOrderWithOrg, DaimoPayOrder, DaimoPayOrderID, SolanaPublicKey, DaimoPayIntentStatus, DaimoPayOrderMode, DepositAddressPaymentOptionMetadata, PlatformType, ExternalPaymentOptionMetadata, WalletPaymentOption, ExternalPaymentOptions, DepositAddressPaymentOptions, DepositAddressPaymentOptionData } from '@daimo/pay-common';
|
|
8
8
|
import { Address, Hex } from 'viem';
|
|
9
|
-
import { WalletName } from '@solana/wallet-adapter-base';
|
|
10
9
|
import { AppRouter } from '@daimo/pay-api';
|
|
11
10
|
import { CreateTRPCClient } from '@trpc/client';
|
|
11
|
+
import { WalletName } from '@solana/wallet-adapter-base';
|
|
12
12
|
|
|
13
13
|
type Hash = `0x${string}`;
|
|
14
14
|
type CustomAvatarProps = {
|
|
@@ -420,6 +420,11 @@ declare function useDaimoPayStatus(): {
|
|
|
420
420
|
status: DaimoPayIntentStatus;
|
|
421
421
|
} | undefined;
|
|
422
422
|
|
|
423
|
+
type UseDaimoPayUI = {
|
|
424
|
+
resetPayment: (payParams?: Partial<PayParams>) => Promise<void>;
|
|
425
|
+
};
|
|
426
|
+
declare function useDaimoPayUI(): UseDaimoPayUI;
|
|
427
|
+
|
|
423
428
|
/** Icon for an EVM chain, given chain ID. No ID shows a loading spinner. */
|
|
424
429
|
declare const Chain: React$1.FC<{
|
|
425
430
|
id?: number;
|
|
@@ -435,8 +440,6 @@ declare const wallets: {
|
|
|
435
440
|
|
|
436
441
|
declare const daimoPayVersion: string;
|
|
437
442
|
|
|
438
|
-
type SolanaWalletName = WalletName<string>;
|
|
439
|
-
|
|
440
443
|
declare enum ROUTES {
|
|
441
444
|
SELECT_METHOD = "daimoPaySelectMethod",
|
|
442
445
|
SELECT_TOKEN = "daimoPaySelectToken",
|
|
@@ -464,6 +467,8 @@ declare enum ROUTES {
|
|
|
464
467
|
SWITCHNETWORKS = "switchNetworks"
|
|
465
468
|
}
|
|
466
469
|
|
|
470
|
+
type TrpcClient = CreateTRPCClient<AppRouter>;
|
|
471
|
+
|
|
467
472
|
type WalletConfigProps = {
|
|
468
473
|
name?: string;
|
|
469
474
|
shortName?: string;
|
|
@@ -492,8 +497,6 @@ type WalletConfigProps = {
|
|
|
492
497
|
isSolanaOnly?: boolean;
|
|
493
498
|
};
|
|
494
499
|
|
|
495
|
-
type TrpcClient = CreateTRPCClient<AppRouter>;
|
|
496
|
-
|
|
497
500
|
declare function useDepositAddressOptions({ trpc, usdRequired, mode, }: {
|
|
498
501
|
trpc: TrpcClient;
|
|
499
502
|
usdRequired: number | undefined;
|
|
@@ -547,11 +550,11 @@ declare function useWalletPaymentOptions({ trpc, address, usdRequired, destChain
|
|
|
547
550
|
/** Creates (or loads) a payment and manages the corresponding modal. */
|
|
548
551
|
interface PaymentState {
|
|
549
552
|
generatePreviewOrder: () => void;
|
|
550
|
-
resetOrder: () => void
|
|
553
|
+
resetOrder: (payParams?: Partial<PayParams>) => Promise<void>;
|
|
551
554
|
buttonProps: PayButtonPaymentProps | undefined;
|
|
552
555
|
setButtonProps: (props: PayButtonPaymentProps | undefined) => void;
|
|
553
556
|
setPayId: (id: string | undefined) => void;
|
|
554
|
-
setPayParams: (payParams: PayParams | undefined) => void
|
|
557
|
+
setPayParams: (payParams: PayParams | undefined) => Promise<void>;
|
|
555
558
|
isDepositFlow: boolean;
|
|
556
559
|
paymentWaitingMessage: string | undefined;
|
|
557
560
|
externalPaymentOptions: ReturnType<typeof useExternalPaymentOptions>;
|
|
@@ -584,8 +587,8 @@ interface PaymentState {
|
|
|
584
587
|
senderEnsName: string | undefined;
|
|
585
588
|
}
|
|
586
589
|
|
|
587
|
-
|
|
588
|
-
|
|
590
|
+
type SolanaWalletName = WalletName<string>;
|
|
591
|
+
|
|
589
592
|
/** Meant for internal use. This will be non-exported in a future SDK version. */
|
|
590
593
|
declare const PayContext: React$1.Context<PayContextValue | null>;
|
|
591
594
|
type PayLogFn = (message: string, ...props: any[]) => void;
|
|
@@ -597,8 +600,8 @@ type PayContextValue = {
|
|
|
597
600
|
setMode: React$1.Dispatch<React$1.SetStateAction<Mode>>;
|
|
598
601
|
customTheme: CustomTheme | undefined;
|
|
599
602
|
setCustomTheme: React$1.Dispatch<React$1.SetStateAction<CustomTheme | undefined>>;
|
|
600
|
-
lang: Languages
|
|
601
|
-
setLang: React$1.Dispatch<React$1.SetStateAction<Languages
|
|
603
|
+
lang: Languages;
|
|
604
|
+
setLang: React$1.Dispatch<React$1.SetStateAction<Languages>>;
|
|
602
605
|
setOnOpen: (fn?: () => void) => void;
|
|
603
606
|
setOnClose: (fn?: () => void) => void;
|
|
604
607
|
open: boolean;
|
|
@@ -639,5 +642,8 @@ type PayContextValue = {
|
|
|
639
642
|
setRedirectReturnUrl: React$1.Dispatch<React$1.SetStateAction<string | undefined>>;
|
|
640
643
|
} & useConnectCallbackProps;
|
|
641
644
|
|
|
642
|
-
|
|
645
|
+
/** Daimo Pay internal context. */
|
|
646
|
+
declare const usePayContext: () => PayContextValue;
|
|
647
|
+
|
|
648
|
+
export { Avatar, Chain as ChainIcon, DaimoPayButton, PayContext as DaimoPayContext, DaimoPayProvider, types as Types, daimoPayVersion, defaultConfig as getDefaultConfig, useDaimoPay, useDaimoPayStatus, useDaimoPayUI, usePayContext, wallets };
|
|
643
649
|
export type { All, CustomAvatarProps, CustomTheme, DaimoPayButtonCustomProps, DaimoPayButtonProps, DaimoPayContextOptions, DaimoPayModalOptions, DaimoPayment, Languages, Mode, Theme };
|