JS Extensions

JSBridge is injected javascript code in MYKEY dapp browser enviroment by default, which support Scatter protocol, and web3js protocol.

In order to control the MYKEY application conveniently, MYKEY adds the following methods:

Method

Description

Check whether the current wallet is MYKEY

Close App window and return to MYKEY

Open full screen

Close full screen

Disable physical back button(Android Only)

Allow physical back button(Android Only)

Get MYKEY Account Information

Get client configuration

Send transaction

Apply MYKEY sign transactions

Set application title

Show loading animation

Hidden loading animation

serialize specified function call

Check whether the current wallet is MYKEY

window.ethereum.isMYKEY

Close App window

Close App window and return to MYKEY.

Open full screen

Open full screen

Params

Param

Type

Description

isLandscape

boolean

true(Landscape)

fasle

Close full screen

Close full screen.

Disable physical back button

Disable physical back button, only for Android

Allow physical back button

Allow physical back button, only for Android

Get MYKEY Account Information

Get MYKEY Account Information

Params

Param

Type

Description

openChain

string

true|fasle

true: open creating page if no chains for an account

Return

Get client configuration

Get client configuration

Return

Send transaction

Send transaction

Params

Param

Type

Description

transaction

string

Specify chain and actions

Return

Example:

Buy ram on EOS.

New field extra will be effected from Android:2.5.0,IOS:2.5.0

Sign

Apply MYKEY sign transactions

Params

Param

Type

Description

message

string

unsigned message

Return

Get Transaction Progress

Params

Param

Type

Description

chain

string

EOS|ETH

transactionId

string

blockNum

int

blockNum, optional

Return

Effective from: Android:2.5.0,iOS:2.5.0

Set application title

Set application title

Params

Param

Type

Description

title

string

application title

Show loading animation

Show loading animation

Hidden loading animation

hidden loading animation

serialize specified function call

serialize specified function call

Return

result:{"errorCode":0,"errorMsg":"","data":"[serialized data]"}

Params

Param

Type

Description

abi

string

abi for the function, type string, eg:"[{\"constant\":false,\"inputs\":[

{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,

\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"

method

string

method name, type string, eg:transfer。

param

string

params, eg:{_to:"0xc4ED1B3f31acadbE3c14B20fA766B6C4B1FAB208",

_value:"20000000000000000000"}

Last updated

Was this helpful?