All Projects → reaster → cardano_wallet_sdk

reaster / cardano_wallet_sdk

Licence: Apache-2.0 license
Targeting Flutter apps, the Cardano Wallet SDK is a high-level Dart library for managing cryptocurrency accounts & executing transactions on the blockchain.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to cardano wallet sdk

tokenomia
Tokenomia is built for the Cardashift ICO, it aims to simplify the use of Native Tokens and Smart Contracts above the Cardano Platform. Cardashift is a community-driven startup platform that raises funds, builds and accelerates startups that solve social and environmental problems.
Stars: ✭ 84 (+170.97%)
Mutual labels:  wallet, cardano
cardano-py
Python3 lib and cli for operating a Cardano Passive Node and using the API's. (PRE-ALPHA)
Stars: ✭ 17 (-45.16%)
Mutual labels:  wallet, cardano
cashuwallet
Cashu is a cryptocurrency wallet for smartphones. Be your own bank. Accept payments or spend crypto directly from your phone.
Stars: ✭ 35 (+12.9%)
Mutual labels:  wallet, cardano
Paymint
The Paymint Wallet is a secure and user friendly Bitcoin wallet
Stars: ✭ 48 (+54.84%)
Mutual labels:  finance, wallet
project-icarus-chrome
Icarus, a reference implementation for a lightweight wallet developed by the IOHK Engineering Team.
Stars: ✭ 32 (+3.23%)
Mutual labels:  wallet, cardano
cardanocli-js
Wrapping the cardano-cli inside JavaScript
Stars: ✭ 173 (+458.06%)
Mutual labels:  wallet, cardano
Customizable-Crypto-Currency-Dashboard-with-Chart
📺 A Dashboard with the price movements of the selected Cryptocurrencies 💹
Stars: ✭ 79 (+154.84%)
Mutual labels:  finance
quantlib
The idiomatic rust implementation of the QuantLib C++ quantitative finance library
Stars: ✭ 89 (+187.1%)
Mutual labels:  finance
currency
A currency computations package.
Stars: ✭ 52 (+67.74%)
Mutual labels:  finance
unity3d-blockchain-wallet
Create wallets and perform transactions on custom ERC20 tokens via Unity3D
Stars: ✭ 33 (+6.45%)
Mutual labels:  wallet
FullFIX
A library for parsing FIX (Financial Information eXchange) protocol messages.
Stars: ✭ 60 (+93.55%)
Mutual labels:  finance
TradeRepublicApi
Unofficial trade republic API
Stars: ✭ 134 (+332.26%)
Mutual labels:  finance
ergo-wallet-app
Ergo Wallet App
Stars: ✭ 80 (+158.06%)
Mutual labels:  wallet
WeWorkFinanceSDK
企业微信会话存档SDK(基于企业微信C版官方SDK封装)
Stars: ✭ 223 (+619.35%)
Mutual labels:  finance
Stocksera
Web application that provides alternative data to retail investors
Stars: ✭ 426 (+1274.19%)
Mutual labels:  finance
Nault
⚡ The most advanced Nano wallet with focus on security, speed and robustness
Stars: ✭ 228 (+635.48%)
Mutual labels:  wallet
trading-post
💸 Verto's decentralised exchange mediator
Stars: ✭ 18 (-41.94%)
Mutual labels:  wallet
sign-in-with-ethereum
Minimal example of sign in with Ethereum. Compatible with web3 browsers.
Stars: ✭ 25 (-19.35%)
Mutual labels:  wallet
lakshmi
Investing library and command-line interface inspired by the Bogleheads philosophy
Stars: ✭ 107 (+245.16%)
Mutual labels:  finance
finac
Finac - financial accounting for humans
Stars: ✭ 27 (-12.9%)
Mutual labels:  finance

CI status Stars count on GitHub Latest Release on pub.dev


cardano_wallet_sdk

Flutter SDK for building Cardano blockchain mobile apps in Flutter using the Dart programming language.

Current Features

  • Create Wallets - Create and restore, both read-only and transactional wallets using staking addresses, mnemonics or private keys.
  • Transaction History - List transactions, rewards and fees for both ADA and Native Tokens.
  • Addresses - Generate and manage Shelley key pairs and addresses.
  • Transactions - Build, sign and submit simple ADA payment transactions.
  • Blockchain API - Cardano blockchain access via the BlockFrost API package
  • Binary Encoding - Enough CBOR support is provided to submit simple payment transactions.

Kick the Tires

To see the SDK in action, both a pure Dart example and multi-platform Flutter example are incuded in this distribution. You can also visit the live Flutter Demonstration Wallet hosted on google cloud.

Project Status

This library is currently under development and is not yet production quality. It is being developed on a part-time basis with an evolving schedule based on funding and developer resources. To date it has been funded by a series of modest Project Catalyst grants. The current schedule is:

  • 2022-04-07 0.1.0-alpha.12 completed Fund 5 SDK prototype and demo Flutter wallet supporting blockchain access, loading wallet balances and submitting simple transactions.
  • 2022-12-31 active Fund 7 phase to build a solid foundation for production SDK. Features include improved API, third-party dependency reduction, mnemonics, all Cardano address types, full CBOR support, native token/NFT minting/burning, basic staking and basic smart contract support.
  • 2023-03-31 planned Fund 8 work will mostly focus on higher-level smart contract support, and as time allows, may include tutorials, DApp linking and community driven features.
  • 2023-06-31 planned Fund 9 will be for ongoing maintenance and community-driven development requests.

This is an ambitious project, requiring much ongoing maintenance, development and community support. If you'd like to see this project succeed, please support us by voting for the Flutter SDK in Fund 9. Proposals will be published in June 2022 and voting will be in August 2022.

If you'd like to can contribute directly, the Flutter SDK has a dedicated wallet:

  addr1qx90lkpwhpwu42jnw00w483krjyfvhhpgk97hdfw9nz3xqaqg6dycrrc4qw0l5fsvfgx95gnqmrfxhgrfy8afsxxje5qgplx9r

Usage

Released versions and installation details can be found on pub.dev.

Coding Style

Although Dart is an imperative language, the framework uses functional idioms whenever possible. In particular, the majority of the classes are immutible and rather than creating side effects by throwing exceptions, the Result class is used. The WalletBuilder's build method provides a concrete example, returning either a wallet instance or error message if issues arise:

Result<Wallet, String> result = walletBuilder.build();
result.when(
    ok: (wallet) => print("Success: ${wallet.walletName}"),
    err: (message) => print("Error: $message"),
);

Wallet Management

Create a wallet builder for the testnet using a BlockFrost key.

final walletBuilder = WalletBuilder()
    ..network = Networks.testnet
    ..testnetAdapterKey = blockfrostKey;

Create a read-only wallet using a staking address.

var address = ShelleyAddress.fromBech32('stake_test1uqvwl7a...');
final walletBuilder = WalletBuilder()
    ..network = Networks.testnet
    ..testnetAdapterKey = blockfrostKey
    ..stakeAddress = address;
Result<ReadOnlyWallet, String> result = await walletBuilder.readOnlyBuildAndSync();
result.when(
    ok: (wallet) => print("${wallet.walletName}: ${wallet.balance}"),
    err: (message) => print("Error: $message"),
);

Restore existing wallet using 24 word mnemonic.

List<String> mnemonic = 'rude stadium move gallery receive just...'.split(' ');
final walletBuilder = WalletBuilder()
    ..network = Networks.testnet
    ..testnetAdapterKey = blockfrostKey
    ..mnemonic = mnemonic;
Result<Wallet, String> result = await walletBuilder.buildAndSync();
if (result.isOk()) {
    var wallet = result.unwrap();
    print("${wallet.walletName}: ${wallet.balance}");
}

Update existing wallet.

final walletBuilder = WalletBuilder()
    ..network = Networks.testnet
    ..testnetAdapterKey = blockfrostKey
    ..mnemonic = mnemonic;
Result<Wallet, String> result = walletBuilder.build();
Wallet wallet = result.unwrap();
Coin oldBalance = wallet.balance;
var result2 = await wallet.update();
result2.when(
    ok: (_) => print("old:$oldBalance lovelace, new: ${wallet.balance} lovelace"),
    err: (message) => print("Error: $message"),
);

Create a new 24 word mnemonic.

List<String> mnemonic = WalletBuilder.generateNewMnemonic();
print("mnemonic: ${mnemonic.join(' ')}");

Wallet Details

List transaction history.

wallet.transactions.forEach((tx) => print(tx));

List addresses.

wallet.addresses.forEach((addr) => print(addr.toBech32()));

List currency balances.

final formatter = AdaFormattter.compactCurrency();
wallet.currencies.forEach((assetId, balance) {
    final isAda = assetId == lovelaceHex;
    print("$assetId: ${isAda ? formatter.format(balance) : balance}");
});

List staking rewards.

wallet.stakeAccounts.forEach((acct) {
    acct.rewards.forEach((reward) {
        print("epoch: ${reward.epoch}, ${reward.amount} ADA");
    });
});

Wallet Keys and Addresses

Access root private and public key pair.

Bip32KeyPair pair = wallet.rootKeyPair;
print("${pair.signingKey}, ${pair.verifyKey}");

Access staking address.

print(wallet.account.stakeAddress));

First unused change address.

print(wallet.firstUnusedChangeAddress));

First unused spend address.

print(wallet.firstUnusedSpendAddress));

Submit Transactions

Send 3 ADA to Bob.

var bobsAddress = parseAddress('addr1qyy6...');
final Result<ShelleyTransaction, String> result = await wallet.sendAda(
    toAddress: bobsAddress,
    lovelace: 3 * 1000000,
);
if (result.isOk()) {
    final tx = result.unwrap();
    print("ADA sent. Fee: ${tx.body.fee} lovelace");
}

Running Integration Tests

Several of the integration tests (suffixed with '_itest.dart') require a BlockFrost key to run. Installation steps are as follows:

  • git clone [email protected]:reaster/cardano_wallet_sdk.git
  • register for a free BlockFrost testnet policy-id key.
  • paste the policy-id key into a text file named: blockfrost_project_id.txt in the parent directory of this project.
echo "your-project-id" > ../blockfrost_project_id.txt

Now you can include the integration tests:

dart test -P itest

Copyright 2021 Richard Easterling
SPDX-License-Identifier: Apache-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].