acala.js
acala.js copied to clipboard
API Manager
- speed measure
- support connect the fastest endpoint
- return promise/rxjs api
- support report the endpoint health status
- support manager multiply chains
configs
- chains
- name, string, chain name
- endpoints, [string] the endpoints of the chain
- isRelayChain, boolean, should set true when the chain is a relay chain
- parachainId, number, the params chain id, will be ignored when the isRealyChain is true
- autoConnect, boolean, auto-connect when set true
- custom, (options) => options, custom API options configs
- timeout
- endpoint health
- health
- busy
- error
methods
- getApi get api
- status$ subscribe to the status of the connected endpoint
- health$ subscribe to the connected health of the connected endpoint
- endpointsReport$ subscribe all endpoints ping-pong test result
- connect manual connect
- disconnect manual disconnect