@daimo/pay 1.7.3 → 1.7.5
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 +22 -16
- package/build/index.js +247 -190
- package/build/index.js.map +1 -1
- package/package.json +4 -3
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React$1, { ReactNode } from 'react';
|
|
1
|
+
import React$1, { ReactNode, ReactElement } from 'react';
|
|
2
2
|
export { version } from '../package.json';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { CreateConfigParameters } from '@wagmi/core';
|
|
@@ -68,6 +68,7 @@ type DaimoPayContextOptions = {
|
|
|
68
68
|
/** Modal UI options, set on the pay button triggering that modal. */
|
|
69
69
|
type DaimoPayModalOptions = {
|
|
70
70
|
closeOnSuccess?: boolean;
|
|
71
|
+
resetOnSuccess?: boolean;
|
|
71
72
|
};
|
|
72
73
|
/** Additional payment options. Onchain payments are always enabled. */
|
|
73
74
|
type PaymentOption = "Daimo" | "Coinbase" | "Binance" | "RampNetwork" | "Solana" | "ExternalChains" | "Lemon";
|
|
@@ -150,11 +151,6 @@ type DaimoPayEvent = {
|
|
|
150
151
|
* chain for payment_completed/payment_bounced.
|
|
151
152
|
*/
|
|
152
153
|
chainId: number;
|
|
153
|
-
/**
|
|
154
|
-
* The transaction hash for this event. Hex for all EVM events, Base58 for
|
|
155
|
-
* payment_started on Solana.
|
|
156
|
-
*/
|
|
157
|
-
txHash: Hex | string;
|
|
158
154
|
/**
|
|
159
155
|
* Payment details.
|
|
160
156
|
*/
|
|
@@ -162,12 +158,22 @@ type DaimoPayEvent = {
|
|
|
162
158
|
};
|
|
163
159
|
type DaimoPayStartedEvent = DaimoPayEvent & {
|
|
164
160
|
type: "payment_started";
|
|
161
|
+
/**
|
|
162
|
+
* The transaction hash sent by the user, if found. (There are rare edge cases
|
|
163
|
+
* where a payment can be paid without a txhash.) Hex for all EVM events,
|
|
164
|
+
* Base58 for payment_started on Solana.
|
|
165
|
+
*/
|
|
166
|
+
txHash: Hex | string | null;
|
|
165
167
|
};
|
|
166
168
|
type DaimoPayCompletedEvent = DaimoPayEvent & {
|
|
167
169
|
type: "payment_completed";
|
|
170
|
+
/** The transaction hash completing this payment. */
|
|
171
|
+
txHash: Hex;
|
|
168
172
|
};
|
|
169
173
|
type DaimoPayBouncedEvent = DaimoPayEvent & {
|
|
170
174
|
type: "payment_bounced";
|
|
175
|
+
/** The transaction hash containing the reverted final call and refund. */
|
|
176
|
+
txHash: Hex;
|
|
171
177
|
};
|
|
172
178
|
/** Props for DaimoPayButton. */
|
|
173
179
|
type PayButtonPaymentProps = {
|
|
@@ -251,6 +257,8 @@ type PayButtonCommonProps = PayButtonPaymentProps & {
|
|
|
251
257
|
closeOnSuccess?: boolean;
|
|
252
258
|
/** Open the modal by default. */
|
|
253
259
|
defaultOpen?: boolean;
|
|
260
|
+
/** Reset the payment after a successful payment. */
|
|
261
|
+
resetOnSuccess?: boolean;
|
|
254
262
|
/** Custom message to display on confirmation page. */
|
|
255
263
|
confirmationMessage?: string;
|
|
256
264
|
/** Redirect URL to return to the app. E.g. after Coinbase, Binance, RampNetwork. */
|
|
@@ -271,18 +279,18 @@ type DaimoPayButtonCustomProps = PayButtonCommonProps & {
|
|
|
271
279
|
children: (renderProps: {
|
|
272
280
|
show: () => void;
|
|
273
281
|
hide: () => void;
|
|
274
|
-
}) =>
|
|
282
|
+
}) => ReactElement;
|
|
275
283
|
};
|
|
276
284
|
/**
|
|
277
285
|
* A button that shows the Daimo Pay checkout. Replaces the traditional
|
|
278
286
|
* Connect Wallet » approve » execute sequence with a single action.
|
|
279
287
|
*/
|
|
280
|
-
declare function DaimoPayButton(props: DaimoPayButtonProps):
|
|
288
|
+
declare function DaimoPayButton(props: DaimoPayButtonProps): JSX.Element;
|
|
281
289
|
declare namespace DaimoPayButton {
|
|
282
290
|
var Custom: typeof DaimoPayButtonCustom;
|
|
283
291
|
}
|
|
284
292
|
/** Like DaimoPayButton, but with custom styling. */
|
|
285
|
-
declare function DaimoPayButtonCustom(props: DaimoPayButtonCustomProps):
|
|
293
|
+
declare function DaimoPayButtonCustom(props: DaimoPayButtonCustomProps): JSX.Element;
|
|
286
294
|
declare namespace DaimoPayButtonCustom {
|
|
287
295
|
var displayName: string;
|
|
288
296
|
}
|
|
@@ -470,12 +478,12 @@ interface PaymentState {
|
|
|
470
478
|
setPayParams: (payParams: PayParams | undefined) => void;
|
|
471
479
|
payParams: PayParams | undefined;
|
|
472
480
|
generatePreviewOrder: (payParams: PayParams) => void;
|
|
481
|
+
resetOrder: () => void;
|
|
473
482
|
daimoPayOrder: DaimoPayOrder | undefined;
|
|
474
483
|
isDepositFlow: boolean;
|
|
475
|
-
modalOptions: DaimoPayModalOptions;
|
|
476
|
-
setModalOptions: (modalOptions: DaimoPayModalOptions) => void;
|
|
477
484
|
paymentWaitingMessage: string | undefined;
|
|
478
485
|
externalPaymentOptions: ReturnType<typeof useExternalPaymentOptions>;
|
|
486
|
+
showSolanaPaymentMethod: boolean;
|
|
479
487
|
walletPaymentOptions: ReturnType<typeof useWalletPaymentOptions>;
|
|
480
488
|
solanaPaymentOptions: ReturnType<typeof useSolanaPaymentOptions>;
|
|
481
489
|
depositAddressOptions: ReturnType<typeof useDepositAddressOptions>;
|
|
@@ -495,10 +503,6 @@ interface PaymentState {
|
|
|
495
503
|
payWithDepositAddress: (option: DepositAddressPaymentOptions) => Promise<DepositAddressPaymentOptionData | null>;
|
|
496
504
|
payWithSolanaToken: (inputToken: SolanaPublicKey) => Promise<string | undefined>;
|
|
497
505
|
refreshOrder: () => Promise<void>;
|
|
498
|
-
onSuccess: (args: {
|
|
499
|
-
txHash: string;
|
|
500
|
-
txURL?: string;
|
|
501
|
-
}) => void;
|
|
502
506
|
senderEnsName: string | undefined;
|
|
503
507
|
}
|
|
504
508
|
|
|
@@ -547,6 +551,8 @@ type PayContextValue = {
|
|
|
547
551
|
paymentState: PaymentState;
|
|
548
552
|
/** TRPC API client. Internal use only. */
|
|
549
553
|
trpc: any;
|
|
554
|
+
/** Callback to call when the payment is successful. */
|
|
555
|
+
onSuccess: () => void;
|
|
550
556
|
/** Custom message to display on confirmation page. */
|
|
551
557
|
confirmationMessage?: string;
|
|
552
558
|
setConfirmationMessage: React$1.Dispatch<React$1.SetStateAction<string | undefined>>;
|
|
@@ -556,4 +562,4 @@ type PayContextValue = {
|
|
|
556
562
|
} & useConnectCallbackProps;
|
|
557
563
|
|
|
558
564
|
export { Avatar, Chain as ChainIcon, DaimoPayButton, PayContext as DaimoPayContext, DaimoPayProvider, types as Types, daimoPayVersion, defaultConfig as getDefaultConfig, useDaimoPayStatus, usePayContext, wallets };
|
|
559
|
-
export type { DaimoPayBouncedEvent, DaimoPayButtonCustomProps, DaimoPayButtonProps, DaimoPayCompletedEvent, DaimoPayEvent, DaimoPayStartedEvent, DaimoPayment };
|
|
565
|
+
export type { All, CustomAvatarProps, CustomTheme, DaimoPayBouncedEvent, DaimoPayButtonCustomProps, DaimoPayButtonProps, DaimoPayCompletedEvent, DaimoPayContextOptions, DaimoPayEvent, DaimoPayModalOptions, DaimoPayStartedEvent, DaimoPayment, Languages, Mode, PaymentOption, Theme };
|