@daimo/pay 1.0.1 → 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
CHANGED
|
@@ -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
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":";;;;;;;;;;;;;;;;;;"}
|