Skip to content

Commit c7d038c

Browse files
authored
Merge pull request #2 from ora-io/refacto
fix: renaming PromptAdresses by Chain
2 parents b90e648 + 6da13d8 commit c7d038c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ In this example we will interact with the ORA contract deployed in the Sepolia n
4848
4949
```ts
5050
import { Web3 } from "web3";
51-
import { Models, ORAPlugin, PromptAddresses } from "@ora-io/web3-plugin-ora";
51+
import { Models, ORAPlugin, Chain } from "@ora-io/web3-plugin-ora";
5252

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

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

5959
// Step 2: Add private key to initialize a wallet (note: NEVER PUSH/SHOW your private key)
6060
const wallet = web3.eth.accounts.wallet.add("PRIVATE_KEY"); // Make sure you have funds

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ora-io/web3-plugin-ora",
3-
"version": "0.0.4",
3+
"version": "0.0.6",
44
"description": "ORA's plugin to extend web3.js with additional methods for interaction with Onchain AI Oracle",
55
"author": "Aleks (hadzija7)",
66
"main": "lib/index.js",

src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
export enum PromptAddresses {
2+
export enum Chain {
33
MAINNET = "0xb880D47D3894D99157B52A7F869aB3B1E2D4349d",
44
SEPOLIA = "0xe75af5294f4CB4a8423ef8260595a54298c7a2FB",
55
OPTIMISM = "0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD",

test/index.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Web3, core } from "web3";
2-
import { Models, ORAPlugin, PromptAddresses } from "../src";
2+
import { Models, ORAPlugin, Chain } from "../src";
33
import dotenv from "dotenv"
44
dotenv.config();
55

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

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

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

1919
beforeAll(() => {
2020
web3 = new Web3(process.env.RPC_URL);
21-
web3.registerPlugin(new ORAPlugin(PromptAddresses.SEPOLIA));
21+
web3.registerPlugin(new ORAPlugin(Chain.SEPOLIA));
2222
acc = web3.eth.accounts.privateKeyToAccount(process.env.PRIVATE_KEY ? process.env.PRIVATE_KEY : "")
2323
web3.eth.accounts.wallet.add(acc);
2424
});

0 commit comments

Comments
 (0)