This repository contains a sample for using the @pythnetwork/staking-sdk client.
First, ensure you have node installed. Then run npm install.
To run the example, run npm run example -- <wallet pubkey> <stake account pubkey>.
There a few gotchas caused by underlying issues in some upstream dependencies -- these unfortunately must be handled by consumers. You'll see these things in this example repo:
-
You must install
rpc-websockets@7.11.0. This is due to a breaking change that was introduced inrpc-websocketswithout a major version revision. -
You must set the
skipLibChecktsconfig option. This is because there are typing errors in some underlying libraries, but these errors are not anything that end users can control and they do not affect the type safety of consuming code.