mirrorworld-sonic-hyperfuse
v0.0.30
Published
TS sdk for client side for websocket connection with validator backend to validate batch block hash in client side.
Downloads
1,200
Readme
hyperfuse-client-sdk
TS sdk for client side for websocket connection with validator backend to validate batch block hash in client side.
usage
// init
let sdk = new SDK({
backendDomain: process.env.BACKEND_DOMAIN!,
backendWssDomain: process.env.BACKEND_WSS_DOMAIN!,
sonicRpc: process.env.SONIC_RPC!,
storage: {object that implements src.types.config.KeypairStorage interface} // in browser will use window.localStorage as default
});
// api
let res = await sdk.reward.getRewardsActivity({
owner: validator1.publicKey.toBase58(),
});
console.log(JSON.stringify(res));
// websocket
await sdk.listener.startClientValidator(
Keypair.fromSecretKey(bs58.decode(process.env.VALIDATOR1!))
);