1.0.13 • Published 2 months ago

partisia-blockchain-applications-rpc v1.0.13

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

Install

npm i partisia-blockchain-applications-rpc

Query Across All Shards

import { PartisiaAccount } from "partisia-blockchain-applications-rpc"

// Set the Config for each shard
const rpc = PartisiaAccount({
    urlBaseGlobal: { url: 'https://reader.partisiablockchain.com', shard_id: 99 },
    urlBaseShards: [
        { url: 'https://reader.partisiablockchain.com/shards/Shard0', shard_id: 0 },
        { url: 'https://reader.partisiablockchain.com/shards/Shard1', shard_id: 1 },
        { url: 'https://reader.partisiablockchain.com/shards/Shard2', shard_id: 2 },
    ]
})

// get account info
const account = await rpc.getAccount('<address>')
// get nonce for adderss
const nonce = await rpc.getNonce('<address>', account.shard_id)
// get contract info
const contract = await rpc.getContract('<contract address>',1)

// get url being used for a specific shard
const url = rpc.getShardUrl(account.shard_id)
1.0.13

2 months ago

1.0.11

5 months ago

1.0.12

5 months ago

1.0.10

10 months ago