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 a new entry to the addressbook. Does not allow repeated addresses.
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.
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.
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.
Parameters:
- address (String) – b58 string
- name (String) – Contact name
- rating (Number) – >= 0
Returns: success
Return type: Boolean
com.greenaddress.addressbook.
get_my_addresses
([subaccount][, before_pointer])¶ Return previously generated addresses in batches of 10 at a time. in descending address pointer order.
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
()¶ Return 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: Python Example
Returns: {‘username’: null or String (custom login username), ‘fb’: Boolean, ‘reddit’: Boolean}
com.greenaddress.addressbook.
read_all
(hashed)¶ Read all entries from the addressbook.
Parameters: hashed – Either a SHA-1 hash previously returned by this call or ‘skip’ to return the current values without hashing. If the addressbook contents have not changed since the hash was generated, an empty list is returned. Callers can optionally use this to determine when nothing has changed. The first time this function is called, pass an empty string as the hash to have the initial hash computed and returned. Returns: [['name', 'b58_address', rating:Number], ...]
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: Python Example
Parameters:
- username (string) – Custom login username
- password (string) – Custom login password
Returns: success
Return type: Boolean
com.greenaddress.addressbook.
user_has_wallet
(usertype, username)¶ Check if a contact has a wallet on GreenAddress.
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