Function getAssetBalance

  • Fetch the balance of an asset in a pool, prioritizing rpc data if the sdk is in full context mode. Can be used for both pools outcome assets and the pool's native/base asset.

    Returns

    Decimal

    Type Parameters

    • C extends Context<MS>

    • MS extends MetadataStorage<{
          __meta: "markets";
          categories: undefined | ({ name: string; img?: string | undefined; ticker?: string | undefined; color?: string | undefined; })[];
          confidentialId: undefined | string;
          description: string;
          img: undefined | string;
          question: string;
          scalarType: undefined | "number" | "date";
          slug: string;
          tags: undefined | string[];
      }, MS>

    Parameters

    • ctx: C

      Context

    • pool: Data<C, C extends RpcContext<MS> ? RpcPool : never, C extends IndexerContext ? IndexedPool<C, MS> : never, MS>

      Pool<C, MS>

    • _assetId: {
          CategoricalOutcome: [MarketId, number];
      } | {
          ScalarOutcome: [MarketId, "Short" | "Long"];
      } | {
          Ztg: null;
      } | {
          PoolShare: number;
      }

    Returns Promise<Decimal>

Generated using TypeDoc