dpal public api
use api in typescript
const doge = window?.DogeApi;connect wallet
const { status } = await doge.enable();
if ( status === 'success') {
const { userAddress } = await doge.userAddress();
// const { network } = await doge.network();
}
// or check isEnabled
if (await doge.isEnabled()) {
const { userAddress } = await doge.userAddress();
// const { network } = await doge.network();
}
// full demo
if(doge){
if (await doge.isEnabled()) {
const { userAddress } = await doge.userAddress();
// const { network } = await doge.network();
} else {
const { status } = await doge.enable();
if ( status === 'success') {
const { userAddress } = await doge.userAddress();
// const { network } = await doge.network();
}
}
}else{
console.log(`please install dpal wallet`)
}request to pay
request to sign message
transfer d20(^v1.2.2)
timeout
Last updated