Skip to content

fix: renaming PromptAdresses by Chain #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ In this example we will interact with the ORA contract deployed in the Sepolia n

```ts
import { Web3 } from "web3";
import { Models, ORAPlugin, PromptAddresses } from "@ora-io/web3-plugin-ora";
import { Models, ORAPlugin, Chain } from "@ora-io/web3-plugin-ora";

// Initialize RPC endpoint (in this case with Sepolia Testnet)
const web3 = new Web3("https://1rpc.io/sepolia");

// Step 1: Register the ORAPlugin to the web3.js context pointing to the Sepolia Testnet network
web3.registerPlugin(new ORAPlugin(PromptAddresses.SEPOLIA));
web3.registerPlugin(new ORAPlugin(Chain.SEPOLIA));

// Step 2: Add private key to initialize a wallet (note: NEVER PUSH/SHOW your private key)
const wallet = web3.eth.accounts.wallet.add("PRIVATE_KEY"); // Make sure you have funds
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ora-io/web3-plugin-ora",
"version": "0.0.4",
"version": "0.0.6",
"description": "ORA's plugin to extend web3.js with additional methods for interaction with Onchain AI Oracle",
"author": "Aleks (hadzija7)",
"main": "lib/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

export enum PromptAddresses {
export enum Chain {
MAINNET = "0xb880D47D3894D99157B52A7F869aB3B1E2D4349d",
SEPOLIA = "0xe75af5294f4CB4a8423ef8260595a54298c7a2FB",
OPTIMISM = "0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD",
Expand Down
6 changes: 3 additions & 3 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Web3, core } from "web3";
import { Models, ORAPlugin, PromptAddresses } from "../src";
import { Models, ORAPlugin, Chain } from "../src";
import dotenv from "dotenv"
dotenv.config();

Expand All @@ -9,7 +9,7 @@ describe("TemplatePlugin Tests", () => {

it("should register TemplatePlugin plugin on Web3Context instance", () => {
const web3Context = new core.Web3Context(process.env.RPC_URL);
web3Context.registerPlugin(new ORAPlugin(PromptAddresses.SEPOLIA));
web3Context.registerPlugin(new ORAPlugin(Chain.SEPOLIA));
expect(web3Context.ora).toBeDefined();
});

Expand All @@ -18,7 +18,7 @@ describe("TemplatePlugin Tests", () => {

beforeAll(() => {
web3 = new Web3(process.env.RPC_URL);
web3.registerPlugin(new ORAPlugin(PromptAddresses.SEPOLIA));
web3.registerPlugin(new ORAPlugin(Chain.SEPOLIA));
acc = web3.eth.accounts.privateKeyToAccount(process.env.PRIVATE_KEY ? process.env.PRIVATE_KEY : "")
web3.eth.accounts.wallet.add(acc);
});
Expand Down
Loading