PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/casper-js-sdk/dist/lib
Просмотр файла: Signer.d.ts
/**
* Provide methods to communicate with [CasperLabs Signer Extension](https://github.com/casper-ecosystem/signer).
* Works only on browser.
*
* @packageDocumentation
*/
import { JsonTypes } from 'typedjson';
import { CasperLabsHelper, SignerTestingHelper } from '../@types/casperlabsSigner';
declare global {
interface Window {
casperlabsHelper: CasperLabsHelper;
signerTestingHelper: SignerTestingHelper;
}
}
/**
* Returns Signer version
*/
export declare const getVersion: () => Promise<string>;
/**
* Check whether CasperLabs Signer extension is connected
*/
export declare const isConnected: () => Promise<boolean>;
/**
* Attempt connection to Signer
*/
export declare const sendConnectionRequest: () => void;
/**
* **Deprecated** in favour of `getActivePublicKey()`.
* Returns `base64` encoded public key of currently selected account.
*
* @throws Error if haven't connected to CasperLabs Signer browser extension.
*/
export declare const getSelectedPublicKeyBase64: () => Promise<string>;
/**
* Retrieve the active public key.
*
* @returns {string} Hex-encoded public key with algorithm prefix.
*/
export declare const getActivePublicKey: () => Promise<string>;
/**
* Send Deploy in JSON format message to Signer plugin to sign.
*
* @param deploy deploy in JSON format
* @param sourcePublicKeyHex public key in hex format with algorithm prefix. Used to sign the deploy
* @param targetPublicKeyHex public key in hex format with algorithm prefix. Used to display hex-formatted address on the UI
*
* @throws Error if haven't connected to CasperLabs Signer browser extension.
* @throws Error if sourcePublicKeyHex is not the same as the key that Signer used to sign the message
* @throws Error if targetPublicKeyHex is not the same as the key that is used as target in deploy.
*/
export declare const sign: (deploy: {
deploy: JsonTypes;
}, sourcePublicKey: string, targetPublicKey: string) => Promise<{
deploy: JsonTypes;
}>;
export declare const signMessage: (message: string, signingPublicKey: string) => Promise<string>;
export declare const disconnectFromSite: () => void;
export declare const forceConnection: () => void;
export declare const forceDisconnect: () => void;
export declare const hasCreatedVault: () => Promise<boolean>;
export declare const resetExistingVault: () => Promise<void>;
export declare const createNewVault: (password: string) => Promise<void>;
export declare const createTestAccount: (name: string, privateKey: string) => Promise<void>;
export declare const getToSignMessageID: () => Promise<number | null>;
export declare const signTestDeploy: (msgId: number) => Promise<void>;
Выполнить команду
Для локальной разработки. Не используйте в интернете!