Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (37 sloc) 974 Bytes

Ethereum API

web3

The associated web3 object. Please refer to web3 documentation for more information

Ethereum

The associated ethereum object. Please refer to Metamask documentation here

Examples

await torus.ethereum.enable(); // does the same thing as `await torus.login();`

Provider

The associated provider object

Reference

declare class Provider {
  send(payload: JsonRPCRequest, callback: Callback<JsonRPCResponse>): any;
}

interface JsonRPCResponse {
  jsonrpc: string;
  id: number;
  result?: any;
  error?: string;
}

interface JsonRPCRequest {
  jsonrpc: string;
  method: string;
  params: any[];
  id: number;
}

interface Callback<ResultType> {
  (error: Error): void;
  (error: null, val: ResultType): void;
}

Examples

const web3 = new Web3(torus.provider);
You can’t perform that action at this time.