Getting Started
yarn add @jazdid/jaz-did-sdk
import { ethers } from 'ethers';
import { Services, evm } from '@jazdid/jaz-did-sdk';
const network = {
56: {
name: 'BSC Mainnet',
rpc: 'https://****',
},
97: {
name: 'BSC Testnet',
rpc: 'https://****',
},
1: {
name: 'ETH',
rpc: 'https://****',
}
}
async function getConnection() {
const provider = new ethers.providers.JsonRpcProvider(rpcUrl, chainId);
const wallet = new ethers.Wallet(privateKey, provider);
return {
provider: wallet,
connection: {
account: await wallet.getAddress(),
chainId: await wallet.getChainId(),
},
};
};
async function main() {
Sdk.init({ serverUrl, openpfpUrl, network: rpcList, provider });
}
Key | Description |
---|---|
povider | ethers.Signer Type |
serverUrl | Sync data service |
openpfpUrl | Sync data service |
network | Chain config info, RPC |
Last modified 6mo ago