From d38b35b071168bb93e54f7a9cf25a2fdbe90d780 Mon Sep 17 00:00:00 2001 From: scobru Date: Sun, 6 Oct 2024 23:13:16 +0200 Subject: [PATCH] add authentication token --- gun-eth/index.js | 11 +++++------ gun-eth/package.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gun-eth/index.js b/gun-eth/index.js index bdcdcbf..63999ed 100644 --- a/gun-eth/index.js +++ b/gun-eth/index.js @@ -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; @@ -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 = { diff --git a/gun-eth/package.json b/gun-eth/package.json index e5e2e41..2fa9349 100644 --- a/gun-eth/package.json +++ b/gun-eth/package.json @@ -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": {