🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@renec-foundation/pegged-fiat-sdk

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@renec-foundation/pegged-fiat-sdk

Typescript SDK to interact with Pegged Fiat program.

latest
npmnpm
Version
0.3.3
Version published
Maintainers
1
Created
Source

pegged-fiat-sdk

How to use

import {
  PublicKey,
  Connection,
  Keypair,
  Commitment,
} from "@solana/web3.js";
import { AnchorProvider, Wallet, BN, Address } from "@project-serum/anchor";
import { Context, PairClient, PEGGED_FIAT_PROGRAM_TESTNET, REVND_TESTNET, REUSD_TESTNET } from "@renec-foundation/pegged-fiat-sdk";
...

// yourKey = Keypair.fromSecretKey(Uint8Array.from([124, 149, 222, 31, 236, 142, 29, 95...]));

const commitment: Commitment = "confirmed";
const connection = new Connection(consts.RPC_ENDPOINT_URL, { commitment });
const wallet = new Wallet(yourKey);
const provider = new AnchorProvider(connection, wallet, { commitment });

const version = 4;
const ctx = Context.withProvider(provider, new PublicKey(PEGGED_FIAT_PROGRAM_TESTNET));


const pair = await PairClient.getPair(ctx, REUSD_TESTNET, REVND_TESTNET, version);

const lockAmount = new anchor.BN("100000000");
const tx = await pair.lockNMint(wallet.publicKey, lockAmount);
const txid = await tx.buildAndExecute();

console.log("txid", txid);
  • Output

FAQs

Package last updated on 06 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts