Skip to main content

Query <TInstructions, TDescriptor>

Index

Constructors

constructor

  • new Query<TInstructions, TDescriptor>(instructions?: TInstructions): Query<TInstructions, TDescriptor>
  • Type parameters

    • TInstructions: QueryInstruction[] = QueryInstruction[]
    • TDescriptor: ChainDefinition = ChainDefinition

    Parameters

    • instructions: TInstructions = ...

    Returns Query<TInstructions, TDescriptor>

Properties

callApi

callApi: <TPallet, TApi>(pallet: TPallet, api: TApi, ...argsAndOptions: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args] extends [] ? [args?: any[any], options?: { at?: Finality }] : [args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args], options?: { at?: Finality }]) => Query<[...TInstructions[], { api: TApi; args: unknown[]; at: Finality; instruction: call-api; pallet: TPallet }], TDescriptor> = ...
@deprecated

Use Query.runtimeApi instead.


Type declaration

    • <TPallet, TApi>(pallet: TPallet, api: TApi, ...argsAndOptions: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args] extends [] ? [args?: any[any], options?: { at?: Finality }] : [args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args], options?: { at?: Finality }]): Query<[...TInstructions[], { api: TApi; args: unknown[]; at: Finality; instruction: call-api; pallet: TPallet }], TDescriptor>
    • Type parameters

      • TPallet: string
      • TApi: string

      Parameters

      • pallet: TPallet
      • api: TApi
      • rest...argsAndOptions: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args] extends [] ? [args?: any[any], options?: { at?: Finality }] : [args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args], options?: { at?: Finality }]

      Returns Query<[...TInstructions[], { api: TApi; args: unknown[]; at: Finality; instruction: call-api; pallet: TPallet }], TDescriptor>

callApis

callApis: <TPallet, TApi, TStream>(pallet: TPallet, api: TApi, args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][], options?: { at?: Finality; stream?: TStream }) => Query<[...TInstructions[], { api: TApi; args: InferPapiRuntimeCall<TypedApi<...>[apis][TPallet][TApi]>[args][]; at: Finality; directives: { stream: NoInfer<TStream> }; instruction: call-api; multi: true; pallet: TPallet }], TDescriptor> = ...
@deprecated

Use Query.runtimeApis instead.


Type declaration

    • <TPallet, TApi, TStream>(pallet: TPallet, api: TApi, args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][], options?: { at?: Finality; stream?: TStream }): Query<[...TInstructions[], { api: TApi; args: InferPapiRuntimeCall<TypedApi<...>[apis][TPallet][TApi]>[args][]; at: Finality; directives: { stream: NoInfer<TStream> }; instruction: call-api; multi: true; pallet: TPallet }], TDescriptor>
    • Type parameters

      • TPallet: string
      • TApi: string
      • TStream: boolean = false

      Parameters

      • pallet: TPallet
      • api: TApi
      • args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][]
      • optionaloptions: { at?: Finality; stream?: TStream }
        • optionalat: Finality
        • optionalstream: TStream

      Returns Query<[...TInstructions[], { api: TApi; args: InferPapiRuntimeCall<TypedApi<...>[apis][TPallet][TApi]>[args][]; at: Finality; directives: { stream: NoInfer<TStream> }; instruction: call-api; multi: true; pallet: TPallet }], TDescriptor>

getConstant

getConstant: <TPallet, TConstant>(pallet: TPallet, constant: TConstant) => Query<[...TInstructions[], { constant: TConstant; instruction: get-constant; pallet: TPallet }], TDescriptor> = ...
@deprecated

Use Query.constant instead.


Type declaration

    • <TPallet, TConstant>(pallet: TPallet, constant: TConstant): Query<[...TInstructions[], { constant: TConstant; instruction: get-constant; pallet: TPallet }], TDescriptor>
    • Type parameters

      • TPallet: string
      • TConstant: string

      Parameters

      • pallet: TPallet
      • constant: TConstant

      Returns Query<[...TInstructions[], { constant: TConstant; instruction: get-constant; pallet: TPallet }], TDescriptor>

readStorage

readStorage: <TPallet, TStorage>(pallet: TPallet, storage: TStorage, ...argsAndOptions: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args] extends [] ? [args?: any[any], options?: { at?: At }] : [args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }]) => Query<[...TInstructions[], { args: any[] | InferPapiStorageEntry<TypedApi<...>[query][TPallet][TStorage]>[args]; at: At; instruction: read-storage; pallet: TPallet; storage: TStorage }], TDescriptor> = ...
@deprecated

Use Query.storage instead.


Type declaration

    • <TPallet, TStorage>(pallet: TPallet, storage: TStorage, ...argsAndOptions: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args] extends [] ? [args?: any[any], options?: { at?: At }] : [args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }]): Query<[...TInstructions[], { args: any[] | InferPapiStorageEntry<TypedApi<...>[query][TPallet][TStorage]>[args]; at: At; instruction: read-storage; pallet: TPallet; storage: TStorage }], TDescriptor>
    • Type parameters

      • TPallet: string
      • TStorage: string

      Parameters

      • pallet: TPallet
      • storage: TStorage
      • rest...argsAndOptions: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args] extends [] ? [args?: any[any], options?: { at?: At }] : [args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }]

      Returns Query<[...TInstructions[], { args: any[] | InferPapiStorageEntry<TypedApi<...>[query][TPallet][TStorage]>[args]; at: At; instruction: read-storage; pallet: TPallet; storage: TStorage }], TDescriptor>

readStorageEntries

readStorageEntries: <TPallet, TStorage>(pallet: TPallet, storage: TStorage, args?: InferPapiStorageEntries<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }) => Query<[...TInstructions[], { args: unknown[]; at: At; instruction: read-storage-entries; pallet: TPallet; storage: TStorage }], TDescriptor> = ...
@deprecated

Type declaration

    • <TPallet, TStorage>(pallet: TPallet, storage: TStorage, args?: InferPapiStorageEntries<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }): Query<[...TInstructions[], { args: unknown[]; at: At; instruction: read-storage-entries; pallet: TPallet; storage: TStorage }], TDescriptor>
    • Type parameters

      • TPallet: string
      • TStorage: string

      Parameters

      • pallet: TPallet
      • storage: TStorage
      • optionalargs: InferPapiStorageEntries<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args]
      • optionaloptions: { at?: At }
        • optionalat: At

      Returns Query<[...TInstructions[], { args: unknown[]; at: At; instruction: read-storage-entries; pallet: TPallet; storage: TStorage }], TDescriptor>

readStorages

readStorages: <TPallet, TStorage, TStream>(pallet: TPallet, storage: TStorage, args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][], options?: { at?: At; stream?: TStream }) => Query<[...TInstructions[], { args: InferPapiStorageEntry<TypedApi<...>[query][TPallet][TStorage]>[args][]; at: At; directives: { stream: NoInfer<TStream> }; instruction: read-storage; multi: true; pallet: TPallet; storage: TStorage }], TDescriptor> = ...
@deprecated

Use Query.storages instead.


Type declaration

    • <TPallet, TStorage, TStream>(pallet: TPallet, storage: TStorage, args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][], options?: { at?: At; stream?: TStream }): Query<[...TInstructions[], { args: InferPapiStorageEntry<TypedApi<...>[query][TPallet][TStorage]>[args][]; at: At; directives: { stream: NoInfer<TStream> }; instruction: read-storage; multi: true; pallet: TPallet; storage: TStorage }], TDescriptor>
    • Type parameters

      • TPallet: string
      • TStorage: string
      • TStream: boolean = false

      Parameters

      • pallet: TPallet
      • storage: TStorage
      • args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][]
      • optionaloptions: { at?: At; stream?: TStream }
        • optionalat: At
        • optionalstream: TStream

      Returns Query<[...TInstructions[], { args: InferPapiStorageEntry<TypedApi<...>[query][TPallet][TStorage]>[args][]; at: At; directives: { stream: NoInfer<TStream> }; instruction: read-storage; multi: true; pallet: TPallet; storage: TStorage }], TDescriptor>

Accessors

instructions

  • get instructions(): TInstructions
  • Returns TInstructions

Methods

concat

  • concat<TQueries>(...queries: TQueries): Query<[...TInstructions[], ...Flatten<{ [ P in string | number | symbol ]: TQueries[P<P>] extends Query<Instructions, _> ? Instructions : never }>[]], TDescriptor>
  • Type parameters

    • TQueries: Query<QueryInstruction[], ChainDefinition>[]

    Parameters

    • rest...queries: TQueries

    Returns Query<[...TInstructions[], ...Flatten<{ [ P in string | number | symbol ]: TQueries[P<P>] extends Query<Instructions, _> ? Instructions : never }>[]], TDescriptor>

constant

  • constant<TPallet, TConstant>(pallet: TPallet, constant: TConstant): Query<[...TInstructions[], { constant: TConstant; instruction: get-constant; pallet: TPallet }], TDescriptor>
  • Type parameters

    • TPallet: string
    • TConstant: string

    Parameters

    • pallet: TPallet
    • constant: TConstant

    Returns Query<[...TInstructions[], { constant: TConstant; instruction: get-constant; pallet: TPallet }], TDescriptor>

contract

  • contract<TContractDescriptor, TContractInstructions>(contract: Contract<TContractDescriptor>, address: string, builder: (query: InkQuery<TContractDescriptor, []>) => InkQuery<TContractDescriptor, TContractInstructions>): Query<[...TInstructions[], { address: string; contract: Contract<TContractDescriptor>; instruction: read-contract; instructions: TContractInstructions }], TDescriptor>
  • experimental

    Type parameters

    • TContractDescriptor: GenericInkDescriptors
    • TContractInstructions: InkQueryInstruction[]

    Parameters

    • contract: Contract<TContractDescriptor>
    • address: string
    • builder: (query: InkQuery<TContractDescriptor, []>) => InkQuery<TContractDescriptor, TContractInstructions>

      Returns Query<[...TInstructions[], { address: string; contract: Contract<TContractDescriptor>; instruction: read-contract; instructions: TContractInstructions }], TDescriptor>

    contracts

    • contracts<TContractDescriptor, TContractInstructions, TStream>(contract: Contract<TContractDescriptor>, addresses: string[], builder: (query: InkQuery<TContractDescriptor, []>) => InkQuery<TContractDescriptor, TContractInstructions>, options?: { stream?: TStream }): Query<[...TInstructions[], { addresses: string[]; contract: Contract<TContractDescriptor>; directives: { stream: NoInfer<TStream> }; instruction: read-contract; instructions: TContractInstructions; multi: true }], TDescriptor>
    • experimental

      Type parameters

      • TContractDescriptor: GenericInkDescriptors
      • TContractInstructions: InkQueryInstruction[]
      • TStream: boolean = false

      Parameters

      • contract: Contract<TContractDescriptor>
      • addresses: string[]
      • builder: (query: InkQuery<TContractDescriptor, []>) => InkQuery<TContractDescriptor, TContractInstructions>
        • optionaloptions: { stream?: TStream }
          • optionalstream: TStream

        Returns Query<[...TInstructions[], { addresses: string[]; contract: Contract<TContractDescriptor>; directives: { stream: NoInfer<TStream> }; instruction: read-contract; instructions: TContractInstructions; multi: true }], TDescriptor>

      runtimeApi

      • runtimeApi<TPallet, TApi>(pallet: TPallet, api: TApi, ...argsAndOptions: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args] extends [] ? [args?: any[any], options?: { at?: Finality }] : [args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args], options?: { at?: Finality }]): Query<[...TInstructions[], { api: TApi; args: unknown[]; at: Finality; instruction: call-api; pallet: TPallet }], TDescriptor>
      • Type parameters

        • TPallet: string
        • TApi: string

        Parameters

        • pallet: TPallet
        • api: TApi
        • rest...argsAndOptions: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args] extends [] ? [args?: any[any], options?: { at?: Finality }] : [args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args], options?: { at?: Finality }]

        Returns Query<[...TInstructions[], { api: TApi; args: unknown[]; at: Finality; instruction: call-api; pallet: TPallet }], TDescriptor>

      runtimeApis

      • runtimeApis<TPallet, TApi, TStream>(pallet: TPallet, api: TApi, args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][], options?: { at?: Finality; stream?: TStream }): Query<[...TInstructions[], { api: TApi; args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][]; at: Finality; directives: { stream: NoInfer<TStream> }; instruction: call-api; multi: true; pallet: TPallet }], TDescriptor>
      • Type parameters

        • TPallet: string
        • TApi: string
        • TStream: boolean = false

        Parameters

        • pallet: TPallet
        • api: TApi
        • args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][]
        • optionaloptions: { at?: Finality; stream?: TStream }
          • optionalat: Finality
          • optionalstream: TStream

        Returns Query<[...TInstructions[], { api: TApi; args: InferPapiRuntimeCall<TypedApi<TDescriptor>[apis][TPallet][TApi]>[args][]; at: Finality; directives: { stream: NoInfer<TStream> }; instruction: call-api; multi: true; pallet: TPallet }], TDescriptor>

      storage

      • storage<TPallet, TStorage>(pallet: TPallet, storage: TStorage, ...argsAndOptions: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args] extends [] ? [args?: any[any], options?: { at?: At }] : [args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }]): Query<[...TInstructions[], { args: any[] | InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args]; at: At; instruction: read-storage; pallet: TPallet; storage: TStorage }], TDescriptor>
      • Type parameters

        • TPallet: string
        • TStorage: string

        Parameters

        • pallet: TPallet
        • storage: TStorage
        • rest...argsAndOptions: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args] extends [] ? [args?: any[any], options?: { at?: At }] : [args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }]

        Returns Query<[...TInstructions[], { args: any[] | InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args]; at: At; instruction: read-storage; pallet: TPallet; storage: TStorage }], TDescriptor>

      storageEntries

      • storageEntries<TPallet, TStorage>(pallet: TPallet, storage: TStorage, args?: InferPapiStorageEntries<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args], options?: { at?: At }): Query<[...TInstructions[], { args: unknown[]; at: At; instruction: read-storage-entries; pallet: TPallet; storage: TStorage }], TDescriptor>
      • Type parameters

        • TPallet: string
        • TStorage: string

        Parameters

        • pallet: TPallet
        • storage: TStorage
        • optionalargs: InferPapiStorageEntries<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args]
        • optionaloptions: { at?: At }
          • optionalat: At

        Returns Query<[...TInstructions[], { args: unknown[]; at: At; instruction: read-storage-entries; pallet: TPallet; storage: TStorage }], TDescriptor>

      storages

      • storages<TPallet, TStorage, TStream>(pallet: TPallet, storage: TStorage, args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][], options?: { at?: At; stream?: TStream }): Query<[...TInstructions[], { args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][]; at: At; directives: { stream: NoInfer<TStream> }; instruction: read-storage; multi: true; pallet: TPallet; storage: TStorage }], TDescriptor>
      • Type parameters

        • TPallet: string
        • TStorage: string
        • TStream: boolean = false

        Parameters

        • pallet: TPallet
        • storage: TStorage
        • args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][]
        • optionaloptions: { at?: At; stream?: TStream }
          • optionalat: At
          • optionalstream: TStream

        Returns Query<[...TInstructions[], { args: InferPapiStorageEntry<TypedApi<TDescriptor>[query][TPallet][TStorage]>[args][]; at: At; directives: { stream: NoInfer<TStream> }; instruction: read-storage; multi: true; pallet: TPallet; storage: TStorage }], TDescriptor>