Skip to content
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

Update examples provider syntax #348

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion examples/providers/get-address-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Get balance of a Quai or Qi address
const balance = await provider.getBalance('0x002F4783248e2D6FF1aa6482A8C0D7a76de3C329', 'latest');
Expand Down
2 changes: 1 addition & 1 deletion examples/providers/get-chain-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Get block (with includeTransactions set to false)
const block = await provider.getBlock(quais.Shard.Cyprus1, 'latest', false);
Expand Down
2 changes: 1 addition & 1 deletion examples/providers/query-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Define simplified abi
const abi = ['event Transfer(address indexed from, address indexed to, uint amount)'];
Expand Down
2 changes: 1 addition & 1 deletion examples/providers/query-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Define filter for any Transfer events in the last 10 blocks in Cyprus1 ([0, 0])
const filter = {
Expand Down
2 changes: 1 addition & 1 deletion examples/providers/ws-subscribe-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const quais = require('../../lib/commonjs/quais');
require('dotenv').config();

async function main() {
const provider = new quais.WebSocketProvider(process.env.WS_RPC_URL);
const provider = new quais.WebSocketProvider(process.env.WS_RPC_URL, undefined, { usePathing: true });

let blockNumber = null;
provider.on(
Expand Down
2 changes: 1 addition & 1 deletion examples/transactions/send-qi-tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create wallet and connect to provider
console.log(process.env.RPC_URL)
Expand Down
2 changes: 1 addition & 1 deletion examples/transactions/send-quai-tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create wallet and connect to provider
const mnemonic = quais.Mnemonic.fromPhrase(process.env.MNEMONIC);
Expand Down
2 changes: 1 addition & 1 deletion examples/wallets/qi-hdwallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create wallet and connect to provider
const mnemonic = quais.Mnemonic.fromPhrase(process.env.MNEMONIC);
Expand Down
3 changes: 1 addition & 2 deletions examples/wallets/qi-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ require('dotenv').config();

async function main() {
// Create provider
console.log('RPC URL: ', process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create Alice's wallet and connect to provider
const mnemonic = quais.Mnemonic.fromPhrase(process.env.MNEMONIC);
Expand Down
3 changes: 1 addition & 2 deletions examples/wallets/qi-wallet-alice-bob-send-receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ require('dotenv').config();

async function main() {
// Create provider
console.log('RPC URL: ', process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create wallet and connect to provider
const mnemonic = quais.Mnemonic.fromPhrase(process.env.MNEMONIC);
Expand Down
3 changes: 1 addition & 2 deletions examples/wallets/qi-wallet-convert-to-quai.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ require('dotenv').config();

async function main() {
// Create provider
console.log('RPC URL: ', process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create Alice's Qi wallet and connect to provider
const mnemonic = quais.Mnemonic.fromPhrase(process.env.MNEMONIC);
Expand Down
3 changes: 1 addition & 2 deletions examples/wallets/qi-wallet-send-qi-to-bob.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ require('dotenv').config();

async function main() {
// Create provider
console.log('RPC URL: ', process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL);
const provider = new quais.JsonRpcProvider(process.env.RPC_URL, undefined, { usePathing: true });

// Create wallet and connect to provider
const mnemonic = quais.Mnemonic.fromPhrase(process.env.MNEMONIC);
Expand Down
Loading