How to use the @polkadot/api/rx/Api function in @polkadot/api

To help you get started, we’ve selected a few @polkadot/api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github polkadot-js / api / packages / api-derive / src / index.spec.ts View on Github external
describe('custom', (): void => {
    const api = new ApiRx({
      derives: {
        balances: {
          fees: (): any => (): Observable => from(['a', 'b'])
        },
        custom: {
          test: (): any => (): Observable => from([1, 2, 3])
        }
      },
      provider: new MockProvider(registry),
      registry
    });

    beforeAll((done): void => {
      api.isReady.subscribe((): void => done());
    });

@polkadot/api

Promise and RxJS wrappers around the Polkadot JS RPC

Apache-2.0
Latest version published 9 days ago

Package Health Score

90 / 100
Full package analysis

Similar packages