Wallets

Information

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

Wallet Calls

Get a list of all wallets with key and value

1profile.wallets().all();

Get the first listed wallet

1profile.wallets().first();

Get the last listed wallet

1profile.wallets().last();

Get a list of all wallets grouped by coin

1profile.wallets().allByCoin();

Get a list of all wallet keys

1profile.wallets().keys();

Get a list of all wallet values

1profile.wallets().values();

Restore a wallet using its wallet data

1profile.wallets().restore(wallet);

Find the wallet by the given ID

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

Find the wallet for the given address

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

Find the wallet for the given public key

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

Find all wallets that use the given coin

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

Find all wallets that use the given coin and network

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

Find all wallets that use the given alias

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

Update a wallet using a given wallet Id and data

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

Check that a wallet contains the provided data

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

Forget a wallet for a given Id

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

Forget all wallets (Use with caution!)

1profile.wallets().flush();

Get the count of stored wallets

1profile.wallets().count();

Return all stored wallets as a single object

1profile.wallets().toObject();

Generate a new wallet

1await profile.walletFactory().generate({ ... });

Create a new wallet from an mnemonic with BIP39 derivation

1await profile.walletFactory().fromMnemonicWithBIP39({ ... });

Create a new wallet from an mnemonic with BIP44 derivation

1await profile.walletFactory().fromMnemonicWithBIP44({ ... });

Create a new wallet from an mnemonic with BIP49 derivation

1await profile.walletFactory().fromMnemonicWithBIP49({ ... });

Create a new wallet from an mnemonic with BIP84 derivation

1await profile.walletFactory().fromMnemonicWithBIP84({ ... });

Create a new wallet from an address

1await profile.walletFactory().fromAddress({ ... });

Create a new wallet from a public key

1await profile.walletFactory().fromPublicKey({ ... });

Create a new wallet from a private key

1await profile.walletFactory().fromPrivateKey({ ... });

Create a new wallet from an address and derivation path (Ledger)

1await profile.walletFactory().fromAddressWithDerivationPath({ ... });

Create a new wallet from a secret (non-BIP39 passphrase)

1await profile.walletFactory().fromSecret({ ... });

Create a new wallet from a WIF (Wallet Import Format)

1await profile.walletFactory().fromWIF({ ... });

API Calls

Information

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

API Options

1// ClientPagination
2cursor?: string | number;
3limit?: number;
4orderBy?: string;
5 
6// ClientTransactionsInput
7address?: string;
8addresses?: string[];
9senderId?: string;
10recipientId?: string;
11walletId?: string;
12senderPublicKey?: string;
13recipientPublicKey?: string;
14asset?: Record<string, any>;
15type?: number;
16typeGroup?: number;
17 
18// ClientWalletsInput
19address?: string;
20addresses?: string[];
21publicKey?: string;
22username?: string;

List all transactions that a wallet has sent or received

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

List all transactions that a wallet has sent

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

List all transactions that a wallet received

1await wallet.receivedTransactions({ });

Get information about a wallet from the network

1await wallet.wallet("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

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

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

Get information about a delegate from the network

1await wallet.delegate("genesis_1");

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

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

List all votes that a wallet cast

1await wallet.votes("034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192");

List all voters that a wallet has

1await wallet.voters("genesis_1");

Broadcast all of the given transactions

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

Transactions

Create a new transfer transaction

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

Create a new second signature transaction

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

Create a new delegate registration transaction

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

Create a new vote transaction

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

Create a new multi signature transaction

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

Create a new ipfs transaction

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

Create a new multi payment transaction

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

Create a new delegate resignation transaction

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

Create a new htlc lock transaction

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

Create a new htlc claim transaction

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

Create a new htlc refund transaction

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

Create a new unlock token transaction

1await wallet.transaction().signUnlockToken(input, options);

Messages

Message options

1// MessageInput
2message: string;
3mnemonic: string;
4 
5// SignedMessage
6message: string;
7signatory: string;
8signature: string;
9mnemonic?: string;

Sign a new message

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

Verify an existing message

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

Ledger

Get the version from ledger

1await wallet.ledger().getVersion();

Get a public key from ledger

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

Sign a transaction with ledger

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

Sign a message with ledger

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

Links

Get an explorer link for a block

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

Get an explorer link for a transaction

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

Get an explorer link for a wallet

1await wallet.link().wallet(id);
Last updated 2 years ago
Edit Page
Share: