UNPKG

@minespider/core-bundles

Version:

A high-level SDK for Minespider Core. It abstract the low-level features from the core SDK for a more high-level usage such as DAPPs. Some of the features are 1:1 with the SDK some others abstract some low-level interactions or multiple actions

37 lines (34 loc) 826 B
import { MinespiderFacade } from "../../src/MinespiderBundle/Business/MinespiderFacade"; import { CertificateFile, CertificateEnvelope } from "@minespider/core-sdk"; export const splitAndSellCertificate = async ( facade: MinespiderFacade, certificateEnvelope: CertificateEnvelope, amount: number, to: string ) => { const publicFileList = [ new CertificateFile( Buffer.from("public file " + Math.random()), "public.txt", { type: "text/plain" } ) ]; const privateFileList = [ new CertificateFile( Buffer.from("private file " + Math.random()), "private.txt", { type: "text/plain" } ) ]; return facade.sellCertification( certificateEnvelope.certificateUuid, amount, to, publicFileList, privateFileList ); };