Skip to content

Commit

Permalink
add authentication token
Browse files Browse the repository at this point in the history
  • Loading branch information
scobru committed Oct 6, 2024
1 parent eb49abb commit d38b35b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions gun-eth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ const SEA = require("gun/sea");
const ethers = require("ethers");
const SHINE = require("./SHINE.json");

/* import Gun from "gun";
import SEA from "gun/sea";
import { ethers } from "ethers";
import SHINE from "./SHINE.json"; */

const SHINE_ABI = SHINE.abi;
const SHINE_OPTIMISM_SEPOLIA = SHINE.address;

Expand All @@ -25,7 +20,11 @@ Gun.chain.setToken = function (token) {
return this;
};

ctx.on("put", function (msg) {
Gun.chain.getToken = function () {
return customToken;
};

Gun.on("put", function (msg) {
const to = this.to;
// Usa il token personalizzato
msg.headers = {
Expand Down
2 changes: 1 addition & 1 deletion gun-eth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gun-eth",
"version": "1.2.6",
"version": "1.2.7",
"description": "A GunDB plugin for Ethereum, and Web3",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d38b35b

Please sign in to comment.