Aktionariat Documentation
  • Introduction to Aktionariat
    • ⚡Quick Start
  • 🛠️APIs
    • 📊Subgraph
      • Schema
      • Query Examples
        • Platform data
        • Token Data
        • Brokerbot Data
        • Swaps Data
    • ⚙️External API
      • ⚙️External API (Gitbook)
  • 🌐Web
    • Integrate with Ethers.js
      • Brokerbot Quoter
    • Integrate Aktionariat Widgets
  • ⛓️Smart Contracts
    • 📔Contracts Overview
    • 👷‍♂️Guides
      • Implement A Trade
        • Direct Trades
        • Multihop Trades
      • Get Brokerbot Contract for Token
      • Buy Shares
      • Sell Shares
    • Technical Reference
      • Allowlist
      • Brokerbot
      • Drag-Along
      • Infinite Allowances
      • Multi-Signature Contract
      • Recovery
      • Shareholder Registry
  • 📖Reference
    • Brokerbot Architecture
    • Github
    • Whitepaper
    • Brokerbot Analytics
  • 💬Socials
    • Twitter
    • Telegram
    • LinkedIn
    • Youtube
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Introduction to Aktionariat

Quick Start

Jump Right Into the Integration

PreviousIntroduction to AktionariatNextSubgraph

Last updated 2 years ago

Was this helpful?

Few easy examples on how to integrate with Aktionariat

  • via REST and our

  • via GraphQL and the

  • via and our Smart Contracts

  • via and our Smart Contracts

External API

An easy and quick way to get all tokens on the Aktionariat platfom is the /token enpoint, which gives you back a lot of details

For all endpoints visit the External API section:

Subgraph

{
  registry(id: "0xcb3e482df38d62e73a7ae0e15a2605cadcc5ae98"){
    txCount
    tokenCount
    totalVolumeUSD
    totalVolumeXCHF
  }
}

For the full details about visit the Subgraph section:

Ethers

A short node.js script to get the price to buy one share:

import { ethers } from "ethers";

let brokerbotAddress = "0x3A2148cEa2A8A4dAE51487fA28451038c24d2576"
const brokerbotABI = ["function getBuyPrice(uint256 shares) view returns (uint256)"];

async function main () {
  const ethersProvider = new ethers.providers.InfuraProvider();
  const wallet = ethers.Wallet.createRandom().connect(ethersProvider);
  const brokerbotContract = new ethers.Contract(brokerbotAddress, brokerbotABI, wallet);
  const price = await brokerbotContract.getBuyPrice(1);
  console.log(Price to buy 1 share: ${price}`);
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

More examples with Ethers:

Solidity

A short contract to show how to buy some shares with XCHF:

contract BuySharesExample {
    //constants
    IERC20 public constant XCHF = 0xB4272071eCAdd69d933AdcD19cA99fe80664fc08;
    address public constant brokerbot = 0x3A2148cEa2A8A4dAE51487fA28451038c24d2576;
    address public constant paymenthub = 0xD5608dEe5F0ed1A09B5cC3FEbB9B3Fc48e68057d;
    
    function buySharesWithBaseToken(uint256 amountShares) external {
    uint256 baseAmount = brokerbot.getPrice(amountShares);
    //approve paymenthub to move base currency (XCHF)
    XCHF.approve(paymenthub, baseAmount)
    paymenthub.payAndNotify(brokerbot, baseAmount, "0x01");
    }

Dive deeper:

To quickly check out the Subgraph you can go to the The Graph's An first insight full query would be to get all total trading data of the platform:

⚡
⚙️External API (Gitbook)
Explorer Page
📊Subgraph
Integrate with Ethers.js
📔Contracts Overview
External API
Aktionariat Subgrathph
Ethers
Solidity

Get all tokens

get

Get all tokens that are registered in the Aktionariat back-end.

Responses
200
Successful operation
400
Token not found
404
Not Found
get
GET /tokens/ HTTP/1.1
Host: ext.aktionariat.com
Accept: */*
[
  {
    "ticker": "DAKS",
    "name": "Draggable Aktionariart AG Shares",
    "description": "Aktionariat is a tokenization platform.",
    "chain": "mainnet",
    "register": "0x6f38e0f1a73c96cb3f42598613ea3474f09cb200",
    "market": "https://investors.aktionariat.com",
    "creation": 1,
    "currency": "CHF",
    "status": "TRADED",
    "tokenType": "EQUITY",
    "url": "https://investors.aktionariat.com",
    "totalSupply": 1330000,
    "marketCap": 18535743,
    "issuer": {
      "name": "Aktionariat AG",
      "description": "Aktionariat is a tokenization platfrom for security tokens",
      "url": "www.aktionariat.com",
      "industry": "Fintech",
      "foundingYear": 2020
    }
  }
]
  • External API
  • GETGet all tokens
  • Subgraph
  • Ethers
  • Solidity