Skip to main content

Query<TInstructions, TDescriptor>

Defined in: packages/core/src/query-builder.ts:297

Type Parameters

Type ParameterDefault type
TInstructions extends QueryInstruction[]QueryInstruction[]
TDescriptor extends ChainDefinitionCommonDescriptor

Constructors

Constructor

new Query<TInstructions, TDescriptor>(instructions): Query<TInstructions, TDescriptor>;

Defined in: packages/core/src/query-builder.ts:303

Parameters

ParameterType
instructionsTInstructions

Returns

Query<TInstructions, TDescriptor>

Properties

callApi()

callApi: <TPallet, TApi, TDefer>(pallet, api, ...__namedParameters) => Query<[...TInstructions[], {
api: TApi;
args: unknown[];
at: undefined | Finality;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "call-api";
pallet: TPallet;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:474

Type Parameters

Type ParameterDefault type
TPallet extends string-
TApi extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
apiTApi
...__namedParametersInferPapiRuntimeCall<TypedApi<TDescriptor>["apis"][TPallet][TApi]>["args"] extends [] ? [any[any], object] : [InferPapiRuntimeCall<TypedApi<TDescriptor>["apis"][TPallet][TApi]>["args"], object]

Returns

Query<[...TInstructions[], { api: TApi; args: unknown[]; at: undefined | Finality; directives: { defer: NoInfer<TDefer>; }; instruction: "call-api"; pallet: TPallet; }], TDescriptor>

Deprecated

Use Query.runtimeApi instead.


callApis()

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

Defined in: packages/core/src/query-builder.ts:506

Type Parameters

Type ParameterDefault type
TPallet extends string-
TApi extends string-
TDefer extends booleanfalse
TStream extends booleanfalse

Parameters

ParameterType
palletTPallet
apiTApi
argsInferPapiRuntimeCall<TypedApi<TDescriptor>["apis"][TPallet][TApi]>["args"][]
options?{ at?: Finality; defer?: TDefer; stream?: TStream; }
options.at?Finality
options.defer?TDefer
options.stream?TStream

Returns

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

Deprecated

Use Query.runtimeApis instead.


getConstant()

getConstant: <TPallet, TConstant, TDefer>(pallet, constant, options?) => Query<[...TInstructions[], {
constant: TConstant;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "get-constant";
pallet: TPallet;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:333

Type Parameters

Type ParameterDefault type
TPallet extends string-
TConstant extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
constantTConstant
options?{ defer?: TDefer; }
options.defer?TDefer

Returns

Query<[...TInstructions[], { constant: TConstant; directives: { defer: NoInfer<TDefer>; }; instruction: "get-constant"; pallet: TPallet; }], TDescriptor>

Deprecated

Use Query.constant instead.


readStorage()

readStorage: <TPallet, TStorage, TDefer>(pallet, storage, ...__namedParameters) => Query<[...TInstructions[], {
args: | never[]
| InferPapiStorageEntry<TypedApi<...>["query"][TPallet][TStorage]>["args"];
at: undefined | At;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "read-storage";
pallet: TPallet;
storage: TStorage;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:373

Type Parameters

Type ParameterDefault type
TPallet extends string-
TStorage extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
storageTStorage
...__namedParametersInferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"] extends [] ? [any[any], object] : [InferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"], object]

Returns

Query<[...TInstructions[], { args: | never[] | InferPapiStorageEntry<TypedApi<...>["query"][TPallet][TStorage]>["args"]; at: undefined | At; directives: { defer: NoInfer<TDefer>; }; instruction: "read-storage"; pallet: TPallet; storage: TStorage; }], TDescriptor>

Deprecated

Use Query.storage instead.


readStorageEntries()

readStorageEntries: <TPallet, TStorage, TDefer>(pallet, storage, args?, options?) => Query<[...TInstructions[], {
args: unknown[];
at: undefined | At;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "read-storage-entries";
pallet: TPallet;
storage: TStorage;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:436

Type Parameters

Type ParameterDefault type
TPallet extends string-
TStorage extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
storageTStorage
args?InferPapiStorageEntries<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"]
options?{ at?: At; defer?: TDefer; }
options.at?At
options.defer?TDefer

Returns

Query<[...TInstructions[], { args: unknown[]; at: undefined | At; directives: { defer: NoInfer<TDefer>; }; instruction: "read-storage-entries"; pallet: TPallet; storage: TStorage; }], TDescriptor>

Deprecated

Use Query.storageEntries instead.


readStorages()

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

Defined in: packages/core/src/query-builder.ts:407

Type Parameters

Type ParameterDefault type
TPallet extends string-
TStorage extends string-
TDefer extends booleanfalse
TStream extends booleanfalse

Parameters

ParameterType
palletTPallet
storageTStorage
argsInferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"][]
options?{ at?: At; defer?: TDefer; stream?: TStream; }
options.at?At
options.defer?TDefer
options.stream?TStream

Returns

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

Deprecated

Use Query.storages instead.

Accessors

instructions

Get Signature

get instructions(): TInstructions;

Defined in: packages/core/src/query-builder.ts:309

Returns

TInstructions

Methods

concat()

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

Defined in: packages/core/src/query-builder.ts:684

Type Parameters

Type Parameter
TQueries extends Query<QueryInstruction[], ChainDefinition>[]

Parameters

ParameterType
...queriesTQueries

Returns

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


constant()

constant<TPallet, TConstant, TDefer>(
pallet,
constant,
options?): Query<[...TInstructions[], {
constant: TConstant;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "get-constant";
pallet: TPallet;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:313

Type Parameters

Type ParameterDefault type
TPallet extends string-
TConstant extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
constantTConstant
options?{ defer?: TDefer; }
options.defer?TDefer

Returns

Query<[...TInstructions[], { constant: TConstant; directives: { defer: NoInfer<TDefer>; }; instruction: "get-constant"; pallet: TPallet; }], TDescriptor>


contract()

Call Signature

contract<TContractDescriptor, TContractInstructions, TDefer>(
contract,
address,
builder,
options?): Query<[...TInstructions[], {
address: Address;
contract: InkContract<TContractDescriptor>;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "read-contract";
instructions: TContractInstructions;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:508

Type Parameters
Type ParameterDefault type
TContractDescriptor extends GenericInkDescriptors-
TContractInstructions extends InkQueryInstruction[]-
TDefer extends booleanfalse
Parameters
ParameterType
contractInkContract<TContractDescriptor>
addressAddress
builder(query) => InkQuery<TContractDescriptor, TContractInstructions>
options?{ defer?: TDefer; }
options.defer?TDefer
Returns

Query<[...TInstructions[], { address: Address; contract: InkContract<TContractDescriptor>; directives: { defer: NoInfer<TDefer>; }; instruction: "read-contract"; instructions: TContractInstructions; }], TDescriptor>

Call Signature

contract<TAbi, TContractInstructions, TDefer>(
contract,
address,
builder,
options?): Query<[...TInstructions[], {
address: Address;
contract: SolidityContract<TAbi>;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "read-contract";
instructions: TContractInstructions;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:534

Type Parameters
Type ParameterDefault type
TAbi extends Abi-
TContractInstructions extends SolidityQueryInstruction[]-
TDefer extends booleanfalse
Parameters
ParameterType
contractSolidityContract<TAbi>
addressAddress
builder(query) => SolidityQuery<TAbi, TContractInstructions>
options?{ defer?: TDefer; }
options.defer?TDefer
Returns

Query<[...TInstructions[], { address: Address; contract: SolidityContract<TAbi>; directives: { defer: NoInfer<TDefer>; }; instruction: "read-contract"; instructions: TContractInstructions; }], TDescriptor>


contracts()

Call Signature

contracts<TContractDescriptor, TContractInstructions, TDefer, TStream>(
contract,
addresses,
builder,
options?): Query<[...TInstructions[], {
addresses: Address[];
contract: InkContract<TContractDescriptor>;
directives: {
defer: NoInfer<TDefer>;
stream: NoInfer<TStream>;
};
instruction: "read-contract";
instructions: TContractInstructions;
multi: true;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:586

Type Parameters
Type ParameterDefault type
TContractDescriptor extends GenericInkDescriptors-
TContractInstructions extends InkQueryInstruction[]-
TDefer extends booleanfalse
TStream extends booleanfalse
Parameters
ParameterType
contractInkContract<TContractDescriptor>
addressesAddress[]
builder(query) => InkQuery<TContractDescriptor, TContractInstructions>
options?{ defer?: TDefer; stream?: TStream; }
options.defer?TDefer
options.stream?TStream
Returns

Query<[...TInstructions[], { addresses: Address[]; contract: InkContract<TContractDescriptor>; directives: { defer: NoInfer<TDefer>; stream: NoInfer<TStream>; }; instruction: "read-contract"; instructions: TContractInstructions; multi: true; }], TDescriptor>

Call Signature

contracts<TAbi, TContractInstructions, TDefer, TStream>(
contract,
addresses,
builder,
options?): Query<[...TInstructions[], {
addresses: Address[];
contract: SolidityContract<TAbi>;
directives: {
defer: NoInfer<TDefer>;
stream: NoInfer<TStream>;
};
instruction: "read-contract";
instructions: TContractInstructions;
multi: true;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:618

Type Parameters
Type ParameterDefault type
TAbi extends Abi-
TContractInstructions extends SolidityQueryInstruction[]-
TDefer extends booleanfalse
TStream extends booleanfalse
Parameters
ParameterType
contractSolidityContract<TAbi>
addressesAddress[]
builder(query) => SolidityQuery<TAbi, TContractInstructions>
options?{ defer?: TDefer; stream?: TStream; }
options.defer?TDefer
options.stream?TStream
Returns

Query<[...TInstructions[], { addresses: Address[]; contract: SolidityContract<TAbi>; directives: { defer: NoInfer<TDefer>; stream: NoInfer<TStream>; }; instruction: "read-contract"; instructions: TContractInstructions; multi: true; }], TDescriptor>


runtimeApi()

runtimeApi<TPallet, TApi, TDefer>(
pallet,
api, ...
__namedParameters): Query<[...TInstructions[], {
api: TApi;
args: unknown[];
at: undefined | Finality;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "call-api";
pallet: TPallet;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:438

Type Parameters

Type ParameterDefault type
TPallet extends string-
TApi extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
apiTApi
...__namedParametersInferPapiRuntimeCall<TypedApi<TDescriptor>["apis"][TPallet][TApi]>["args"] extends [] ? [any[any], object] : [InferPapiRuntimeCall<TypedApi<TDescriptor>["apis"][TPallet][TApi]>["args"], object]

Returns

Query<[...TInstructions[], { api: TApi; args: unknown[]; at: undefined | Finality; directives: { defer: NoInfer<TDefer>; }; instruction: "call-api"; pallet: TPallet; }], TDescriptor>


runtimeApis()

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

Defined in: packages/core/src/query-builder.ts:476

Type Parameters

Type ParameterDefault type
TPallet extends string-
TApi extends string-
TDefer extends booleanfalse
TStream extends booleanfalse

Parameters

ParameterType
palletTPallet
apiTApi
argsInferPapiRuntimeCall<TypedApi<TDescriptor>["apis"][TPallet][TApi]>["args"][]
options?{ at?: Finality; defer?: TDefer; stream?: TStream; }
options.at?Finality
options.defer?TDefer
options.stream?TStream

Returns

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


storage()

storage<TPallet, TStorage, TDefer>(
pallet,
storage, ...
__namedParameters): Query<[...TInstructions[], {
args: | never[]
| InferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"];
at: undefined | At;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "read-storage";
pallet: TPallet;
storage: TStorage;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:335

Type Parameters

Type ParameterDefault type
TPallet extends string-
TStorage extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
storageTStorage
...__namedParametersInferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"] extends [] ? [any[any], object] : [InferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"], object]

Returns

Query<[...TInstructions[], { args: | never[] | InferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"]; at: undefined | At; directives: { defer: NoInfer<TDefer>; }; instruction: "read-storage"; pallet: TPallet; storage: TStorage; }], TDescriptor>


storageEntries()

storageEntries<TPallet, TStorage, TDefer>(
pallet,
storage,
args?,
options?): Query<[...TInstructions[], {
args: unknown[];
at: undefined | At;
directives: {
defer: NoInfer<TDefer>;
};
instruction: "read-storage-entries";
pallet: TPallet;
storage: TStorage;
}], TDescriptor>;

Defined in: packages/core/src/query-builder.ts:409

Type Parameters

Type ParameterDefault type
TPallet extends string-
TStorage extends string-
TDefer extends booleanfalse

Parameters

ParameterType
palletTPallet
storageTStorage
args?InferPapiStorageEntries<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"]
options?{ at?: At; defer?: TDefer; }
options.at?At
options.defer?TDefer

Returns

Query<[...TInstructions[], { args: unknown[]; at: undefined | At; directives: { defer: NoInfer<TDefer>; }; instruction: "read-storage-entries"; pallet: TPallet; storage: TStorage; }], TDescriptor>


storages()

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

Defined in: packages/core/src/query-builder.ts:375

Type Parameters

Type ParameterDefault type
TPallet extends string-
TStorage extends string-
TDefer extends booleanfalse
TStream extends booleanfalse

Parameters

ParameterType
palletTPallet
storageTStorage
argsInferPapiStorageEntry<TypedApi<TDescriptor>["query"][TPallet][TStorage]>["args"][]
options?{ at?: At; defer?: TDefer; stream?: TStream; }
options.at?At
options.defer?TDefer
options.stream?TStream

Returns

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