steady-sdk
v1.0.40
Published
An SDK for the Steady Protocol contract
Downloads
200
Readme
Update package with
npm login
npm publish
Usage within a frontend (eg. react)
add the sdk to the project
yarn add steady-sdk
yarn add [email protected]
Import the sdk files and ethers
import { Steady } from "steady-sdk";
const ethers = require("ethers");
create ethers provider and instantiate sdk
const rpc = <YOUR_RPC_URL>;
const address = <STD_CONTRACT_ADDRESS>;
const provider = new ethers.providers.Web3Provider(window.ethereum);
await provider.send("eth_requestAccounts", []);
const signer = provider.getSigner();
let contract = new Steady(address, rpc, signer);
call contract endpoint
contract.contractConfig((config) => {
console.log(`Successfully connected, config is: ${JSON.stringify(config)}`);
});
Usage within a backend (eg. node.js)
add the sdk to the project
yarn add steady-sdk
import the sdk files and ethers
import { Steady } from "steady-sdk";
const ethers = require("ethers");
instantiate sdk (read only)
const rpc = <YOUR_RPC_URL>;
const address = <STD_CONTRACT_ADDRESS>;
let contract = new Steady(address, rpc);
call contract endpoint
contract.contractConfig((config) => {
console.log(`Successfully connected, config is: ${JSON.stringify(config)}`);
});