import { Identity } from '@textile/crypto' ; import { CopyAuthOptions , GrpcAuthentication , WithKeyInfoOptions , WithUserAuthOptions , } from '@textile/grpc-authentication' ; import { KeyInfo , UserAuth } from '@textile/security' ; import log from 'loglevel' ; import { addresses , balance , cidInfo , cidSummary , retrievalDealRecords , storageDealRecords , } from './api' ; import { AddressInfo , CidInfo , CidSummary , DealRecordsConfig , RetrievalDealRecord , StorageDealRecord , } from './types' ; const logger = log . getLogger ( 'filecoin' ) ; example export class Filecoin extends GrpcAuthentication { example example static copyAuth ( auth , options ? ) { return new Filecoin ( auth . context , options ?. debug ) ; } example static withUserAuth ( auth , options ? ) { const res = super . withUserAuth ( auth , options ) ; return this . copyAuth ( res , options ) ; } example static async withKeyInfo ( key , options ? ) { const auth = await super . withKeyInfo ( key , options ) ; return this . copyAuth ( auth , options ) ; } example async getToken ( identity ) { return super . getToken ( identity ) ; } /**
     * {@inheritDoc @textile/hub#GrpcAuthentication.getToken}
     */ setToken ( token ) { return super . setToken ( token ) ; } example async getTokenChallenge ( publicKey , callback ) { return super . getTokenChallenge ( publicKey , callback ) ; } beta async addresses ( ) { return addresses ( this ) ; } beta param address async balance ( address ) { return balance ( this , address ) ; } beta param cids async cidSummary ( ... cids ) { return cidSummary ( this , undefined , ... cids ) ; } beta param cid async cidInfo ( cid ) { return cidInfo ( this , undefined , cid ) ; } beta param config async storageDealRecords ( config ) { return storageDealRecords ( this , config ) ; } beta param config async retrievalDealRecords ( config ) { return retrievalDealRecords ( this , config ) ; } }