NAV
csharp

Introduction

Sirius is a Digital Assets custody and a blockchain infrastructure API allowing consumers to manage blockchain wallets, keep their assets safe in self-managed custody, flexibly control transaction signing policies, receive deposits and execute withdrawals leveraging omnibus model, deploy and invoke smart contracts, receive smart contract events and read smart contract storage in many different blockchains in a general manner using the same API, data models and management UI. You don't need to learn the particularities of all the blockchains to get into the crypto world and use all top blockchains with ease.

For more information about Sirius, please contact us info@swisschain.io.

Feedback

In the case, if you have found an issue in REST API, gRPC API, Universe portal, or in this documentation, please give us feedback by adding a GitHub issue. Thank you!

API usage

There are several ways to use Sirius API. The most convenient is the .NET API client library.

Nuget Package: Nuget Package

Proto files: https://github.com/swisschain/Sirius.Api.Docs/tree/master/.proto

Client registration


var options = new SiriusApiOptions
{
    ServerGrpcUrl = new Uri("<sirius api url>"),
    ApiKey = "<you api key>",
    Timeout = TimeSpan.FromSeconds(60)
};

services.AddSiriusApiClient(options);

In Startup on ConfigureServices add API client using IServiceCollection extension method.

Pagination

Sirius API uses cursor-based pagination model in all endpoints which can return loads of items.

Request


var pagination = new PaginationInt64
{
    Cursor = 10008,
    Limit = 100,
    Order = PaginationOrder.Asc
}

name type description example
cursor optional, string Cursor to continue the search stellar-test
limit optional, int Maximum number of items to return in the search results 10
order optional, Order Result items sorting order asc

Response


var items = response.Body.Items;
var pagination = response.Body.Pagination;

name type description
Items List The array of an objects
Pagination Pagination Pagination state to continue search

Models

Pagination information


var cursor = response.Body.Pagination.Cursor;
var count = response.Body.Pagination.Count;
var order = response.Body.Pagination.Order;

name type description example
Cursor optional, string Cursor to continue the search stellar-test
Count optional, number Number of items in the current page 10
Order optional, Order Result items sorting order asc

Order (enum)

Order of the sorting

Assets

Sirius provides the set of crypto assets available to use. You can get notifications about a deposit or initiate a withdrawal in any asset presented in this set. The asset is a generic model which represents a native asset, fungible token or a non-fungible token. It's possible that in the different blockchains assets with the same symbol and/or address are existed, so you have to rely only on the asset ID if you need to deterministically identify it. If you've received a deposit of an asset which is not supported by Sirius yet, you can add this particular asset to your personal list by specifying all needed asset parameters.

Returns assets by search parameters.

var request = new AssetSearchRequest
{
    Id = 10001,
    BlockchainId = "ethereum",
    Symbol = "USDC",
    TokenId = null,
    Address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    Accuracy = 6,
    Pagination = new PaginationInt64
    {
        Cursor = null,
        Limit = 100,
        Order = PaginationOrder.Asc
    }
};

var response = client.AssetsV2.SearchAsync(request);

Request

name type description example
Id optional, long ID of the asset to search 100553
BlockchainId optional, string Exact blockchain id to search bitcoin-private
Symbol optional, string Text to search in the asset symbol BTC
TokenId optional, string Text to search in the asset symbol BTC
Address optional, string Exact address to search 0xC1701AbD559FC263829CA3917d03045F95b5224A
Accuracy optional, int Exact accuracy to search 8
Pagination optional, Pagination

Response

Paginated array of the assets.

Error Code Meaning
UNKNOWN An unspecified error code received.
INVALID_PARAMETERS Your request contains invalid parameters.
DOMAIN_PROBLEM An error occurred while processing request.
TECHNICAL_PROBLEM We had a problem with our server. Try again later.

AddAttributes

Adds asset attributes.

var request = new AssetAddAttributesRequest
{
    IdempotencyId = "AD1D5199-1D1F-4B2C-AE6C-DED0DAAC4D34",
    AssetId = 10001,
    Aml = new AmlAssetAttributesCreateInfo
    {
        Chainalysis = new AmlChainalysisAssetAttributesInfo
        {
            Symbol = "USDC",
            TransferFormat = ChainalysisTransferFormat.HashAndAddress,
            IsCheckDepositsEnabled = true,
            IsCheckWithdrawalsEnabled = true,
            IsNotifyWithdrawalsEnabled = true
        },
        MerkleScience = new AmlMerkleScienceAssetAttributesInfo
        {
            Symbol = "USDC",
            Currency = 14,
            IsDisabled = false
        }
    },
    Brokerage = new BrokerageAssetAttributesCreateInfo
    {
        MinDepositThreshold = 1,
        MinWithdrawalAmount = 1
    }
};

var response = client.AssetsV2.AddAttributes(request);

Request

name type description example
IdempotencyId string Request unique identifier "AD1D5199-1D1F-4B2C-AE6C-DED0DAAC4D34"
AssetId long Asset identifier in Sirius 10001
Aml AmlAssetAttributesCreateInfo AML asset attributes
Brokerage BrokerageAssetAttributesCreateInfo Brokerage asset attributes

Response

name type description example
Id long Asset attributes identifier 30002
Error Code Meaning
UNKNOWN An unspecified error code received.
INVALID_PARAMETERS Your request contains invalid parameters.
DOMAIN_PROBLEM An error occurred while processing request.
TECHNICAL_PROBLEM We had a problem with our server. Try again later.

Models

Asset

name type description example
Id long ID of the asset 100003
BlockchainId string Exact blockchain id bitcoin-private
Symbol string Asset symbol BTC
TokenId string Token ID 101
Address string Exact address 0xC1701AbD559FC263829CA3917d03045F95b5224A
Accuracy int Exact accuracy 8
Name string The name of token Toy
MetadataUrl string The token metadata URL ipfs://metadata.json
Type string The blockchain-specific type of token ERC-20
Aml AmlAssetAttributesInfo The AML attributes
Brokerage BrokerageAssetAttributesInfo The brokerage attributes

AmlAssetAttributesCreateInfo

name type description example
Chainalysis AmlChainalysisAssetAttributesInfo Chainalysis attributes
MerkleScience AmlMerkleScienceAssetAttributesInfo MerkleScience attributes

AmlAssetAttributesInfo

name type description example
Id long ID of the info 300001
Chainalysis AmlChainalysisAssetAttributesInfo Chainalysis attributes
MerkleScience AmlMerkleScienceAssetAttributesInfo MerkleScience attributes
CreatedAt DateTime Create date time
UpdatedAt DateTime Update date time

AmlChainalysisAssetAttributesInfo

name type description example
Symbol string Chainalysis asset symbol BTC
IsCheckWithdrawalsEnabled bool Indicates that withdrawals check enabled true
IsCheckDepositsEnabled bool Indicates that deposits check enabled true
IsNotifyWithdrawalsEnabled bool Indicates that notify withdrawals check enabled true
TransferFormat ChainalysisTransferFormat Update date time

ChainalysisTransferFormat (enum)

AmlMerkleScienceAssetAttributesInfo

name type description example
Symbol string MerkleScience asset symbol BTC
Currency int MerkleScience currency ID 12
IsDisabled bool Indicates that asset check enabled true

BrokerageAssetAttributesCreateInfo

name type description example
MinDepositThreshold decimal Minimum deposit threshold 0.0001
MinWithdrawalAmount decimal Minimum withdrawal amount 0.1

BrokerageAssetAttributesInfo

name type description example
Id long ID of the info 300001
MinDepositThreshold decimal Minimum deposit threshold 0.0001
MinWithdrawalAmount decimal Minimum withdrawal amount 0.1
CreatedAt DateTime Create date time
UpdatedAt DateTime Update date time