gun-eth 1.2.5 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +11 -17
- package/package.json +1 -1
package/index.js
CHANGED
@@ -3,11 +3,6 @@ const SEA = require("gun/sea");
|
|
3
3
|
const ethers = require("ethers");
|
4
4
|
const SHINE = require("./SHINE.json");
|
5
5
|
|
6
|
-
/* import Gun from "gun";
|
7
|
-
import SEA from "gun/sea";
|
8
|
-
import { ethers } from "ethers";
|
9
|
-
import SHINE from "./SHINE.json"; */
|
10
|
-
|
11
6
|
const SHINE_ABI = SHINE.abi;
|
12
7
|
const SHINE_OPTIMISM_SEPOLIA = SHINE.address;
|
13
8
|
|
@@ -25,18 +20,17 @@ Gun.chain.setToken = function (token) {
|
|
25
20
|
return this;
|
26
21
|
};
|
27
22
|
|
28
|
-
Gun.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
});
|
23
|
+
Gun.chain.getToken = function () {
|
24
|
+
return customToken;
|
25
|
+
};
|
26
|
+
|
27
|
+
Gun.on("put", function (msg) {
|
28
|
+
const to = this.to;
|
29
|
+
// Usa il token personalizzato
|
30
|
+
msg.headers = {
|
31
|
+
token: customToken,
|
32
|
+
};
|
33
|
+
to.next(msg); // passa al prossimo middleware
|
40
34
|
});
|
41
35
|
|
42
36
|
// Aggiungi il metodo alla catena di Gun
|