gondi 0.35.0 → 0.36.1
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/dist/index.mjs +44 -44
- package/dist/index.mjs.map +4 -4
- package/dist/src/utils/typedData.d.ts +22 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type TypedDataField = {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
};
|
|
5
|
+
type TypedDataTypes = Record<string, readonly TypedDataField[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the sign typed data parameters with the message reduced to the fields declared in
|
|
8
|
+
* `types`, recursing into nested structs and arrays.
|
|
9
|
+
*
|
|
10
|
+
* Extra properties do not change the EIP-712 hash, but they are serialized into the
|
|
11
|
+
* `eth_signTypedData_v4` request, so wallets display them and wallet security checks scan them:
|
|
12
|
+
* Rabby warns that "the transaction is not associated with the website that initiated it" when a
|
|
13
|
+
* URL anywhere in the payload does not match the connected site. Structs assembled by spreading
|
|
14
|
+
* API objects (offers carrying nested NFT and collection data) must therefore be stripped before
|
|
15
|
+
* reaching the wallet.
|
|
16
|
+
*/
|
|
17
|
+
export declare const sanitizeTypedDataMessage: <const TParameters extends {
|
|
18
|
+
primaryType: string;
|
|
19
|
+
types: TypedDataTypes;
|
|
20
|
+
message: Record<string, unknown>;
|
|
21
|
+
}>(parameters: TParameters) => TParameters;
|
|
22
|
+
export {};
|