0.0.4 • Published 9 months ago

@unielon/wallet-tg-sdk v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

Unielon Telegram SDK

Install

npm install @unielon/unielon-tg-sdk

Usage

import { UnielonWallet } from "@unielon/unielon-tg-sdk";
const { unielon } = new UnielonWallet({ ...options });

init options configuration

UnielonWallet instance options configuration

namedescriptiontypedefault
connect_direct_linkwallet Telegram bot app urlstringhttps://t.me/unielonbot/wallet
injectedHas it been injected into the web window?booleanfalse
request_timeouttimeoutnumber1000
metaDataclient infoObject-

metaData configuration

namedescriptiontypedefault
hostnamehostnamestring-
iconclinet iconstring-
nameclient namestring-
urlurl,you clicentstring-
descriptiondescriptionstring-
direct_linkdirect linkstring-

Unielon wallet chain API

Code snippet for dogecoin chain request:

try {
  const result = await unielon.requestAccounts();
  // result is {code,message,data: ['Dt92u***29dc',...]}
  return result;
} catch (error) {
  // This error code indicates that the chain has not been added to Unielon Wallet.
}

Dogecoin chain request Api

methoddescriptionparamsresponse
requestAccountsconnect dogecoin wallet--
sendDogecoinSend Dogecoin transaction request,inscription&deploy&mint Drc20 tick--
sendTradeSend Dogecoin trade request--
sendBoxSend box transaction request--
createLpCreate liquidity pool for trading pair--
createSwapSend swap transaction--
sendBoxBox inscription, deployment and minting---
getBalanceget dogecoin chain balances---
getNetworkget dogecoin chain network---
getAccountsget dogecoin accounts---
signMessagesign a message with the connected wallet.---
sendNftget dogecoin address---