Functions
1. Connect to Endless Wallet
import { UserResponseStatus } from '@endlesslab/endless-web3-sdk';
const connectRes = await jssdk.connect();
if (connectRes.status === UserResponseStatus.APPROVED) {
// connected, you can get the wallet address
// The wallet address is Base58 string
console.log('wallet address: ', connectRes.args.account);
}else{
// connect failed
}2. GetAccount method
import { EndLessSDKEvent } from '@endlesslab/endless-web3-sdk';
jssdk.on(EndLessSDKEvent.INIT, async () => {
const getAccountRes = await jssdk.getAccount();
if (getAccountRes.status === UserResponseStatus.APPROVED) {
// The wallet address is Base58 string
console.log('wallet address: ', connectRes.args.account);
}else{
// The user is not connected to the dapp or the current wallet has not been created.
}
});3. Disconnect method
4. Signature message method
5. Sending a Transaction method
6. Signature transaction method
7. Open view method
8. Add event listening method
9. Uninstall event listening method
10. Transaction of sending EDS coins with script payload
Last updated