addressbook module

The Addressbook module is used to manage contacts of a GreenAddress account and synchronize them between social accounts.

com.greenaddress.addressbook

com.greenaddress.addressbook.add_entry(address, name, rating)
Add new entry to the addressbook. Does not allow repeated addresses.
Check the usage on Github: JS Example
Parameters:
  • address (String) – b58 string
  • name (String) – Contact name
  • rating (Number) – >= 0
Returns:

success

Return type:

Boolean

com.greenaddress.addressbook.delete_entry(address)
Delete addressbook entry.
Check the usage on Github: JS Example
Parameters:address (string) – Base58 representation of bitcoin public key or p2sh.
Returns:null
com.greenaddress.addressbook.disable_sync(party)
Disable linking of a third-party account.
Check usages on Github: JS Example
Parameters:party (string) – Values are ‘facebook’, ‘reddit’ and ‘custom’.
Returns:success
Return type:Boolean
com.greenaddress.addressbook.edit_entry(address, name, rating)
Change name and rating of an address.
Check the usage on Github: JS Example
Parameters:
  • address (String) – identifying address
  • name (String) – Contact name
  • rating (Number) – >= 0
Returns:

success

Return type:

Boolean

com.greenaddress.addressbook.get_my_addresses([subaccount][, before_pointer])
Returns previously generated addresses. Available only in full access mode. Result is paginated and addresses are returned 10 per page, in descending address pointer order.
Check usages on Github: JS Example
Parameters:
  • subaccount (int) – Subaccount pointer, if not specified return addresses generated with main account.
  • before_pointer (int) – Minimum address pointer which should not be returned. This should be used for pagination - pass the last pointer from the returned page to fetch the next page.
Returns:

[{‘ad’: String, ‘num_tx’: Int, ‘pointer’: Int}, ...]

Return type:

List

com.greenaddress.addressbook.get_sync_status()
Returns the linking status of third-party accounts and the logged in GreenAddress Wallet. With this API you can check which third-party accounts are linked, and if a custom login is enabled.
Check usage on Github: JS Example
Returns:{‘username’: null or String (custom login username), ‘fb’: Boolean, ‘reddit’: Boolean}
com.greenaddress.addressbook.read_all(hashed)
Read all entries from addressbook.
Check usage on Github: JS Example
Returns:[['name', 'b58_address', rating:Number], ...]
com.greenaddress.addressbook.reddit_user_has_wallet(username)

Deprecated: use user_has_wallet(‘reddit’, username)

com.greenaddress.addressbook.sync_custom(username, password)
Define and enable custom login for the current account. Available in user full access mode only, it enables watch-only mode.
Check usages on Github: JS Example
Parameters:
  • username (string) – Custom login username
  • password (string) – Custom login password
Returns:

success

Return type:

Boolean

com.greenaddress.addressbook.sync_fb(access_token)
Link GreenAddress account with a Facebook account.
Check the usage on Github: JS Example
Please read also the Facebook documentation about access_token
Parameters:access_token (string) – Facebook user access token
Returns:success
Return type:Boolean
com.greenaddress.addressbook.sync_reddit(access_token)
Link GreenAddress account with a Reddit account.
Check the usage on Github: JS Example
Please read also the Reddit documentation about OAuth
Parameters:access_token (string) – Reddit user access token
Returns:success
Return type:Boolean
com.greenaddress.addressbook.user_has_wallet(usertype, username)
Check if a contact has a wallet on GreenAddress.
Check usage on Github: JS Example
Parameters:
  • usertype (string) – Accepted values are ‘Facebook’, ‘reddit’ and ‘email’.
  • username (string) – Facebook user ID, check reference about Facebook user ID here or Reddit username or email address.
Returns:

has_wallet

Return type:

Boolean