@thirdweb-dev/service-utils 0.4.37 → 0.4.38-nightly-997c3945a7673517fb28273a9985f70ff892b365-20240817000330
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/cf-worker/dist/thirdweb-dev-service-utils-cf-worker.cjs.dev.js +3 -69
- package/cf-worker/dist/thirdweb-dev-service-utils-cf-worker.cjs.prod.js +3 -69
- package/cf-worker/dist/thirdweb-dev-service-utils-cf-worker.esm.js +3 -69
- package/dist/declarations/src/cf-worker/usage.d.ts +3 -182
- package/dist/declarations/src/cf-worker/usage.d.ts.map +1 -1
- package/dist/declarations/src/core/usage.d.ts +181 -0
- package/dist/declarations/src/core/usage.d.ts.map +1 -0
- package/dist/declarations/src/node/index.d.ts +1 -0
- package/dist/declarations/src/node/index.d.ts.map +1 -1
- package/dist/{index-36c58a51.cjs.prod.js → index-23f268d8.cjs.prod.js} +67 -0
- package/dist/{index-6bf55bf9.esm.js → index-5dc16842.esm.js} +67 -1
- package/dist/{index-3933adbc.cjs.dev.js → index-88f1ffb6.cjs.dev.js} +67 -0
- package/node/dist/thirdweb-dev-service-utils-node.cjs.dev.js +3 -1
- package/node/dist/thirdweb-dev-service-utils-node.cjs.prod.js +3 -1
- package/node/dist/thirdweb-dev-service-utils-node.esm.js +3 -2
- package/package.json +2 -2
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var index = require('../../dist/index-
|
5
|
+
var index = require('../../dist/index-88f1ffb6.cjs.dev.js');
|
6
6
|
var aws4fetch = require('aws4fetch');
|
7
|
-
var zod = require('zod');
|
8
7
|
var client = require('../../dist/client-a5cc5822.cjs.dev.js');
|
8
|
+
require('zod');
|
9
9
|
|
10
10
|
// Initialize a singleton for AWS usage.
|
11
11
|
let _aws;
|
@@ -16,72 +16,6 @@ function getAws(options) {
|
|
16
16
|
return _aws;
|
17
17
|
}
|
18
18
|
|
19
|
-
/**
|
20
|
-
* Types
|
21
|
-
*/
|
22
|
-
const usageEventSchema = zod.z.object({
|
23
|
-
source: zod.z.enum(["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]),
|
24
|
-
action: zod.z.string(),
|
25
|
-
/**
|
26
|
-
* The following fields are optional.
|
27
|
-
*/
|
28
|
-
|
29
|
-
accountId: zod.z.string().optional(),
|
30
|
-
isClientEvent: zod.z.boolean().optional(),
|
31
|
-
apiKeyId: zod.z.string().optional(),
|
32
|
-
creatorWalletAddress: zod.z.string().optional(),
|
33
|
-
clientId: zod.z.string().optional(),
|
34
|
-
walletAddress: zod.z.string().optional(),
|
35
|
-
walletType: zod.z.string().optional(),
|
36
|
-
chainId: zod.z.number().int().positive().optional(),
|
37
|
-
provider: zod.z.string().optional(),
|
38
|
-
mimeType: zod.z.string().optional(),
|
39
|
-
fileSize: zod.z.number().int().nonnegative().optional(),
|
40
|
-
fileCid: zod.z.string().optional(),
|
41
|
-
evmMethod: zod.z.string().optional(),
|
42
|
-
userOpHash: zod.z.string().optional(),
|
43
|
-
gasLimit: zod.z.number().nonnegative().optional(),
|
44
|
-
gasPricePerUnit: zod.z.string().optional(),
|
45
|
-
transactionFeeUsd: zod.z.number().optional(),
|
46
|
-
transactionHash: zod.z.string().optional(),
|
47
|
-
sdkName: zod.z.string().optional(),
|
48
|
-
sdkVersion: zod.z.string().optional(),
|
49
|
-
sdkPlatform: zod.z.string().optional(),
|
50
|
-
sdkOS: zod.z.string().optional(),
|
51
|
-
productName: zod.z.string().optional(),
|
52
|
-
transactionValue: zod.z.string().optional(),
|
53
|
-
pathname: zod.z.string().optional(),
|
54
|
-
contractAddress: zod.z.string().optional(),
|
55
|
-
errorCode: zod.z.string().optional(),
|
56
|
-
httpStatusCode: zod.z.number().int().nonnegative().optional(),
|
57
|
-
functionName: zod.z.string().optional(),
|
58
|
-
extension: zod.z.string().optional(),
|
59
|
-
retryCount: zod.z.number().int().nonnegative().optional(),
|
60
|
-
policyId: zod.z.string().optional(),
|
61
|
-
msSinceQueue: zod.z.number().nonnegative().optional(),
|
62
|
-
msSinceSend: zod.z.number().nonnegative().optional(),
|
63
|
-
msTotalDuration: zod.z.number().nonnegative().optional(),
|
64
|
-
swapId: zod.z.string().optional(),
|
65
|
-
tokenAddress: zod.z.string().optional(),
|
66
|
-
amountWei: zod.z.string().optional(),
|
67
|
-
amountUSDCents: zod.z.number().nonnegative().optional(),
|
68
|
-
httpMethod: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]).optional(),
|
69
|
-
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
70
|
-
ecosystemId: zod.z.string().optional(),
|
71
|
-
ecosystemPartnerId: zod.z.string().optional(),
|
72
|
-
chainName: zod.z.string().optional(),
|
73
|
-
tokenSymbol: zod.z.string().optional(),
|
74
|
-
dstChainId: zod.z.number().optional(),
|
75
|
-
dstTokenAddress: zod.z.string().optional(),
|
76
|
-
dstChainName: zod.z.string().optional(),
|
77
|
-
dstTokenSymbol: zod.z.string().optional(),
|
78
|
-
msLatency: zod.z.number().optional(),
|
79
|
-
toAmountUSDCents: zod.z.number().optional(),
|
80
|
-
secondaryProvider: zod.z.string().optional(),
|
81
|
-
onRampId: zod.z.string().optional(),
|
82
|
-
evmRequestParams: zod.z.string().optional(),
|
83
|
-
providerIp: zod.z.string().optional()
|
84
|
-
});
|
85
19
|
/**
|
86
20
|
* Publish usage events. Provide the relevant fields for your application.
|
87
21
|
*
|
@@ -105,7 +39,7 @@ async function publishUsageEvents(usageEvents, config) {
|
|
105
39
|
} = config;
|
106
40
|
const entries = usageEvents.map(event => {
|
107
41
|
// Enforce schema of usage event.
|
108
|
-
const parsed = usageEventSchema.parse(event);
|
42
|
+
const parsed = index.usageEventSchema.parse(event);
|
109
43
|
return {
|
110
44
|
Id: crypto.randomUUID(),
|
111
45
|
MessageBody: JSON.stringify(parsed)
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var index = require('../../dist/index-
|
5
|
+
var index = require('../../dist/index-23f268d8.cjs.prod.js');
|
6
6
|
var aws4fetch = require('aws4fetch');
|
7
|
-
var zod = require('zod');
|
8
7
|
var client = require('../../dist/client-84e46164.cjs.prod.js');
|
8
|
+
require('zod');
|
9
9
|
|
10
10
|
// Initialize a singleton for AWS usage.
|
11
11
|
let _aws;
|
@@ -16,72 +16,6 @@ function getAws(options) {
|
|
16
16
|
return _aws;
|
17
17
|
}
|
18
18
|
|
19
|
-
/**
|
20
|
-
* Types
|
21
|
-
*/
|
22
|
-
const usageEventSchema = zod.z.object({
|
23
|
-
source: zod.z.enum(["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]),
|
24
|
-
action: zod.z.string(),
|
25
|
-
/**
|
26
|
-
* The following fields are optional.
|
27
|
-
*/
|
28
|
-
|
29
|
-
accountId: zod.z.string().optional(),
|
30
|
-
isClientEvent: zod.z.boolean().optional(),
|
31
|
-
apiKeyId: zod.z.string().optional(),
|
32
|
-
creatorWalletAddress: zod.z.string().optional(),
|
33
|
-
clientId: zod.z.string().optional(),
|
34
|
-
walletAddress: zod.z.string().optional(),
|
35
|
-
walletType: zod.z.string().optional(),
|
36
|
-
chainId: zod.z.number().int().positive().optional(),
|
37
|
-
provider: zod.z.string().optional(),
|
38
|
-
mimeType: zod.z.string().optional(),
|
39
|
-
fileSize: zod.z.number().int().nonnegative().optional(),
|
40
|
-
fileCid: zod.z.string().optional(),
|
41
|
-
evmMethod: zod.z.string().optional(),
|
42
|
-
userOpHash: zod.z.string().optional(),
|
43
|
-
gasLimit: zod.z.number().nonnegative().optional(),
|
44
|
-
gasPricePerUnit: zod.z.string().optional(),
|
45
|
-
transactionFeeUsd: zod.z.number().optional(),
|
46
|
-
transactionHash: zod.z.string().optional(),
|
47
|
-
sdkName: zod.z.string().optional(),
|
48
|
-
sdkVersion: zod.z.string().optional(),
|
49
|
-
sdkPlatform: zod.z.string().optional(),
|
50
|
-
sdkOS: zod.z.string().optional(),
|
51
|
-
productName: zod.z.string().optional(),
|
52
|
-
transactionValue: zod.z.string().optional(),
|
53
|
-
pathname: zod.z.string().optional(),
|
54
|
-
contractAddress: zod.z.string().optional(),
|
55
|
-
errorCode: zod.z.string().optional(),
|
56
|
-
httpStatusCode: zod.z.number().int().nonnegative().optional(),
|
57
|
-
functionName: zod.z.string().optional(),
|
58
|
-
extension: zod.z.string().optional(),
|
59
|
-
retryCount: zod.z.number().int().nonnegative().optional(),
|
60
|
-
policyId: zod.z.string().optional(),
|
61
|
-
msSinceQueue: zod.z.number().nonnegative().optional(),
|
62
|
-
msSinceSend: zod.z.number().nonnegative().optional(),
|
63
|
-
msTotalDuration: zod.z.number().nonnegative().optional(),
|
64
|
-
swapId: zod.z.string().optional(),
|
65
|
-
tokenAddress: zod.z.string().optional(),
|
66
|
-
amountWei: zod.z.string().optional(),
|
67
|
-
amountUSDCents: zod.z.number().nonnegative().optional(),
|
68
|
-
httpMethod: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]).optional(),
|
69
|
-
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
70
|
-
ecosystemId: zod.z.string().optional(),
|
71
|
-
ecosystemPartnerId: zod.z.string().optional(),
|
72
|
-
chainName: zod.z.string().optional(),
|
73
|
-
tokenSymbol: zod.z.string().optional(),
|
74
|
-
dstChainId: zod.z.number().optional(),
|
75
|
-
dstTokenAddress: zod.z.string().optional(),
|
76
|
-
dstChainName: zod.z.string().optional(),
|
77
|
-
dstTokenSymbol: zod.z.string().optional(),
|
78
|
-
msLatency: zod.z.number().optional(),
|
79
|
-
toAmountUSDCents: zod.z.number().optional(),
|
80
|
-
secondaryProvider: zod.z.string().optional(),
|
81
|
-
onRampId: zod.z.string().optional(),
|
82
|
-
evmRequestParams: zod.z.string().optional(),
|
83
|
-
providerIp: zod.z.string().optional()
|
84
|
-
});
|
85
19
|
/**
|
86
20
|
* Publish usage events. Provide the relevant fields for your application.
|
87
21
|
*
|
@@ -105,7 +39,7 @@ async function publishUsageEvents(usageEvents, config) {
|
|
105
39
|
} = config;
|
106
40
|
const entries = usageEvents.map(event => {
|
107
41
|
// Enforce schema of usage event.
|
108
|
-
const parsed = usageEventSchema.parse(event);
|
42
|
+
const parsed = index.usageEventSchema.parse(event);
|
109
43
|
return {
|
110
44
|
Id: crypto.randomUUID(),
|
111
45
|
MessageBody: JSON.stringify(parsed)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { a as authorize } from '../../dist/index-
|
2
|
-
export { r as rateLimit,
|
1
|
+
import { u as usageEventSchema, a as authorize } from '../../dist/index-5dc16842.esm.js';
|
2
|
+
export { r as rateLimit, b as usageLimit } from '../../dist/index-5dc16842.esm.js';
|
3
3
|
import { AwsClient } from 'aws4fetch';
|
4
|
-
import { z } from 'zod';
|
5
4
|
export { d as SERVICES, S as SERVICE_DEFINITIONS, c as SERVICE_NAMES, g as getServiceByName } from '../../dist/client-8440b8fb.esm.js';
|
5
|
+
import 'zod';
|
6
6
|
|
7
7
|
// Initialize a singleton for AWS usage.
|
8
8
|
let _aws;
|
@@ -13,72 +13,6 @@ function getAws(options) {
|
|
13
13
|
return _aws;
|
14
14
|
}
|
15
15
|
|
16
|
-
/**
|
17
|
-
* Types
|
18
|
-
*/
|
19
|
-
const usageEventSchema = z.object({
|
20
|
-
source: z.enum(["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]),
|
21
|
-
action: z.string(),
|
22
|
-
/**
|
23
|
-
* The following fields are optional.
|
24
|
-
*/
|
25
|
-
|
26
|
-
accountId: z.string().optional(),
|
27
|
-
isClientEvent: z.boolean().optional(),
|
28
|
-
apiKeyId: z.string().optional(),
|
29
|
-
creatorWalletAddress: z.string().optional(),
|
30
|
-
clientId: z.string().optional(),
|
31
|
-
walletAddress: z.string().optional(),
|
32
|
-
walletType: z.string().optional(),
|
33
|
-
chainId: z.number().int().positive().optional(),
|
34
|
-
provider: z.string().optional(),
|
35
|
-
mimeType: z.string().optional(),
|
36
|
-
fileSize: z.number().int().nonnegative().optional(),
|
37
|
-
fileCid: z.string().optional(),
|
38
|
-
evmMethod: z.string().optional(),
|
39
|
-
userOpHash: z.string().optional(),
|
40
|
-
gasLimit: z.number().nonnegative().optional(),
|
41
|
-
gasPricePerUnit: z.string().optional(),
|
42
|
-
transactionFeeUsd: z.number().optional(),
|
43
|
-
transactionHash: z.string().optional(),
|
44
|
-
sdkName: z.string().optional(),
|
45
|
-
sdkVersion: z.string().optional(),
|
46
|
-
sdkPlatform: z.string().optional(),
|
47
|
-
sdkOS: z.string().optional(),
|
48
|
-
productName: z.string().optional(),
|
49
|
-
transactionValue: z.string().optional(),
|
50
|
-
pathname: z.string().optional(),
|
51
|
-
contractAddress: z.string().optional(),
|
52
|
-
errorCode: z.string().optional(),
|
53
|
-
httpStatusCode: z.number().int().nonnegative().optional(),
|
54
|
-
functionName: z.string().optional(),
|
55
|
-
extension: z.string().optional(),
|
56
|
-
retryCount: z.number().int().nonnegative().optional(),
|
57
|
-
policyId: z.string().optional(),
|
58
|
-
msSinceQueue: z.number().nonnegative().optional(),
|
59
|
-
msSinceSend: z.number().nonnegative().optional(),
|
60
|
-
msTotalDuration: z.number().nonnegative().optional(),
|
61
|
-
swapId: z.string().optional(),
|
62
|
-
tokenAddress: z.string().optional(),
|
63
|
-
amountWei: z.string().optional(),
|
64
|
-
amountUSDCents: z.number().nonnegative().optional(),
|
65
|
-
httpMethod: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]).optional(),
|
66
|
-
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
67
|
-
ecosystemId: z.string().optional(),
|
68
|
-
ecosystemPartnerId: z.string().optional(),
|
69
|
-
chainName: z.string().optional(),
|
70
|
-
tokenSymbol: z.string().optional(),
|
71
|
-
dstChainId: z.number().optional(),
|
72
|
-
dstTokenAddress: z.string().optional(),
|
73
|
-
dstChainName: z.string().optional(),
|
74
|
-
dstTokenSymbol: z.string().optional(),
|
75
|
-
msLatency: z.number().optional(),
|
76
|
-
toAmountUSDCents: z.number().optional(),
|
77
|
-
secondaryProvider: z.string().optional(),
|
78
|
-
onRampId: z.string().optional(),
|
79
|
-
evmRequestParams: z.string().optional(),
|
80
|
-
providerIp: z.string().optional()
|
81
|
-
});
|
82
16
|
/**
|
83
17
|
* Publish usage events. Provide the relevant fields for your application.
|
84
18
|
*
|
@@ -1,183 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
/**
|
3
|
-
* Types
|
4
|
-
*/
|
5
|
-
declare const usageEventSchema: z.ZodObject<{
|
6
|
-
source: z.ZodEnum<["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]>;
|
7
|
-
action: z.ZodString;
|
8
|
-
/**
|
9
|
-
* The following fields are optional.
|
10
|
-
*/
|
11
|
-
accountId: z.ZodOptional<z.ZodString>;
|
12
|
-
isClientEvent: z.ZodOptional<z.ZodBoolean>;
|
13
|
-
apiKeyId: z.ZodOptional<z.ZodString>;
|
14
|
-
creatorWalletAddress: z.ZodOptional<z.ZodString>;
|
15
|
-
clientId: z.ZodOptional<z.ZodString>;
|
16
|
-
walletAddress: z.ZodOptional<z.ZodString>;
|
17
|
-
walletType: z.ZodOptional<z.ZodString>;
|
18
|
-
chainId: z.ZodOptional<z.ZodNumber>;
|
19
|
-
provider: z.ZodOptional<z.ZodString>;
|
20
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
21
|
-
fileSize: z.ZodOptional<z.ZodNumber>;
|
22
|
-
fileCid: z.ZodOptional<z.ZodString>;
|
23
|
-
evmMethod: z.ZodOptional<z.ZodString>;
|
24
|
-
userOpHash: z.ZodOptional<z.ZodString>;
|
25
|
-
gasLimit: z.ZodOptional<z.ZodNumber>;
|
26
|
-
gasPricePerUnit: z.ZodOptional<z.ZodString>;
|
27
|
-
transactionFeeUsd: z.ZodOptional<z.ZodNumber>;
|
28
|
-
transactionHash: z.ZodOptional<z.ZodString>;
|
29
|
-
sdkName: z.ZodOptional<z.ZodString>;
|
30
|
-
sdkVersion: z.ZodOptional<z.ZodString>;
|
31
|
-
sdkPlatform: z.ZodOptional<z.ZodString>;
|
32
|
-
sdkOS: z.ZodOptional<z.ZodString>;
|
33
|
-
productName: z.ZodOptional<z.ZodString>;
|
34
|
-
transactionValue: z.ZodOptional<z.ZodString>;
|
35
|
-
pathname: z.ZodOptional<z.ZodString>;
|
36
|
-
contractAddress: z.ZodOptional<z.ZodString>;
|
37
|
-
errorCode: z.ZodOptional<z.ZodString>;
|
38
|
-
httpStatusCode: z.ZodOptional<z.ZodNumber>;
|
39
|
-
functionName: z.ZodOptional<z.ZodString>;
|
40
|
-
extension: z.ZodOptional<z.ZodString>;
|
41
|
-
retryCount: z.ZodOptional<z.ZodNumber>;
|
42
|
-
policyId: z.ZodOptional<z.ZodString>;
|
43
|
-
msSinceQueue: z.ZodOptional<z.ZodNumber>;
|
44
|
-
msSinceSend: z.ZodOptional<z.ZodNumber>;
|
45
|
-
msTotalDuration: z.ZodOptional<z.ZodNumber>;
|
46
|
-
swapId: z.ZodOptional<z.ZodString>;
|
47
|
-
tokenAddress: z.ZodOptional<z.ZodString>;
|
48
|
-
amountWei: z.ZodOptional<z.ZodString>;
|
49
|
-
amountUSDCents: z.ZodOptional<z.ZodNumber>;
|
50
|
-
httpMethod: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]>>;
|
51
|
-
ecosystemId: z.ZodOptional<z.ZodString>;
|
52
|
-
ecosystemPartnerId: z.ZodOptional<z.ZodString>;
|
53
|
-
chainName: z.ZodOptional<z.ZodString>;
|
54
|
-
tokenSymbol: z.ZodOptional<z.ZodString>;
|
55
|
-
dstChainId: z.ZodOptional<z.ZodNumber>;
|
56
|
-
dstTokenAddress: z.ZodOptional<z.ZodString>;
|
57
|
-
dstChainName: z.ZodOptional<z.ZodString>;
|
58
|
-
dstTokenSymbol: z.ZodOptional<z.ZodString>;
|
59
|
-
msLatency: z.ZodOptional<z.ZodNumber>;
|
60
|
-
toAmountUSDCents: z.ZodOptional<z.ZodNumber>;
|
61
|
-
secondaryProvider: z.ZodOptional<z.ZodString>;
|
62
|
-
onRampId: z.ZodOptional<z.ZodString>;
|
63
|
-
evmRequestParams: z.ZodOptional<z.ZodString>;
|
64
|
-
providerIp: z.ZodOptional<z.ZodString>;
|
65
|
-
}, "strip", z.ZodTypeAny, {
|
66
|
-
source: "storage" | "rpc" | "bundler" | "relayer" | "embeddedWallets" | "pay" | "ecosystemWallets" | "paymaster" | "connectWallet" | "checkout" | "engine" | "rpcV2";
|
67
|
-
action: string;
|
68
|
-
errorCode?: string | undefined;
|
69
|
-
clientId?: string | undefined;
|
70
|
-
creatorWalletAddress?: string | undefined;
|
71
|
-
accountId?: string | undefined;
|
72
|
-
isClientEvent?: boolean | undefined;
|
73
|
-
apiKeyId?: string | undefined;
|
74
|
-
walletAddress?: string | undefined;
|
75
|
-
walletType?: string | undefined;
|
76
|
-
chainId?: number | undefined;
|
77
|
-
provider?: string | undefined;
|
78
|
-
mimeType?: string | undefined;
|
79
|
-
fileSize?: number | undefined;
|
80
|
-
fileCid?: string | undefined;
|
81
|
-
evmMethod?: string | undefined;
|
82
|
-
userOpHash?: string | undefined;
|
83
|
-
gasLimit?: number | undefined;
|
84
|
-
gasPricePerUnit?: string | undefined;
|
85
|
-
transactionFeeUsd?: number | undefined;
|
86
|
-
transactionHash?: string | undefined;
|
87
|
-
sdkName?: string | undefined;
|
88
|
-
sdkVersion?: string | undefined;
|
89
|
-
sdkPlatform?: string | undefined;
|
90
|
-
sdkOS?: string | undefined;
|
91
|
-
productName?: string | undefined;
|
92
|
-
transactionValue?: string | undefined;
|
93
|
-
pathname?: string | undefined;
|
94
|
-
contractAddress?: string | undefined;
|
95
|
-
httpStatusCode?: number | undefined;
|
96
|
-
functionName?: string | undefined;
|
97
|
-
extension?: string | undefined;
|
98
|
-
retryCount?: number | undefined;
|
99
|
-
policyId?: string | undefined;
|
100
|
-
msSinceQueue?: number | undefined;
|
101
|
-
msSinceSend?: number | undefined;
|
102
|
-
msTotalDuration?: number | undefined;
|
103
|
-
swapId?: string | undefined;
|
104
|
-
tokenAddress?: string | undefined;
|
105
|
-
amountWei?: string | undefined;
|
106
|
-
amountUSDCents?: number | undefined;
|
107
|
-
httpMethod?: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE" | undefined;
|
108
|
-
ecosystemId?: string | undefined;
|
109
|
-
ecosystemPartnerId?: string | undefined;
|
110
|
-
chainName?: string | undefined;
|
111
|
-
tokenSymbol?: string | undefined;
|
112
|
-
dstChainId?: number | undefined;
|
113
|
-
dstTokenAddress?: string | undefined;
|
114
|
-
dstChainName?: string | undefined;
|
115
|
-
dstTokenSymbol?: string | undefined;
|
116
|
-
msLatency?: number | undefined;
|
117
|
-
toAmountUSDCents?: number | undefined;
|
118
|
-
secondaryProvider?: string | undefined;
|
119
|
-
onRampId?: string | undefined;
|
120
|
-
evmRequestParams?: string | undefined;
|
121
|
-
providerIp?: string | undefined;
|
122
|
-
}, {
|
123
|
-
source: "storage" | "rpc" | "bundler" | "relayer" | "embeddedWallets" | "pay" | "ecosystemWallets" | "paymaster" | "connectWallet" | "checkout" | "engine" | "rpcV2";
|
124
|
-
action: string;
|
125
|
-
errorCode?: string | undefined;
|
126
|
-
clientId?: string | undefined;
|
127
|
-
creatorWalletAddress?: string | undefined;
|
128
|
-
accountId?: string | undefined;
|
129
|
-
isClientEvent?: boolean | undefined;
|
130
|
-
apiKeyId?: string | undefined;
|
131
|
-
walletAddress?: string | undefined;
|
132
|
-
walletType?: string | undefined;
|
133
|
-
chainId?: number | undefined;
|
134
|
-
provider?: string | undefined;
|
135
|
-
mimeType?: string | undefined;
|
136
|
-
fileSize?: number | undefined;
|
137
|
-
fileCid?: string | undefined;
|
138
|
-
evmMethod?: string | undefined;
|
139
|
-
userOpHash?: string | undefined;
|
140
|
-
gasLimit?: number | undefined;
|
141
|
-
gasPricePerUnit?: string | undefined;
|
142
|
-
transactionFeeUsd?: number | undefined;
|
143
|
-
transactionHash?: string | undefined;
|
144
|
-
sdkName?: string | undefined;
|
145
|
-
sdkVersion?: string | undefined;
|
146
|
-
sdkPlatform?: string | undefined;
|
147
|
-
sdkOS?: string | undefined;
|
148
|
-
productName?: string | undefined;
|
149
|
-
transactionValue?: string | undefined;
|
150
|
-
pathname?: string | undefined;
|
151
|
-
contractAddress?: string | undefined;
|
152
|
-
httpStatusCode?: number | undefined;
|
153
|
-
functionName?: string | undefined;
|
154
|
-
extension?: string | undefined;
|
155
|
-
retryCount?: number | undefined;
|
156
|
-
policyId?: string | undefined;
|
157
|
-
msSinceQueue?: number | undefined;
|
158
|
-
msSinceSend?: number | undefined;
|
159
|
-
msTotalDuration?: number | undefined;
|
160
|
-
swapId?: string | undefined;
|
161
|
-
tokenAddress?: string | undefined;
|
162
|
-
amountWei?: string | undefined;
|
163
|
-
amountUSDCents?: number | undefined;
|
164
|
-
httpMethod?: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE" | undefined;
|
165
|
-
ecosystemId?: string | undefined;
|
166
|
-
ecosystemPartnerId?: string | undefined;
|
167
|
-
chainName?: string | undefined;
|
168
|
-
tokenSymbol?: string | undefined;
|
169
|
-
dstChainId?: number | undefined;
|
170
|
-
dstTokenAddress?: string | undefined;
|
171
|
-
dstChainName?: string | undefined;
|
172
|
-
dstTokenSymbol?: string | undefined;
|
173
|
-
msLatency?: number | undefined;
|
174
|
-
toAmountUSDCents?: number | undefined;
|
175
|
-
secondaryProvider?: string | undefined;
|
176
|
-
onRampId?: string | undefined;
|
177
|
-
evmRequestParams?: string | undefined;
|
178
|
-
providerIp?: string | undefined;
|
179
|
-
}>;
|
180
|
-
export type UsageEvent = z.infer<typeof usageEventSchema>;
|
1
|
+
import { type UsageEvent } from "../core/usage";
|
181
2
|
/**
|
182
3
|
* Publish usage events. Provide the relevant fields for your application.
|
183
4
|
*
|
@@ -192,11 +13,11 @@ export type UsageEvent = z.infer<typeof usageEventSchema>;
|
|
192
13
|
* @param usageEvents
|
193
14
|
* @param config
|
194
15
|
*/
|
195
|
-
|
16
|
+
declare function publishUsageEvents(usageEvents: UsageEvent[], config: {
|
196
17
|
queueUrl: string;
|
197
18
|
accessKeyId: string;
|
198
19
|
secretAccessKey: string;
|
199
20
|
region?: string;
|
200
21
|
}): Promise<void>;
|
201
|
-
export {};
|
22
|
+
export { publishUsageEvents, type UsageEvent };
|
202
23
|
//# sourceMappingURL=usage.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"../../../../src/cf-worker","sources":["usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"../../../../src/cf-worker","sources":["usage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,eAAe,CAAC;AAWlE;;;;;;;;;;;;;GAaG;AACH,iBAAe,kBAAkB,CAC/B,WAAW,EAAE,UAAU,EAAE,EACzB,MAAM,EAAE;IACN,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAAC,IAAI,CAAC,CAiCf;AAED,OAAO,EAAE,kBAAkB,EAAE,KAAK,UAAU,EAAE,CAAC"}
|
@@ -0,0 +1,181 @@
|
|
1
|
+
import { z } from "zod";
|
2
|
+
export declare const usageEventSchema: z.ZodObject<{
|
3
|
+
source: z.ZodEnum<["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]>;
|
4
|
+
action: z.ZodString;
|
5
|
+
/**
|
6
|
+
* The following fields are optional.
|
7
|
+
*/
|
8
|
+
accountId: z.ZodOptional<z.ZodString>;
|
9
|
+
isClientEvent: z.ZodOptional<z.ZodBoolean>;
|
10
|
+
apiKeyId: z.ZodOptional<z.ZodString>;
|
11
|
+
creatorWalletAddress: z.ZodOptional<z.ZodString>;
|
12
|
+
clientId: z.ZodOptional<z.ZodString>;
|
13
|
+
walletAddress: z.ZodOptional<z.ZodString>;
|
14
|
+
walletType: z.ZodOptional<z.ZodString>;
|
15
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
16
|
+
provider: z.ZodOptional<z.ZodString>;
|
17
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
18
|
+
fileSize: z.ZodOptional<z.ZodNumber>;
|
19
|
+
fileCid: z.ZodOptional<z.ZodString>;
|
20
|
+
evmMethod: z.ZodOptional<z.ZodString>;
|
21
|
+
userOpHash: z.ZodOptional<z.ZodString>;
|
22
|
+
gasLimit: z.ZodOptional<z.ZodNumber>;
|
23
|
+
gasPricePerUnit: z.ZodOptional<z.ZodString>;
|
24
|
+
transactionFeeUsd: z.ZodOptional<z.ZodNumber>;
|
25
|
+
transactionHash: z.ZodOptional<z.ZodString>;
|
26
|
+
sdkName: z.ZodOptional<z.ZodString>;
|
27
|
+
sdkVersion: z.ZodOptional<z.ZodString>;
|
28
|
+
sdkPlatform: z.ZodOptional<z.ZodString>;
|
29
|
+
sdkOS: z.ZodOptional<z.ZodString>;
|
30
|
+
productName: z.ZodOptional<z.ZodString>;
|
31
|
+
transactionValue: z.ZodOptional<z.ZodString>;
|
32
|
+
pathname: z.ZodOptional<z.ZodString>;
|
33
|
+
contractAddress: z.ZodOptional<z.ZodString>;
|
34
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
35
|
+
httpStatusCode: z.ZodOptional<z.ZodNumber>;
|
36
|
+
functionName: z.ZodOptional<z.ZodString>;
|
37
|
+
extension: z.ZodOptional<z.ZodString>;
|
38
|
+
retryCount: z.ZodOptional<z.ZodNumber>;
|
39
|
+
policyId: z.ZodOptional<z.ZodString>;
|
40
|
+
msSinceQueue: z.ZodOptional<z.ZodNumber>;
|
41
|
+
msSinceSend: z.ZodOptional<z.ZodNumber>;
|
42
|
+
msTotalDuration: z.ZodOptional<z.ZodNumber>;
|
43
|
+
swapId: z.ZodOptional<z.ZodString>;
|
44
|
+
tokenAddress: z.ZodOptional<z.ZodString>;
|
45
|
+
amountWei: z.ZodOptional<z.ZodString>;
|
46
|
+
amountUSDCents: z.ZodOptional<z.ZodNumber>;
|
47
|
+
httpMethod: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]>>;
|
48
|
+
ecosystemId: z.ZodOptional<z.ZodString>;
|
49
|
+
ecosystemPartnerId: z.ZodOptional<z.ZodString>;
|
50
|
+
authenticationMethod: z.ZodOptional<z.ZodString>;
|
51
|
+
chainName: z.ZodOptional<z.ZodString>;
|
52
|
+
tokenSymbol: z.ZodOptional<z.ZodString>;
|
53
|
+
dstChainId: z.ZodOptional<z.ZodNumber>;
|
54
|
+
dstTokenAddress: z.ZodOptional<z.ZodString>;
|
55
|
+
dstChainName: z.ZodOptional<z.ZodString>;
|
56
|
+
dstTokenSymbol: z.ZodOptional<z.ZodString>;
|
57
|
+
msLatency: z.ZodOptional<z.ZodNumber>;
|
58
|
+
toAmountUSDCents: z.ZodOptional<z.ZodNumber>;
|
59
|
+
secondaryProvider: z.ZodOptional<z.ZodString>;
|
60
|
+
onRampId: z.ZodOptional<z.ZodString>;
|
61
|
+
evmRequestParams: z.ZodOptional<z.ZodString>;
|
62
|
+
providerIp: z.ZodOptional<z.ZodString>;
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
64
|
+
source: "storage" | "rpc" | "bundler" | "relayer" | "embeddedWallets" | "pay" | "ecosystemWallets" | "paymaster" | "connectWallet" | "checkout" | "engine" | "rpcV2";
|
65
|
+
action: string;
|
66
|
+
errorCode?: string | undefined;
|
67
|
+
clientId?: string | undefined;
|
68
|
+
creatorWalletAddress?: string | undefined;
|
69
|
+
accountId?: string | undefined;
|
70
|
+
isClientEvent?: boolean | undefined;
|
71
|
+
apiKeyId?: string | undefined;
|
72
|
+
walletAddress?: string | undefined;
|
73
|
+
walletType?: string | undefined;
|
74
|
+
chainId?: number | undefined;
|
75
|
+
provider?: string | undefined;
|
76
|
+
mimeType?: string | undefined;
|
77
|
+
fileSize?: number | undefined;
|
78
|
+
fileCid?: string | undefined;
|
79
|
+
evmMethod?: string | undefined;
|
80
|
+
userOpHash?: string | undefined;
|
81
|
+
gasLimit?: number | undefined;
|
82
|
+
gasPricePerUnit?: string | undefined;
|
83
|
+
transactionFeeUsd?: number | undefined;
|
84
|
+
transactionHash?: string | undefined;
|
85
|
+
sdkName?: string | undefined;
|
86
|
+
sdkVersion?: string | undefined;
|
87
|
+
sdkPlatform?: string | undefined;
|
88
|
+
sdkOS?: string | undefined;
|
89
|
+
productName?: string | undefined;
|
90
|
+
transactionValue?: string | undefined;
|
91
|
+
pathname?: string | undefined;
|
92
|
+
contractAddress?: string | undefined;
|
93
|
+
httpStatusCode?: number | undefined;
|
94
|
+
functionName?: string | undefined;
|
95
|
+
extension?: string | undefined;
|
96
|
+
retryCount?: number | undefined;
|
97
|
+
policyId?: string | undefined;
|
98
|
+
msSinceQueue?: number | undefined;
|
99
|
+
msSinceSend?: number | undefined;
|
100
|
+
msTotalDuration?: number | undefined;
|
101
|
+
swapId?: string | undefined;
|
102
|
+
tokenAddress?: string | undefined;
|
103
|
+
amountWei?: string | undefined;
|
104
|
+
amountUSDCents?: number | undefined;
|
105
|
+
httpMethod?: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE" | undefined;
|
106
|
+
ecosystemId?: string | undefined;
|
107
|
+
ecosystemPartnerId?: string | undefined;
|
108
|
+
authenticationMethod?: string | undefined;
|
109
|
+
chainName?: string | undefined;
|
110
|
+
tokenSymbol?: string | undefined;
|
111
|
+
dstChainId?: number | undefined;
|
112
|
+
dstTokenAddress?: string | undefined;
|
113
|
+
dstChainName?: string | undefined;
|
114
|
+
dstTokenSymbol?: string | undefined;
|
115
|
+
msLatency?: number | undefined;
|
116
|
+
toAmountUSDCents?: number | undefined;
|
117
|
+
secondaryProvider?: string | undefined;
|
118
|
+
onRampId?: string | undefined;
|
119
|
+
evmRequestParams?: string | undefined;
|
120
|
+
providerIp?: string | undefined;
|
121
|
+
}, {
|
122
|
+
source: "storage" | "rpc" | "bundler" | "relayer" | "embeddedWallets" | "pay" | "ecosystemWallets" | "paymaster" | "connectWallet" | "checkout" | "engine" | "rpcV2";
|
123
|
+
action: string;
|
124
|
+
errorCode?: string | undefined;
|
125
|
+
clientId?: string | undefined;
|
126
|
+
creatorWalletAddress?: string | undefined;
|
127
|
+
accountId?: string | undefined;
|
128
|
+
isClientEvent?: boolean | undefined;
|
129
|
+
apiKeyId?: string | undefined;
|
130
|
+
walletAddress?: string | undefined;
|
131
|
+
walletType?: string | undefined;
|
132
|
+
chainId?: number | undefined;
|
133
|
+
provider?: string | undefined;
|
134
|
+
mimeType?: string | undefined;
|
135
|
+
fileSize?: number | undefined;
|
136
|
+
fileCid?: string | undefined;
|
137
|
+
evmMethod?: string | undefined;
|
138
|
+
userOpHash?: string | undefined;
|
139
|
+
gasLimit?: number | undefined;
|
140
|
+
gasPricePerUnit?: string | undefined;
|
141
|
+
transactionFeeUsd?: number | undefined;
|
142
|
+
transactionHash?: string | undefined;
|
143
|
+
sdkName?: string | undefined;
|
144
|
+
sdkVersion?: string | undefined;
|
145
|
+
sdkPlatform?: string | undefined;
|
146
|
+
sdkOS?: string | undefined;
|
147
|
+
productName?: string | undefined;
|
148
|
+
transactionValue?: string | undefined;
|
149
|
+
pathname?: string | undefined;
|
150
|
+
contractAddress?: string | undefined;
|
151
|
+
httpStatusCode?: number | undefined;
|
152
|
+
functionName?: string | undefined;
|
153
|
+
extension?: string | undefined;
|
154
|
+
retryCount?: number | undefined;
|
155
|
+
policyId?: string | undefined;
|
156
|
+
msSinceQueue?: number | undefined;
|
157
|
+
msSinceSend?: number | undefined;
|
158
|
+
msTotalDuration?: number | undefined;
|
159
|
+
swapId?: string | undefined;
|
160
|
+
tokenAddress?: string | undefined;
|
161
|
+
amountWei?: string | undefined;
|
162
|
+
amountUSDCents?: number | undefined;
|
163
|
+
httpMethod?: "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE" | undefined;
|
164
|
+
ecosystemId?: string | undefined;
|
165
|
+
ecosystemPartnerId?: string | undefined;
|
166
|
+
authenticationMethod?: string | undefined;
|
167
|
+
chainName?: string | undefined;
|
168
|
+
tokenSymbol?: string | undefined;
|
169
|
+
dstChainId?: number | undefined;
|
170
|
+
dstTokenAddress?: string | undefined;
|
171
|
+
dstChainName?: string | undefined;
|
172
|
+
dstTokenSymbol?: string | undefined;
|
173
|
+
msLatency?: number | undefined;
|
174
|
+
toAmountUSDCents?: number | undefined;
|
175
|
+
secondaryProvider?: string | undefined;
|
176
|
+
onRampId?: string | undefined;
|
177
|
+
evmRequestParams?: string | undefined;
|
178
|
+
providerIp?: string | undefined;
|
179
|
+
}>;
|
180
|
+
export type UsageEvent = z.infer<typeof usageEventSchema>;
|
181
|
+
//# sourceMappingURL=usage.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"../../../../src/core","sources":["usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;IAiB3B;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsEH,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
@@ -3,6 +3,7 @@ import type { CoreServiceConfig } from "../core/api";
|
|
3
3
|
import type { AuthorizationInput } from "../core/authorize";
|
4
4
|
import type { AuthorizationResult } from "../core/authorize/types";
|
5
5
|
import type { CoreAuthInput } from "../core/types";
|
6
|
+
export * from "../core/usage";
|
6
7
|
export * from "../core/rateLimit";
|
7
8
|
export * from "../core/services";
|
8
9
|
export * from "../core/usageLimit";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/node","sources":["index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,eAAe,EACf,cAAc,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,KAAK,iBAAiB,GAAG,iBAAiB,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC,GAAG,EAAE,eAAe,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,iBAAiB,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAsB9B;AAaD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,GACnB,kBAAkB,CA2FpB;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,UAE9C;AAED,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,UAEpE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,EACH,GAAG,EACH,QAAQ,EACR,aAAa,EACb,SAAS,GACV,EAAE,SAAS,GAAG;IAEb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,QAwBA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/node","sources":["index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,eAAe,EACf,cAAc,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,KAAK,iBAAiB,GAAG,iBAAiB,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC,GAAG,EAAE,eAAe,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,iBAAiB,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAsB9B;AAaD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,GACnB,kBAAkB,CA2FpB;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,UAE9C;AAED,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,UAEpE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,EACH,GAAG,EACH,QAAQ,EACR,aAAa,EACb,SAAS,GACV,EAAE,SAAS,GAAG;IAEb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,QAwBA"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
var client = require('./client-84e46164.cjs.prod.js');
|
4
|
+
var zod = require('zod');
|
4
5
|
|
5
6
|
async function fetchKeyMetadataFromApi(clientId, config) {
|
6
7
|
const {
|
@@ -349,6 +350,71 @@ async function authorize(authData, serviceConfig, cacheOptions) {
|
|
349
350
|
};
|
350
351
|
}
|
351
352
|
|
353
|
+
const usageEventSchema = zod.z.object({
|
354
|
+
source: zod.z.enum(["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]),
|
355
|
+
action: zod.z.string(),
|
356
|
+
/**
|
357
|
+
* The following fields are optional.
|
358
|
+
*/
|
359
|
+
|
360
|
+
accountId: zod.z.string().optional(),
|
361
|
+
isClientEvent: zod.z.boolean().optional(),
|
362
|
+
apiKeyId: zod.z.string().optional(),
|
363
|
+
creatorWalletAddress: zod.z.string().optional(),
|
364
|
+
clientId: zod.z.string().optional(),
|
365
|
+
walletAddress: zod.z.string().optional(),
|
366
|
+
walletType: zod.z.string().optional(),
|
367
|
+
chainId: zod.z.number().int().positive().optional(),
|
368
|
+
provider: zod.z.string().optional(),
|
369
|
+
mimeType: zod.z.string().optional(),
|
370
|
+
fileSize: zod.z.number().int().nonnegative().optional(),
|
371
|
+
fileCid: zod.z.string().optional(),
|
372
|
+
evmMethod: zod.z.string().optional(),
|
373
|
+
userOpHash: zod.z.string().optional(),
|
374
|
+
gasLimit: zod.z.number().nonnegative().optional(),
|
375
|
+
gasPricePerUnit: zod.z.string().optional(),
|
376
|
+
transactionFeeUsd: zod.z.number().optional(),
|
377
|
+
transactionHash: zod.z.string().optional(),
|
378
|
+
sdkName: zod.z.string().optional(),
|
379
|
+
sdkVersion: zod.z.string().optional(),
|
380
|
+
sdkPlatform: zod.z.string().optional(),
|
381
|
+
sdkOS: zod.z.string().optional(),
|
382
|
+
productName: zod.z.string().optional(),
|
383
|
+
transactionValue: zod.z.string().optional(),
|
384
|
+
pathname: zod.z.string().optional(),
|
385
|
+
contractAddress: zod.z.string().optional(),
|
386
|
+
errorCode: zod.z.string().optional(),
|
387
|
+
httpStatusCode: zod.z.number().int().nonnegative().optional(),
|
388
|
+
functionName: zod.z.string().optional(),
|
389
|
+
extension: zod.z.string().optional(),
|
390
|
+
retryCount: zod.z.number().int().nonnegative().optional(),
|
391
|
+
policyId: zod.z.string().optional(),
|
392
|
+
msSinceQueue: zod.z.number().nonnegative().optional(),
|
393
|
+
msSinceSend: zod.z.number().nonnegative().optional(),
|
394
|
+
msTotalDuration: zod.z.number().nonnegative().optional(),
|
395
|
+
swapId: zod.z.string().optional(),
|
396
|
+
tokenAddress: zod.z.string().optional(),
|
397
|
+
amountWei: zod.z.string().optional(),
|
398
|
+
amountUSDCents: zod.z.number().nonnegative().optional(),
|
399
|
+
httpMethod: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]).optional(),
|
400
|
+
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
401
|
+
ecosystemId: zod.z.string().optional(),
|
402
|
+
ecosystemPartnerId: zod.z.string().optional(),
|
403
|
+
authenticationMethod: zod.z.string().optional(),
|
404
|
+
chainName: zod.z.string().optional(),
|
405
|
+
tokenSymbol: zod.z.string().optional(),
|
406
|
+
dstChainId: zod.z.number().optional(),
|
407
|
+
dstTokenAddress: zod.z.string().optional(),
|
408
|
+
dstChainName: zod.z.string().optional(),
|
409
|
+
dstTokenSymbol: zod.z.string().optional(),
|
410
|
+
msLatency: zod.z.number().optional(),
|
411
|
+
toAmountUSDCents: zod.z.number().optional(),
|
412
|
+
secondaryProvider: zod.z.string().optional(),
|
413
|
+
onRampId: zod.z.string().optional(),
|
414
|
+
evmRequestParams: zod.z.string().optional(),
|
415
|
+
providerIp: zod.z.string().optional()
|
416
|
+
});
|
417
|
+
|
352
418
|
const RATE_LIMIT_WINDOW_SECONDS = 10;
|
353
419
|
|
354
420
|
// Redis interface compatible with ioredis (Node) and upstash (Cloudflare Workers).
|
@@ -470,4 +536,5 @@ async function usageLimit(authzResult, serviceConfig) {
|
|
470
536
|
|
471
537
|
exports.authorize = authorize;
|
472
538
|
exports.rateLimit = rateLimit;
|
539
|
+
exports.usageEventSchema = usageEventSchema;
|
473
540
|
exports.usageLimit = usageLimit;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { e as authorizeClient } from './client-8440b8fb.esm.js';
|
2
|
+
import { z } from 'zod';
|
2
3
|
|
3
4
|
async function fetchKeyMetadataFromApi(clientId, config) {
|
4
5
|
const {
|
@@ -347,6 +348,71 @@ async function authorize(authData, serviceConfig, cacheOptions) {
|
|
347
348
|
};
|
348
349
|
}
|
349
350
|
|
351
|
+
const usageEventSchema = z.object({
|
352
|
+
source: z.enum(["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]),
|
353
|
+
action: z.string(),
|
354
|
+
/**
|
355
|
+
* The following fields are optional.
|
356
|
+
*/
|
357
|
+
|
358
|
+
accountId: z.string().optional(),
|
359
|
+
isClientEvent: z.boolean().optional(),
|
360
|
+
apiKeyId: z.string().optional(),
|
361
|
+
creatorWalletAddress: z.string().optional(),
|
362
|
+
clientId: z.string().optional(),
|
363
|
+
walletAddress: z.string().optional(),
|
364
|
+
walletType: z.string().optional(),
|
365
|
+
chainId: z.number().int().positive().optional(),
|
366
|
+
provider: z.string().optional(),
|
367
|
+
mimeType: z.string().optional(),
|
368
|
+
fileSize: z.number().int().nonnegative().optional(),
|
369
|
+
fileCid: z.string().optional(),
|
370
|
+
evmMethod: z.string().optional(),
|
371
|
+
userOpHash: z.string().optional(),
|
372
|
+
gasLimit: z.number().nonnegative().optional(),
|
373
|
+
gasPricePerUnit: z.string().optional(),
|
374
|
+
transactionFeeUsd: z.number().optional(),
|
375
|
+
transactionHash: z.string().optional(),
|
376
|
+
sdkName: z.string().optional(),
|
377
|
+
sdkVersion: z.string().optional(),
|
378
|
+
sdkPlatform: z.string().optional(),
|
379
|
+
sdkOS: z.string().optional(),
|
380
|
+
productName: z.string().optional(),
|
381
|
+
transactionValue: z.string().optional(),
|
382
|
+
pathname: z.string().optional(),
|
383
|
+
contractAddress: z.string().optional(),
|
384
|
+
errorCode: z.string().optional(),
|
385
|
+
httpStatusCode: z.number().int().nonnegative().optional(),
|
386
|
+
functionName: z.string().optional(),
|
387
|
+
extension: z.string().optional(),
|
388
|
+
retryCount: z.number().int().nonnegative().optional(),
|
389
|
+
policyId: z.string().optional(),
|
390
|
+
msSinceQueue: z.number().nonnegative().optional(),
|
391
|
+
msSinceSend: z.number().nonnegative().optional(),
|
392
|
+
msTotalDuration: z.number().nonnegative().optional(),
|
393
|
+
swapId: z.string().optional(),
|
394
|
+
tokenAddress: z.string().optional(),
|
395
|
+
amountWei: z.string().optional(),
|
396
|
+
amountUSDCents: z.number().nonnegative().optional(),
|
397
|
+
httpMethod: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]).optional(),
|
398
|
+
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
399
|
+
ecosystemId: z.string().optional(),
|
400
|
+
ecosystemPartnerId: z.string().optional(),
|
401
|
+
authenticationMethod: z.string().optional(),
|
402
|
+
chainName: z.string().optional(),
|
403
|
+
tokenSymbol: z.string().optional(),
|
404
|
+
dstChainId: z.number().optional(),
|
405
|
+
dstTokenAddress: z.string().optional(),
|
406
|
+
dstChainName: z.string().optional(),
|
407
|
+
dstTokenSymbol: z.string().optional(),
|
408
|
+
msLatency: z.number().optional(),
|
409
|
+
toAmountUSDCents: z.number().optional(),
|
410
|
+
secondaryProvider: z.string().optional(),
|
411
|
+
onRampId: z.string().optional(),
|
412
|
+
evmRequestParams: z.string().optional(),
|
413
|
+
providerIp: z.string().optional()
|
414
|
+
});
|
415
|
+
|
350
416
|
const RATE_LIMIT_WINDOW_SECONDS = 10;
|
351
417
|
|
352
418
|
// Redis interface compatible with ioredis (Node) and upstash (Cloudflare Workers).
|
@@ -466,4 +532,4 @@ async function usageLimit(authzResult, serviceConfig) {
|
|
466
532
|
};
|
467
533
|
}
|
468
534
|
|
469
|
-
export { authorize as a, rateLimit as r,
|
535
|
+
export { authorize as a, usageLimit as b, rateLimit as r, usageEventSchema as u };
|
@@ -1,6 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
var client = require('./client-a5cc5822.cjs.dev.js');
|
4
|
+
var zod = require('zod');
|
4
5
|
|
5
6
|
async function fetchKeyMetadataFromApi(clientId, config) {
|
6
7
|
const {
|
@@ -349,6 +350,71 @@ async function authorize(authData, serviceConfig, cacheOptions) {
|
|
349
350
|
};
|
350
351
|
}
|
351
352
|
|
353
|
+
const usageEventSchema = zod.z.object({
|
354
|
+
source: zod.z.enum(["ecosystemWallets", "embeddedWallets", "rpc", "storage", "bundler", "paymaster", "relayer", "connectWallet", "checkout", "engine", "pay", "rpcV2"]),
|
355
|
+
action: zod.z.string(),
|
356
|
+
/**
|
357
|
+
* The following fields are optional.
|
358
|
+
*/
|
359
|
+
|
360
|
+
accountId: zod.z.string().optional(),
|
361
|
+
isClientEvent: zod.z.boolean().optional(),
|
362
|
+
apiKeyId: zod.z.string().optional(),
|
363
|
+
creatorWalletAddress: zod.z.string().optional(),
|
364
|
+
clientId: zod.z.string().optional(),
|
365
|
+
walletAddress: zod.z.string().optional(),
|
366
|
+
walletType: zod.z.string().optional(),
|
367
|
+
chainId: zod.z.number().int().positive().optional(),
|
368
|
+
provider: zod.z.string().optional(),
|
369
|
+
mimeType: zod.z.string().optional(),
|
370
|
+
fileSize: zod.z.number().int().nonnegative().optional(),
|
371
|
+
fileCid: zod.z.string().optional(),
|
372
|
+
evmMethod: zod.z.string().optional(),
|
373
|
+
userOpHash: zod.z.string().optional(),
|
374
|
+
gasLimit: zod.z.number().nonnegative().optional(),
|
375
|
+
gasPricePerUnit: zod.z.string().optional(),
|
376
|
+
transactionFeeUsd: zod.z.number().optional(),
|
377
|
+
transactionHash: zod.z.string().optional(),
|
378
|
+
sdkName: zod.z.string().optional(),
|
379
|
+
sdkVersion: zod.z.string().optional(),
|
380
|
+
sdkPlatform: zod.z.string().optional(),
|
381
|
+
sdkOS: zod.z.string().optional(),
|
382
|
+
productName: zod.z.string().optional(),
|
383
|
+
transactionValue: zod.z.string().optional(),
|
384
|
+
pathname: zod.z.string().optional(),
|
385
|
+
contractAddress: zod.z.string().optional(),
|
386
|
+
errorCode: zod.z.string().optional(),
|
387
|
+
httpStatusCode: zod.z.number().int().nonnegative().optional(),
|
388
|
+
functionName: zod.z.string().optional(),
|
389
|
+
extension: zod.z.string().optional(),
|
390
|
+
retryCount: zod.z.number().int().nonnegative().optional(),
|
391
|
+
policyId: zod.z.string().optional(),
|
392
|
+
msSinceQueue: zod.z.number().nonnegative().optional(),
|
393
|
+
msSinceSend: zod.z.number().nonnegative().optional(),
|
394
|
+
msTotalDuration: zod.z.number().nonnegative().optional(),
|
395
|
+
swapId: zod.z.string().optional(),
|
396
|
+
tokenAddress: zod.z.string().optional(),
|
397
|
+
amountWei: zod.z.string().optional(),
|
398
|
+
amountUSDCents: zod.z.number().nonnegative().optional(),
|
399
|
+
httpMethod: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "CONNECT", "OPTIONS", "TRACE"]).optional(),
|
400
|
+
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
401
|
+
ecosystemId: zod.z.string().optional(),
|
402
|
+
ecosystemPartnerId: zod.z.string().optional(),
|
403
|
+
authenticationMethod: zod.z.string().optional(),
|
404
|
+
chainName: zod.z.string().optional(),
|
405
|
+
tokenSymbol: zod.z.string().optional(),
|
406
|
+
dstChainId: zod.z.number().optional(),
|
407
|
+
dstTokenAddress: zod.z.string().optional(),
|
408
|
+
dstChainName: zod.z.string().optional(),
|
409
|
+
dstTokenSymbol: zod.z.string().optional(),
|
410
|
+
msLatency: zod.z.number().optional(),
|
411
|
+
toAmountUSDCents: zod.z.number().optional(),
|
412
|
+
secondaryProvider: zod.z.string().optional(),
|
413
|
+
onRampId: zod.z.string().optional(),
|
414
|
+
evmRequestParams: zod.z.string().optional(),
|
415
|
+
providerIp: zod.z.string().optional()
|
416
|
+
});
|
417
|
+
|
352
418
|
const RATE_LIMIT_WINDOW_SECONDS = 10;
|
353
419
|
|
354
420
|
// Redis interface compatible with ioredis (Node) and upstash (Cloudflare Workers).
|
@@ -470,4 +536,5 @@ async function usageLimit(authzResult, serviceConfig) {
|
|
470
536
|
|
471
537
|
exports.authorize = authorize;
|
472
538
|
exports.rateLimit = rateLimit;
|
539
|
+
exports.usageEventSchema = usageEventSchema;
|
473
540
|
exports.usageLimit = usageLimit;
|
@@ -3,8 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var node_crypto = require('node:crypto');
|
6
|
-
var index = require('../../dist/index-
|
6
|
+
var index = require('../../dist/index-88f1ffb6.cjs.dev.js');
|
7
7
|
var client = require('../../dist/client-a5cc5822.cjs.dev.js');
|
8
|
+
require('zod');
|
8
9
|
|
9
10
|
/**
|
10
11
|
*
|
@@ -176,6 +177,7 @@ function logHttpRequest(_ref) {
|
|
176
177
|
}
|
177
178
|
|
178
179
|
exports.rateLimit = index.rateLimit;
|
180
|
+
exports.usageEventSchema = index.usageEventSchema;
|
179
181
|
exports.usageLimit = index.usageLimit;
|
180
182
|
exports.SERVICES = client.SERVICES;
|
181
183
|
exports.SERVICE_DEFINITIONS = client.SERVICE_DEFINITIONS;
|
@@ -3,8 +3,9 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var node_crypto = require('node:crypto');
|
6
|
-
var index = require('../../dist/index-
|
6
|
+
var index = require('../../dist/index-23f268d8.cjs.prod.js');
|
7
7
|
var client = require('../../dist/client-84e46164.cjs.prod.js');
|
8
|
+
require('zod');
|
8
9
|
|
9
10
|
/**
|
10
11
|
*
|
@@ -176,6 +177,7 @@ function logHttpRequest(_ref) {
|
|
176
177
|
}
|
177
178
|
|
178
179
|
exports.rateLimit = index.rateLimit;
|
180
|
+
exports.usageEventSchema = index.usageEventSchema;
|
179
181
|
exports.usageLimit = index.usageLimit;
|
180
182
|
exports.SERVICES = client.SERVICES;
|
181
183
|
exports.SERVICE_DEFINITIONS = client.SERVICE_DEFINITIONS;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { createHash } from 'node:crypto';
|
2
|
-
import { a as authorize } from '../../dist/index-
|
3
|
-
export { r as rateLimit, u as usageLimit } from '../../dist/index-
|
2
|
+
import { a as authorize } from '../../dist/index-5dc16842.esm.js';
|
3
|
+
export { r as rateLimit, u as usageEventSchema, b as usageLimit } from '../../dist/index-5dc16842.esm.js';
|
4
4
|
export { d as SERVICES, S as SERVICE_DEFINITIONS, c as SERVICE_NAMES, g as getServiceByName } from '../../dist/client-8440b8fb.esm.js';
|
5
|
+
import 'zod';
|
5
6
|
|
6
7
|
/**
|
7
8
|
*
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@thirdweb-dev/service-utils",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.38-nightly-997c3945a7673517fb28273a9985f70ff892b365-20240817000330",
|
4
4
|
"main": "dist/thirdweb-dev-service-utils.cjs.js",
|
5
5
|
"module": "dist/thirdweb-dev-service-utils.esm.js",
|
6
6
|
"exports": {
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"@preconstruct/cli": "2.7.0",
|
48
48
|
"@thirdweb-dev/tsconfig": "^0.1.7",
|
49
49
|
"@types/node": "20.14.9",
|
50
|
-
"typescript": "5.5.
|
50
|
+
"typescript": "5.5.4"
|
51
51
|
},
|
52
52
|
"scripts": {
|
53
53
|
"format": "biome format ./src --write",
|