Package io.token

Class Member


  • public class Member
    extends java.lang.Object
    Represents a Member in the Token system. Each member has an active secret and public key pair that is used to perform authentication.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Member​(java.lang.String memberId, java.lang.String partnerId, java.lang.String realmId, Client client, TokenClient.TokenCluster cluster)
      Creates an instance of Member.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.reactivex.Completable addAlias​(io.token.proto.common.alias.AliasProtos.Alias alias)
      Adds a new alias for the member.
      void addAliasBlocking​(io.token.proto.common.alias.AliasProtos.Alias alias)
      Adds a new alias for the member.
      io.reactivex.Completable addAliases​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliasList)
      Adds new aliases for the member.
      void addAliasesBlocking​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliases)
      Adds new aliases for the member.
      io.reactivex.Observable<io.token.proto.common.member.MemberProtos.Member> addRecoveryRule​(io.token.proto.common.member.MemberProtos.RecoveryRule recoveryRule)
      Adds the recovery rule.
      io.token.proto.common.member.MemberProtos.Member addRecoveryRuleBlocking​(io.token.proto.common.member.MemberProtos.RecoveryRule recoveryRule)
      Adds the recovery rule.
      io.reactivex.Observable<java.util.List<io.token.proto.common.alias.AliasProtos.Alias>> aliases()
      Gets all aliases owned by the member.
      java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliasesBlocking()
      Gets a list of all aliases owned by the member.
      io.reactivex.Completable approveKey​(io.token.proto.common.security.SecurityProtos.Key key)
      Approves a public key owned by this member.
      io.reactivex.Completable approveKey​(io.token.security.keystore.SecretKeyPair key, io.token.proto.common.security.SecurityProtos.Key.Level level)
      Approves a key owned by this member.
      void approveKeyBlocking​(io.token.proto.common.security.SecurityProtos.Key key)
      Approves a public key owned by this member.
      void approveKeyBlocking​(io.token.security.keystore.SecretKeyPair key, io.token.proto.common.security.SecurityProtos.Key.Level level)
      Approves a secret key owned by this member.
      io.reactivex.Completable approveKeys​(java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys)
      Approves public keys owned by this member.
      void approveKeysBlocking​(java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys)
      Approves public keys owned by this member.
      io.reactivex.Observable<io.token.proto.common.security.SecurityProtos.Signature> authorizeRecovery​(io.token.proto.common.member.MemberProtos.MemberRecoveryOperation.Authorization authorization)
      Authorizes recovery as a trusted agent.
      io.token.proto.common.security.SecurityProtos.Signature authorizeRecoveryBlocking​(io.token.proto.common.member.MemberProtos.MemberRecoveryOperation.Authorization authorization)
      Authorizes recovery as a trusted agent.
      io.reactivex.Observable<java.lang.Boolean> confirmFunds​(java.lang.String accountId, double amount, java.lang.String currency)
      Confirm that the given account has sufficient funds to cover the charge.
      boolean confirmFundsBlocking​(java.lang.String accountId, double amount, java.lang.String currency)
      Confirm that the given account has sufficient funds to cover the charge.
      protected io.reactivex.Observable<Account> createTestBankAccountImpl​(double balance, java.lang.String currency)
      Creates a test bank account in a fake bank and links the account.
      io.reactivex.Completable deleteMember()
      Delete the member.
      void deleteMemberBlocking()
      Delete the member.
      boolean equals​(java.lang.Object obj)  
      io.reactivex.Observable<io.token.proto.common.alias.AliasProtos.Alias> firstAlias()
      Gets the first alias owner by the user.
      io.token.proto.common.alias.AliasProtos.Alias firstAliasBlocking()
      Gets user first alias.
      protected io.reactivex.Observable<Account> getAccountImpl​(java.lang.String accountId)
      Looks up a funding bank account linked to Token.
      protected io.reactivex.Observable<java.util.List<Account>> getAccountsImpl()
      Looks up funding bank accounts linked to Token.
      io.reactivex.Observable<io.token.proto.common.transaction.TransactionProtos.Balance> getBalance​(java.lang.String accountId, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up account balance.
      io.token.proto.common.transaction.TransactionProtos.Balance getBalanceBlocking​(java.lang.String accountId, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up account balance.
      io.reactivex.Observable<java.util.List<io.token.proto.common.transaction.TransactionProtos.Balance>> getBalances​(java.util.List<java.lang.String> accountIds, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up balances for a list of accounts.
      java.util.List<io.token.proto.common.transaction.TransactionProtos.Balance> getBalancesBlocking​(java.util.List<java.lang.String> accountIds, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up balances for a list of accounts.
      io.reactivex.Observable<io.token.proto.common.bank.BankProtos.BankInfo> getBankInfo​(java.lang.String bankId)
      Returns linking information for the specified bank id.
      io.token.proto.common.bank.BankProtos.BankInfo getBankInfoBlocking​(java.lang.String bankId)
      Returns linking information for the specified bank id.
      io.reactivex.Observable<java.lang.String> getDefaultAgent()
      Gets the member id of the default recovery agent.
      java.lang.String getDefaultAgentBlocking()
      Gets the member id of the default recovery agent.
      io.reactivex.Observable<java.util.List<io.token.proto.common.security.SecurityProtos.Key>> getKeys()
      Gets all public keys for this member.
      java.util.List<io.token.proto.common.security.SecurityProtos.Key> getKeysBlocking()
      Gets all public keys for this member.
      io.reactivex.Observable<io.token.proto.common.member.MemberProtos.Profile> getProfile​(java.lang.String memberId)
      Gets a member's public profile.
      io.token.proto.common.member.MemberProtos.Profile getProfileBlocking​(java.lang.String memberId)
      Gets a member's public profile.
      io.reactivex.Observable<java.lang.String> getProfileName​(java.lang.String memberId)
      Gets a member's profile name.
      java.lang.String getProfileNameBlocking​(java.lang.String memberId)
      Gets a member's profile name.
      io.reactivex.Observable<io.token.proto.common.blob.BlobProtos.Blob> getProfilePicture​(java.lang.String memberId, io.token.proto.common.member.MemberProtos.ProfilePictureSize size)
      Gets a member's public profile picture.
      io.token.proto.common.blob.BlobProtos.Blob getProfilePictureBlocking​(java.lang.String memberId, io.token.proto.common.member.MemberProtos.ProfilePictureSize size)
      Gets a member's public profile picture.
      io.reactivex.Observable<io.token.proto.common.transaction.TransactionProtos.StandingOrder> getStandingOrder​(java.lang.String accountId, java.lang.String standingOrderId, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up an existing standing order for a given account.
      io.token.proto.common.transaction.TransactionProtos.StandingOrder getStandingOrderBlocking​(java.lang.String accountId, java.lang.String standingOrderId, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up an existing standing order for a given account.
      io.reactivex.Observable<io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String>> getStandingOrders​(java.lang.String accountId, java.lang.String offset, int limit, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up standing orders for a given account.
      io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String> getStandingOrdersBlocking​(java.lang.String accountId, java.lang.String offset, int limit, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up standing orders for a given account.
      TokenClient.TokenCluster getTokenCluster()
      Get the Token cluster, e.g.
      io.reactivex.Observable<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransaction​(java.lang.String accountId, java.lang.String transactionId, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up an existing transaction for a given account.
      io.token.proto.common.transaction.TransactionProtos.Transaction getTransactionBlocking​(java.lang.String accountId, java.lang.String transactionId, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up an existing transaction for a given account.
      io.reactivex.Observable<io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String>> getTransactions​(java.lang.String accountId, java.lang.String offset, int limit, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up transactions for a given account.
      io.reactivex.Observable<io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String>> getTransactions​(java.lang.String accountId, java.lang.String offset, int limit, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel, java.lang.String startDate, java.lang.String endDate)
      Looks up transactions for a given account.
      io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactionsBlocking​(java.lang.String accountId, java.lang.String offset, int limit, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Looks up transactions for a given account.
      io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactionsBlocking​(java.lang.String accountId, java.lang.String offset, int limit, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel, java.lang.String startDate, java.lang.String endDate)
      Looks up transactions for a given account.
      int hashCode()  
      io.reactivex.Observable<java.lang.String> lastHash()
      Gets the last hash.
      java.lang.String lastHashBlocking()
      Gets the last hash.
      java.lang.String memberId()
      Gets member ID.
      java.lang.String partnerId()
      Gets member ID of partner.
      java.lang.String realmId()
      Gets member ID of realm owner.
      io.reactivex.Completable removeAlias​(io.token.proto.common.alias.AliasProtos.Alias alias)
      Removes an alias for the member.
      void removeAliasBlocking​(io.token.proto.common.alias.AliasProtos.Alias alias)
      Removes an alias for the member.
      io.reactivex.Completable removeAliases​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliasList)
      Removes aliases for the member.
      void removeAliasesBlocking​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliases)
      Removes aliases for the member.
      io.reactivex.Completable removeKey​(java.lang.String keyId)
      Removes a public key owned by this member.
      void removeKeyBlocking​(java.lang.String keyId)
      Removes a public key owned by this member.
      io.reactivex.Completable removeKeys​(java.util.List<java.lang.String> keyIds)
      Removes public keys owned by this member.
      void removeKeysBlocking​(java.util.List<java.lang.String> keyIds)
      Removes public keys owned by this member.
      io.reactivex.Observable<java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination>> resolveTransferDestinations​(java.lang.String accountId)
      Resolves transfer destinations for the given account ID.
      java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> resolveTransferDestinationsBlocking​(java.lang.String accountId)
      Resolves transfer destinations for the given account ID.
      io.reactivex.Observable<java.lang.String> retryVerification​(io.token.proto.common.alias.AliasProtos.Alias alias)
      Retries alias verification.
      java.lang.String retryVerificationBlocking​(io.token.proto.common.alias.AliasProtos.Alias alias)
      Retries alias verification.
      io.token.proto.common.security.SecurityProtos.Signature signTokenPayload​(io.token.proto.common.token.TokenProtos.TokenPayload payload, io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
      Signs a token payload.
      java.lang.String toString()  
      io.reactivex.Completable useDefaultRecoveryRule()
      Set Token as the recovery agent.
      void useDefaultRecoveryRuleBlocking()
      Set Token as the recovery agent.
      io.reactivex.Completable verifyAlias​(java.lang.String verificationId, java.lang.String code)
      Verifies a given alias.
      void verifyAliasBlocking​(java.lang.String verificationId, java.lang.String code)
      Verifies a given alias.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • memberId

        protected final java.lang.String memberId
      • partnerId

        protected final java.lang.String partnerId
      • realmId

        protected final java.lang.String realmId
      • client

        protected final Client client
    • Constructor Detail

      • Member

        protected Member​(java.lang.String memberId,
                         @Nullable
                         java.lang.String partnerId,
                         @Nullable
                         java.lang.String realmId,
                         Client client,
                         TokenClient.TokenCluster cluster)
        Creates an instance of Member.
        Parameters:
        memberId - member ID
        partnerId - member ID of the partner, if applicable
        realmId - the realm id
        client - RPC client used to perform operations against the server
        cluster - Token cluster, e.g. sandbox, production
    • Method Detail

      • memberId

        public java.lang.String memberId()
        Gets member ID.
        Returns:
        a unique ID that identifies the member in the Token system
      • partnerId

        @Nullable
        public java.lang.String partnerId()
        Gets member ID of partner.
        Returns:
        partner member ID
      • realmId

        @Nullable
        public java.lang.String realmId()
        Gets member ID of realm owner.
        Returns:
        realm owner member ID
      • lastHash

        public io.reactivex.Observable<java.lang.String> lastHash()
        Gets the last hash.
        Returns:
        an observable of the last hash
      • lastHashBlocking

        public java.lang.String lastHashBlocking()
        Gets the last hash.
        Returns:
        the last hash
      • firstAlias

        public io.reactivex.Observable<io.token.proto.common.alias.AliasProtos.Alias> firstAlias()
        Gets the first alias owner by the user.
        Returns:
        first alias owned by the user, or throws exception if no aliases are found
      • firstAliasBlocking

        public io.token.proto.common.alias.AliasProtos.Alias firstAliasBlocking()
        Gets user first alias.
        Returns:
        first alias owned by the user, or throws exception if not aliases are found
      • aliases

        public io.reactivex.Observable<java.util.List<io.token.proto.common.alias.AliasProtos.Alias>> aliases()
        Gets all aliases owned by the member.
        Returns:
        list of aliases owned by the member
      • aliasesBlocking

        public java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliasesBlocking()
        Gets a list of all aliases owned by the member.
        Returns:
        list of aliases owned by the member
      • getKeys

        public io.reactivex.Observable<java.util.List<io.token.proto.common.security.SecurityProtos.Key>> getKeys()
        Gets all public keys for this member.
        Returns:
        list of public keys that are approved for this member
      • getKeysBlocking

        public java.util.List<io.token.proto.common.security.SecurityProtos.Key> getKeysBlocking()
        Gets all public keys for this member.
        Returns:
        list of public keys that are approved for this member
      • getAccountsImpl

        protected io.reactivex.Observable<java.util.List<Account>> getAccountsImpl()
        Looks up funding bank accounts linked to Token.
        Returns:
        list of accounts
      • getAccountImpl

        protected io.reactivex.Observable<Account> getAccountImpl​(java.lang.String accountId)
        Looks up a funding bank account linked to Token.
        Parameters:
        accountId - account id
        Returns:
        looked up account
      • addAlias

        public io.reactivex.Completable addAlias​(io.token.proto.common.alias.AliasProtos.Alias alias)
        Adds a new alias for the member.
        Parameters:
        alias - alias, e.g. 'john', must be unique
        Returns:
        completable that indicates whether the operation finished or had an error
      • addAliasBlocking

        public void addAliasBlocking​(io.token.proto.common.alias.AliasProtos.Alias alias)
        Adds a new alias for the member.
        Parameters:
        alias - alias, e.g. 'john', must be unique
      • addAliases

        public io.reactivex.Completable addAliases​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliasList)
        Adds new aliases for the member.
        Parameters:
        aliasList - aliases, e.g. 'john', must be unique
        Returns:
        completable that indicates whether the operation finished or had an error
      • addAliasesBlocking

        public void addAliasesBlocking​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliases)
        Adds new aliases for the member.
        Parameters:
        aliases - aliases, e.g. 'john', must be unique
      • retryVerification

        public io.reactivex.Observable<java.lang.String> retryVerification​(io.token.proto.common.alias.AliasProtos.Alias alias)
        Retries alias verification.
        Parameters:
        alias - the alias to be verified
        Returns:
        the verification id
      • retryVerificationBlocking

        public java.lang.String retryVerificationBlocking​(io.token.proto.common.alias.AliasProtos.Alias alias)
        Retries alias verification.
        Parameters:
        alias - the alias to be verified
        Returns:
        the verification id
      • addRecoveryRule

        public io.reactivex.Observable<io.token.proto.common.member.MemberProtos.Member> addRecoveryRule​(io.token.proto.common.member.MemberProtos.RecoveryRule recoveryRule)
        Adds the recovery rule.
        Parameters:
        recoveryRule - the recovery rule
        Returns:
        an observable of updated member
      • addRecoveryRuleBlocking

        public io.token.proto.common.member.MemberProtos.Member addRecoveryRuleBlocking​(io.token.proto.common.member.MemberProtos.RecoveryRule recoveryRule)
        Adds the recovery rule.
        Parameters:
        recoveryRule - the recovery rule
        Returns:
        updated member
      • useDefaultRecoveryRule

        public io.reactivex.Completable useDefaultRecoveryRule()
        Set Token as the recovery agent.
        Returns:
        a completable
      • useDefaultRecoveryRuleBlocking

        public void useDefaultRecoveryRuleBlocking()
        Set Token as the recovery agent.
      • authorizeRecovery

        public io.reactivex.Observable<io.token.proto.common.security.SecurityProtos.Signature> authorizeRecovery​(io.token.proto.common.member.MemberProtos.MemberRecoveryOperation.Authorization authorization)
        Authorizes recovery as a trusted agent.
        Parameters:
        authorization - the authorization
        Returns:
        the signature
      • authorizeRecoveryBlocking

        public io.token.proto.common.security.SecurityProtos.Signature authorizeRecoveryBlocking​(io.token.proto.common.member.MemberProtos.MemberRecoveryOperation.Authorization authorization)
        Authorizes recovery as a trusted agent.
        Parameters:
        authorization - the authorization
        Returns:
        the signature
      • getDefaultAgent

        public io.reactivex.Observable<java.lang.String> getDefaultAgent()
        Gets the member id of the default recovery agent.
        Returns:
        the member id
      • getDefaultAgentBlocking

        public java.lang.String getDefaultAgentBlocking()
        Gets the member id of the default recovery agent.
        Returns:
        the member id
      • verifyAlias

        public io.reactivex.Completable verifyAlias​(java.lang.String verificationId,
                                                    java.lang.String code)
        Verifies a given alias.
        Parameters:
        verificationId - the verification id
        code - the code
        Returns:
        a completable
      • verifyAliasBlocking

        public void verifyAliasBlocking​(java.lang.String verificationId,
                                        java.lang.String code)
        Verifies a given alias.
        Parameters:
        verificationId - the verification id
        code - the code
      • removeAlias

        public io.reactivex.Completable removeAlias​(io.token.proto.common.alias.AliasProtos.Alias alias)
        Removes an alias for the member.
        Parameters:
        alias - alias, e.g. 'john'
        Returns:
        completable that indicates whether the operation finished or had an error
      • removeAliasBlocking

        public void removeAliasBlocking​(io.token.proto.common.alias.AliasProtos.Alias alias)
        Removes an alias for the member.
        Parameters:
        alias - alias, e.g. 'john'
      • removeAliases

        public io.reactivex.Completable removeAliases​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliasList)
        Removes aliases for the member.
        Parameters:
        aliasList - aliases, e.g. 'john'
        Returns:
        completable that indicates whether the operation finished or had an error
      • removeAliasesBlocking

        public void removeAliasesBlocking​(java.util.List<io.token.proto.common.alias.AliasProtos.Alias> aliases)
        Removes aliases for the member.
        Parameters:
        aliases - aliases, e.g. 'john'
      • approveKey

        public io.reactivex.Completable approveKey​(io.token.security.keystore.SecretKeyPair key,
                                                   io.token.proto.common.security.SecurityProtos.Key.Level level)
        Approves a key owned by this member. The key is added to the list of valid keys for the member.
        Parameters:
        key - key to add to the approved list
        level - key privilege level
        Returns:
        completable that indicates whether the operation finished or had an error
      • approveKey

        public io.reactivex.Completable approveKey​(io.token.proto.common.security.SecurityProtos.Key key)
        Approves a public key owned by this member. The key is added to the list of valid keys for the member.
        Parameters:
        key - key to add to the approved list
        Returns:
        completable that indicates whether the operation finished or had an error
      • approveKeyBlocking

        public void approveKeyBlocking​(io.token.security.keystore.SecretKeyPair key,
                                       io.token.proto.common.security.SecurityProtos.Key.Level level)
        Approves a secret key owned by this member. The key is added to the list of valid keys for the member.
        Parameters:
        key - key to add to the approved list
        level - key privilege level
      • approveKeyBlocking

        public void approveKeyBlocking​(io.token.proto.common.security.SecurityProtos.Key key)
        Approves a public key owned by this member. The key is added to the list of valid keys for the member.
        Parameters:
        key - key to add to the approved list
      • approveKeys

        public io.reactivex.Completable approveKeys​(java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys)
        Approves public keys owned by this member. The keys are added to the list of valid keys for the member.
        Parameters:
        keys - keys to add to the approved list
        Returns:
        completable that indicates whether the operation finished or had an error
      • approveKeysBlocking

        public void approveKeysBlocking​(java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys)
        Approves public keys owned by this member. The keys are added to the list of valid keys for the member.
        Parameters:
        keys - keys to add to the approved list
      • removeKey

        public io.reactivex.Completable removeKey​(java.lang.String keyId)
        Removes a public key owned by this member.
        Parameters:
        keyId - key ID of the key to remove
        Returns:
        completable that indicates whether the operation finished or had an error
      • removeKeyBlocking

        public void removeKeyBlocking​(java.lang.String keyId)
        Removes a public key owned by this member.
        Parameters:
        keyId - key ID of the key to remove
      • removeKeys

        public io.reactivex.Completable removeKeys​(java.util.List<java.lang.String> keyIds)
        Removes public keys owned by this member.
        Parameters:
        keyIds - key IDs of the keys to remove
        Returns:
        completable that indicates whether the operation finished or had an error
      • removeKeysBlocking

        public void removeKeysBlocking​(java.util.List<java.lang.String> keyIds)
        Removes public keys owned by this member.
        Parameters:
        keyIds - key IDs of the keys to remove
      • getProfile

        public io.reactivex.Observable<io.token.proto.common.member.MemberProtos.Profile> getProfile​(java.lang.String memberId)
        Gets a member's public profile.
        Parameters:
        memberId - member ID of member whose profile we want
        Returns:
        their profile
      • getProfileBlocking

        public io.token.proto.common.member.MemberProtos.Profile getProfileBlocking​(java.lang.String memberId)
        Gets a member's public profile.
        Parameters:
        memberId - member ID of member whose profile we want
        Returns:
        profile info
      • getProfileName

        public io.reactivex.Observable<java.lang.String> getProfileName​(java.lang.String memberId)
        Gets a member's profile name.
        Parameters:
        memberId - member ID of member whose profile name we want
        Returns:
        their profile name
      • getProfileNameBlocking

        public java.lang.String getProfileNameBlocking​(java.lang.String memberId)
        Gets a member's profile name.
        Parameters:
        memberId - member ID of member whose profile we want
        Returns:
        their profile name
      • getProfilePicture

        public io.reactivex.Observable<io.token.proto.common.blob.BlobProtos.Blob> getProfilePicture​(java.lang.String memberId,
                                                                                                     io.token.proto.common.member.MemberProtos.ProfilePictureSize size)
        Gets a member's public profile picture.
        Parameters:
        memberId - member ID of member whose profile we want
        size - desired size category (small, medium, large, original)
        Returns:
        blob with picture; empty blob (no fields set) if has no picture
      • getProfilePictureBlocking

        public io.token.proto.common.blob.BlobProtos.Blob getProfilePictureBlocking​(java.lang.String memberId,
                                                                                    io.token.proto.common.member.MemberProtos.ProfilePictureSize size)
        Gets a member's public profile picture.
        Parameters:
        memberId - member ID of member whose profile we want
        size - Size category desired (small/medium/large/original)
        Returns:
        blob with picture; empty blob (no fields set) if has no picture
      • signTokenPayload

        public io.token.proto.common.security.SecurityProtos.Signature signTokenPayload​(io.token.proto.common.token.TokenProtos.TokenPayload payload,
                                                                                        io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Signs a token payload.
        Parameters:
        payload - token payload
        keyLevel - key level
        Returns:
        token payload signature
      • getTransaction

        public io.reactivex.Observable<io.token.proto.common.transaction.TransactionProtos.Transaction> getTransaction​(java.lang.String accountId,
                                                                                                                       java.lang.String transactionId,
                                                                                                                       io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up an existing transaction for a given account.
        Parameters:
        accountId - the account id
        transactionId - ID of the transaction
        keyLevel - key level
        Returns:
        transaction record
      • getTransactionBlocking

        public io.token.proto.common.transaction.TransactionProtos.Transaction getTransactionBlocking​(java.lang.String accountId,
                                                                                                      java.lang.String transactionId,
                                                                                                      io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up an existing transaction for a given account.
        Parameters:
        accountId - the account id
        transactionId - ID of the transaction
        keyLevel - key level
        Returns:
        transaction
      • getTransactions

        public io.reactivex.Observable<io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String>> getTransactions​(java.lang.String accountId,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         java.lang.String offset,
                                                                                                                                                                         int limit,
                                                                                                                                                                         io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up transactions for a given account.
        Parameters:
        accountId - the account id
        offset - optional offset to start at
        limit - max number of records to return
        keyLevel - key level
        Returns:
        a paged list of transaction records
      • getTransactions

        public io.reactivex.Observable<io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String>> getTransactions​(java.lang.String accountId,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         java.lang.String offset,
                                                                                                                                                                         int limit,
                                                                                                                                                                         io.token.proto.common.security.SecurityProtos.Key.Level keyLevel,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         java.lang.String startDate,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         java.lang.String endDate)
        Looks up transactions for a given account.
        Parameters:
        accountId - the account id
        offset - optional offset to start at
        limit - max number of records to return
        keyLevel - key level
        startDate - inclusive lower bound of transaction booking date
        endDate - inclusive upper bound of transaction booking date
        Returns:
        a paged list of transaction records
      • getTransactionsBlocking

        public io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactionsBlocking​(java.lang.String accountId,
                                                                                                                                                        @Nullable
                                                                                                                                                        java.lang.String offset,
                                                                                                                                                        int limit,
                                                                                                                                                        io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up transactions for a given account.
        Parameters:
        accountId - the account id
        offset - optional offset to start at
        limit - max number of records to return
        keyLevel - key level
        Returns:
        paged list of transactions
      • getTransactionsBlocking

        public io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.Transaction,​java.lang.String> getTransactionsBlocking​(java.lang.String accountId,
                                                                                                                                                        @Nullable
                                                                                                                                                        java.lang.String offset,
                                                                                                                                                        int limit,
                                                                                                                                                        io.token.proto.common.security.SecurityProtos.Key.Level keyLevel,
                                                                                                                                                        @Nullable
                                                                                                                                                        java.lang.String startDate,
                                                                                                                                                        @Nullable
                                                                                                                                                        java.lang.String endDate)
        Looks up transactions for a given account.
        Parameters:
        accountId - the account id
        offset - optional offset to start at
        limit - max number of records to return
        keyLevel - key level
        startDate - inclusive lower bound of transaction booking date
        endDate - inclusive upper bound of transaction booking date
        Returns:
        paged list of transactions
      • getStandingOrder

        public io.reactivex.Observable<io.token.proto.common.transaction.TransactionProtos.StandingOrder> getStandingOrder​(java.lang.String accountId,
                                                                                                                           java.lang.String standingOrderId,
                                                                                                                           io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up an existing standing order for a given account.
        Parameters:
        accountId - the account ID
        standingOrderId - ID of the standing order
        keyLevel - key level
        Returns:
        standing order record
      • getStandingOrderBlocking

        public io.token.proto.common.transaction.TransactionProtos.StandingOrder getStandingOrderBlocking​(java.lang.String accountId,
                                                                                                          java.lang.String standingOrderId,
                                                                                                          io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up an existing standing order for a given account.
        Parameters:
        accountId - the account ID
        standingOrderId - ID of the standing order
        keyLevel - key level
        Returns:
        standing order record
      • getStandingOrders

        public io.reactivex.Observable<io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String>> getStandingOrders​(java.lang.String accountId,
                                                                                                                                                                             @Nullable
                                                                                                                                                                             java.lang.String offset,
                                                                                                                                                                             int limit,
                                                                                                                                                                             io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up standing orders for a given account.
        Parameters:
        accountId - the account ID
        offset - optional offset to start at
        limit - max number of records to return
        keyLevel - key level
        Returns:
        a paged list of standing order records
      • getStandingOrdersBlocking

        public io.token.proto.PagedList<io.token.proto.common.transaction.TransactionProtos.StandingOrder,​java.lang.String> getStandingOrdersBlocking​(java.lang.String accountId,
                                                                                                                                                            @Nullable
                                                                                                                                                            java.lang.String offset,
                                                                                                                                                            int limit,
                                                                                                                                                            io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up standing orders for a given account.
        Parameters:
        accountId - the account ID
        offset - optional offset to start at
        limit - max number of records to return
        keyLevel - key level
        Returns:
        a paged list of standing order records
      • getBalance

        public io.reactivex.Observable<io.token.proto.common.transaction.TransactionProtos.Balance> getBalance​(java.lang.String accountId,
                                                                                                               io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up account balance.
        Parameters:
        accountId - the account id
        keyLevel - key level
        Returns:
        balance
      • getBalanceBlocking

        public io.token.proto.common.transaction.TransactionProtos.Balance getBalanceBlocking​(java.lang.String accountId,
                                                                                              io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up account balance.
        Parameters:
        accountId - account id
        keyLevel - key level
        Returns:
        balance
      • getBalances

        public io.reactivex.Observable<java.util.List<io.token.proto.common.transaction.TransactionProtos.Balance>> getBalances​(java.util.List<java.lang.String> accountIds,
                                                                                                                                io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up balances for a list of accounts.
        Parameters:
        accountIds - list of account ids
        keyLevel - key level
        Returns:
        list of balances
      • getBalancesBlocking

        public java.util.List<io.token.proto.common.transaction.TransactionProtos.Balance> getBalancesBlocking​(java.util.List<java.lang.String> accountIds,
                                                                                                               io.token.proto.common.security.SecurityProtos.Key.Level keyLevel)
        Looks up balances for a list of accounts.
        Parameters:
        accountIds - list of account ids
        keyLevel - key level
        Returns:
        list of balances
      • confirmFunds

        public io.reactivex.Observable<java.lang.Boolean> confirmFunds​(java.lang.String accountId,
                                                                       double amount,
                                                                       java.lang.String currency)
        Confirm that the given account has sufficient funds to cover the charge.
        Parameters:
        accountId - account ID
        amount - charge amount
        currency - charge currency
        Returns:
        true if the account has sufficient funds to cover the charge
      • confirmFundsBlocking

        public boolean confirmFundsBlocking​(java.lang.String accountId,
                                            double amount,
                                            java.lang.String currency)
        Confirm that the given account has sufficient funds to cover the charge.
        Parameters:
        accountId - account ID
        amount - charge amount
        currency - charge currency
        Returns:
        true if the account has sufficient funds to cover the charge
      • getBankInfo

        public io.reactivex.Observable<io.token.proto.common.bank.BankProtos.BankInfo> getBankInfo​(java.lang.String bankId)
        Returns linking information for the specified bank id.
        Parameters:
        bankId - the bank id
        Returns:
        bank linking information
      • getBankInfoBlocking

        public io.token.proto.common.bank.BankProtos.BankInfo getBankInfoBlocking​(java.lang.String bankId)
        Returns linking information for the specified bank id.
        Parameters:
        bankId - the bank id
        Returns:
        bank linking information
      • deleteMember

        public io.reactivex.Completable deleteMember()
        Delete the member.
        Returns:
        completable
      • deleteMemberBlocking

        public void deleteMemberBlocking()
        Delete the member.
      • resolveTransferDestinations

        public io.reactivex.Observable<java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination>> resolveTransferDestinations​(java.lang.String accountId)
        Resolves transfer destinations for the given account ID.
        Parameters:
        accountId - account ID
        Returns:
        transfer destinations
      • resolveTransferDestinationsBlocking

        public java.util.List<io.token.proto.common.transferinstructions.TransferInstructionsProtos.TransferDestination> resolveTransferDestinationsBlocking​(java.lang.String accountId)
        Resolves transfer destinations for the given account ID.
        Parameters:
        accountId - account ID
        Returns:
        transfer destinations
      • getTokenCluster

        public TokenClient.TokenCluster getTokenCluster()
        Get the Token cluster, e.g. sandbox, production.
        Returns:
        Token cluster
      • createTestBankAccountImpl

        protected io.reactivex.Observable<Account> createTestBankAccountImpl​(double balance,
                                                                             java.lang.String currency)
        Creates a test bank account in a fake bank and links the account.
        Parameters:
        balance - account balance to set
        currency - currency code, e.g. "EUR"
        Returns:
        the linked account
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object