1.0.9 • Published 1 year ago

partisia-rpc v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Install

npm i partisia-rpc

Query Across All Shards

import { PartisiaAccount } from "partisia-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.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.0

2 years ago