Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
104 lines (76 sloc) 1.75 KB

Client SDK API Reference

Register Event Subscription

function on(
  event: string,
  callback: (error: Error | null, payload: any | null) => void
): void;

Events: connect, disconnect, session_update, call_request, wc_sessionRequest, wc_sessionUpdate, wc_exchangeKey

Create New Session

async function createSession(): Promise<void>;

Approve Session Request

function approveSession({
  chainId: number, // Required
  accounts: string[] // Required
}): void;

Reject Session Request

function rejectSession({
  message: string // Optional
}): void;

Update Session

function updateSession({
  chainId: number, // Required
  accounts: string[] // Required
}): void;

Kill Session (disconnect)

function killSession({
  message: string // Optional
}): void;

Send Transaction (eth_sendTransaction)

async function sendTransaction({
  from: string, // Required
  to: string, // Required
  gasLimit: string, // Required
  gasPrice: string, // Required
  value: string, // Required
  data: string, // Required
  nonce: string // Required
}): Promise<string>;

Returns: Transaction hash

Sign Message (eth_sign)

async function signMessage(params: string[]): Promise<string>;

Returns: Signature

Sign Typed Data (eth_signTypedData)

async function signTypedData(params: any[]): Promise<string>;

Returns: Signature

Approve Call Request

function approveRequest({
  id: number, // Required
  result: any // Required
}): void;

Reject Call Request

function rejectRequest({
  id: number, // Required
  result: null // Required
}): void;