UNPKG

@intuweb3/sdk

Version:

INTU SDK - Modern blockchain interaction toolkit

62 lines (61 loc) 7.21 kB
import { registerWasmAsset } from "./web_assembly/wasm_wrapper.native.js"; import type { PreRegisterResponse, PolybaseKeyResponse, RegisterStepOneResponse, RegisterStepTwoResponse, RegisterStepThreeResponse, SignTransactionResponse, CombineTransactionsResponse, ParseTransactionResponse, EncryptResponse, DecryptResponse } from "./types/models.js"; export { registerWasmAsset }; declare global { var __intuWebViewWasmService: { isWasmReady: () => boolean; createSeed: () => Promise<string>; preRegister: (signature: string) => Promise<{ encryptionKey: string; megaPublicKey: string; encMegaSecretKey: string; }>; getPolybaseKey: (signature: string) => Promise<{ key: string; }>; registerStepOne: (seed: string, threshold: number, index: number, megaPkArray: string[]) => Promise<{ pedersenDealingArray: string[]; }>; registerStepTwo: (seed: string, threshold: number, index: number, megaPkArray: string[], encryptionSignature: string, encryptedMegaSecret: string, dealingsKeyArray: string[], dealingsKappaArray: string[], dealingsLambdaArray: string[]) => Promise<{ pedersenOpeningArray: string[]; simpleDealingArray: string[]; pedersenTranscriptArray: string[]; }>; registerStepThree: (seed: string, threshold: number, index: number, megaPkArray: string[], encryptionSignature: string, encryptedMegaSecret: string, simpleDealingKeyArray: string[], simpleDealingKappaArray: string[], pedersenTranscriptKey: string, pedersenTranscriptKappa: string, pedersenOpeningLambda: string) => Promise<{ simpleOpeningArray: string[]; multiplyDealingArray: string[]; simpleTranscriptArray: string[]; }>; getMasterPublicKey: (transcript_key: string) => Promise<string>; } | null; } export declare function createSeed(): Promise<{ seed: string; }>; export declare function createRandomMessage(): Promise<{ message: string; }>; export declare function getUniqueHashFromSignature(signature: string): Promise<PolybaseKeyResponse>; export declare function parseTransaction(txdata: string): Promise<ParseTransactionResponse>; export declare function getPolybaseKey(signature: string): Promise<PolybaseKeyResponse>; export declare function preRegister(signature: string): Promise<PreRegisterResponse>; export declare function encryptData(encryptionKey: string, dataToEncrypt: string): Promise<EncryptResponse>; export declare function decryptData(encryptionSignature: string, dataToDecrypt: string): Promise<DecryptResponse>; export declare function formTransaction(to: string, value: string, chainId: string, nonce: string, data: string, gasPrice: string, gas: string, decimal: string): Promise<string>; export declare function registerStepOne(seed: string, threshold: number, index: number, megaPkArray: string[]): Promise<RegisterStepOneResponse>; export declare function registerStepTwo(seed: string, threshold: number, index: number, megaPkArray: string[], encryptionSignature: string, encryptedMegaSecret: string, dealingsKeyArray: string[], dealingsKappaArray: string[], dealingsLambdaArray: string[]): Promise<RegisterStepTwoResponse>; export declare function registerStepThree(seed: string, threshold: number, index: number, megaPkArray: string[], encryptionSignature: string, encryptedMegaSecret: string, dealingsKeyArray: string[], dealingsKappaArray: string[], transcriptKeySingle: string, transcriptKappaSingle: string, pedersenOpeningLambda: string): Promise<RegisterStepThreeResponse>; export declare function getMasterPublicKey(transcript_key: string): Promise<string>; export declare function signTransaction(seed: string, threshold: number, index: number, message: string, encryptionSignature: string, encryptedMegaSecret: string, dealingKeyXLambdaArray: string[], dealingKappaXLambdaArray: string[], pedersenOpeningLambda: string, simpleTranscriptKey: string, simpleTranscriptKappa: string, transcriptLambda: string): Promise<SignTransactionResponse>; export declare function signTransactionWithoutLambda(seed: string, message: string, encryptionSignature: string, openingSimpleKey: string, openingSimpleKappa: string, simpleTranscriptKey: string, simpleTranscriptKappa: string): Promise<SignTransactionResponse>; export declare function combineSignedTransactions(seed: string, threshold: number, message: string, signatureArray: string[], transcript_key: string, transcript_kappa: string): Promise<CombineTransactionsResponse>; export declare function combineSignedTransactionsWithoutLambda(seed: string, threshold: number, message: string, signatureArray: string[], transcript_key: string, transcript_kappa: string): Promise<CombineTransactionsResponse>; export declare function reshareStepByOriginalGroup(seed: string, threshold: number, index: number, encryptionSignature: string, simpleOpeningKey: string, newMegaPkArray: string[]): Promise<void>; export declare function reshareStepOneByNewUser(seed: string, threshold: number, index: number, newMegaPkArray: string[]): Promise<void>; export declare function reshareStepTwo(seed: string, threshold_reshare: number, index: number, megaPkArray: string[], encryptionSignature: string, encryptedMegaSecret: string, simple_dealings_key_reshared_once_or_twice: string[], simpleTranscriptKey: string, pedersenDealingsKappaReshare: string[], pedersenDealingsLambdaReshare: string[]): Promise<void>; export declare function reshareStepThree(seed: string, threshold_reshare: number, index: number, megaPkArray: string[], encryptionSignature: string, encryptedMegaSecret: string, simpleDealingsKappaReshare: string[], pedersenOpeningLambdaReshareArray: string[], simple_dealings_key_reshared_once_or_twice: string[], transcript_key_simple_or_reshared_once: string, transcriptKappaReshare: string): Promise<void>; export declare function reshareSignTransaction(seed: string, threshold_reshare: number, index: number, message: string, encryptionSignature: string, encryptedMegaSecret: string, pedersenDealingsLambdaReshare: string[], dealingsKeyXlambdaReshare: string[], dealingsKappaXlambdaReshare: string[], pedersenOpeningLambdaReshare: string, transcriptKeyResharedTwice: string, simpleTranscriptsKappaReshare: string): Promise<void>; export declare function reshareCombineSignedTransactions(simpleTranscriptKappaReshare: string, transcriptKeyResharedTwice: string, threshold: number, seed: string, message: string, signatureArray: string[]): Promise<void>; export declare function signMessage(seed: string, threshold: number, index: number, message: string, encryptionSignature: string, encryptedMegaSecret: string, dealingKeyXLambdaArray: string[], dealingKappaXLambdaArray: string[], pedersenOpeningLambda: string, simpleTranscriptKey: string, simpleTranscriptKappa: string, pedersenTranscriptLambda: string): Promise<void>; export declare function combineSignedMessages(seed: string, threshold: number, message: string, signatureArray: string[], transcript_key: string, transcript_kappa: string): Promise<CombineTransactionsResponse>; export declare function createMessage(message: string): Promise<string>;