Class ModuleWrapper<TWrappedModule>

Type Parameters

Hierarchy

  • Base<TWrappedModule["params"]>
    • ModuleWrapper

Implements

  • Module<TWrappedModule["params"], TWrappedModule["eventData"]>

Constructors

  • Type Parameters

    • TWrappedModule extends ModuleFields<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>> & EventFunctions<ModuleEventData, TWrappedModule> = Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>

    Parameters

    • params: BaseParamsFields & {
          account?: AccountInstance;
          module: TWrappedModule;
      }

    Returns ModuleWrapper<TWrappedModule>

Properties

eventData: TWrappedModule["eventData"]
params: TWrappedModule["params"]
wrapperParams: BaseParamsFields & {
    account?: AccountInstance;
    module: TWrappedModule;
}
defaultLogger?: Logger
requiredQueries: string[]

Accessors

  • get account(): undefined | AccountInstance
  • Returns undefined | AccountInstance

  • get address(): string
  • Returns string

  • get config(): TWrappedModule["config"]
  • Returns TWrappedModule["config"]

  • get downResolver(): ModuleResolver
  • Returns ModuleResolver

  • get logger(): Logger | Console
  • Returns Logger | Console

  • get module(): TWrappedModule
  • Returns TWrappedModule

  • get queries(): string[]
  • Returns string[]

  • get upResolver(): ModuleResolver
  • Returns ModuleResolver

Methods

  • Type Parameters

    • T extends SchemaFields & PayloadFields & QueryFields & {
          schema: string;
      } | PayloadWrapper<SchemaFields & PayloadFields & QueryFields & {
          schema: string;
      }>

    Parameters

    • query: T
    • Optional payloads: (SchemaFields & PayloadFields & {
          schema: string;
      })[]
    • Optional account: AccountInstance

    Returns PromiseEx<[SchemaFields & PayloadFields & BoundWitnessFields & {
        query: string;
        resultSet?: string;
        schema: "network.xyo.boundwitness";
    }, (SchemaFields & PayloadFields & {
        schema: string;
    })[]], AccountInstance>

  • Type Parameters

    • T extends SchemaFields & PayloadFields & QueryFields & {
          schema: string;
      } | PayloadWrapper<SchemaFields & PayloadFields & QueryFields & {
          schema: string;
      }>

    Parameters

    • query: T
    • Optional payloads: (SchemaFields & PayloadFields & {
          schema: string;
      })[]
    • Optional account: AccountInstance

    Returns Promise<[SchemaFields & PayloadFields & BoundWitnessFields & {
        query: string;
        resultSet?: string;
        schema: "network.xyo.boundwitness";
    }, (SchemaFields & PayloadFields & {
        schema: string;
    })[]]>

  • Parameters

    • eventNames: Parameters<TWrappedModule["clearListeners"]>[0]

    Returns void

  • Returns Promise<Promise<Promisable<ModuleDescription, never>>>

  • Returns Promise<(SchemaFields & PayloadFields & {
        schema: string;
    })[]>

  • Parameters

    • eventName: Parameters<TWrappedModule["emit"]>[0]
    • eventArgs: Parameters<TWrappedModule["emit"]>[1]

    Returns Promise<void>

  • Parameters

    • eventName: Parameters<TWrappedModule["emitSerial"]>[0]
    • eventArgs: Parameters<TWrappedModule["emitSerial"]>[1]

    Returns Promise<void>

  • Parameters

    • query: [SchemaFields & PayloadFields & BoundWitnessFields & {
          query: string;
          resultSet?: string;
          schema: "network.xyo.boundwitness";
      }, (SchemaFields & PayloadFields & {
          schema: string;
      })[]]
    • result: undefined | ModuleQueryResult<SchemaFields & PayloadFields & {
          schema: string;
      }>

    Returns (null | SchemaFields & PayloadFields & {
        message?: string;
        schema: "network.xyo.error.module";
        sources?: string[];
    })[]

  • Parameters

    • eventNames: Parameters<TWrappedModule["listenerCount"]>[0]

    Returns number

  • Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    • eventNames: TEventName
    • listener: EventListener<TWrappedModule["eventData"][TEventName]>

    Returns void

  • Parameters

    Returns void

  • Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    • eventNames: TEventName
    • listener: EventListener<TWrappedModule["eventData"][TEventName]>

    Returns EventUnsubscribeFunction

  • Type Parameters

    • TEventName extends string | number | symbol

    Parameters

    • eventName: TEventName
    • listener: EventListener<TWrappedModule["eventData"][TEventName]>

    Returns EventUnsubscribeFunction

  • Returns Promise<(SchemaFields & PayloadFields & {
        schema: string;
    })[]>

  • Type Parameters

    • T extends SchemaFields & PayloadFields & BoundWitnessFields & {
          query: string;
          resultSet?: string;
          schema: "network.xyo.boundwitness";
      } = SchemaFields & PayloadFields & BoundWitnessFields & {
          query: string;
          resultSet?: string;
          schema: "network.xyo.boundwitness";
      }

    Parameters

    • query: T
    • Optional payloads: (SchemaFields & PayloadFields & {
          schema: string;
      })[]

    Returns Promise<ModuleQueryResult<SchemaFields & PayloadFields & {
        schema: string;
    }>>

  • Type Parameters

    • T extends SchemaFields & PayloadFields & BoundWitnessFields & {
          query: string;
          resultSet?: string;
          schema: "network.xyo.boundwitness";
      } = SchemaFields & PayloadFields & BoundWitnessFields & {
          query: string;
          resultSet?: string;
          schema: "network.xyo.boundwitness";
      }

    Parameters

    • query: T
    • Optional payloads: (SchemaFields & PayloadFields & {
          schema: string;
      })[]

    Returns Promisable<boolean, never>

  • Type Parameters

    • TModule extends ModuleFields<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>> & EventFunctions<ModuleEventData, TModule> = Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>

    Parameters

    Returns Promise<TModule[]>

  • Type Parameters

    • TModule extends ModuleFields<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>> & EventFunctions<ModuleEventData, TModule> = Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>

    Parameters

    • nameOrAddress: string

    Returns Promise<undefined | TModule>

  • Resolves the supplied filter into wrapped modules

    Example

    Example using ArchivistWrapper

    const filter = { address: [address] }
    const mods: ArchivistWrapper[] = await node.resolveWrapped(ArchivistWrapper, filter)

    Type Parameters

    • T extends ModuleWrapper<Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>, T> = ModuleWrapper<Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>>

    Parameters

    Returns Promise<T[]>

    An array of ModuleWrapper instances corresponding to the underlying modules matching the supplied filter

  • Type Parameters

    • T extends ModuleWrapper<Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>, T> = ModuleWrapper<Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>>

    Parameters

    Returns Promise<undefined | T>

  • Type Parameters

    • T extends SchemaFields & PayloadFields & QueryFields & {
          schema: string;
      } | PayloadWrapper<SchemaFields & PayloadFields & QueryFields & {
          schema: string;
      }>

    Parameters

    • queryPayload: T
    • Optional payloads: (SchemaFields & PayloadFields & {
          schema: string;
      })[]

    Returns Promise<(SchemaFields & PayloadFields & {
        schema: string;
    })[]>

  • Parameters

    • query: [SchemaFields & PayloadFields & BoundWitnessFields & {
          query: string;
          resultSet?: string;
          schema: "network.xyo.boundwitness";
      }, (SchemaFields & PayloadFields & {
          schema: string;
      })[]]
    • result: undefined | ModuleQueryResult<SchemaFields & PayloadFields & {
          schema: string;
      }>

    Returns void

  • Parameters

    • Optional module: Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>

    Returns boolean

  • Parameters

    • module: Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>

    Returns boolean

  • Parameters

    • module: Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>

    Returns string[]

  • Type Parameters

    • TModuleWrapper extends ModuleWrapper<Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>, TModuleWrapper>

    Parameters

    • this: ConstructableModuleWrapper<TModuleWrapper>
    • Optional module: Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>
    • Optional account: AccountInstance

    Returns undefined | TModuleWrapper

  • Type Parameters

    • TModuleWrapper extends ModuleWrapper<Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>, TModuleWrapper>

    Parameters

    • this: ConstructableModuleWrapper<TModuleWrapper>
    • Optional module: Module<ModuleParams<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: string;
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<Omit<SchemaFields & PayloadFields & {
          archivist?: ArchivistModuleConfig;
          name?: string;
          paging?: Record<string, {
              size?: number;
          }>;
          schema: "network.xyo.module.config";
          security?: {
              allowAnonymous?: boolean;
              allowed?: Record<string, (string | CosigningAddressSet)[]>;
              disallowed?: Record<string, string[]>;
          };
          storeQueries?: boolean;
      } & Omit<undefined, "schema">, "schema"> & {
          schema: string;
      }, "schema">, undefined>, ModuleEventData>
    • Optional account: AccountInstance

    Returns TModuleWrapper

Generated using TypeDoc