@snapshot-labs/snapshot.js 0.12.60 → 0.12.62
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/snapshot.cjs.js +2 -1
- package/dist/snapshot.esm.js +2 -1
- package/dist/snapshot.min.js +215 -13
- package/dist/src/verify/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/utils.ts +4 -1
- package/src/verify/index.ts +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StarknetType } from 'starknet';
|
|
2
2
|
import type { TypedDataField } from '@ethersproject/abstract-signer';
|
|
3
3
|
import type { ProviderOptions } from '../utils/provider';
|
|
4
4
|
export type SignaturePayload = {
|
|
5
5
|
domain: Record<string, string | number>;
|
|
6
|
-
types: Record<string,
|
|
6
|
+
types: Record<string, StarknetType[] | TypedDataField[]>;
|
|
7
7
|
primaryType?: string;
|
|
8
8
|
message: Record<string, any>;
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snapshot-labs/snapshot.js",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.62",
|
|
4
4
|
"repository": "snapshot-labs/snapshot.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/snapshot.cjs.js",
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
"cross-fetch": "^3.1.6",
|
|
25
25
|
"json-to-graphql-query": "^2.2.4",
|
|
26
26
|
"lodash.set": "^4.3.2",
|
|
27
|
-
"starknet": "^
|
|
27
|
+
"starknet": "^6.11.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@rollup/plugin-commonjs": "^18.1.0",
|
|
31
|
+
"@rollup/plugin-inject": "^5.0.5",
|
|
31
32
|
"@rollup/plugin-node-resolve": "^11.0.1",
|
|
32
33
|
"@types/node": "^13.9.5",
|
|
33
34
|
"@typescript-eslint/eslint-plugin": "^4.28.2",
|
|
@@ -42,7 +43,6 @@
|
|
|
42
43
|
"rollup-plugin-filesize": "^9.1.2",
|
|
43
44
|
"rollup-plugin-json": "^4.0.0",
|
|
44
45
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
45
|
-
"rollup-plugin-node-globals": "^1.4.0",
|
|
46
46
|
"rollup-plugin-string": "^3.0.0",
|
|
47
47
|
"rollup-plugin-terser": "^7.0.0",
|
|
48
48
|
"rollup-plugin-typescript2": "^0.27.0",
|
package/src/utils.ts
CHANGED
|
@@ -794,7 +794,10 @@ function isValidNetwork(network: string) {
|
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
function isValidAddress(address: string) {
|
|
797
|
-
return
|
|
797
|
+
return (
|
|
798
|
+
address !== EMPTY_ADDRESS &&
|
|
799
|
+
(isAddress(address) || isStarknetAddress(address))
|
|
800
|
+
);
|
|
798
801
|
}
|
|
799
802
|
|
|
800
803
|
function isValidSnapshot(snapshot: number | string, network: string) {
|
package/src/verify/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as starknet from './starknet';
|
|
2
2
|
import * as evm from './evm';
|
|
3
3
|
import { isEvmAddress, isStarknetAddress } from '../utils';
|
|
4
|
-
import type {
|
|
4
|
+
import type { StarknetType } from 'starknet';
|
|
5
5
|
import type { TypedDataField } from '@ethersproject/abstract-signer';
|
|
6
6
|
import type { ProviderOptions } from '../utils/provider';
|
|
7
7
|
|
|
8
8
|
export type SignaturePayload = {
|
|
9
9
|
domain: Record<string, string | number>;
|
|
10
|
-
types: Record<string,
|
|
10
|
+
types: Record<string, StarknetType[] | TypedDataField[]>;
|
|
11
11
|
primaryType?: string;
|
|
12
12
|
message: Record<string, any>;
|
|
13
13
|
};
|