// Copyright Abridged, Inc. 2021,2024. All Rights Reserved. // Node module: @collabland/sdk // This file is licensed under the MIT License. // License text available at https://opensource.org/license/mit/ import {inject, Provider} from '@loopback/core'; import {getService, RestDataSource} from '../datasources/index.js'; import {AssetClaimResponse} from '../models/asset-claim-response.model.js'; import {AssetVerificationResponse} from '../models/asset-verification-response.model.js'; import {AssetOwnershipExcludingCreatedTimePkSkId} from '../models/asset-ownership-excluding-created-time-pk-sk-id.model.js'; /** * The service interface is generated from OpenAPI spec with operations tagged * by AssetOwnershipController. */ export interface AssetOwnershipService { /** * @param account * @param assets * @returns OK */ getAssets( account: string, assets?: string[], ): Promise< { asset?: string; balance?: string | number; tokens?: { id?: string | number; balance?: string | number; uri?: string; metadata?: {}; }[]; }[] >; /** * @param account * @param assets * @returns OK */ getOwnership(account: string, assets?: string[]): Promise; /** * @param token * @returns OK */ verifyOwnership(token: string): Promise; /** * @param format * @param _requestBody * @returns OK */ generateJwt( format: 'jwt' | 'ae' | undefined, _requestBody: AssetOwnershipExcludingCreatedTimePkSkId, ): Promise<{ token?: string; slug?: string; url?: string; }>; } export class AssetOwnershipServiceProvider implements Provider { constructor( // rest must match the name property in the datasource json file @inject('datasources.rest') protected dataSource: RestDataSource = new RestDataSource(), ) {} async value(): Promise { const service = await getService<{ apis: {AssetOwnershipController: AssetOwnershipService}; }>(this.dataSource); return service.apis['AssetOwnershipController']; } }