@daimo/pay 1.0.0 → 1.0.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.
- package/build/index.d.ts +3 -2
- package/build/package.json.js +1 -1
- package/build/src/components/DaimoPayButton/index.js +2 -6
- package/build/src/components/DaimoPayButton/index.js.map +1 -1
- package/build/src/index.js +1 -1
- package/build/src/utils/exports.js +3 -1
- package/build/src/utils/exports.js.map +1 -1
- package/build/src/utils/trpc.js +4 -0
- package/build/src/utils/trpc.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -219,7 +219,7 @@ declare namespace DaimoPayButton {
|
|
|
219
219
|
var Custom: typeof DaimoPayButtonCustom;
|
|
220
220
|
}
|
|
221
221
|
/** Like DaimoPayButton, but with custom styling. */
|
|
222
|
-
declare function DaimoPayButtonCustom(props: DaimoPayButtonCustomProps):
|
|
222
|
+
declare function DaimoPayButtonCustom(props: DaimoPayButtonCustomProps): React$1.ReactNode;
|
|
223
223
|
declare namespace DaimoPayButtonCustom {
|
|
224
224
|
var displayName: string;
|
|
225
225
|
}
|
|
@@ -259,7 +259,8 @@ declare const wallets: {
|
|
|
259
259
|
[key: string]: CreateConnectorFn;
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
declare const daimoPayVersion: string;
|
|
262
263
|
/** Generates a globally-unique payId. */
|
|
263
264
|
declare function generatePayId(): string;
|
|
264
265
|
|
|
265
|
-
export { Avatar, Chain as ChainIcon, DaimoPayButton, DaimoPayProvider, types_d as Types, generatePayId, defaultConfig as getDefaultConfig, useModal as useDaimoPayModal, useDaimoPayStatus, wallets };
|
|
266
|
+
export { Avatar, Chain as ChainIcon, DaimoPayButton, DaimoPayProvider, types_d as Types, daimoPayVersion, generatePayId, defaultConfig as getDefaultConfig, useModal as useDaimoPayModal, useDaimoPayStatus, wallets };
|
package/build/package.json.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
|
-
import useIsMounted from '../../hooks/useIsMounted.js';
|
|
4
3
|
import { usePayContext } from '../DaimoPay.js';
|
|
5
4
|
import { TextContainer } from './styles.js';
|
|
6
5
|
import { DaimoPayOrderMode, DaimoPayOrderStatusSource, writeDaimoPayOrderID, assertNotNull, DaimoPayIntentStatus } from '@daimo/common';
|
|
@@ -20,7 +19,6 @@ function DaimoPayButton(props) {
|
|
|
20
19
|
}
|
|
21
20
|
/** Like DaimoPayButton, but with custom styling. */
|
|
22
21
|
function DaimoPayButtonCustom(props) {
|
|
23
|
-
const isMounted = useIsMounted();
|
|
24
22
|
const context = usePayContext();
|
|
25
23
|
// Pre-load payment info in background.
|
|
26
24
|
// Reload when any of the info changes.
|
|
@@ -89,9 +87,7 @@ function DaimoPayButtonCustom(props) {
|
|
|
89
87
|
const modalOptions = { closeOnSuccess };
|
|
90
88
|
const show = () => context.showPayment(modalOptions);
|
|
91
89
|
const hide = () => context.setOpen(false);
|
|
92
|
-
|
|
93
|
-
return null;
|
|
94
|
-
return jsx(Fragment, { children: children({ show, hide }) });
|
|
90
|
+
return children({ show, hide });
|
|
95
91
|
}
|
|
96
92
|
DaimoPayButtonCustom.displayName = "DaimoPayButton.Custom";
|
|
97
93
|
DaimoPayButton.Custom = DaimoPayButtonCustom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/src/index.js
CHANGED
|
@@ -6,5 +6,5 @@ export { useModal as useDaimoPayModal } from './hooks/useModal.js';
|
|
|
6
6
|
export { default as Avatar } from './components/Common/Avatar/index.js';
|
|
7
7
|
export { default as ChainIcon } from './components/Common/Chain/index.js';
|
|
8
8
|
export { wallets } from './wallets/index.js';
|
|
9
|
-
export { generatePayId } from './utils/exports.js';
|
|
9
|
+
export { daimoPayVersion, generatePayId } from './utils/exports.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { writeDaimoPayOrderID } from '@daimo/common';
|
|
2
2
|
import { bytesToBigInt } from 'viem';
|
|
3
|
+
import packageJson from '../../package.json.js';
|
|
3
4
|
|
|
4
5
|
// Exported utilities, useful for @daimo/pay users.
|
|
6
|
+
const daimoPayVersion = packageJson.version;
|
|
5
7
|
/** Generates a globally-unique payId. */
|
|
6
8
|
function generatePayId() {
|
|
7
9
|
const id = bytesToBigInt(crypto.getRandomValues(new Uint8Array(32)));
|
|
8
10
|
return writeDaimoPayOrderID(id);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
export { generatePayId };
|
|
13
|
+
export { daimoPayVersion, generatePayId };
|
|
12
14
|
//# sourceMappingURL=exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exports.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/build/src/utils/trpc.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { createTRPCClient, httpBatchLink } from '@trpc/client';
|
|
2
|
+
import { daimoPayVersion } from './exports.js';
|
|
2
3
|
|
|
3
4
|
function createTrpcClient(apiUrl) {
|
|
4
5
|
return createTRPCClient({
|
|
5
6
|
links: [
|
|
6
7
|
httpBatchLink({
|
|
7
8
|
url: apiUrl,
|
|
9
|
+
headers: {
|
|
10
|
+
"x-pay-version": daimoPayVersion,
|
|
11
|
+
},
|
|
8
12
|
}),
|
|
9
13
|
],
|
|
10
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|