class Decorate
extends Events
Abstract
import { Decorate } from "https://deno.land/x/polkadot@0.2.27/api/base/Decorate.ts";
Constructors
Type Parameters
ApiType extends ApiTypes
Properties
protected
__phantom: BNprotected
_call: QueryableCalls<ApiType>protected
_consts: QueryableConsts<ApiType>protected
_decorateMethod: DecorateMethod<ApiType>This is the one and only method concrete children classes need to implement.
It's a higher-order function, which takes one argument
method: Method extends (...args: any[]) => Observable<any>
(and one optional options
), and should return the user facing method.
For example:
- For ApiRx,
decorateMethod
should just be identity, because the input function is already an Observable - For ApiPromise,
decorateMethod
should return a function that takes all the parameters frommethod
, adds an optionalcallback
argument, and returns a Promise.
We could easily imagine other user-facing interfaces, which are simply
implemented by transforming the Observable to Stream/Iterator/Kefir/Bacon
via decorateMethod
.
protected
_errors: DecoratedErrors<ApiType>protected
_events: DecoratedEvents<ApiType>protected
optional
_extrinsics: SubmittableExtrinsics<ApiType>protected
optional
_genesisHash: Hashprotected
_isConnected: BehaviorSubject<boolean>protected
readonly
_options: ApiOptionsprotected
_query: QueryableStorage<ApiType>protected
optional
_queryMulti: QueryableStorageMulti<ApiType>protected
optional
_rpc: DecoratedRpc<ApiType, RpcInterface>protected
_rpcCore: RpcCore & RpcInterfaceprotected
optional
_runtimeChain: Textprotected
_runtimeMap: Record<HexString, string>protected
optional
_runtimeMetadata: Metadataprotected
optional
_runtimeVersion: RuntimeVersionprotected
_rx: ApiInterfaceRxprotected
_rxDecorateMethod: <Method extends AnyFunction>(method: Method) => MethodPut the this.onCall
function of ApiRx here, because it is needed by
api._rx
.
protected
_type: ApiTypesreadonly
registry: RegistryMethods
private
_decorateExtrinsicEntry<ApiType extends ApiTypes>(method: CallFunction, creator: (value: Call | Uint8Array | string) => SubmittableExtrinsic<ApiType>): SubmittableExtrinsicFunction<ApiType>private
_decorateFunctionMeta(input: MetaDecoration, output: MetaDecoration): MetaDecorationprivate
_decorateStorageCall<ApiType extends ApiTypes>(creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): ReturnType<DecorateMethod<ApiType>>private
_decorateStorageEntry<ApiType extends ApiTypes>(creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): QueryableStorageEntry<ApiType>private
_decorateStorageEntryAt<ApiType extends ApiTypes>(registry: Registry,
creator: StorageEntry,
decorateMethod: DecorateMethod<ApiType>,
blockHash: Uint8Array,
private
_queueStorage(call: [StorageEntry, unknown[]], queue: [Observable<Codec[]>, [StorageEntry, unknown[]][]][]): Observable<Codec>private
_retrieveMapEntries(): Observable<[StorageKey, Codec][]>private
_retrieveMapEntriesPaged(): Observable<[StorageKey, Codec][]>private
_retrieveMapKeys(): Observable<StorageKey[]>private
_retrieveMapKeysPaged(): Observable<StorageKey[]>private
_retrieveMulti(keys: [StorageEntry, unknown[]][], blockHash?: Uint8Array): Observable<Codec[]>private
_rpcSubmitter<ApiType extends ApiTypes>(decorateMethod: DecorateMethod<ApiType>): DecoratedRpc<ApiType, RpcInterface>protected
_addRuntimeDef(result: DefinitionsCall, additional?: DefinitionsCall): voidprotected
_createDecorated(registry: VersionedRegistry<ApiType>,
fromEmpty: boolean,
decoratedApi: ApiDecoration<ApiType> | null,
blockHash?: Uint8Array,
protected
_decorateCall<ApiType extends ApiTypes>(registry: Registry,
def: DefinitionCallNamed,
stateCall: (method: string, bytes: Uint8Array) => Observable<Codec>,
decorateMethod: DecorateMethod<ApiType>,
protected
_decorateCalls<ApiType extends ApiTypes>(unnamed 0: VersionedRegistry<any>,
decorateMethod: DecorateMethod<ApiType>,
blockHash?: Uint8Array | string | null,
protected
_decorateDerive(decorateMethod: DecorateMethod<ApiType>): AllDerives<ApiType>protected
_decorateDeriveRx(decorateMethod: DecorateMethod<ApiType>): AllDerives<"rxjs">protected
_decorateExtrinsics<ApiType extends ApiTypes>(unnamed 0: DecoratedMeta, decorateMethod: DecorateMethod<ApiType>): SubmittableExtrinsics<ApiType>protected
_decorateMulti<ApiType extends ApiTypes>(decorateMethod: DecorateMethod<ApiType>): QueryableStorageMulti<ApiType>protected
_decorateMultiAt<ApiType extends ApiTypes>(atApi: ApiDecoration<ApiType>,
decorateMethod: DecorateMethod<ApiType>,
blockHash: Uint8Array | string,
protected
_decorateRpc<ApiType extends ApiTypes>(rpc: RpcCore & RpcInterface,
decorateMethod: DecorateMethod<ApiType>,
input?: Partial<DecoratedRpc<ApiType, RpcInterface>>,
protected
_decorateStorage<ApiType extends ApiTypes>(): QueryableStorage<ApiType>protected
_emptyDecorated(registry: Registry, blockHash?: Uint8Array): ApiDecoration<ApiType>protected
_filterRpc(methods: string[], additional: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>>): voidprotected
_filterRpcMethods(exposed: string[]): voidprotected
_getRuntimeDefs(): [string, DefinitionsCallEntry[]][]protected
_injectMetadata(registry: VersionedRegistry<ApiType>, fromEmpty?): voidabstract
at(blockHash: Uint8Array | string, knownVersion?: RuntimeVersion): Promise<ApiDecoration<ApiType>>createType<T extends Codec = Codec, K extends string = string>(type: K, ...params: unknown[]): DetectCodec<T, K>
deprecated
injectMetadata(): voidregisterTypes(types?: RegistryTypes): void