import { CreateDirectRequest , CreateRequest , pubkeyOf , toSolanaKeyMaterial , } from '../lib/util' ; import * as service from '../service/create' ; import { Channel } from '../lib/Channel' ; param request export const create = async ( request ) : Promise < Channel > => { const payer = toSolanaKeyMaterial ( request . payer ) ; const owner = request . owner ? toSolanaKeyMaterial ( request . owner ) : pubkeyOf ( payer ) ; return service . createChannel ( owner , payer , request . name , request . signCallback , request . cluster ) ; } ; param request export const createDirect = async ( request ) : Promise < Channel > => { const payer = toSolanaKeyMaterial ( request . payer ) ; const owner = request . owner ? toSolanaKeyMaterial ( request . owner ) : pubkeyOf ( payer ) ; return service . createDirectChannel ( owner , payer , request . inviteeDID , request . signCallback , request . cluster ) ; } ;