@investorid/identity-sdk
Version:
Interact with BlockChain Identities.
56 lines (55 loc) • 1.51 kB
TypeScript
import { Signer } from 'ethers';
import { Provider } from "ethers/providers";
/**
* Allowed Ethereum network for the SDK.
*/
export declare enum NETWORKS {
HOMESTEAD = "homestead",
ROPSTEN = "ropsten"
}
/**
* Thrown when attempting to set an Invalid BlockChain Provider.
*/
export declare class InvalidProviderError extends Error {
constructor(message?: string);
}
/**
* The current BlockChain Provider of the SDK.
*/
export declare let provider: Provider | Signer | null;
/**
* Get the current set BlockChain Provider.
*/
export declare function getProvider(): Provider | Signer;
/**
* Set the BlockChain Provider for the SDK.
* @param newProvider
*/
export declare function setProvider(newProvider: Provider | Signer | NETWORKS | string | null): void;
/**
* Does the SDK allows to fetch data from unsecured providers?
*/
export declare let allowUnsecuredProviders: boolean;
/**
* Configure the SDK with generic options. Invalid parameters will be ignored.
* @param options
* @params [options.allowUnsecuredProviders] Boolean.
*/
export declare function config(options: {
allowUnsecuredProviders?: boolean;
}): void;
declare const _default: {
enums: {
NETWORKS: typeof NETWORKS;
};
errors: {
InvalidProviderError: typeof InvalidProviderError;
};
config: typeof config;
settings: {
allowUnsecuredProviders: boolean;
};
getProvider: typeof getProvider;
setProvider: typeof setProvider;
};
export default _default;