Replies: 1 comment
-
Yes, Web3Auth does support NEAR as it is blockchain agnostics. Simply use the below code to create web3auth.provider: import { Web3Auth } from "@web3auth/web3auth";
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
const web3auth = new Web3Auth({
clientId: "YOUR_CLIENT_ID", // get it from Web3Auth Dashboard(https://dashboard.web3auth.io)
chainConfig: {
chainNamespace: "other",
rpcTarget: "https://rpc.ankr.com/near",
displayName: "NEAR",
blockExplorer: "https://explorer.near.org/",
ticker: "NEAR",
tickerName: "NEAR",
},
});
const openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId,
network: "testnet",
uxMode: "popup",
},
});
web3auth.configureAdapter(openloginAdapter);
await web3auth.initModal();
const web3authProvider = web3auth.connect(); // web3auth.provider Next, get the User's Private Key using the below code: async getPrivateKey() {
// web3authProvider is web3auth.provider
const privateKey = await web3authProvider.request({
method: "private_key"
});
// Fetch Address, do transactions with privateKey on NEAR Blockchain
} Use https://www.npmjs.com/package/near-api-js to interact with NEAR. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Asked by
gmist#6034
on Discord.Beta Was this translation helpful? Give feedback.
All reactions