RTSDK
    Preparing search index...

    Class AssetFactory

    const Asset = new AssetFactory(myTopiaInstance);
    

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

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

    Methods

    • Instantiate a new instance of Asset class.

      Parameters

      Returns Asset

      Returns a new Asset object with the asset id.

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

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

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

    • Returns AxiosInstance

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

      Parameters

      Returns Promise<Asset>

      Returns a new Asset object with the asset details.

      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);