The packages/*/package.json files were the manifests the build writes into build/, committed back over the source ones: exports maps of thousands of entries pointing at ./cjs/* files, main at ./cjs/index.js, module and types set. pezkuwi-dev-build-ts generates those fields itself; in the source they pointed at files that only existed because build output had been committed too. main, module, types, exports, browser, react-native and sideEffects are back in the source form of the upstream manifests; every other field is unchanged. - @pezkuwi/* common dependencies 14.0.25 -> 14.0.26 (wasm-crypto 7.5.20 underneath, with working ed25519 and secp256k1) - the root resolutions forcing common 14.0.25 and wasm 7.5.4 onto the whole tree are removed; only the typescript pin remains - @pezkuwi/dev, dev-test and dev-ts ^0.85.12 - the deno script is removed - version 16.5.37
@pezkuwi/rpc-provider
Generic transport providers to handle the transport of method calls to and from Pezkuwi clients from applications interacting with it. It provides an interface to making RPC calls and is generally, unless you are operating at a low-level and taking care of encoding and decoding of parameters/results, it won't be directly used, rather only passed to a higher-level interface.
Provider Selection
There are three flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets, and the third one uses bizinikiwi light-client through @bizinikiwi/connect. It is generally recommended to use the WsProvider since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
All providers are usable (as is the API), in both browser-based and Node.js environments. Polyfills for unsupported functionality are automatically applied based on feature-detection.
Usage
Installation -
yarn add @pezkuwi/rpc-provider
WebSocket Initialization -
import { WsProvider } from '@pezkuwi/rpc-provider';
// this is the actual default endpoint
const provider = new WsProvider('ws://127.0.0.1:9944');
const version = await provider.send('client_version', []);
console.log('client version', version);
HTTP Initialization -
import { HttpProvider } from '@pezkuwi/rpc-provider';
// this is the actual default endpoint
const provider = new HttpProvider('http://127.0.0.1:9933');
const version = await provider.send('chain_getBlockHash', []);
console.log('latest block Hash', hash);
@bizinikiwi/connect Initialization -
Instantiating a Provider for the Pezkuwi Relay Chain:
import { ScProvider } from '@pezkuwi/rpc-provider';
import * as Sc from '@bizinikiwi/connect';
const provider = new ScProvider(Sc, Sc.WellKnownChain.pezkuwi);
await provider.connect();
const version = await provider.send('chain_getBlockHash', []);
Instantiating a Provider for a Pezkuwi teyrchain:
import { ScProvider } from '@pezkuwi/rpc-provider';
import * as Sc from '@bizinikiwi/connect';
const pezkuwiProvider = new ScProvider(Sc, Sc.WellKnownChain.pezkuwi);
const teyrchainProvider = new ScProvider(Sc, teyrchainSpec, pezkuwiProvider);
await teyrchainProvider.connect();
const version = await teyrchainProvider.send('chain_getBlockHash', []);