Wallets

These methods are accessible through profile.wallets() which exposes a WalletRepository instance.

Wallet Calls

Get a list of all wallets with key and value

profile.wallets().all();

Get the first listed wallet

profile.wallets().first();

Get the last listed wallet

profile.wallets().last();

Get a list of all wallets grouped by coin

profile.wallets().allByCoin();

Get a list of all wallet keys

profile.wallets().keys();

Get a list of all wallet values

profile.wallets().values();

Create a new wallet from a mnemonic, coin implementation and network

await profile.wallets().importByMnemonic("this is a top secret passphrase", "ARK", "devnet");

Create a new wallet from an address, coin implementation and network

await profile.wallets().importByAddress("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib", "ARK", "devnet");

Create a new wallet from an address, coin implementation, network and ledger account index

await profile.wallets().importByAddressWithLedgerPath("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib", "ARK", "devnet", "0");

Create a new wallet from an address, coin implementation, network and BIP38 password

await profile.wallets().importByMnemonicWithEncryption("this is a top secret passphrase", "ARK", "devnet", "password");

Generate a new wallet from a coin implementation and network

await profile.wallets().generate("ARK", "ark.devnet");

Restore a wallet using its wallet data

profile.wallets().restore(wallet);

Find the wallet by the given ID

profile.wallets().findById("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

Find the wallet for the given address

profile.wallets().findByAddress("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

Find the wallet for the given public key

profile.wallets().findByPublicKey("034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192");

Find all wallets that use the given coin

profile.wallets().findByCoin("DARK");

Find all wallets that use the given coin and network

profile.wallets().findByCoinWithNetwork("DARK", "ark.devnet");

Find all wallets that use the given alias

profile.wallets().findByAlias("Alias");

Update a wallet using a given wallet Id and data

profile.wallets().update(newWallet.id(), { alias: "My New Wallet" });

Check that a wallet contains the provided data

profile.wallets().has(wallet.id());

Forget a wallet for a given Id

profile.wallets().forget("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

Forget all wallets (Use with caution!)

profile.wallets().flush();

Get the count of stored wallets

profile.wallets().count();

Return all stored wallets as a single object

profile.wallets().toObject();

API Calls

The following methods are accessible through profile.wallets() and provide a means of interacting with the underlying coin.

API Options

// ClientPagination
cursor?: string | number;
limit?: number;
orderBy?: string;

// ClientTransactionsInput
address?: string;
addresses?: string[];
senderId?: string;
recipientId?: string;
walletId?: string;
senderPublicKey?: string;
recipientPublicKey?: string;
entityType?: number;
entitySubType?: number;
entityAction?: string;
asset?: Record<string, any>;
type?: number;
typeGroup?: number;

// ClientWalletsInput
address?: string;
addresses?: string[];
publicKey?: string;
username?: string;

List all transactions that a wallet has sent or received

await wallet.transactions({ limit: 15 });

List all transactions that a wallet has sent

await wallet.sentTransactions({ limit: 100 });

List all transactions that a wallet received

await wallet.receivedTransactions({ });

Get information about a wallet from the network

await wallet.wallet("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

Get a list of wallets from the network that match the given criteria

await wallet.wallets({ ... });

Get information about a delegate from the network

await wallet.delegate("genesis_1");

Get a list of delegates from the network that match the given criteria

await wallet.delegates({ ... });

List all votes that a wallet cast

await wallet.votes("034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192");

List all voters that a wallet has

await wallet.voters("genesis_1");

Check if the peer is syncing

await wallet.client().syncing();

Broadcast all of the given transactions

await wallet.client().broadcast([transaction, transaction, transaction]);

Transactions

Create a new transfer transaction

await wallet.transaction().signTransfer(input, options);

Create a new second signature transaction

await wallet.transaction().signSecondSignature(input, options);

Create a new delegate registration transaction

await wallet.transaction().signDelegateRegistration(input, options);

Create a new vote transaction

await wallet.transaction().signVote(input, options);

Create a new multi signature transaction

await wallet.transaction().signMultiSignature(input, options);

Create a new ipfs transaction

await wallet.transaction().signIpfs(input, options);

Create a new multi payment transaction

await wallet.transaction().signMultiPayment(input, options);

Create a new delegate resignation transaction

await wallet.transaction().signDelegateResignation(input, options);

Create a new htlc lock transaction

await wallet.transaction().signHtlcLock(input, options);

Create a new htlc claim transaction

await wallet.transaction().signHtlcClaim(input, options);

Create a new htlc refund transaction

await wallet.transaction().signHtlcRefund(input, options);

Messages

Message options

// MessageInput
message: string;
mnemonic: string;

// SignedMessage
message: string;
signatory: string;
signature: string;
mnemonic?: string;

Sign a new message

await wallet.message().sign(input);

Verify an existing message

await wallet.message().verify(input);

Ledger

Get the version from ledger

await wallet.ledger().getVersion();

Get a public key from ledger

await wallet.ledger().getPublicKey(path);

Sign a transaction with ledger

await wallet.ledger().signTransaction(path, serializedTx);

Sign a message with ledger

await wallet.ledger().signMessage(path, asciiMessage);

Links

Get an explorer link for a block

await wallet.link().block(id);

Get an explorer link for a transaction

await wallet.link().transaction(id);

Get an explorer link for a wallet

await wallet.link().wallet(id);
2021 © ARK.io | All Rights Reserved
An ARK.io Product