krypteo
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

Krypteo Wallet SDK

Krypteo SDK нь Bitski JS санг krypteo.mn-д нэвтрэх боломжтой болгон өөрчилсөн сан юм. Уг санг ашигласнаар Metamask зэрэгтэй ижил web3js-ийн provider байдлаар ашиглагддаг төвлөрсөн хэтэвч Krypteo Wallet-ийг өөрийн вэб дээр холбох боломжтой болно.

Суулгах заавар:

npm install --save krypteo

Ашиглах заавар:

import { Bitski } from 'krypteo';
import Web3 from 'web3';

const bitski = new Bitski('CLIENT-ID', 'https://myapp.com/callback.html');

const provider = bitski.getProvider();
const web3 = new Web3(provider);

// public calls are always available
const network = await web3.eth.getBlockNumber();

// connect via oauth to use the wallet (call this from a click handler)
await bitski.signIn();

// now you can get accounts
const accounts = await web3.eth.getAccounts();

// and submit transactions for the user to approve
const txn = await web3.eth.sendTransaction({
  from: accounts[0],
  to: '...',
  value: web3.utils.toWei('1')
});

Readme

Keywords

none

Package Sidebar

Install

npm i krypteo

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

3.45 MB

Total Files

170

Last publish

Collaborators

  • suugii