File tree 4 files changed +7
-7
lines changed
4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,13 @@ In this example we will interact with the ORA contract deployed in the Sepolia n
48
48
49
49
``` ts
50
50
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" ;
52
52
53
53
// Initialize RPC endpoint (in this case with Sepolia Testnet)
54
54
const web3 = new Web3 (" https://1rpc.io/sepolia" );
55
55
56
56
// 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 ));
58
58
59
59
// Step 2: Add private key to initialize a wallet (note: NEVER PUSH/SHOW your private key)
60
60
const wallet = web3 .eth .accounts .wallet .add (" PRIVATE_KEY" ); // Make sure you have funds
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @ora-io/web3-plugin-ora" ,
3
- "version" : " 0.0.4 " ,
3
+ "version" : " 0.0.6 " ,
4
4
"description" : " ORA's plugin to extend web3.js with additional methods for interaction with Onchain AI Oracle" ,
5
5
"author" : " Aleks (hadzija7)" ,
6
6
"main" : " lib/index.js" ,
Original file line number Diff line number Diff line change 1
1
2
- export enum PromptAddresses {
2
+ export enum Chain {
3
3
MAINNET = "0xb880D47D3894D99157B52A7F869aB3B1E2D4349d" ,
4
4
SEPOLIA = "0xe75af5294f4CB4a8423ef8260595a54298c7a2FB" ,
5
5
OPTIMISM = "0xC3287BDEF03b925A7C7f54791EDADCD88e632CcD" ,
Original file line number Diff line number Diff line change 1
1
import { Web3 , core } from "web3" ;
2
- import { Models , ORAPlugin , PromptAddresses } from "../src" ;
2
+ import { Models , ORAPlugin , Chain } from "../src" ;
3
3
import dotenv from "dotenv"
4
4
dotenv . config ( ) ;
5
5
@@ -9,7 +9,7 @@ describe("TemplatePlugin Tests", () => {
9
9
10
10
it ( "should register TemplatePlugin plugin on Web3Context instance" , ( ) => {
11
11
const web3Context = new core . Web3Context ( process . env . RPC_URL ) ;
12
- web3Context . registerPlugin ( new ORAPlugin ( PromptAddresses . SEPOLIA ) ) ;
12
+ web3Context . registerPlugin ( new ORAPlugin ( Chain . SEPOLIA ) ) ;
13
13
expect ( web3Context . ora ) . toBeDefined ( ) ;
14
14
} ) ;
15
15
@@ -18,7 +18,7 @@ describe("TemplatePlugin Tests", () => {
18
18
19
19
beforeAll ( ( ) => {
20
20
web3 = new Web3 ( process . env . RPC_URL ) ;
21
- web3 . registerPlugin ( new ORAPlugin ( PromptAddresses . SEPOLIA ) ) ;
21
+ web3 . registerPlugin ( new ORAPlugin ( Chain . SEPOLIA ) ) ;
22
22
acc = web3 . eth . accounts . privateKeyToAccount ( process . env . PRIVATE_KEY ? process . env . PRIVATE_KEY : "" )
23
23
web3 . eth . accounts . wallet . add ( acc ) ;
24
24
} ) ;
You can’t perform that action at this time.
0 commit comments