EVM SDK

To integrate the SDK into your repository, follow the steps below:

Installation:

Install the EVM SDK by running the following command:

Solana SDK JS: https://www.npmjs.com/package/streamnft-evm

npm install streamnft-evm

Import:

import * as stream from "streamnft-evm";

Configure:

  • Define ChainID variable based on the EVM network chain

NetworkChain ID

Polygon

137

Sepolia

11155111

Mantle Testnet

5001

Hedera Testnet

296

Hedera Mainnet

295

Telos Testnet

291

  • Get wallet Signer/Provider from SDK for EVM chain

1. Signer with wallet :

const signer = stream.getWalletSigner();

2. Signer with Private key:

const signer = stream.getSigner(chainId, "PRIVATE_KEY");

3. Provider

const signer = stream.getProvider(chainId);
  • Get wallet Signer from SDK for Hedera chain

1. Using Hashconnect wallet :

// topic and accountId from hashconnect pair response
const provider = hashconnect.getProvider("testnet", topic, accountId);
const signer = hashconnect.getSigner(provider);

2. Using Private key :

// accountID : type AccountId
// privateKey: type PrivateKey
const signer = getHederaSigner(accountId, privateKey, accountIdString);
  • Set Wallet Signer manually

1. Set up the Ethereum network provider and signer using AlchemyProvider:

//Replace "API_KEY" with your Alchemy API key, and "PRIVATE_KEY" with your private key.
const { ethers } = require("ethers");

// Set your Ethereum network provider and signer for Polygon
const provider = new ethers.providers.AlchemyProvider(network, "API_KEY");
const wallet = new ethers.Wallet("PRIVATE_KEY");
const signer = wallet.connect(provider);

2. Set up the Ethereum network provider and signer using JsonRpcProvider :

//Replace "PRIVATE_KEY" with your private key. 
const { ethers } = require("ethers");
const { JsonRpcProvider } = require("@ethersproject/providers");

// Set your Ethereum network provider and signer for Mantle
const rpcUrl = "https://rpc.testnet.mantle.xyz";
const chainId = 5001;
const provider = new JsonRpcProvider(rpcUrl, chainId);
const privateKey = "PRIVATE_KEY";
const signer = new ethers.Wallet(privateKey, provider);
console.log(signer);

Last updated