Class AssetFactory

Usage

const Asset = new AssetFactory(myTopiaInstance);

Hierarchy

Constructors

Properties

credentials: undefined | InteractiveCredentials
jwt?: string
requestOptions: object
topia: Topia

Methods

  • Summary

    Instantiate a new instance of Asset class.

    Usage

    const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
    

    Parameters

    Returns Asset

  • Parameters

    • __namedParameters: {
          error?: unknown;
          message?: string;
          params?: object;
          sdkMethod?: string;
      }
      • Optional error?: unknown
      • Optional message?: string
      • Optional params?: object
      • Optional sdkMethod?: string

    Returns {
        data: {};
        message: string;
        method: string;
        params: object;
        sdkMethod: undefined | string;
        stack: string;
        stackTrace: Error;
        status: number;
        success: boolean;
        url: string;
    }

    • data: {}
      • message: string
      • method: string
      • params: object
      • sdkMethod: undefined | string
      • stack: string
      • stackTrace: Error
      • status: number
      • success: boolean
      • url: string
    • Returns AxiosInstance

    • Summary

      Upload a new Asset and return a new instance of Asset class.

      Usage

      const assetPayload = {
      assetName: "exampleAssetName"
      bottomLayerURL: "https://example.bottomLayerURL"
      creatorTags: { "decorations": true },
      tagJson: "[{"label":"decorations","value":"decorations"}]",
      isPublic: true,
      topLayerURL: "https://example.topLayerURL"
      }
      const asset = await Asset.upload(assetPayload, apiKey);

      Parameters

      Returns Promise<Asset>