Full Documentation

This lists the full functionality available in the SDK.

Version 0.2 requires .Net framework 4.6.1 or later.

Usage

Installation

Add the SDK from the Nuget Package Manager to your project. The SDK is available here.

Initialize the application

using SilaAPI.silamoney.client.api;
class SilamoneyApi
{
SilaApi api = new SilaApi(Environments.SANDBOX,
privateKey,
appHandle);
}

This sets up the app private key and handle for the SDK to use for signing subsequent requests. The other SDK functionality will not be available until this configuration is completed. The SDK does not store this information outside of the instance that is configured. Private keys are never transmitted over the network or stored outside the scope of this instance.

You can manage your apps in the Developer Console. The APPLICATION_PRIVATE_KEY is the Private Key that matches the Public Key associated with the Application Handle in your Console.

Keep your Application Private Key secure! Never share it with anyone, including us. If you believe that your private key has been compromised, please replace the key for that app with a new one in the Developer Console.

User Methods

Check Handle

Checks the availability of user_handle so that it can be used in user registration.

string userHandle = "user.silamoney.eth";
ApiResponse<object> response = api.CheckHandle(userHandle);

Success Response Object 200 OK

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // user is available!

Failure Response Object 200 OK

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // FAILURE
Console.WriteLine(((BaseResponse)response.Data).Message); // user is already taken

Register

Attaches KYC data and specified blockchain address to an assigned handle.

User user = new User(userHandle, firstName, lastName, entityName, identityName, phone, email, streetAddress1, streetAddress2, city,
state, postalCode, cryptoAddress, birthdate);
ApiResponse<object> response = api.Register(user);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // user was successfully registered.

RequestKYC

Starts KYC verification process on a registered user handle.

ApiResponse<object> response = api.RequestKYC(userHandle, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // user submitted for KYC review.

CheckKYC

Returns whether the entity attached to the user handle is verified, not valid, or still pending.

ApiResponse<object> response = api.CheckKYC(userHandle, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // user has passed ID verification!

LinkAccount

Uses a provided Plaid public token to link a bank account to a verified entity. More detail & Plaid public key is available here.

ApiResponse<object> response = api.LinkAccount(userHandle, publicToken, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // Bank account successfully linked.

GetAccounts

Gets basic bank account names linked to user handle.

ApiResponse<object> response = api.GetAccounts(userHandle, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((List<Account>)response.Data)[0].AccountName); // Account Name
Console.WriteLine(((List<Account>)response.Data)[0].AccountNumber); // Account Number
Console.WriteLine(((List<Account>)response.Data)[0].AccountStatus); // Account Status
Console.WriteLine(((List<Account>)response.Data)[0].AccountType); // Account Type

IssueSila

Debits a specified account and issues tokens to the address belonging to the requested handle.

ApiResponse<object> response = api.IssueSila(userHandle, amount, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // Transaction submitted to processing queue.

TransferSila

Starts a transfer of the requested amount of SILA to the requested destination handle.

ApiResponse<object> response = api.TransferSila(userHandle, amount, destinationHandle, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // Transaction submitted to processing queue.

RedeemSila

Burns given the amount of SILA at the handle's blockchain address and credits their named bank account in the equivalent monetary amount.

ApiResponse<object> response = api.RedeemSila(userHandle, amount, userPrivateKey);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((BaseResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((BaseResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((BaseResponse)response.Data).Message); // Transaction submitted to processing queue.

GetTransactions

ApiResponse<object> response = api.GetTransactions(userHandle, userPrivateKey, filters);

Success Response Object

Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((GetTransactionsResult)response.Data).Page); // Page Number
Console.WriteLine(((GetTransactionsResult)response.Data).ReturnedCount); // Pages returned
Console.WriteLine(((GetTransactionsResult)response.Data).Success); // Status of the request
Console.WriteLine(((GetTransactionsResult)response.Data).TotalCount); // Total of transactions returned
Console.WriteLine(((GetTransactionsResult)response.Data).Transactions); // Transactions array

SilaBalance

ApiResponse<object> response = api.SilaBalance(DefaultConfig.environment, "0xabc123abc123abc123");
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(response.Data); // Sila tokens