⚡Quick Start
Jump Right Into the Integration
Few easy examples on how to integrate with Aktionariat
via REST and our External API
via GraphQL and the Aktionariat Subgrathph
via Ethers and our Smart Contracts
via Solidity 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
Get all tokens that are registered in the Aktionariat back-end.
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
}
}
]
For all endpoints visit the External API section:
⚙️External API (Gitbook)Subgraph
To quickly check out the Subgraph you can go to the The Graph's Explorer Page An first insight full query would be to get all total trading data of the platform:
{
registry(id: "0xcb3e482df38d62e73a7ae0e15a2605cadcc5ae98"){
txCount
tokenCount
totalVolumeUSD
totalVolumeXCHF
}
}
For the full details about visit the Subgraph section:
📊SubgraphEthers
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:
Integrate with Ethers.jsSolidity
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:
📔Contracts OverviewLast updated
Was this helpful?