UNPKG

@zerochain/sdk

Version:

The Züs JS SDK is a JavaScript client library that provides a convenient interface for interacting with the Züs Network. It allows developers to perform various operations such as creating and managing allocations, uploading and downloading files, executi

84 lines (83 loc) 2.81 kB
import type { ActiveWallet, NetworkDomain } from '@/types/wallet'; /** * Split keys from the primary master key * * splitKeys splits the primary master key into n number of keys */ export declare const splitKeys: ({ domain, wallet, privateKey, numSplits, }: { domain: NetworkDomain; wallet: ActiveWallet; /** Primary master key */ privateKey: string; /** Number of keys to split into */ numSplits: number; }) => Promise<string>; /** * setWalletInfo sets the Split key wallet info * * setWalletInfo should be set before any transaction or client specific APIs. */ export declare const setWalletInfo: ({ domain, wallet, jsonWallet, splitKeyWallet, }: { domain: NetworkDomain; wallet: ActiveWallet; /** JSON format of wallet */ jsonWallet: string; /** * `true` If wallet keys is split. * * splitKeyWallet parameter is valid only if SignatureScheme is `bls0chain`. * * @default false */ splitKeyWallet?: boolean; }) => Promise<void>; /** setAuthUrl will be called by app to set zauth URL to SDK. */ export declare const setAuthUrl: ({ domain, wallet, url, }: { domain: NetworkDomain; wallet: ActiveWallet; /** URL of zAuth server */ url: string; }) => Promise<void>; /** * registerAuthorizer registers the callback function to authorize the transaction. * * It stores the callback function in the global variable `authCallback` */ export declare const registerAuthorizer: ({ domain, wallet, authTxnCallback, }: { domain: NetworkDomain; wallet: ActiveWallet; authTxnCallback: (message: string) => void; }) => Promise<void>; export declare const registerAuthCommon: ({ domain, wallet, authTxnCallback, }: { domain: NetworkDomain; wallet: ActiveWallet; authTxnCallback: (message: string) => void; }) => Promise<void>; /** * callAuth calls the authorization callback function and provides the message to pass to it. * * The message is passed as the first argument to the JS calling. */ /** authResponse Publishes the response to the authorization request. */ export declare const authResponse: ({ domain, wallet, response, }: { domain: NetworkDomain; wallet: ActiveWallet; response: string; }) => Promise<void>; export declare const registerZauthServer: ({ domain, wallet, serverAddress, }: { domain: NetworkDomain; wallet: ActiveWallet; serverAddress: string; }) => Promise<void>; export declare const zauthRetrieveKey: ({ domain, wallet, clientId, peerPublicKey, serverAddress, token, }: { domain: NetworkDomain; wallet: ActiveWallet; /** Wallet ID */ clientId: string; /** Peer public key */ peerPublicKey: string; /** Server address */ serverAddress: string; /** JWT Token */ token: string; }) => Promise<string>;