TKMember

@interface TKMember : NSObject <TKRepresentable>

Represents a Member in the Token system. Each member has an active secret and public key pair that is used to perform authentication.

The class provides async API

  • id

    Member ID.

    Declaration

    Objective-C

    @property (readonly, retain, atomic) NSString *_Nonnull id;

    Swift

    var id: String { get }
  • Convenience access to aliases[0].

    Declaration

    Objective-C

    @property (readonly, retain, atomic) Alias *_Nullable firstAlias;

    Swift

    var firstAlias: Alias? { get }
  • Member’s aliases: emails, etc. In UI, user normally refers to member by alias.

    Declaration

    Objective-C

    @property (readonly, retain, atomic) NSArray<Alias *> *_Nullable aliases;

    Swift

    var aliases: [Alias]? { get }
  • Customized authorization browser creation block.

    Declaration

    Objective-C

    @property (readonly, retain, atomic) TKBrowserFactory _Nullable browserFactory;

    Swift

    var browserFactory: TKBrowserFactory? { get }
  • Current token cluster

    Declaration

    Objective-C

    @property (readonly, retain, atomic) TokenCluster *_Nonnull tokenCluster;

    Swift

    var tokenCluster: TokenCluster { get }
  • Creates new member instance. The method is not meant to be invoked directly. Use TokenClient to obtain an instance of this class.

    Declaration

    Objective-C

    + (nonnull TKMember *)member:(nonnull Member *)member
                    tokenCluster:(nonnull TokenCluster *)tokenCluster
                       useClient:(nonnull TKClient *)client
               useBrowserFactory:(nonnull TKBrowserFactory)browserFactory
                         aliases:(nonnull NSMutableArray<Alias *> *)aliases;

    Swift

    /*not inherited*/ init(_ member: Member, tokenCluster: TokenCluster, use client: TKClient, useBrowserFactory browserFactory: @escaping TKBrowserFactory, aliases: NSMutableArray)
  • Undocumented

    Declaration

    Objective-C

    - (TKClient *)getClient;

    Swift

    func getClient() -> TKClient
  • Creates a representable that acts as another member using an access token.

    Declaration

    Objective-C

    - (nonnull id<TKRepresentable>)forAccessToken:(nonnull NSString *)accessTokenId;

    Swift

    func forAccessToken(_ accessTokenId: String) -> TKRepresentable

    Parameters

    accessTokenId

    the access token id

  • Gets public keys Array for the member.

    Declaration

    Objective-C

    - (void)getKeys:(OnSuccessWithKeys)onSuccess onError:(OnError)onError;

    Swift

    func getKeys(_ onSuccess: @escaping OnSuccessWithKeys, onError: @escaping OnError)

    Parameters

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Approves a key owned by this member. The key is added to the list of valid keys for the member.

    Declaration

    Objective-C

    - (void)approveKey:(nonnull Key *)key
             onSuccess:(OnSuccess)onSuccess
               onError:(OnError)onError;

    Swift

    func approve(_ key: Key, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    key

    to add to the approved list

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Adds a set of keys owned by this member. The keys are added to the list of valid keys for the member.

    Declaration

    Objective-C

    - (void)approveKeys:(nonnull NSArray<Key *> *)keys
              onSuccess:(OnSuccess)onSuccess
                onError:(OnError)onError;

    Swift

    func approve(_ keys: [Key], onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    keys

    to add to the approved list

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Removes a key owned by this member.

    Declaration

    Objective-C

    - (void)removeKey:(nonnull NSString *)keyId
            onSuccess:(OnSuccess)onSuccess
              onError:(OnError)onError;

    Swift

    func removeKey(_ keyId: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    keyId

    key ID of the key to remove

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Removes a set of keys owned by this member.

    Declaration

    Objective-C

    - (void)removeKeys:(nonnull NSArray<NSString *> *)keyIds
             onSuccess:(OnSuccess)onSuccess
               onError:(OnError)onError;

    Swift

    func removeKeys(_ keyIds: [String], onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    keyIds

    key IDs of the key to remove

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Removes all public keys that do not have a corresponding private key stored on the current device from tke member.

    Declaration

    Objective-C

    - (void)removeNonStoredKeys:(OnSuccess)onSuccess onError:(OnError)onError;

    Swift

    func removeNonStoredKeys(_ onSuccess: @escaping OnSuccess, onError: @escaping OnError)
  • Resend alias verification message (email, text, etc.).

    Declaration

    Objective-C

    - (void)resendAliasVerification:(nonnull Alias *)alias
                          onSuccess:(OnSuccessWithString)onSuccess
                            onError:(OnError)onError;

    Swift

    func resendAliasVerification(_ alias: Alias, onSuccess: @escaping OnSuccessWithString, onError: @escaping OnError)

    Parameters

    alias

    resend verification message for this alias

    onSuccess

    invoked on success with verification ID

  • Gets aliases Array for the member.

    Declaration

    Objective-C

    - (void)getAliases:(OnSuccessWithAliases)onSuccess onError:(OnError)onError;

    Swift

    func getAliases(_ onSuccess: @escaping OnSuccessWithAliases, onError: @escaping OnError)

    Parameters

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Adds a new alias for the member.

    Declaration

    Objective-C

    - (void)addAlias:(nonnull Alias *)alias
           onSuccess:(OnSuccess)onSuccess
             onError:(OnError)onError;

    Swift

    func addAlias(_ alias: Alias, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    alias

    alias, e.g. ‘john’, must be unique

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Adds a set of aliases for the member.

    Declaration

    Objective-C

    - (void)addAliases:(nonnull NSArray<Alias *> *)aliases
             onSuccess:(OnSuccess)onSuccess
               onError:(OnError)onError;

    Swift

    func addAliases(_ aliases: [Alias], onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    aliases

    set of aliases

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Removes an alias for the member.

    Declaration

    Objective-C

    - (void)removeAlias:(nonnull Alias *)alias
              onSuccess:(OnSuccess)onSuccess
                onError:(OnError)onError;

    Swift

    func removeAlias(_ alias: Alias, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    alias

    alias, e.g. ‘john’

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Removes a set of aliases for the member.

    Declaration

    Objective-C

    - (void)removeAliases:(nonnull NSArray<Alias *> *)aliases
                onSuccess:(OnSuccess)onSuccess
                  onError:(OnError)onError;

    Swift

    func removeAliases(_ aliases: [Alias], onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    aliases

    set of aliases

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Verifies a given alias.

    Declaration

    Objective-C

    - (void)verifyAlias:(nonnull NSString *)verificationId
                   code:(nonnull NSString *)code
              onSuccess:(OnSuccess)onSuccess
                onError:(OnError)onError;

    Swift

    func verifyAlias(_ verificationId: String, code: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    verificationId

    the verification id

    code

    the code

  • Delete the member.

    Declaration

    Objective-C

    - (void)deleteMember:(OnSuccess)onSuccess onError:(OnError)onError;

    Swift

    func delete(_ onSuccess: @escaping OnSuccess, onError: @escaping OnError)
  • Subscribes a device to receive push notifications

    Declaration

    Objective-C

    - (void)subscribeToNotifications:(nonnull NSString *)handler
                 handlerInstructions:
                     (nonnull NSMutableDictionary<NSString *, NSString *> *)
                         handlerInstructions
                           onSuccess:(OnSuccessWithSubscriber)onSuccess
                             onError:(OnError)onError;

    Swift

    func subscribe(toNotifications handler: String, handlerInstructions: NSMutableDictionary, onSuccess: @escaping OnSuccessWithSubscriber, onError: @escaping OnError)

    Parameters

    handler

    handler that will send the notifications to this subscriber

    handlerInstructions

    instructions on how to send the notification

  • Get all subscribers

    Declaration

    Objective-C

    - (void)getSubscribers:(OnSuccessWithSubscribers)onSuccess
                   onError:(OnError)onError;

    Swift

    func getSubscribers(_ onSuccess: @escaping OnSuccessWithSubscribers, onError: @escaping OnError)
  • Get a subscriber by Id

    Declaration

    Objective-C

    - (void)getSubscriber:(nonnull NSString *)subscriberId
                onSuccess:(OnSuccessWithSubscriber)onSuccess
                  onError:(OnError)onError;

    Swift

    func getSubscriber(_ subscriberId: String, onSuccess: @escaping OnSuccessWithSubscriber, onError: @escaping OnError)

    Parameters

    subscriberId

    id of subscriber to get

  • Get all notifications

    Declaration

    Objective-C

    - (void)getNotificationsOffset:(NSString *_Nullable)offset
                             limit:(int)limit
                         onSuccess:(OnSuccessWithNotifications)onSuccess
                           onError:(OnError)onError;

    Swift

    func getNotificationsOffset(_ offset: String?, limit: Int32, onSuccess: @escaping OnSuccessWithNotifications, onError: @escaping OnError)

    Parameters

    offset

    offset to start at (NULL for none)

    limit

    max number of records to return

  • Get a notification by Id

    Declaration

    Objective-C

    - (void)getNotification:(nonnull NSString *)notificationId
                  onSuccess:(OnSuccessWithNotification)onSuccess
                    onError:(OnError)onError;

    Swift

    func getNotification(_ notificationId: String, onSuccess: @escaping OnSuccessWithNotification, onError: @escaping OnError)

    Parameters

    notificationId

    id of notification to get

  • Updates the status of a notification.

    Declaration

    Objective-C

    - (void)updateNotificationStatus:(nonnull NSString *)notificationId
                              status:(id)status
                           onSuccess:(OnSuccess)onSuccess
                             onError:(OnError)onError;

    Swift

    func updateNotificationStatus(_ notificationId: String, status: Any!, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    notificationId

    the notification id to update

    status

    the status to update

  • Unsubscribes a device from push notifications

    Declaration

    Objective-C

    - (void)unsubscribeFromNotifications:(nonnull NSString *)subscriberId
                               onSuccess:(OnSuccess)onSuccess
                                 onError:(OnError)onError;

    Swift

    func unsubscribe(fromNotifications subscriberId: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    subscriberId

    if of subscriber to remove

  • Initiates the account linking process. The authorization browser will present and the accounts selected by user will be linked.

    Declaration

    Objective-C

    - (void)initiateAccountLinking:(nonnull NSString *)bankId
                         onSuccess:(OnSuccessWithTKAccounts)onSuccess
                           onError:(OnError)onError;

    Swift

    func initiateAccountLinking(_ bankId: String, onSuccess: @escaping OnSuccessWithTKAccounts, onError: @escaping OnError)

    Parameters

    bankId

    bank Id

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Links a set of funding bank accounts to Token and returns it to the caller.

    Declaration

    Objective-C

    - (void)linkAccounts:(nonnull NSString *)bankId
             accessToken:(nonnull NSString *)accessToken
               onSuccess:(OnSuccessWithTKAccounts)onSuccess
                 onError:(OnError)onError;

    Swift

    func linkAccounts(_ bankId: String, accessToken: String, onSuccess: @escaping OnSuccessWithTKAccounts, onError: @escaping OnError)

    Parameters

    bankId

    bank ID to link

    accessToken

    bank access token, generated by the bank

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Links a set of funding bank accounts to Token and returns it to the caller.

    Declaration

    Objective-C

    - (void)linkAccounts:(nonnull BankAuthorization *)bankAuthorization
               onSuccess:(OnSuccessWithTKAccounts)onSuccess
                 onError:(OnError)onError;

    Swift

    func linkAccounts(_ bankAuthorization: BankAuthorization, onSuccess: @escaping OnSuccessWithTKAccounts, onError: @escaping OnError)

    Parameters

    bankAuthorization

    bank authorization, generated by the bank

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Unlinks bank accounts previously linked via linkAccounts call.

    Declaration

    Objective-C

    - (void)unlinkAccounts:(nonnull NSArray<NSString *> *)accountIds
                 onSuccess:(OnSuccess)onSuccess
                   onError:(OnError)onError;

    Swift

    func unlinkAccounts(_ accountIds: [String], onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    accountIds

    account ids to unlink

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Looks up a member’s default account

    Declaration

    Objective-C

    - (void)getDefaultAccount:(OnSuccessWithTKAccount)onSuccess
                      onError:(OnError)onError;

    Swift

    func getDefaultAccount(_ onSuccess: @escaping OnSuccessWithTKAccount, onError: @escaping OnError)
  • Updates member’s default account

    Declaration

    Objective-C

    - (void)setDefaultAccount:(nonnull NSString *)accountId
                    onSuccess:(OnSuccess)onSuccess
                      onError:(OnError)onError;

    Swift

    func setDefaultAccount(_ accountId: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    accountId

    id of account to set to default

    onSuccess

    invoked on success

    onError

    invoked on error

  • Looks up an existing token transfer.

    Declaration

    Objective-C

    - (void)getTransfer:(nonnull NSString *)transferId
              onSuccess:(OnSuccessWithTransfer)onSuccess
                onError:(OnError)onError;

    Swift

    func getTransfer(_ transferId: String, onSuccess: @escaping OnSuccessWithTransfer, onError: @escaping OnError)

    Parameters

    transferId

    ID of the transfer record

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Looks up existing token transfers.

    Declaration

    Objective-C

    - (void)getTransfersOffset:(NSString *_Nullable)offset
                         limit:(int)limit
                     onSuccess:(OnSuccessWithTransfers)onSuccess
                       onError:(OnError)onError;

    Swift

    func getTransfersOffset(_ offset: String?, limit: Int32, onSuccess: @escaping OnSuccessWithTransfers, onError: @escaping OnError)

    Parameters

    offset

    offset to start at (NULL for none)

    limit

    max number of records to return

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Looks up existing token transfers.

    Declaration

    Objective-C

    - (void)getTransfersOffset:(NSString *_Nullable)offset
                         limit:(int)limit
                       tokenId:(NSString *_Nullable)tokenId
                     onSuccess:(OnSuccessWithTransfers)onSuccess
                       onError:(OnError)onError;

    Swift

    func getTransfersOffset(_ offset: String?, limit: Int32, tokenId: String?, onSuccess: @escaping OnSuccessWithTransfers, onError: @escaping OnError)

    Parameters

    offset

    offset to start at (NULL for none)

    limit

    max number of records to return

    tokenId

    optional token id to restrict the search

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Creates a new member address.

    Declaration

    Objective-C

    - (void)addAddress:(nonnull Address *)address
              withName:(nonnull NSString *)name
             onSuccess:(OnSuccessWithAddress)onSuccess
               onError:(OnError)onError;

    Swift

    func add(_ address: Address, withName name: String, onSuccess: @escaping OnSuccessWithAddress, onError: @escaping OnError)

    Parameters

    name

    the name of the address

    address

    the address json

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Deletes a member address by its id.

    Declaration

    Objective-C

    - (void)deleteAddressWithId:(nonnull NSString *)addressId
                      onSuccess:(OnSuccess)onSuccess
                        onError:(OnError)onError;

    Swift

    func deleteAddress(withId addressId: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    addressId

    the id of the address

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Creates a new transfer token builder.

    Declaration

    Objective-C

    - (nonnull TransferTokenBuilder *)
        createTransferTokenBuilder:(nonnull NSDecimalNumber *)amount
                          currency:(nonnull NSString *)currency;

    Swift

    func createTransferTokenBuilder(_ amount: NSDecimalNumber, currency: String) -> TransferTokenBuilder

    Parameters

    amount

    lifetime amount of the token

    currency

    currency code, e.g. USD

    Return Value

    the transfer token builder

  • Creates a new transfer token builder from token request.

    Declaration

    Objective-C

    - (nonnull TransferTokenBuilder *)createTransferTokenBuilderWithTokenRequest:
        (nonnull TokenRequest *)tokenRequest;

    Swift

    func createTransferTokenBuilder(with tokenRequest: TokenRequest) -> TransferTokenBuilder

    Parameters

    tokenRequest

    token request

    Return Value

    the transfer token builder

  • Creates a new transfer token builder from token payload.

    Declaration

    Objective-C

    - (nonnull TransferTokenBuilder *)createTransferTokenBuilderWithTokenPayload:
        (nonnull TokenPayload *)tokenPayload;

    Swift

    func createTransferTokenBuilder(with tokenPayload: TokenPayload) -> TransferTokenBuilder

    Parameters

    tokenPayload

    token payload

    Return Value

    the transfer token builder

  • Deprecated

    Use createTransferTokenBuilder instead

    Creates a new transfer token builder.

    Declaration

    Objective-C

    - (nonnull TransferTokenBuilder *)
        createTransferToken:(nonnull NSDecimalNumber *)amount
                   currency:(nonnull NSString *)currency;

    Swift

    func createTransferToken(_ amount: NSDecimalNumber, currency: String) -> TransferTokenBuilder

    Parameters

    amount

    lifetime amount of the token

    currency

    currency code, e.g. USD

    Return Value

    the transfer token builder

  • Deprecated

    Use createTransferTokenBuilderWithTokenRequest instead

    Creates a new transfer token builder from token request.

    Declaration

    Objective-C

    - (nonnull TransferTokenBuilder *)createTransferToken:
        (nonnull TokenRequest *)tokenRequest;

    Swift

    func createTransferToken(_ tokenRequest: TokenRequest) -> TransferTokenBuilder

    Parameters

    tokenRequest

    token request

    Return Value

    the transfer token builder

  • Prepares a transfer token, returning the resolved token payload and policy.

    Declaration

    Objective-C

    - (void)prepareTransferToken:(nonnull TransferTokenBuilder *)builder
                       onSuccess:(OnSuccessWithPrepareTokenResult)onSuccess
                         onError:(OnError)onError;

    Swift

    func prepareTransferToken(_ builder: TransferTokenBuilder, onSuccess: @escaping OnSuccessWithPrepareTokenResult, onError: @escaping OnError)

    Parameters

    builder

    transfer token builder

  • Signs a token payload.

    Declaration

    Objective-C

    - (Signature *_Nullable)signTokenPayload:(nonnull TokenPayload *)tokenPayload
                                    keyLevel:(id)keyLevel
                                     onError:(OnError)onError;

    Swift

    func sign(_ tokenPayload: TokenPayload, keyLevel: Any!, onError: @escaping OnError) -> Signature?

    Parameters

    tokenPayload

    token payload

    keyLevel

    key level

    Return Value

    token payload signature

  • Creates a token directly from a resolved token payload and list of token signatures.

    Declaration

    Objective-C

    - (void)createToken:(nonnull TokenPayload *)tokenPayload
         tokenRequestId:(NSString *_Nullable)tokenRequestId
             signatures:(nonnull NSArray<Signature *> *)signatures
              onSuccess:(OnSuccessWithToken)onSuccess
                onError:(OnError)onError;

    Swift

    func createToken(_ tokenPayload: TokenPayload, tokenRequestId: String?, signatures: [Signature], onSuccess: @escaping OnSuccessWithToken, onError: @escaping OnError)

    Parameters

    tokenPayload

    token payload

    tokenRequestId

    the token request id

    signatures

    list of signatures

  • Creates a token directly from a resolved token payload and list of token signatures.

    Declaration

    Objective-C

    - (void)createToken:(nonnull TokenPayload *)tokenPayload
         tokenRequestId:(NSString *_Nullable)tokenRequestId
               keyLevel:(id)keyLevel
              onSuccess:(OnSuccessWithToken)onSuccess
                onError:(OnError)onError;

    Swift

    func createToken(_ tokenPayload: TokenPayload, tokenRequestId: String?, keyLevel: Any!, onSuccess: @escaping OnSuccessWithToken, onError: @escaping OnError)

    Parameters

    tokenPayload

    token payload

    tokenRequestId

    the token request id

    keyLevel

    the key level

  • Creates a new access token for a list of resources.

    Declaration

    Objective-C

    - (void)createAccessToken:(nonnull AccessTokenBuilder *)accessTokenBuilder
                    onSuccess:(OnSuccessWithToken)onSuccess
                      onError:(OnError)onError;

    Swift

    func createAccessToken(_ accessTokenBuilder: AccessTokenBuilder, onSuccess: @escaping OnSuccessWithToken, onError: @escaping OnError)

    Parameters

    accessTokenBuilder

    the access token configuration object

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Cancels the existing access token and creates a replacement for it.

    Declaration

    Objective-C

    - (void)replaceAccessToken:(nonnull Token *)tokenToCancel
            accessTokenBuilder:(nonnull AccessTokenBuilder *)accessTokenBuilder
                     onSuccess:(OnSuccessWithTokenOperationResult)onSuccess
                       onError:(OnError)onError;

    Swift

    func replaceAccessToken(_ tokenToCancel: Token, accessTokenBuilder: AccessTokenBuilder, onSuccess: @escaping OnSuccessWithTokenOperationResult, onError: @escaping OnError)

    Parameters

    tokenToCancel

    old token to cancel

    accessTokenBuilder

    access token configuration to create a new token from

  • Looks up a existing transfer token.

    Declaration

    Objective-C

    - (void)getToken:(nonnull NSString *)tokenId
           onSuccess:(OnSuccessWithToken)onSuccess
             onError:(OnError)onError;

    Swift

    func getToken(_ tokenId: String, onSuccess: @escaping OnSuccessWithToken, onError: @escaping OnError)

    Parameters

    tokenId

    token id

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Looks up a existing access token where the calling member is the grantor and the given member is the grantee.

    Declaration

    Objective-C

    - (void)getActiveAccessToken:(nonnull NSString *)toMemberId
                       onSuccess:(OnSuccessWithToken)onSuccess
                         onError:(OnError)onError;

    Swift

    func getActiveAccessToken(_ toMemberId: String, onSuccess: @escaping OnSuccessWithToken, onError: @escaping OnError)

    Parameters

    toMemberId

    grantee of the active access token

  • Looks up transfer tokens owned by the member.

    Declaration

    Objective-C

    - (void)getTransferTokensOffset:(NSString *_Nullable)offset
                              limit:(int)limit
                          onSuccess:(OnSuccessWithTokens)onSuccess
                            onError:(OnError)onError;

    Swift

    func getTransferTokensOffset(_ offset: String?, limit: Int32, onSuccess: @escaping OnSuccessWithTokens, onError: @escaping OnError)

    Parameters

    offset

    offset to start at (NULL for none)

    limit

    max number of records to return

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Looks up access tokens owned by the member.

    Declaration

    Objective-C

    - (void)getAccessTokensOffset:(NSString *_Nullable)offset
                            limit:(int)limit
                        onSuccess:(OnSuccessWithTokens)onSuccess
                          onError:(OnError)onError;

    Swift

    func getAccessTokensOffset(_ offset: String?, limit: Int32, onSuccess: @escaping OnSuccessWithTokens, onError: @escaping OnError)

    Parameters

    offset

    offset to start at (NULL for none)

    limit

    max number of records to return

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Endorses the transfer token by signing it. The signature is persisted along with the token. If the member doesn’t have a sufficiently high-privilege key, this gets status TokenOperationResult_Status_MoreSignaturesNeeded and the system pushes a notification to the member prompting them to use a higher-privilege key.

    Declaration

    Objective-C

    - (void)endorseToken:(nonnull Token *)token
                 withKey:(id)keyLevel
               onSuccess:(OnSuccessWithTokenOperationResult)onSuccess
                 onError:(OnError)onError;

    Swift

    func endorseToken(_ token: Token, withKey keyLevel: Any!, onSuccess: @escaping OnSuccessWithTokenOperationResult, onError: @escaping OnError)

    Parameters

    token

    token to endorse

    keyLevel

    key to use

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Cancels the transfer token by signing it. The signature is persisted along with the token.

    Declaration

    Objective-C

    - (void)cancelToken:(nonnull Token *)token
              onSuccess:(OnSuccessWithTokenOperationResult)onSuccess
                onError:(OnError)onError;

    Swift

    func cancel(_ token: Token, onSuccess: @escaping OnSuccessWithTokenOperationResult, onError: @escaping OnError)

    Parameters

    token

    token to cancel

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Redeems a transfer token.

    Declaration

    Objective-C

    - (void)redeemToken:(nonnull Token *)token
              onSuccess:(OnSuccessWithTransfer)onSuccess
                onError:(OnError)onError;

    Swift

    func redeemToken(_ token: Token, onSuccess: @escaping OnSuccessWithTransfer, onError: @escaping OnError)

    Parameters

    token

    transfer token to redeem

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Deprecated

    Use redeemToken:amount:currency:description:transferDestination:onSuccess:onError: instead

    Redeems a transfer token.

    Declaration

    Objective-C

    - (void)redeemToken:(nonnull Token *)token
                 amount:(NSDecimalNumber *_Nullable)amount
               currency:(NSString *_Nullable)currency
            description:(NSString *_Nullable)description
            destination:(TransferEndpoint *_Nullable)destination
              onSuccess:(OnSuccessWithTransfer)onSuccess
                onError:(OnError)onError;

    Swift

    func redeemToken(_ token: Token, amount: NSDecimalNumber?, currency: String?, description: String?, destination: TransferEndpoint?, onSuccess: @escaping OnSuccessWithTransfer, onError: @escaping OnError)

    Parameters

    token

    transfer token to redeem

    amount

    transfer amount

    currency

    transfer currency code, e.g. EUR

    description

    transfer description

    destination

    transfer destination

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Redeems a transfer token.

    Declaration

    Objective-C

    - (void)redeemToken:(nonnull Token *)token
                     amount:(NSDecimalNumber *_Nullable)amount
                   currency:(NSString *_Nullable)currency
                description:(NSString *_Nullable)description
        transferDestination:(TransferDestination *_Nullable)transferDestination
                  onSuccess:(OnSuccessWithTransfer)onSuccess
                    onError:(OnError)onError;

    Swift

    func redeemToken(_ token: Token, amount: NSDecimalNumber?, currency: String?, description: String?, transferDestination: TransferDestination?, onSuccess: @escaping OnSuccessWithTransfer, onError: @escaping OnError)

    Parameters

    token

    transfer token to redeem

    amount

    transfer amount

    currency

    transfer currency code, e.g. EUR

    description

    transfer description

    transferDestination

    transfer destination

    onSuccess

    callback invoked on success

    onError

    callback invoked on error

  • Uploads a blob to the server.

    Declaration

    Objective-C

    - (void)createBlob:(nonnull NSString *)ownerId
              withType:(nonnull NSString *)type
              withName:(nonnull NSString *)name
              withData:(nonnull NSData *)data
             onSuccess:(OnSuccessWithAttachment)onSuccess
               onError:(OnError)onError;

    Swift

    func createBlob(_ ownerId: String, withType type: String, withName name: String, with data: Data, onSuccess: @escaping OnSuccessWithAttachment, onError: @escaping OnError)

    Parameters

    ownerId

    owner of the blob

    type

    MIME type of the file

    name

    name of the file

    data

    binary data

    onSuccess

    invoked on success

    onError

    invoked on error

  • Gets a blob.

    Declaration

    Objective-C

    - (void)getBlob:(nonnull NSString *)blobId
          onSuccess:(OnSuccessWithBlob)onSuccess
            onError:(OnError)onError;

    Swift

    func getBlob(_ blobId: String, onSuccess: @escaping OnSuccessWithBlob, onError: @escaping OnError)

    Parameters

    blobId

    id of the blob

    onSuccess

    invoked on success

    onError

    invoked on error

  • Gets a blob attached to a token.

    Declaration

    Objective-C

    - (void)getTokenBlob:(nonnull NSString *)tokenId
              withBlobId:(nonnull NSString *)blobId
               onSuccess:(OnSuccessWithBlob)onSuccess
                 onError:(OnError)onError;

    Swift

    func getTokenBlob(_ tokenId: String, withBlobId blobId: String, onSuccess: @escaping OnSuccessWithBlob, onError: @escaping OnError)

    Parameters

    tokenId

    id of the token

    blobId

    id of the blob

    onSuccess

    invoked on success

    onError

    invoked on error

  • Returns linking information for the specified bank id.

    Declaration

    Objective-C

    - (void)getBankInfo:(nonnull NSString *)bankId
              onSuccess:(OnSuccessWithBankInfo)onSuccess
                onError:(OnError)onError;

    Swift

    func getBankInfo(_ bankId: String, onSuccess: @escaping OnSuccessWithBankInfo, onError: @escaping OnError)

    Parameters

    bankId

    the bank id

    onSuccess

    invoked on success

    onError

    invoked on error

  • Creates a fake test bank account, returns BankAuthorization for linking. Only works in test environments, not in production.

    Declaration

    Objective-C

    - (void)createTestBankAccount:(nonnull Money *)balance
                        onSuccess:(OnSuccessWithOauthBankAuthorization)onSuccess
                          onError:(OnError)onError;

    Swift

    func createTestBankAccount(_ balance: Money, onSuccess: @escaping OnSuccessWithOauthBankAuthorization, onError: @escaping OnError)

    Parameters

    balance

    starting balance

    onSuccess

    invoked on success

    onError

    invoked on error

  • Returns profile for the given member id.

    Declaration

    Objective-C

    - (void)getProfile:(nonnull NSString *)ownerId
             onSuccess:(OnSuccessWithProfile)onSuccess
               onError:(OnError)onError;

    Swift

    func getProfile(_ ownerId: String, onSuccess: @escaping OnSuccessWithProfile, onError: @escaping OnError)

    Parameters

    ownerId

    of the member to lookup the profile for

    onSuccess

    invoked on success

    onError

    invoked on error

  • Updates caller profile.

    Declaration

    Objective-C

    - (void)setProfile:(nonnull Profile *)profile
             onSuccess:(OnSuccessWithProfile)onSuccess
               onError:(OnError)onError;

    Swift

    func setProfile(_ profile: Profile, onSuccess: @escaping OnSuccessWithProfile, onError: @escaping OnError)

    Parameters

    profile

    to set

    onSuccess

    invoked on success

    onError

    invoked on error

  • Returns profile picture of a given member id and size

    Declaration

    Objective-C

    - (void)getProfilePicture:(nonnull NSString *)ownerId
                         size:(id)size
                    onSuccess:(OnSuccessWithBlob)onSuccess
                      onError:(OnError)onError;

    Swift

    func getProfilePicture(_ ownerId: String, size: Any!, onSuccess: @escaping OnSuccessWithBlob, onError: @escaping OnError)

    Parameters

    ownerId

    onwer member id

    size

    image size

    onSuccess

    invoked on success

    onError

    invoked on error

  • Set profile picture for the current user

    Declaration

    Objective-C

    - (void)setProfilePicture:(nonnull NSString *)ownerId
                     withType:(nonnull NSString *)type
                     withName:(nonnull NSString *)name
                     withData:(nonnull NSData *)data
                    onSuccess:(OnSuccess)onSuccess
                      onError:(OnError)onError;

    Swift

    func setProfilePicture(_ ownerId: String, withType type: String, withName name: String, with data: Data, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    ownerId

    owner of the picture

    type

    MIME type of the file

    name

    name of the file

    data

    binary data

    onSuccess

    invoked on success

    onError

    invoked on error

  • Returns a list of paired devices for the current user

    Declaration

    Objective-C

    - (void)getPairedDevices:(OnSuccessWithPairedDevices)onSuccess
                     onError:(OnError)onError;

    Swift

    func getPairedDevices(_ onSuccess: @escaping OnSuccessWithPairedDevices, onError: @escaping OnError)

    Parameters

    onSuccess

    invoked on success with a list of paired devices

  • If more signatures is needed after endorsing a token, calls this method to notify the user to endorse the token. We expect this to happen if user tried to endorse with a low privilege key on another device.

    Declaration

    Objective-C

    - (void)triggerStepUpNotification:(nonnull NSString *)tokenId
                            onSuccess:(OnSuccessWithNotifyStatus)onSuccess
                              onError:(OnError)onError;

    Parameters

    tokenId

    id of the token to endorse

    onSuccess

    invoked on success with notify status

  • If more signatures is needed after getting balance, calls this method to notify the user to renew the access. We expect this to happen if user tried to get balance with a low privilege key on another device.

    Declaration

    Objective-C

    - (void)triggerBalanceStepUpNotification:
                (nonnull NSArray<NSString *> *)accountIds
                                   onSuccess:(OnSuccessWithNotifyStatus)onSuccess
                                     onError:(OnError)onError;

    Parameters

    accountIds

    ids of the accounts to get balances

    onSuccess

    invoked on success with notify status

  • If more signatures is needed after getting transaction, calls this method to notify the user to renew the access. We expect this to happen if user tried to get transaction with a low privilege key on another device.

    Declaration

    Objective-C

    - (void)triggerTransactionStepUpNotification:(nonnull NSString *)transactionId
                                       accountID:(nonnull NSString *)accountId
                                       onSuccess:
                                           (OnSuccessWithNotifyStatus)onSuccess
                                         onError:(OnError)onError;

    Parameters

    transactionId

    id of the transaction to get transaction

    accountId

    the account id of transaction to get transaction

    onSuccess

    invoked on success with notify status

  • To grant access to balances or transactions, a device will need to apply SCA with standard key.

    Declaration

    Objective-C

    - (void)ApplySca:(nonnull NSArray<NSString *> *)accountIds
           onSuccess:(OnSuccess)onSuccess
             onError:(OnError)onError;

    Swift

    func applySca(_ accountIds: [String], onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    accountIds

    account ids for applying SCA

  • Sign with a Token signature a token request state payload.

    Declaration

    Objective-C

    - (void)signTokenRequestState:(nonnull NSString *)tokenRequestId
                          tokenId:(nonnull NSString *)tokenId
                            state:(nonnull NSString *)state
                        onSuccess:(OnSuccessWithSignature)onSuccess
                          onError:(OnError)onError;

    Swift

    func signTokenRequestState(_ tokenRequestId: String, tokenId: String, state: String, onSuccess: @escaping OnSuccessWithSignature, onError: @escaping OnError)

    Parameters

    tokenRequestId

    token request id

    tokenId

    token id

    state

    state

  • Stores a token request.

    Declaration

    Objective-C

    - (void)storeTokenRequest:(nonnull TokenRequestPayload *)requestPayload
               requestOptions:(nonnull TokenRequestOptions *)requestOptions
                    onSuccess:(OnSuccessWithString)onSuccess
                      onError:(OnError)onError;

    Swift

    func storeTokenRequest(_ requestPayload: TokenRequestPayload, requestOptions: TokenRequestOptions, onSuccess: @escaping OnSuccessWithString, onError: @escaping OnError)

    Parameters

    requestPayload

    token request payload

    requestOptions

    token request options

  • Updates an existing token request.

    Declaration

    Objective-C

    - (void)updateTokenRequest:(nonnull NSString *)requestId
                       options:(nonnull TokenRequestOptions *)options
                     onSuccess:(OnSuccess)onSuccess
                       onError:(OnError)onError;

    Swift

    func updateTokenRequest(_ requestId: String, options: TokenRequestOptions, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    requestId

    token request ID

    options

    new token request options

  • Replaces the member’s receipt contact.

    Declaration

    Objective-C

    - (void)setReceiptContact:(nonnull ReceiptContact *)receiptContact
                    onSuccess:(OnSuccess)onSuccess
                      onError:(OnError)onError;

    Swift

    func setReceiptContact(_ receiptContact: ReceiptContact, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    receiptContact

    receipt contact to set

  • Gets the member’s receipt contact.

    Declaration

    Objective-C

    - (void)getReceiptContact:(OnSuccessWithReceiptContact)onSuccess
                      onError:(OnError)onError;

    Swift

    func getReceiptContact(_ onSuccess: @escaping OnSuccessWithReceiptContact, onError: @escaping OnError)
  • Marks a member as a trusted beneficiary.

    Declaration

    Objective-C

    - (void)addTrustedBeneficiary:(nonnull NSString *)memberId
                        onSuccess:(OnSuccess)onSuccess
                          onError:(OnError)onError;

    Swift

    func addTrustedBeneficiary(_ memberId: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)
  • Removes a trusted beneficiary.

    Declaration

    Objective-C

    - (void)removeTrustedBeneficiary:(nonnull NSString *)memberId
                           onSuccess:(OnSuccess)onSuccess
                             onError:(OnError)onError;

    Swift

    func removeTrustedBeneficiary(_ memberId: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)
  • Gets a list of all the user’s trusted beneficiaries.

    Declaration

    Objective-C

    - (void)getTrustedBeneficiaries:(OnSuccessWithTrustedBeneficiaries)onSuccess
                            onError:(OnError)onError;

    Swift

    func getTrustedBeneficiaries(_ onSuccess: @escaping OnSuccessWithTrustedBeneficiaries, onError: @escaping OnError)
  • Sets the security metadata to be sent with each request.

    Declaration

    Objective-C

    - (void)setSecurityMetadata:(nonnull SecurityMetadata *)securityMetadata;

    Swift

    func setSecurityMetadata(_ securityMetadata: SecurityMetadata)

    Parameters

    securityMetadata

    the security metadata

  • Sets the app callback url of a member.

    Declaration

    Objective-C

    - (void)setAppCallbackUrl:(nonnull NSString *)appCallbackUrl
                    onSuccess:(OnSuccess)onSuccess
                      onError:(OnError)onError;

    Swift

    func setAppCallbackUrl(_ appCallbackUrl: String, onSuccess: @escaping OnSuccess, onError: @escaping OnError)

    Parameters

    appCallbackUrl

    the app callback url

  • Resolves transfer destinations for the given account ID.

    Declaration

    Objective-C

    - (void)resolveTransferDestinations:(nonnull NSString *)accountId
                              onSuccess:(OnSuccessWithTransferEndpoints)onSuccess
                                onError:(OnError)onError;

    Swift

    func resolveTransferDestinations(_ accountId: String, onSuccess: @escaping OnSuccessWithTransferEndpoints, onError: @escaping OnError)

    Parameters

    accountId

    account ID