@0xsequence/replacer 1.1.0 → 1.1.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/dist/0xsequence-replacer.cjs.dev.js +9 -9
- package/dist/0xsequence-replacer.cjs.prod.js +9 -9
- package/dist/0xsequence-replacer.esm.js +9 -9
- package/dist/declarations/src/cached.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/cached.ts +11 -12
- package/src/index.ts +14 -15
- package/src/ipfs.ts +0 -1
|
@@ -41,17 +41,17 @@ function eip5719Contract(address, provider) {
|
|
|
41
41
|
// TODO: for some reason walletContracts is not being loaded from local
|
|
42
42
|
// remove this code once fixed
|
|
43
43
|
const abi = [{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
inputs: [{
|
|
45
|
+
internalType: 'bytes32',
|
|
46
|
+
type: 'bytes32'
|
|
47
47
|
}],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
name: 'getAlternativeSignature',
|
|
49
|
+
outputs: [{
|
|
50
|
+
internalType: 'string',
|
|
51
|
+
type: 'string'
|
|
52
52
|
}],
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
stateMutability: 'view',
|
|
54
|
+
type: 'function'
|
|
55
55
|
}];
|
|
56
56
|
return new ethers.ethers.Contract(address, abi, provider);
|
|
57
57
|
}
|
|
@@ -41,17 +41,17 @@ function eip5719Contract(address, provider) {
|
|
|
41
41
|
// TODO: for some reason walletContracts is not being loaded from local
|
|
42
42
|
// remove this code once fixed
|
|
43
43
|
const abi = [{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
inputs: [{
|
|
45
|
+
internalType: 'bytes32',
|
|
46
|
+
type: 'bytes32'
|
|
47
47
|
}],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
name: 'getAlternativeSignature',
|
|
49
|
+
outputs: [{
|
|
50
|
+
internalType: 'string',
|
|
51
|
+
type: 'string'
|
|
52
52
|
}],
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
stateMutability: 'view',
|
|
54
|
+
type: 'function'
|
|
55
55
|
}];
|
|
56
56
|
return new ethers.ethers.Contract(address, abi, provider);
|
|
57
57
|
}
|
|
@@ -37,17 +37,17 @@ function eip5719Contract(address, provider) {
|
|
|
37
37
|
// TODO: for some reason walletContracts is not being loaded from local
|
|
38
38
|
// remove this code once fixed
|
|
39
39
|
const abi = [{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
inputs: [{
|
|
41
|
+
internalType: 'bytes32',
|
|
42
|
+
type: 'bytes32'
|
|
43
43
|
}],
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
name: 'getAlternativeSignature',
|
|
45
|
+
outputs: [{
|
|
46
|
+
internalType: 'string',
|
|
47
|
+
type: 'string'
|
|
48
48
|
}],
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
stateMutability: 'view',
|
|
50
|
+
type: 'function'
|
|
51
51
|
}];
|
|
52
52
|
return new ethers.Contract(address, abi, provider);
|
|
53
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ethers } from
|
|
1
|
+
import { ethers } from 'ethers';
|
|
2
2
|
export * from "./cached.js";
|
|
3
3
|
export declare function eip5719Contract(address: string, provider: ethers.providers.Provider): ethers.Contract;
|
|
4
4
|
export declare function eip1271Contract(address: string, provider: ethers.providers.Provider): ethers.Contract;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/replacer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "EIP-5719 client implementation",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/replacer",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"author": "Horizon Blockchain Games",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@0xsequence/
|
|
13
|
-
"@0xsequence/
|
|
12
|
+
"@0xsequence/abi": "1.1.2",
|
|
13
|
+
"@0xsequence/core": "1.1.2"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"ethers": ">=5.5"
|
package/src/cached.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ethers } from
|
|
2
|
-
import { runByEIP5719, URISolver } from
|
|
1
|
+
import { ethers } from 'ethers'
|
|
2
|
+
import { runByEIP5719, URISolver } from '.'
|
|
3
3
|
|
|
4
4
|
export class CachedEIP5719 {
|
|
5
5
|
constructor(
|
|
@@ -8,16 +8,15 @@ export class CachedEIP5719 {
|
|
|
8
8
|
public window: number = 1000
|
|
9
9
|
) {}
|
|
10
10
|
|
|
11
|
-
private pending: Map<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
private pending: Map<
|
|
12
|
+
string,
|
|
13
|
+
{
|
|
14
|
+
timestamp: number
|
|
15
|
+
promise: Promise<ethers.BytesLike>
|
|
16
|
+
}
|
|
17
|
+
> = new Map()
|
|
15
18
|
|
|
16
|
-
async runByEIP5719(
|
|
17
|
-
address: string,
|
|
18
|
-
digest: ethers.BytesLike,
|
|
19
|
-
signature: ethers.BytesLike
|
|
20
|
-
): Promise<ethers.BytesLike> {
|
|
19
|
+
async runByEIP5719(address: string, digest: ethers.BytesLike, signature: ethers.BytesLike): Promise<ethers.BytesLike> {
|
|
21
20
|
const key = `${address}-${digest}-${signature}`
|
|
22
21
|
const now = Date.now()
|
|
23
22
|
|
|
@@ -29,4 +28,4 @@ export class CachedEIP5719 {
|
|
|
29
28
|
this.pending.set(key, { timestamp: now, promise })
|
|
30
29
|
return promise
|
|
31
30
|
}
|
|
32
|
-
}
|
|
31
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
+
import { ethers } from 'ethers'
|
|
2
|
+
import { walletContracts } from '@0xsequence/abi'
|
|
3
|
+
import { isIPFS, useGateway } from './ipfs'
|
|
4
|
+
import { commons } from '@0xsequence/core'
|
|
1
5
|
|
|
2
|
-
|
|
3
|
-
import { walletContracts } from "@0xsequence/abi"
|
|
4
|
-
import { isIPFS, useGateway } from "./ipfs"
|
|
5
|
-
import { commons } from "@0xsequence/core"
|
|
6
|
-
|
|
7
|
-
export * from "./cached"
|
|
6
|
+
export * from './cached'
|
|
8
7
|
|
|
9
8
|
export function eip5719Contract(address: string, provider: ethers.providers.Provider): ethers.Contract {
|
|
10
9
|
// TODO: for some reason walletContracts is not being loaded from local
|
|
11
10
|
// remove this code once fixed
|
|
12
11
|
const abi = [
|
|
13
12
|
{
|
|
14
|
-
|
|
13
|
+
inputs: [
|
|
15
14
|
{
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
internalType: 'bytes32',
|
|
16
|
+
type: 'bytes32'
|
|
18
17
|
}
|
|
19
18
|
],
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
name: 'getAlternativeSignature',
|
|
20
|
+
outputs: [
|
|
22
21
|
{
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
internalType: 'string',
|
|
23
|
+
type: 'string'
|
|
25
24
|
}
|
|
26
25
|
],
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
stateMutability: 'view',
|
|
27
|
+
type: 'function'
|
|
29
28
|
}
|
|
30
29
|
]
|
|
31
30
|
|
package/src/ipfs.ts
CHANGED