@droplinked_inc/web3-kit 2.0.0 → 3.0.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/CHANGELOG.md +33 -0
- package/README.md +2 -0
- package/THREAT_MODEL.md +1 -1
- package/dist/types.d.ts +14 -58
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -6
- package/dist/types.js.map +1 -1
- package/dist/zod-compat.d.ts +14 -0
- package/dist/zod-compat.d.ts.map +1 -0
- package/dist/zod-compat.js +16 -0
- package/dist/zod-compat.js.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @droplinked_inc/web3-kit
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- d1970bb: **Breaking: move to zod 4 (`zod ^4.6.7`).** Clears GHSA-mrhx-c7xc-m3w5 (zod < 4.6.6).
|
|
8
|
+
|
|
9
|
+
Breaking because the package re-exports zod schemas (`Uint256Schema`, `ChainPaymentSchema`, `PurchaseSignatureSchema`, `EvmAddressSchema`, …): they are now zod 4 schema objects, and a `ZodError` thrown by `.parse()` is zod 4's.
|
|
10
|
+
|
|
11
|
+
Unchanged: what every schema accepts and returns, the inferred types and the custom error messages. `Uint256Schema` still accepts integer JS numbers past `Number.MAX_SAFE_INTEGER` (e.g. `1e18` wei), which zod 4's `.int()` alone would reject (`schema-behaviour.test.ts`, written against zod 3 and passing on both).
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [d1970bb]
|
|
16
|
+
- @droplinked_inc/wallet-connection@0.5.0
|
|
17
|
+
|
|
18
|
+
## 2.0.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- a947b41: chore(security): re-enable npm provenance attestations via OIDC trusted publisher.
|
|
23
|
+
|
|
24
|
+
The first-publish wave (5-18) shipped with `provenance: false` because the
|
|
25
|
+
npmjs.com trusted-publisher binding for `@droplinked_inc/*` had not yet been
|
|
26
|
+
configured — provenance requires OIDC, which requires the binding. Now that
|
|
27
|
+
all 10 packages are live on npm, this changeset re-enables provenance and
|
|
28
|
+
removes the legacy `NPM_TOKEN` fallback from `release.yml` so the next
|
|
29
|
+
publish cuts a verifiable attestation.
|
|
30
|
+
|
|
31
|
+
No source changes; patch bump only to force re-publish on next release run.
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [a947b41]
|
|
34
|
+
- @droplinked_inc/wallet-connection@0.4.1
|
|
35
|
+
|
|
3
36
|
## 2.0.0
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @droplinked_inc/web3-kit
|
|
2
2
|
|
|
3
|
+
> Replaces `droplinked-web3-kit`. See [MIGRATION.md](../../docs/MIGRATION.md) for the swap path.
|
|
4
|
+
|
|
3
5
|
Higher-level web3 building blocks for the Droplinked frontend stack: a
|
|
4
6
|
frozen chain registry, a hard-coded known-token registry, decimal-safe
|
|
5
7
|
display formatters, and viem-backed transaction builders.
|
package/THREAT_MODEL.md
CHANGED
|
@@ -122,7 +122,7 @@ under). Frozen-ness is asserted in unit tests.
|
|
|
122
122
|
|
|
123
123
|
- `viem@^2.21` — ABI encoding and `formatUnits`/`parseUnits`. Pure
|
|
124
124
|
JS, no native dependencies.
|
|
125
|
-
- `zod@^
|
|
125
|
+
- `zod@^4.6.7` — schema validation. No regex back-references; all
|
|
126
126
|
patterns are linear-time.
|
|
127
127
|
|
|
128
128
|
No `ethers`, no `web3.js` — both were direct dependencies of v1.0.13
|
package/dist/types.d.ts
CHANGED
|
@@ -35,10 +35,10 @@ export declare enum Groups {
|
|
|
35
35
|
XION = "XION",
|
|
36
36
|
UD = "UD"
|
|
37
37
|
}
|
|
38
|
-
export declare const ChainsSchema: z.
|
|
39
|
-
export declare const NetworkSchema: z.
|
|
40
|
-
export declare const GroupsSchema: z.
|
|
41
|
-
export declare const EvmAddressSchema: z.
|
|
38
|
+
export declare const ChainsSchema: z.ZodEnum<typeof Chains>;
|
|
39
|
+
export declare const NetworkSchema: z.ZodEnum<typeof Network>;
|
|
40
|
+
export declare const GroupsSchema: z.ZodEnum<typeof Groups>;
|
|
41
|
+
export declare const EvmAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
42
42
|
export type EvmAddress = `0x${string}`;
|
|
43
43
|
export declare const HexStringSchema: z.ZodString;
|
|
44
44
|
/**
|
|
@@ -47,7 +47,7 @@ export declare const HexStringSchema: z.ZodString;
|
|
|
47
47
|
* normalizes to bigint. Negative, fractional, or out-of-range
|
|
48
48
|
* inputs are rejected.
|
|
49
49
|
*/
|
|
50
|
-
export declare const Uint256Schema: z.
|
|
50
|
+
export declare const Uint256Schema: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
51
51
|
export type Uint256 = bigint;
|
|
52
52
|
/**
|
|
53
53
|
* Canonical short-symbol identifier for known fiat-equivalent or
|
|
@@ -67,73 +67,29 @@ export declare enum PaymentTokens {
|
|
|
67
67
|
DAI = "DAI",
|
|
68
68
|
WETH = "WETH"
|
|
69
69
|
}
|
|
70
|
-
export declare const PaymentTokensSchema: z.
|
|
70
|
+
export declare const PaymentTokensSchema: z.ZodEnum<typeof PaymentTokens>;
|
|
71
71
|
export declare const ChainPaymentSchema: z.ZodObject<{
|
|
72
|
-
totalPrice: z.
|
|
73
|
-
tbdValues: z.ZodArray<z.
|
|
74
|
-
tbdReceivers: z.ZodArray<z.
|
|
75
|
-
tokenAddress: z.ZodOptional<z.
|
|
72
|
+
totalPrice: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>;
|
|
73
|
+
tbdValues: z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodTransform<bigint, string | number | bigint>>>;
|
|
74
|
+
tbdReceivers: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
75
|
+
tokenAddress: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
76
76
|
memo: z.ZodString;
|
|
77
77
|
chainLinkRoundId: z.ZodOptional<z.ZodString>;
|
|
78
|
-
},
|
|
79
|
-
totalPrice: bigint;
|
|
80
|
-
tbdValues: bigint[];
|
|
81
|
-
tbdReceivers: `0x${string}`[];
|
|
82
|
-
memo: string;
|
|
83
|
-
tokenAddress?: `0x${string}` | undefined;
|
|
84
|
-
chainLinkRoundId?: string | undefined;
|
|
85
|
-
}, {
|
|
86
|
-
totalPrice: string | number | bigint;
|
|
87
|
-
tbdValues: (string | number | bigint)[];
|
|
88
|
-
tbdReceivers: string[];
|
|
89
|
-
memo: string;
|
|
90
|
-
tokenAddress?: string | undefined;
|
|
91
|
-
chainLinkRoundId?: string | undefined;
|
|
92
|
-
}>;
|
|
78
|
+
}, z.core.$strip>;
|
|
93
79
|
export type IChainPayment = z.infer<typeof ChainPaymentSchema>;
|
|
94
80
|
export declare const PurchaseConfirmationDataSchema: z.ZodArray<z.ZodObject<{
|
|
95
81
|
amount: z.ZodNumber;
|
|
96
82
|
productId: z.ZodString;
|
|
97
83
|
nullifier: z.ZodString;
|
|
98
|
-
},
|
|
99
|
-
amount: number;
|
|
100
|
-
productId: string;
|
|
101
|
-
nullifier: string;
|
|
102
|
-
}, {
|
|
103
|
-
amount: number;
|
|
104
|
-
productId: string;
|
|
105
|
-
nullifier: string;
|
|
106
|
-
}>, "many">;
|
|
84
|
+
}, z.core.$strip>>;
|
|
107
85
|
export declare const PurchaseSignatureSchema: z.ZodObject<{
|
|
108
86
|
signature: z.ZodString;
|
|
109
87
|
purchaseData: z.ZodArray<z.ZodObject<{
|
|
110
88
|
amount: z.ZodNumber;
|
|
111
89
|
productId: z.ZodString;
|
|
112
90
|
nullifier: z.ZodString;
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
productId: string;
|
|
116
|
-
nullifier: string;
|
|
117
|
-
}, {
|
|
118
|
-
amount: number;
|
|
119
|
-
productId: string;
|
|
120
|
-
nullifier: string;
|
|
121
|
-
}>, "many">;
|
|
122
|
-
}, "strip", z.ZodTypeAny, {
|
|
123
|
-
signature: string;
|
|
124
|
-
purchaseData: {
|
|
125
|
-
amount: number;
|
|
126
|
-
productId: string;
|
|
127
|
-
nullifier: string;
|
|
128
|
-
}[];
|
|
129
|
-
}, {
|
|
130
|
-
signature: string;
|
|
131
|
-
purchaseData: {
|
|
132
|
-
amount: number;
|
|
133
|
-
productId: string;
|
|
134
|
-
nullifier: string;
|
|
135
|
-
}[];
|
|
136
|
-
}>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
137
93
|
export type PurchaseSignature = z.infer<typeof PurchaseSignatureSchema>;
|
|
138
94
|
export declare const ZERO_ADDRESS: EvmAddress;
|
|
139
95
|
export declare enum NFTType {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;GAIG;AACH,oBAAY,MAAM;IAChB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,QAAQ,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IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,WAAW;IACrB,OAAO,IAAI;IACX,GAAG,IAAI;IACP,QAAQ,IAAI;CACb;AAED,oBAAY,OAAO;IACjB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
|
package/dist/types.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* schemas. See THREAT_MODEL.md for the rationale on each invariant.
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
+
import { integer } from './zod-compat.js';
|
|
9
10
|
/* -------------------------------------------------------------------------- */
|
|
10
11
|
/* Chain identifiers (preserved 1:1 with the original v1.0.13 surface) */
|
|
11
12
|
/* -------------------------------------------------------------------------- */
|
|
@@ -41,9 +42,9 @@ export var Groups;
|
|
|
41
42
|
Groups["XION"] = "XION";
|
|
42
43
|
Groups["UD"] = "UD";
|
|
43
44
|
})(Groups || (Groups = {}));
|
|
44
|
-
export const ChainsSchema = z.
|
|
45
|
-
export const NetworkSchema = z.
|
|
46
|
-
export const GroupsSchema = z.
|
|
45
|
+
export const ChainsSchema = z.enum(Chains);
|
|
46
|
+
export const NetworkSchema = z.enum(Network);
|
|
47
|
+
export const GroupsSchema = z.enum(Groups);
|
|
47
48
|
/* -------------------------------------------------------------------------- */
|
|
48
49
|
/* EVM primitives */
|
|
49
50
|
/* -------------------------------------------------------------------------- */
|
|
@@ -63,7 +64,7 @@ export const HexStringSchema = z
|
|
|
63
64
|
export const Uint256Schema = z
|
|
64
65
|
.union([
|
|
65
66
|
z.bigint(),
|
|
66
|
-
|
|
67
|
+
integer().nonnegative(),
|
|
67
68
|
z.string().regex(/^\d+$/u),
|
|
68
69
|
])
|
|
69
70
|
.transform((v) => (typeof v === 'bigint' ? v : BigInt(v)))
|
|
@@ -90,7 +91,7 @@ export var PaymentTokens;
|
|
|
90
91
|
PaymentTokens["DAI"] = "DAI";
|
|
91
92
|
PaymentTokens["WETH"] = "WETH";
|
|
92
93
|
})(PaymentTokens || (PaymentTokens = {}));
|
|
93
|
-
export const PaymentTokensSchema = z.
|
|
94
|
+
export const PaymentTokensSchema = z.enum(PaymentTokens);
|
|
94
95
|
/* -------------------------------------------------------------------------- */
|
|
95
96
|
/* Chain payment payload (replaces v1.0.13's `IChainPayment`) */
|
|
96
97
|
/* -------------------------------------------------------------------------- */
|
|
@@ -106,7 +107,7 @@ export const ChainPaymentSchema = z.object({
|
|
|
106
107
|
/* Purchase / claim signature */
|
|
107
108
|
/* -------------------------------------------------------------------------- */
|
|
108
109
|
export const PurchaseConfirmationDataSchema = z.array(z.object({
|
|
109
|
-
amount:
|
|
110
|
+
amount: integer().nonnegative(),
|
|
110
111
|
productId: z.string().min(1).max(128),
|
|
111
112
|
nullifier: z.string().regex(/^0x[a-fA-F0-9]{1,128}$/u),
|
|
112
113
|
}));
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAN,IAAY,MAYX;AAZD,WAAY,MAAM;IAChB,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,yBAAe,CAAA;IACf,qBAAW,CAAA;IACX,2BAAiB,CAAA;IACjB,+BAAqB,CAAA;IACrB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACr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,CAAC,CAAC,KAAK,CACnD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,OAAO,EAAE,CAAC,WAAW,EAAE;IAC/B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC;CACvD,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,EAAE,qCAAqC,CAAC;IAC3F,YAAY,EAAE,8BAA8B;CAC7C,CAAC,CAAC;AAIH,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAe,4CAA4C,CAAC;AAErF,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,2CAAW,CAAA;IACX,yCAAU,CAAA;AACZ,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,2CAAO,CAAA;IACP,qDAAY,CAAA;AACd,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,8BAAmB,CAAA;IACnB,gCAAqB,CAAA;IACrB,4BAAiB,CAAA;IACjB,wBAAa,CAAA;IACb,0BAAe,CAAA;AACjB,CAAC,EANW,OAAO,KAAP,OAAO,QAMlB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behaviour-preserving schema primitive for the zod 3 -> zod 4 migration.
|
|
3
|
+
*
|
|
4
|
+
* zod 4's `z.number().int()` also rejects integers beyond
|
|
5
|
+
* `Number.MAX_SAFE_INTEGER`; zod 3 accepted any integer. `Uint256Schema`
|
|
6
|
+
* takes JS numbers for convenience (e.g. `1e18` wei), so keeping zod 3's
|
|
7
|
+
* acceptance set is what keeps those callers working.
|
|
8
|
+
*
|
|
9
|
+
* Internal: not re-exported from the package entry point.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
/** Any integer, as zod 3's `z.number().int()` accepted. */
|
|
13
|
+
export declare function integer(): z.ZodNumber;
|
|
14
|
+
//# sourceMappingURL=zod-compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-compat.d.ts","sourceRoot":"","sources":["../src/zod-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2DAA2D;AAC3D,wBAAgB,OAAO,gBAEtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behaviour-preserving schema primitive for the zod 3 -> zod 4 migration.
|
|
3
|
+
*
|
|
4
|
+
* zod 4's `z.number().int()` also rejects integers beyond
|
|
5
|
+
* `Number.MAX_SAFE_INTEGER`; zod 3 accepted any integer. `Uint256Schema`
|
|
6
|
+
* takes JS numbers for convenience (e.g. `1e18` wei), so keeping zod 3's
|
|
7
|
+
* acceptance set is what keeps those callers working.
|
|
8
|
+
*
|
|
9
|
+
* Internal: not re-exported from the package entry point.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
/** Any integer, as zod 3's `z.number().int()` accepted. */
|
|
13
|
+
export function integer() {
|
|
14
|
+
return z.number().refine(Number.isInteger, { error: 'Expected integer, received float' });
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=zod-compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-compat.js","sourceRoot":"","sources":["../src/zod-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2DAA2D;AAC3D,MAAM,UAAU,OAAO;IACrB,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,kCAAkC,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droplinked_inc/web3-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Higher-level web3 building blocks (chain registry, known-token registry, display formatters, tx builders) — hardened rebuild of the original droplinked-web3-kit@1.0.13.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"viem": "^2.21.0",
|
|
24
|
-
"zod": "^
|
|
24
|
+
"zod": "^4.6.7"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@droplinked_inc/wallet-connection": "0.
|
|
27
|
+
"@droplinked_inc/wallet-connection": "0.5.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/jest": "^29.5.12",
|
|
31
31
|
"@types/node": "^22.5.0",
|
|
32
32
|
"fast-check": "^3.22.0",
|
|
33
33
|
"typescript": "^5.6.0",
|
|
34
|
-
"@droplinked_inc/wallet-connection": "0.
|
|
34
|
+
"@droplinked_inc/wallet-connection": "0.5.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"provenance": false,
|