Report bug · Request feature · Docs
ADS Wallet Connector is an browser JavaScript connector to ADS Browser Wallet.
Place the following script near the end of your pages, right before the closing </body>
tag, to enable ADS connector.
<script src="https://connect.adshares.net/dist/connector.min.js"></script>
npm install @adshares/ads-connector
yarn add @adshares/ads-connector
AdsConnector.ready(function() {
var adsWallet = new AdsWallet();
});
import AdsWallet from '@adshares/ads-connector'
const adsWallet = new AdsWallet();
All methods return Promises.
const adsWallet = new AdsWallet(); // pass true to enable testnet
// check if wallet is installed
adsWallet.getInfo().then(info => alert(info.version), error => alert('Not installed'))
// authenticate
adsWallet.authenticate('message').then(response => {})
// broadcast
adsWallet.broadcast('4164736861726573').then(response => {})
// transfer
adsWallet.sendOne('0001-00000001-8B4E', 1.23, '4164736861726573').then(response => {})
// --- info ---
{
id: string,
name: string,
version: string,
description: string,
author: string
}
// --- authenticate ---
{
status: string, // "accepted" or "rejected",
testnet: boolean,
signature: string, // signature of the message with prefix "message:"
account: {
address: string, // account address, eg. '0001-00000001-8B4E'
publicKey: string, // account public key
balance: string, // current accoun balance in ADS (float as string)
messageId: integer, // current account message id
hash: string // current account hash
}
}
// --- transactions ---
{
status: string, // 'accepted' or 'rejected',
testnet: boolean,
transaction: {
id: string, // transaction id, eg. '0001:00002361:0001'
type: string, // transaction type ('broadcast', 'send_one'),
fee: string // transaction fee in ADS (float as string)
}
}
Please follow our Contributing Guidelines
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Maciej Pilarczyk - programmer
See also the list of contributors who participated in this project.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.