8.4.1 • Published 2 days ago

@web3auth/solana-provider v8.4.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 days ago

Web3Auth Solana Provider

npm version minzip

Web3Auth is where passwordless auth meets non-custodial key infrastructure for Web3 apps and wallets. By aggregating OAuth (Google, Twitter, Discord) logins, different wallets and innovative Multi Party Computation (MPC) - Web3Auth provides a seamless login experience to every user on your application.

Web3Auth Solana Provider can be used to interact with wallet or connected Solana chain using RPC calls. This is a Solana chain compatible JRPC provider.

📖 Documentation

Read more about Web3Auth Solana Provider in the official Web3Auth Documentation.

💡 Features

  • Plug and Play, OAuth based Web3 Authentication Service
  • Fully decentralized, non-custodial key infrastructure
  • End to end Whitelabelable solution
  • Threshold Cryptography based Key Reconstruction
  • Multi Factor Authentication Setup & Recovery (Includes password, backup phrase, device factor editing/deletion etc)
  • Support for WebAuthn & Passwordless Login
  • Support for connecting to multiple wallets
  • DApp Active Session Management

...and a lot more

🔗 Installation

npm install --save @web3auth/solana-provider

🩹 Example

SolanaPrivateKeyProvider

import { SolanaPrivateKeyProvider } from "@web3auth/solana-provider";

const solanaPrivateProvider = await SolanaPrivateKeyProvider.getProviderInstance({
  chainConfig: {
    rpcTarget: "https://ssc-dao.genesysgo.net",
    chainId: "0x1", // hex chain id
    displayName: "solana",
    ticker: "SOL",
    tickerName: "Solana",
  },
  privKey: "user's private key",
});

SolanaWallet

SolanaWallet can be used with two types of providers:

  1. web3auth.provider that you get after logging in with Web3Auth.
  2. solanaPrivateProvider.provider that you get after passing user's private key to SolanaPrivateKeyProvider.

web3auth.provider

import { SolanaWallet } from "@web3auth/solana-provider";

const solanaWallet = new SolanaWallet(web3auth.provider);
const msg = Buffer.from("Signing Message", "utf8");
const result = await solanaWallet.signMessage(msg);
return result;

solanaPrivateProvider.provider

import { SolanaWallet } from "@web3auth/solana-provider";

const solanaWallet = new SolanaWallet(solanaPrivateProvider.provider);
const msg = Buffer.from("Signing Message", "utf8");
const result = await solanaWallet.signMessage(msg);
return result.toString();

General Example

import { SolanaPrivateKeyProvider, SolanaWallet } from "@web3auth/solana-provider";
import type { SafeEventEmitterProvider } from "@web3auth/base";

const signSolanaMessage = async (provider: SafeEventEmitterProvider): Promise<string> => {
  const solanaWallet = new SolanaWallet(provider as any);
  const msg = Buffer.from("Signing Message", "utf8");
  const result = await solanaWallet.signMessage(msg);
  return result.toString();
};

(async () => {
  // Assuming you're logged in with Web3Auth.
  const privateKey = await web3auth.provider.request({
    method: "solanaPrivateKey",
  });
  const solanaPrivateProvider = await SolanaPrivateKeyProvider.getProviderInstance({
    chainConfig: {
      rpcTarget: "https://ssc-dao.genesysgo.net",
      chainId: "0x1", // hex chain id
      displayName: "solana",
      ticker: "SOL",
      tickerName: "Solana",
    },
    privKey: privateKey,
  });
  const signedMessage = await signSolanaMessage(solanaPrivateProvider.provider);
})();

Checkout the examples for your preferred blockchain and platform in our examples repository

🌐 Demo

Checkout the Web3Auth Demo to see how Web3Auth can be used in your application.

💬 Troubleshooting and Support

  • Have a look at our Community Portal to see if anyone has any questions or issues you might be having. Feel free to reate new topics and we'll help you out as soon as possible.
  • Checkout our Troubleshooting Documentation Page to know the common issues and solutions.
  • For Priority Support, please have a look at our Pricing Page for the plan that suits your needs.
8.4.1

2 days ago

8.4.0

11 days ago

8.2.1

24 days ago

8.3.0

24 days ago

8.2.0

24 days ago

8.1.0

29 days ago

8.0.1

3 months ago

8.0.0

3 months ago

8.0.0-alpha.19

3 months ago

8.0.0-alpha.18

3 months ago

8.0.0-alpha.16

3 months ago

8.0.0-alpha.17

3 months ago

8.0.0-alpha.9

3 months ago

8.0.0-alpha.14

3 months ago

8.0.0-alpha.15

3 months ago

8.0.0-alpha.10

3 months ago

8.0.0-alpha.11

3 months ago

8.0.0-alpha.12

3 months ago

8.0.0-alpha.13

3 months ago

7.3.2

3 months ago

8.0.0-alpha.0

3 months ago

8.0.0-alpha.8

3 months ago

7.3.1

4 months ago

7.2.1

5 months ago

6.1.4

10 months ago

6.1.3

10 months ago

7.1.2

6 months ago

7.1.1

6 months ago

7.1.0

6 months ago

7.0.0

8 months ago

7.0.4

7 months ago

7.2.0

5 months ago

7.0.2

8 months ago

7.0.1

8 months ago

6.1.6

10 months ago

6.1.8

9 months ago

6.1.7

10 months ago

7.0.2-beta.0

8 months ago

7.0.0-beta.0

8 months ago

5.1.1

1 year ago

5.1.0

1 year ago

6.1.0

11 months ago

6.1.1

11 months ago

6.0.0-alpha.0

11 months ago

5.0.0-alpha.0

1 year ago

6.0.1-alpha.0

11 months ago

5.0.1-alpha.0

1 year ago

5.2.0

1 year ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

6.0.1

11 months ago

6.0.0

11 months ago

6.0.3-alpha.0

11 months ago

6.0.4-alpha.0

11 months ago

4.2.3-beta.0

1 year ago

4.0.0-alpha.0

1 year ago

3.0.4

2 years ago

3.0.3

2 years ago

4.5.0-beta.0

1 year ago

3.2.0

1 year ago

3.0.0

2 years ago

4.4.0

1 year ago

4.2.2

1 year ago

4.6.0

1 year ago

4.2.4

1 year ago

4.0.0

1 year ago

4.2.2-alpha.0

1 year ago

3.3.0

1 year ago

3.1.0

1 year ago

4.5.0

1 year ago

4.3.2

1 year ago

4.3.2-beta.0

1 year ago

4.1.0

1 year ago

4.3.0

1 year ago

4.1.1

1 year ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

1.0.0-alpha.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

0.10.0

2 years ago

0.11.0-alpha.0

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.6.3

2 years ago

0.8.0

2 years ago

0.8.2

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago