MYKEY Docs
中文English
English
English
  • Introduction
  • Sign in with MYKEY
    • Verify signature at backend server
    • More detailed tech and process of MYKEY login
  • Integrate with MYKEY
    • Multiple ways to integration with MYKEY
    • Mobile Dapp with H5 pages
      • ETH
      • EOS
      • JS Extensions
    • Integration via MYKEY Android SDK
      • Preconditions
      • Initiate SDK
      • Authorize
      • Sign
      • Transfer
      • Call contracts
    • Integration via MYKEY iOS SDK
      • Preconditions
      • Initiate SDK
      • Authorize
      • Sign
      • Transfer
      • Call contracts
    • Web application with scanning qrcode
    • SimpleWallet Protocol Compatible
    • Deeplink Protocol
  • Dive into MYKEY
    • Dive into MYKEY account
    • Classes and methods
      • Android Classes
      • iOS Classes
    • Error Code
    • Identify MYKEY deposit transaction
      • ETH deposit
      • EOS deposit
    • MYKEY Whitepaper
  • KEY ID
    • KEYID ETH Contracts introduction
      • Account Module
      • Account Storage Module
      • Logic Management Module
      • Logic Module
    • Account recovery mechanism
    • KEYID contract upgrade process
    • KEYID contract upgrade records
      • ETH
        • KEY ID Ethereum Contracts Upgrade Pending Time Adjustment
        • KEY ID Ethereum logic contract module upgrade announcement
        • KEY ID Ethereum Contracts Upgrade Pending Time Adjustment
        • KEY ID Ethereum AccountLogic/DualsigsLogic Contracts Upgrade
        • KEY ID Ethereum DappLogic Contract Upgrade
  • Development Resources
    • Ethereum
    • EOS
  • Join Us
    • DApp submit
    • Developers Community
Powered by GitBook
On this page
  • Check whether the current wallet is MYKEY
  • Close App window
  • Open full screen
  • Close full screen
  • Disable physical back button
  • Allow physical back button
  • Get MYKEY Account Information
  • Get client configuration
  • Send transaction
  • Sign
  • Get Transaction Progress
  • Set application title
  • Show loading animation
  • Hidden loading animation
  • serialize specified function call

Was this helpful?

  1. Integrate with MYKEY
  2. Mobile Dapp with H5 pages

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.

window.MyKey.Browser.closeWindow

Open full screen

Open full screen

window.MyKey.Browser.openFullScreen

Params

Param

Type

Description

isLandscape

boolean

true(Landscape)

fasle

Close full screen

Close full screen.

window.MyKey.Browser.closeFullScreen

Disable physical back button

Disable physical back button, only for Android

window.MyKey.Browser.forbidPhysicalBack

Allow physical back button

Allow physical back button, only for Android

window.MyKey.Browser.allowPhysicalBack

Get MYKEY Account Information

Get MYKEY Account Information

window.MyKey.Browser.getAccountInfo

Params

Param

Type

Description

openChain

string

true|fasle

true: open creating page if no chains for an account

Return

Return format: Promise
{
	"data": {
		"accountName": "",     //Nickname in MYKEY
		"chainInfoList": ["account": "", "chain": ""],
		"id": "",    //unique id in MYKEY
		"operationKeys": ["","",""],   //public keys of three operation keys
		"xpubOperationKeys": ["","",""]  //public keys of three operation keys in Xpub format
	},
	"errorCode": 0
}

Get client configuration

Get client configuration

window.MyKey.Browser.getClientConfig

Return

Return format: Promise
{
	"data": {
		"currency": "CNY",
		"locale": "zh-CN",
		"maxKycBindAccount": 1,
		"regioin": "CN",
		"userAgent": "",       //include field channel:MYKEY
		"recaptchaUserKey":""  //only use for MYKEY redpackage
	},
	"errorCode": 0
}

Send transaction

Send transaction

window.MyKey.Browser.sendTransaction(transaction) => Promise

Params

Param

Type

Description

transaction

string

Specify chain and actions

Return

Return format: Promise
result: {
	"errorCode": 0,
	"errorMsg": "",
	"data": {
		"transactionId": "",
		"signature": ""
	}
}

Example:

Buy ram on EOS.

window.MyKey.Browser.sendTransaction('{"actions":[{"account":"eosio","name":"buyram","data":{"payer":"","receiver":"","quant":"1.0000 EOS"}}],"chain":"EOS"},"extra":{"key":"value"}}')

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

Sign

Apply MYKEY sign transactions

window.MyKey.Browser.sign(message) => Promise

Params

Param

Type

Description

message

string

unsigned message

Return

Return format: Promise
result: {
	"errorCode": 0,
	"errorMsg": "",
	"data": {
		"signature": ""
	}
}

Get Transaction Progress

window.MyKey.Browser.getTransactionProgress

Params

Param

Type

Description

chain

string

EOS|ETH

transactionId

string

blockNum

int

blockNum, optional

Return

Return format: Promise
result: {
	"errorCode": 0,
	"errorMsg": "",
	"data": {
		"percent": ,   //[0 - 100]
		"blockNum":    //[blockNum]
	}
}

Effective from: Android:2.5.0,iOS:2.5.0

Set application title

Set application title

window.MyKey.Browser.setTitle(title)

Params

Param

Type

Description

title

string

application title

Show loading animation

Show loading animation

window.MyKey.Browser.showLoading

Hidden loading animation

hidden loading animation

window.MyKey.Browser.hiddenLoading

serialize specified function call

serialize specified function call

window.MyKey.Browser.encodeFunctionCall(abi, method, param) => Promise

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"}

PreviousEOSNextIntegration via MYKEY Android SDK

Last updated 4 years ago

Was this helpful?

isMYKEY
closeWindow
openFullScreen
closeFullScreen
forbidPhysicalBack
allowPhysicalBack
getAccountInfo
getClientConfig
sendTransaction
sign
setTitle
showLoading
hiddenLoading
encodeFunctionCall