.Net SDK
Tokenio.Rpc.Client Class Reference

An authenticated RPC client that is used to talk to Token gateway. The class is a thin wrapper on top of gRPC generated client. Makes the API easier to use. More...

Public Member Functions

 Client (string memberId, ICryptoEngine cryptoEngine, ManagedChannel channel)
 Instantiates a client. More...
 
void UseAccessToken (string accessTokenId, bool customerInitiated=false)
 Sets the On-Behalf-Of authentication value to be used with this client. The value must correspond to an existing Access Token ID issued for the client member. Sets customer initiated to false if not specified. More...
 
Task< ProtoMember > GetMember ()
 Looks up member information for the current user. The user is defined by the key used for authentication. More...
 
Task< ProtoMember > GetMember (string memberId)
 Looks up member information for a given user. More...
 
Task< ProtoMember > UpdateMember (IList< MemberOperation > operations, IList< MemberOperationMetadata > metadata)
 Updates member by applying the specified operations. More...
 
Task< ProtoMember > UpdateMember (IList< MemberOperation > operations)
 Updates member by applying the specified operations that don't contain any add alias operation. More...
 
Task< ProtoMember > UpdateMember (ProtoMember member, IList< MemberOperation > operations, IList< MemberOperationMetadata > metadata)
 Updates member by applying the specified operations. More...
 
Task UseDefaultRecoveryRule ()
 Set Token as the recovery agent. More...
 
Task< IList< ProtoAccount > > LinkAccounts (BankAuthorization authorization)
 Links a funding bank account to Token. More...
 
Task< IList< ProtoAccount > > LinkAccounts (OauthBankAuthorization authorization)
 Links a funding bank account to Token. More...
 
Task UnlinkAccounts (IList< string > accountIds)
 Unlinks token accounts. More...
 
Task< ProtoAccount > GetAccount (string accountId)
 Looks up a linked funding account. More...
 
Task< IList< ProtoAccount > > GetAccounts ()
 Looks up all the linked funding accounts. More...
 
Task< string > StoreTokenRequest (TokenRequestPayload payload, Proto.Common.TokenProtos.TokenRequestOptions options)
 Stores a transfer token request. More...
 
Task< string > StoreTokenRequest (TokenPayload payload, IDictionary< string, string > options)
 DEPRECATED Stores a transfer token request. More...
 
Task UpdateTokenRequest (string requestId, Proto.Common.TokenProtos.TokenRequestOptions options)
 Update an existing token request. More...
 
Task< Token > CreateTransferToken (TokenPayload payload)
 Creates a new transfer token. More...
 
Task< Token > CreateTransferToken (TokenPayload payload, string tokenRequestId)
 Creates a new transfer token with a token request id. More...
 
Task< Token > CreateAccessToken (TokenPayload payload)
 Creates an access token. More...
 
Task< Token > CreateAccessToken (TokenPayload payload, string tokenRequestId)
 Creates an access token with a token request id. More...
 
Task< Token > GetToken (string tokenId)
 Looks up an existing token. More...
 
Task< PagedList< Token > > GetTokens (TokenType type, int limit, string offset)
 Looks up a list of existing token. More...
 
Task< TokenOperationResult > EndorseToken (Token token, Level level)
 Endorses a token. More...
 
Task< TokenOperationResult > CancelToken (Token token)
 Cancels a token. More...
 
Task< TokenOperationResult > ReplaceToken (Token tokenToCancel, TokenPayload tokenToCreate)
 Cancels the existing token and creates a replacement for it. Supported only for access tokens. More...
 
Task< ProtoAccount > GetDefaultAccount (string memberId)
 Makes RPC to get default bank account for this member. More...
 
Task SetDefaultAccount (string accountId)
 Makes RPC to set default bank account. More...
 
Task< bool > IsDefault (string accountId)
 Looks up if this account is default. More...
 
Task< Balance > GetBalance (string acountId, Level keyLevel)
 Look up account balance. More...
 
Task< IList< Balance > > GetBalances (IList< string > accountIds, Level keyLevel)
 Look up balances for a list of accounts. More...
 
Task< Transfer > CreateTransfer (TransferPayload payload)
 Creates a transfer redeeming a transfer token. More...
 
Task< Transfer > GetTransfer (string transferId)
 Looks up an existing transfer. More...
 
Task< PagedList< Transfer > > GetTransfers (string tokenId, string offset, int limit)
 Looks up a list of existing transfers. More...
 
Task< Transaction > GetTransaction (string accountId, string transactionId, Level keyLevel)
 Look up an existing transaction and return the response. More...
 
Task< PagedList< Transaction > > GetTransactions (string accountId, int limt, Level keyLevel, string offset)
 Lookup transactions and return response. More...
 
Task< string > CreateBlob (Payload payload)
 Creates and uploads a blob. More...
 
Task< Blob > GetBlob (string blobId)
 Retrieves a blob from the server. More...
 
Task< Blob > GetTokenBlob (string tokenId, string blobId)
 Retrieves a blob that is attached to a token. More...
 
Task< AddressRecord > AddAddress (string name, Address address)
 Adds a new member address. More...
 
Task< AddressRecord > GetAddress (string addressId)
 Looks up an address by id. More...
 
Task< IList< AddressRecord > > GetAddresses ()
 Looks up member addresses. More...
 
Task DeleteAddress (string addressId)
 Deletes a member address by its id. More...
 
Task< Profile > SetProfile (Profile profile)
 Replaces a member's public profile. More...
 
Task< Profile > GetProfile (string memberId)
 Gets a member's public profile. More...
 
Task SetProfilePicture (Payload payload)
 Replaces a member's public profile picture. More...
 
Task< Blob > GetProfilePicture (string memberId, ProfilePictureSize size)
 Gets a member's public profile picture. More...
 
Task< BankInfo > GetBankInfo (string bankId)
 Returns linking information for the specified bank id. More...
 
Task< OauthBankAuthorization > CreateTestBankAccount (Money balance)
 Creates a test bank account and returns the authorization for it. More...
 
Task< ProtoAccount > CreateAndLinkTestBankAccount (Money balance)
 Creates a test bank account and links it. More...
 
Task< IList< Alias > > GetAliases ()
 Returns a list of aliases of the member. More...
 
Task< string > RetryVerification (Alias alias)
 Retry alias verification. More...
 
Task< Signature > AuthorizeRecovery (Authorization authorization)
 Authorizes recovery as a trusted agent. More...
 
Task< string > GetDefaultAgent ()
 Gets the member id of the default recovery agent. More...
 
Task VerifyAlias (string verificationId, string code)
 Verifies a given alias. More...
 
Task ApplySca (IList< string > accountIds)
 Apply SCA for the given list of account IDs. More...
 
Task< Signature > SignTokenRequestState (string tokenRequestId, string tokenId, string state)
 Signs a token request state payload. More...
 
Task< IList< Device > > GetPairedDevices ()
 Get a list of paired devices. More...
 
Task VerifyAffiliate (string memberId)
 Verifies an affiliated TPP. More...
 
Task< IList< TransferEndpoint > > ResolveTransferDestination (string accountId)
 Resolves transfer destinations for the given account. More...
 
Task AddTrustedBeneficiary (TrustedBeneficiary.Types.Payload payload)
 Adds a trusted beneficiary for whom the SCA will be skipped. More...
 
Task RemoveTrustedBeneficiary (TrustedBeneficiary.Types.Payload payload)
 Removes a trusted beneficiary. More...
 
Task< IList< TrustedBeneficiary > > GetTrustedBeneficiaries ()
 Gets a list of all trusted beneficiaries. More...
 

Properties

string MemberId [get]
 

Detailed Description

An authenticated RPC client that is used to talk to Token gateway. The class is a thin wrapper on top of gRPC generated client. Makes the API easier to use.

Constructor & Destructor Documentation

◆ Client()

Tokenio.Rpc.Client.Client ( string  memberId,
ICryptoEngine  cryptoEngine,
ManagedChannel  channel 
)
inline

Instantiates a client.

Parameters
memberIdthe member id
cryptoEnginethe crypto engine used to sign for authentication, request payloads, etc
channelmanaged channel

Member Function Documentation

◆ AddAddress()

Task<AddressRecord> Tokenio.Rpc.Client.AddAddress ( string  name,
Address  address 
)
inline

Adds a new member address.

Parameters
namethe name of the address
addressthe address json
Returns
the created address record

◆ AddTrustedBeneficiary()

Task Tokenio.Rpc.Client.AddTrustedBeneficiary ( TrustedBeneficiary.Types.Payload  payload)
inline

Adds a trusted beneficiary for whom the SCA will be skipped.

Parameters
payloadthe trusted beneficiary payload
Returns
a task

◆ ApplySca()

Task Tokenio.Rpc.Client.ApplySca ( IList< string >  accountIds)
inline

Apply SCA for the given list of account IDs.

Parameters
accountIdsthe list of account ids
Returns
a task

◆ AuthorizeRecovery()

Task<Signature> Tokenio.Rpc.Client.AuthorizeRecovery ( Authorization  authorization)
inline

Authorizes recovery as a trusted agent.

Parameters
authorizationthe authorization
Returns
the signature

◆ CancelToken()

Task<TokenOperationResult> Tokenio.Rpc.Client.CancelToken ( Token  token)
inline

Cancels a token.

Parameters
tokenthe token to cancel
Returns
the result of the cancel operation

◆ CreateAccessToken() [1/2]

Task<Token> Tokenio.Rpc.Client.CreateAccessToken ( TokenPayload  payload)
inline

Creates an access token.

Parameters
payloadthe access token payload
Returns
the access token

◆ CreateAccessToken() [2/2]

Task<Token> Tokenio.Rpc.Client.CreateAccessToken ( TokenPayload  payload,
string  tokenRequestId 
)
inline

Creates an access token with a token request id.

Parameters
payloadthe access token payload
tokenRequestIdthe token request id
Returns
the access token

◆ CreateAndLinkTestBankAccount()

Task<ProtoAccount> Tokenio.Rpc.Client.CreateAndLinkTestBankAccount ( Money  balance)
inline

Creates a test bank account and links it.

Parameters
balancethe account balance to set
Returns
the linked account

◆ CreateBlob()

Task<string> Tokenio.Rpc.Client.CreateBlob ( Payload  payload)
inline

Creates and uploads a blob.

Parameters
payloadthe blob payload
Returns
id of the blob

◆ CreateTestBankAccount()

Task<OauthBankAuthorization> Tokenio.Rpc.Client.CreateTestBankAccount ( Money  balance)
inline

Creates a test bank account and returns the authorization for it.

Parameters
balancethe account balance to set
Returns
the oauth bank authorization

◆ CreateTransfer()

Task<Transfer> Tokenio.Rpc.Client.CreateTransfer ( TransferPayload  payload)
inline

Creates a transfer redeeming a transfer token.

Parameters
payloadthe transfer payload
Returns

◆ CreateTransferToken() [1/2]

Task<Token> Tokenio.Rpc.Client.CreateTransferToken ( TokenPayload  payload)
inline

Creates a new transfer token.

Parameters
payloadthe transfer token payload
Returns
the transfer token
Exceptions
TransferTokenException

◆ CreateTransferToken() [2/2]

Task<Token> Tokenio.Rpc.Client.CreateTransferToken ( TokenPayload  payload,
string  tokenRequestId 
)
inline

Creates a new transfer token with a token request id.

Parameters
payloadthe transfer token payload
tokenRequestIdthe token request id
Returns
the transfer payload
Exceptions
TransferTokenException

◆ DeleteAddress()

Task Tokenio.Rpc.Client.DeleteAddress ( string  addressId)
inline

Deletes a member address by its id.

Parameters
addressIdthe id of the address
Returns
a task

◆ EndorseToken()

Task<TokenOperationResult> Tokenio.Rpc.Client.EndorseToken ( Token  token,
Level  level 
)
inline

Endorses a token.

Parameters
tokenthe token
levelthe key level to be used to endorse the token
Returns
the result of the endorsement

◆ GetAccount()

Task<ProtoAccount> Tokenio.Rpc.Client.GetAccount ( string  accountId)
inline

Looks up a linked funding account.

Parameters
accountIdthe account id
Returns
the account info

◆ GetAccounts()

Task<IList<ProtoAccount> > Tokenio.Rpc.Client.GetAccounts ( )
inline

Looks up all the linked funding accounts.

Returns
a list of linked accounts

◆ GetAddress()

Task<AddressRecord> Tokenio.Rpc.Client.GetAddress ( string  addressId)
inline

Looks up an address by id.

Parameters
addressIdthe address id
Returns
the address record

◆ GetAddresses()

Task<IList<AddressRecord> > Tokenio.Rpc.Client.GetAddresses ( )
inline

Looks up member addresses.

Returns
a list of addresses

◆ GetAliases()

Task<IList<Alias> > Tokenio.Rpc.Client.GetAliases ( )
inline

Returns a list of aliases of the member.

Returns
a list of aliases

◆ GetBalance()

Task<Balance> Tokenio.Rpc.Client.GetBalance ( string  acountId,
Level  keyLevel 
)
inline

Look up account balance.

Parameters
acountIdthe account id
keyLevelthe key level
Returns
the account balance
Exceptions
StepUpRequiredException

◆ GetBalances()

Task<IList<Balance> > Tokenio.Rpc.Client.GetBalances ( IList< string >  accountIds,
Level  keyLevel 
)
inline

Look up balances for a list of accounts.

Parameters
accountIdsa list of account ids
keyLevelthe key level
Returns
a list of balances

◆ GetBankInfo()

Task<BankInfo> Tokenio.Rpc.Client.GetBankInfo ( string  bankId)
inline

Returns linking information for the specified bank id.

Parameters
bankIdthe bank id
Returns
the bank linking information

◆ GetBlob()

Task<Blob> Tokenio.Rpc.Client.GetBlob ( string  blobId)
inline

Retrieves a blob from the server.

Parameters
blobIdthe blob id
Returns
the blob

◆ GetDefaultAccount()

Task<ProtoAccount> Tokenio.Rpc.Client.GetDefaultAccount ( string  memberId)
inline

Makes RPC to get default bank account for this member.

Parameters
memberIdthe member id
Returns
the bank account

◆ GetDefaultAgent()

Task<string> Tokenio.Rpc.Client.GetDefaultAgent ( )
inline

Gets the member id of the default recovery agent.

Returns
the member id

◆ GetMember() [1/2]

Task<ProtoMember> Tokenio.Rpc.Client.GetMember ( )
inline

Looks up member information for the current user. The user is defined by the key used for authentication.

Returns
the member

◆ GetMember() [2/2]

Task<ProtoMember> Tokenio.Rpc.Client.GetMember ( string  memberId)
inline

Looks up member information for a given user.

Parameters
memberIdthe member id of the user
Returns
the member

◆ GetPairedDevices()

Task<IList<Device> > Tokenio.Rpc.Client.GetPairedDevices ( )
inline

Get a list of paired devices.

Returns
the list

◆ GetProfile()

Task<Profile> Tokenio.Rpc.Client.GetProfile ( string  memberId)
inline

Gets a member's public profile.

Parameters
memberIdthe member id of the member
Returns
the profile

◆ GetProfilePicture()

Task<Blob> Tokenio.Rpc.Client.GetProfilePicture ( string  memberId,
ProfilePictureSize  size 
)
inline

Gets a member's public profile picture.

Parameters
memberIdthe member id
sizethe desired size(small, medium, large, original)
Returns
blob with picture; empty blob (no fields set) if has no picture

◆ GetToken()

Task<Token> Tokenio.Rpc.Client.GetToken ( string  tokenId)
inline

Looks up an existing token.

Parameters
tokenIdthe token id
Returns
the token

◆ GetTokenBlob()

Task<Blob> Tokenio.Rpc.Client.GetTokenBlob ( string  tokenId,
string  blobId 
)
inline

Retrieves a blob that is attached to a token.

Parameters
tokenIdthe id of the token
blobIdthe id of the blob
Returns

◆ GetTokens()

Task<PagedList<Token> > Tokenio.Rpc.Client.GetTokens ( TokenType  type,
int  limit,
string  offset 
)
inline

Looks up a list of existing token.

Parameters
typethe token type
limitthe max number of records to return
offsetnullable offset to start at
Returns
the tokens in paged list

◆ GetTransaction()

Task<Transaction> Tokenio.Rpc.Client.GetTransaction ( string  accountId,
string  transactionId,
Level  keyLevel 
)
inline

Look up an existing transaction and return the response.

Parameters
accountIdthe account id
transactionIdthe transaction id
keyLevelthe key level
Returns
the transaction
Exceptions
StepUpRequiredExceptionif further authentication is required

◆ GetTransactions()

Task<PagedList<Transaction> > Tokenio.Rpc.Client.GetTransactions ( string  accountId,
int  limt,
Level  keyLevel,
string  offset 
)
inline

Lookup transactions and return response.

Parameters
accountIdthe account id
limtthe limit
keyLevelthe level
offsetnullable offset to start at
Returns
a paged list of transactions
Exceptions
StepUpRequiredExceptionif further authentication is required

◆ GetTransfer()

Task<Transfer> Tokenio.Rpc.Client.GetTransfer ( string  transferId)
inline

Looks up an existing transfer.

Parameters
transferIdthe transfer id
Returns
the transfer record

◆ GetTransfers()

Task<PagedList<Transfer> > Tokenio.Rpc.Client.GetTransfers ( string  tokenId,
string  offset,
int  limit 
)
inline

Looks up a list of existing transfers.

Parameters
tokenIdnullable token id
offsetnullable offset to start at
limitmax number of records to return
Returns

◆ GetTrustedBeneficiaries()

Task<IList<TrustedBeneficiary> > Tokenio.Rpc.Client.GetTrustedBeneficiaries ( )
inline

Gets a list of all trusted beneficiaries.

Returns
the list

◆ IsDefault()

Task<bool> Tokenio.Rpc.Client.IsDefault ( string  accountId)
inline

Looks up if this account is default.

Parameters
accountIdthe account id
Returns
true if the account is default; false otherwise

◆ LinkAccounts() [1/2]

Task<IList<ProtoAccount> > Tokenio.Rpc.Client.LinkAccounts ( BankAuthorization  authorization)
inline

Links a funding bank account to Token.

Parameters
authorizationan authorization to accounts, from the bank
Returns
a list of linked accounts

◆ LinkAccounts() [2/2]

Task<IList<ProtoAccount> > Tokenio.Rpc.Client.LinkAccounts ( OauthBankAuthorization  authorization)
inline

Links a funding bank account to Token.

Parameters
authorizationan OAuth authorization for linking
Returns
a list of linked accounts
Exceptions
BankAuthorizationRequiredException

◆ RemoveTrustedBeneficiary()

Task Tokenio.Rpc.Client.RemoveTrustedBeneficiary ( TrustedBeneficiary.Types.Payload  payload)
inline

Removes a trusted beneficiary.

Parameters
payloadthe trusted beneficiary payload
Returns
a task

◆ ReplaceToken()

Task<TokenOperationResult> Tokenio.Rpc.Client.ReplaceToken ( Token  tokenToCancel,
TokenPayload  tokenToCreate 
)
inline

Cancels the existing token and creates a replacement for it. Supported only for access tokens.

Parameters
tokenToCancelthe token to cancel
tokenToCreatethe payload to create new token with
Returns
the result of the replacement opration

◆ ResolveTransferDestination()

Task<IList<TransferEndpoint> > Tokenio.Rpc.Client.ResolveTransferDestination ( string  accountId)
inline

Resolves transfer destinations for the given account.

Parameters
accountIdthe account id
Returns
a list of transfer endpoints

◆ RetryVerification()

Task<string> Tokenio.Rpc.Client.RetryVerification ( Alias  alias)
inline

Retry alias verification.

Parameters
aliasthe alias to be verified
Returns
the verification id

◆ SetDefaultAccount()

Task Tokenio.Rpc.Client.SetDefaultAccount ( string  accountId)
inline

Makes RPC to set default bank account.

Parameters
accountIdthe account id
Returns
a task

◆ SetProfile()

Task<Profile> Tokenio.Rpc.Client.SetProfile ( Profile  profile)
inline

Replaces a member's public profile.

Parameters
profilethe profile to set
Returns
the profile that was set

◆ SetProfilePicture()

Task Tokenio.Rpc.Client.SetProfilePicture ( Payload  payload)
inline

Replaces a member's public profile picture.

Parameters
payloadthe blob payload
Returns
a task

◆ SetSecurityMetadata()

void Tokenio.Rpc.Client.SetSecurityMetadata ( SecurityMetadata  securityMetadata)
inline

Sets the security metadata to be sent with each request.

Parameters
securityMetadatasecurity metadata

◆ SignTokenRequestState()

Task<Signature> Tokenio.Rpc.Client.SignTokenRequestState ( string  tokenRequestId,
string  tokenId,
string  state 
)
inline

Signs a token request state payload.

Parameters
tokenRequestIdthe token request id
tokenIdthe token id
statethe state
Returns
the signature

◆ StoreTokenRequest() [1/2]

Task<string> Tokenio.Rpc.Client.StoreTokenRequest ( TokenRequestPayload  payload,
Proto.Common.TokenProtos.TokenRequestOptions  options 
)
inline

Stores a transfer token request.

Parameters
payloadthe token request payload (immutable fields)
optionsthe token request options (mutable fields)
Returns
an id to reference the token request

◆ StoreTokenRequest() [2/2]

Task<string> Tokenio.Rpc.Client.StoreTokenRequest ( TokenPayload  payload,
IDictionary< string, string >  options 
)
inline

DEPRECATED Stores a transfer token request.

Parameters
payloadthe transfer token payload
optionsa map of options
Returns
an id to reference the token request

◆ UnlinkAccounts()

Task Tokenio.Rpc.Client.UnlinkAccounts ( IList< string >  accountIds)
inline

Unlinks token accounts.

Parameters
accountIdsthe account ids to unlink
Returns
a task

◆ UpdateMember() [1/3]

Task<ProtoMember> Tokenio.Rpc.Client.UpdateMember ( IList< MemberOperation >  operations,
IList< MemberOperationMetadata >  metadata 
)
inline

Updates member by applying the specified operations.

Parameters
operationsthe operations to apply
metadatathe metadata associated with the operations
Returns
the updated member

◆ UpdateMember() [2/3]

Task<ProtoMember> Tokenio.Rpc.Client.UpdateMember ( IList< MemberOperation >  operations)
inline

Updates member by applying the specified operations that don't contain any add alias operation.

Parameters
operationsthe operations to apply
Returns
the updated member

◆ UpdateMember() [3/3]

Task<ProtoMember> Tokenio.Rpc.Client.UpdateMember ( ProtoMember  member,
IList< MemberOperation >  operations,
IList< MemberOperationMetadata >  metadata 
)
inline

Updates member by applying the specified operations.

Parameters
memberthe member to update, which should be the member that the client is bond to
operationsthe operations to apply
metadatathe updated member
Returns

◆ UpdateTokenRequest()

Task Tokenio.Rpc.Client.UpdateTokenRequest ( string  requestId,
Proto.Common.TokenProtos.TokenRequestOptions  options 
)
inline

Update an existing token request.

Parameters
requestIdtoken request ID
optionsnew token request options
Returns
a task

◆ UseAccessToken()

void Tokenio.Rpc.Client.UseAccessToken ( string  accessTokenId,
bool  customerInitiated = false 
)
inline

Sets the On-Behalf-Of authentication value to be used with this client. The value must correspond to an existing Access Token ID issued for the client member. Sets customer initiated to false if not specified.

Parameters
accessTokenIdthe access token id to be used
customerInitiatedwhether the customer initiated the calls

◆ UseDefaultRecoveryRule()

Task Tokenio.Rpc.Client.UseDefaultRecoveryRule ( )
inline

Set Token as the recovery agent.

Returns
a task

◆ VerifyAffiliate()

Task Tokenio.Rpc.Client.VerifyAffiliate ( string  memberId)
inline

Verifies an affiliated TPP.

Parameters
memberIdmember ID of the TPP verify
Returns
a task

◆ VerifyAlias()

Task Tokenio.Rpc.Client.VerifyAlias ( string  verificationId,
string  code 
)
inline

Verifies a given alias.

Parameters
verificationIdthe verification id
codethe verification code
Returns
a task

The documentation for this class was generated from the following file: