Skip to Content
Usage ExamplesCreating a User

Creating a User from Private Key

import { Nord, NordUser } from "@n1xyz/nord-ts"; import { Connection } from "@solana/web3.js"; const connection = new Connection('https://api.devnet.solana.com'); // Create a Nord instance // Initialize and fetch market data const nord = await Nord.new({ app: 'your_app_addr', // Provide the app verification key solanaConnection: connection, webServerUrl: 'https://zo-devnet.n1.xyz', }); // Create user from private key const user = NordUser.fromPrivateKey( nord, 'your_private_key', // Can be string or Uint8Array ); // Fetch user account information await user.updateAccountId(); await user.fetchInfo();
Last updated on