LogoLogo
PAO DocsCommunity DocsInfrastructure DocsPeerplays.com
  • Developer Documentation
  • API Reference
    • Peerplays Core API
      • Popular API Calls
      • Account History
      • Asset API
      • Block API
      • Crypto API
      • Database API
      • Network Broadcast API
      • Network Nodes API
      • Orders API
    • Wallet API
      • Account Calls
      • Asset Calls
      • Blockchain Inspection
      • General Calls
      • Governance
      • Privacy Mode
      • Trading Calls
      • Transaction Builder
      • Wallet Calls
    • Bookie API
      • General Calls
      • Listeners
      • Tournaments
  • Peerplays API Libraries
    • Python Peerplays
      • Installation
      • Creating an Account
      • Creating a Peerplays Wallet
      • NFT API
      • Marketplace API
      • Role Based Permissions API
  • Development Guides
    • Creating User Issued Assets
    • Introduction to Permissions
    • NFT Minting
    • Calculating Costs
  • The Cookbook
    • NFTs for Staking Creator Tokens
  • Tools and Integrations
    • PeerID
      • 1.0.0
        • Infrastructure
          • Deployment on a Linux Serve
          • Deployment to AWS ECS
            • Building the Docker Images
            • Storing Secrets in Amazon Parameter Store to use in ECS
            • Creating the Task Definition
            • Creating the Cluster
            • Creating the Service
        • Development
          • How does PeerID work without storing the keys ?
          • Authentication with PeerID
          • Brain Storming
          • Software Requirements
      • Authentication with PeerID
      • Requirements Specification
    • Random Number Generator
      • RNG Technical Summary
      • RNG API
  • Supporting & Reference Docs
    • Peerplays Development FAQs
    • Sidechain Operator Node (SON) Development
      • Generic Sidechain Docs
        • Quick joining GLADIATOR
        • Changes to Peerplaysjs-lib
        • Requirements Specification
        • Low Level Designs
          • bitcoin-deposit-handling-lld
          • bitcoin-operations-draft
          • bitcoin-sidechain-handler-lld
          • bitcoin-sidechain-multisig-bitcoin-wallet-and-bitcoin-addresses-pw
          • bitcoin-withdrawal-handling-lld
          • btc-address-scripting-mechanism
          • comparison-between-scenarios-for-handling-deposits-and-withdrawals
          • exchange-rate-list
          • generic-sidechain-deposit-hld
          • generic-sidechain-high-level-design
          • generic-sidechain-listener-hld
          • generic-sidechain-withdrawal-hld
          • refund-btc-mechanism
          • son-configuration
          • son-consensus-communication-and-transaction-signing-on-chain-lld
          • son-de-register-proposals-lld
          • son-objects-and-operators
          • son-rewards-lld
          • son-voting-lld
          • son-wallet-list_sons-lld
          • creation of a multi-sig bitcoin address lld
          • claiming initial son vesting lld
          • changeover and SON maintenance scenarios lld
          • user-sidechain-addresses-mapping
          • wallet-commands-for-son
        • Functional Specs
          • SON Configuration
          • SON rewards
          • SON Voting and Consensus
          • SONs switchover scenarios
          • SON Status Operations & Monitoring
          • Proposals
          • SON Smart Contracts
      • Bitcoin Sidechain Docs
        • Functional Specs
          • btc-refunds
          • voting-and-consensus
          • son-switchover
          • son-rewards
          • son-proposals
          • son-configuration
          • heartbeat-monitoring
          • BTC Transaction Processing & Signing
          • Bitcoin Withdrawal Handling
          • Bitcoin Deposit Handling
          • SON Multisig Bitcoin Wallet
      • Hive Sidechain Docs
        • Functional Specs
          • HIVE Deposit Handling
          • HIVE Withdrawal Handling
    • Peerplays DEX Development
      • Peerplays NEX
        • Functional Specifications
          • NEX-FS01 Dashboard Page
            • NEX-FS12 ETH-SONs Deposit/Withdraw Functionality
          • NEX-FS02 Login and Account Creation
          • NEX-FS03 Menus and Nav
          • NEX-FS04 Notifications
          • NEX-FS05a Market Page (alpha)
          • NEX-FS05 Market Page
          • NEX-FS06 Profile Page
          • NEX-FS07 Wallet Functions
          • NEX-FS08 App Settings
          • NEX-FS09 Blockchain Page
          • NEX-FS10 GPOS Page
          • NEX-FS11 WhaleVault Integration
      • Requirements Specification
      • Functional Specs
        • Asset Info Page and Asset Lists
        • Dashboard
        • Exchange Page
        • Login and Account Creation
        • User Account Page
        • Voting Page
    • SPK Network
      • Functional Specs
        • Claimdrop Snapshot Functional Specification
        • Initial Claimdrop Functional Specification
    • NFT Development
      • NFT Store
        • NFT Store User Stories
        • NFT Store UI HLD
        • NFT Store Requirements Specification
        • Functional Specifications
          • APP-FS01 App Header
          • APP-FS02 App Body
          • APP-FS03 App Footer
          • APP-FS04 App Navigation
          • APP-FS05 Wallet Functions
          • APP-FS06 App Home Page
          • APP-FS07 Account Page
          • APP-FS08 Browse View
        • App Page List
        • Requirement Traceability Matrix
    • Operation IDs List
    • Sidechain Flow Diagram (HIVE coin)
    • Sidechain Flow Diagram (Bitcoin)
    • Sidechain Flow Diagram (Ethereum coin)
    • TradeHands Explorer
      • User Personas
      • User stories
      • APP-FS01 Detailed View
      • Draft: APP-FS02 Front Page
      • APP-FS03 Collection Details Page
    • Grafana
      • Grafana Installation
      • Install Grafana Behind reverse proxy
      • Loki Installation
      • Promtail agent Installation
      • Grafana Explorer
    • NEX Deployment & Configuration
      • NEX Deployment
      • NEX - Blockchain API configuration
      • Deploying NEX in a HA scenario
    • API Node
      • MarketCap API
    • TOTO Application
      • FS-Subscription Plan
      • FS-Achievements
  • Development Workflow Docs
    • Development Workflow
  • Other Documentation
    • Peerplays Home
    • Community Docs
    • Infrastructure Docs
    • Site Reliability Engineering
Powered by GitBook
On this page
  • Wallet Calls
  • is_new
  • is_locked
  • lock
  • unlock
  • set_password
  • dump_private_keys
  • import_key
  • import_accounts
  • import_account_keys
  • import_balance
  • suggest_brain_key
  • get_transaction_id
  • get_private_key
  • load_wallet_file
  • normalize_brain_key
  • save_wallet_file

Was this helpful?

Export as PDF
  1. API Reference
  2. Wallet API

Wallet Calls

PreviousTransaction BuilderNextBookie API

Last updated 2 years ago

Was this helpful?

Wallet Calls

is_new

Checks whether the wallet has just been created and has not yet had a password set.

Calling set_password will transition the wallet to the locked state.

bool graphene::wallet::wallet_api::is_new()const

True if the wallet is new.

is_locked

Checks whether the wallet is locked (is unable to use its private keys).

This state can be changed by calling or .

bool graphene::wallet::wallet_api::is_locked()const

True if the wallet is locked

lock

Locks the wallet immediately.

void graphene::wallet::wallet_api::lock()

unlock

Unlocks the wallet.

The wallet remain unlocked until the lock is called or the program exits.

When used in command line, if typed “unlock” without a password followed, the user will be prompted to input a password without echo.

void graphene::wallet::wallet_api::unlock(
    string password)

set_password

Sets a new password on the wallet.

The wallet must be either ‘new’ or ‘unlocked’ to execute this command.

When used in command line, if typed “set_password” without a password followed, the user will be prompted to input a password without echo.

void graphene::wallet::wallet_api::set_password(
    string password)
  • password: a new password

dump_private_keys

Dumps all private keys owned by the wallet.

map<public_key_type, string> graphene::wallet::wallet_api::dump_private_keys()

A _**_map containing the private keys, indexed by their public key

import_key

Imports the private key for an existing account.

The private key must match either an owner key or an active key for the named account.

bool graphene::wallet::wallet_api::import_key(
    string account_name_or_id, 
    string wif_key)
  • account_name_or_id: the account owning the key

  • wif_key: the private key in WIF format

true if the key was imported

import_accounts

Imports accounts from a BitShares 0.x wallet file. Current wallet file must be unlocked to perform the import.

map<string, bool> graphene::wallet::wallet_api::import_accounts(
    string filename, 
    string password)
  • filename: the BitShares 0.x wallet file to import

  • password: the password to encrypt the BitShares 0.x wallet file

A map containing the accounts found and whether imported.

import_account_keys

Imports from a BitShares 0.x wallet file, find keys that were bound to a given account name on the BitShares 0.x chain, rebind them to an account name on the 2.0 chain. Current wallet file must be unlocked to perform the import.

bool graphene::wallet::wallet_api::import_account_keys(
    string filename, 
    string password, 
    string src_account_name, 
    string dest_account_name)
  • filename: the BitShares 0.x wallet file to import

  • password: the password to encrypt the BitShares 0.x wallet file

  • src_account_name: name of the account on BitShares 0.x chain

  • dest_account_name: name of the account on BitShares 2.0 chain, can be same or different to src_account_name

Whether the import has succeeded

import_balance

This call will construct transaction(s) that will claim all balances controlled by wif_keys and deposit them into the given account.

vector<signed_transaction> graphene::wallet::wallet_api::import_balance(
    string account_name_or_id, 
    const vector<string> &wif_keys, 
    bool broadcast)
  • account_name_or_id: name or ID of an account that to claim balances to

  • wif_keys: private WIF keys of balance objects to claim balances from

  • broadcast: true to broadcast the transaction on the network

suggest_brain_key

This function will suggest a suitably random string that should be easy to write down (and, with effort, memorize).

brain_key_info graphene::wallet::wallet_api::suggest_brain_key()const

A suggested brain_key

get_transaction_id

This method is used to convert a JSON transaction to its transacting ID.

transaction_id_type graphene::wallet::wallet_api::get_transaction_id(
    const signed_transaction &trx)const
  • trx: a JSON transaction

The ID (hash) of the transaction.

get_private_key

Get the WIF private key corresponding to a public key. The private key must already be in the wallet.

string graphene::wallet::wallet_api::get_private_key(
    public_key_type pubkey)const
  • pubkey: a public key in Base58 format

The WIF private key

load_wallet_file

Loads a specified Graphene wallet.

The current wallet is closed before the new wallet is loaded.

Important: This does not change the filename that will be used for future wallet writes, so this may cause you to overwrite your original wallet unless you also call set_wallet_filename()

bool graphene::wallet::wallet_api::load_wallet_file(
    string wallet_filename = "")
  • wallet_filename: the filename of the wallet JSON file to load. If wallet_filename is empty, it reloads the existing wallet file.

True if the specified wallet is loaded.

normalize_brain_key

Transforms a brain key to reduce the chance of errors when re-entering the key from memory.

This takes a user-supplied brain key and normalizes it into the form used for generating private keys. In particular, this upper-cases all ASCII characters and collapses multiple spaces into one.

string graphene::wallet::wallet_api::normalize_brain_key(
    string s)const
  • s: the brain key as supplied by the user

The brain key in its normalized form.

save_wallet_file

Saves the current wallet to the given filename.

Important: This does not change the wallet filename that will be used for future writes, so think of this function as ‘Save a Copy As…’ instead of ‘Save As…’. Use set_wallet_filename() to make the filename persist.

void graphene::wallet::wallet_api::save_wallet_file(
    string wallet_filename = "")
  • wallet_filename: the filename of the new wallet JSON file to create or overwrite. If wallet_filename is empty, save to the current filename.

password: the password previously set with

The keys are printed in WIF format. You can import these keys into another wallet using

See also **

Suggests a safe brain key to use for creating your account. requires you to specify a ‘brain key’, a long passphrase that provides enough entropy to generate cryptographic keys.

lock()
unlock()
set_password()
import_key()
dump_private_keys()
create_account_with_brain_key()