All Projects → CirclesUBI → circles-core

CirclesUBI / circles-core

Licence: AGPL-3.0 license
Common methods to interact with the Circles ecosystem

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to circles-core

lemverse
The first-ever coworking metaverse
Stars: ✭ 91 (+313.64%)
Mutual labels:  web3
ipfs-blog
IPFS Blog & News
Stars: ✭ 31 (+40.91%)
Mutual labels:  web3
eth-provider
A Universal Ethereum Provider Client
Stars: ✭ 139 (+531.82%)
Mutual labels:  web3
ether-swr
Ether-SWR is a React hook that fetches Ethereum data. It streamlines the chores to keep the internal state of the Decentralized App (DApp), batches the RPC calls to an Ethereum node and cache the responses
Stars: ✭ 125 (+468.18%)
Mutual labels:  web3
ethereum-scripts
Common useful JavaScript snippets for geth
Stars: ✭ 33 (+50%)
Mutual labels:  web3
vortex-components
⚛️Vortex Components is a collection of React Components that helps developers build Ethereum Dapps powered by the Vortex Redux Store.
Stars: ✭ 14 (-36.36%)
Mutual labels:  web3
eth-self-token-example
在本地网络发布一个名叫 YuTou 的 token
Stars: ✭ 8 (-63.64%)
Mutual labels:  web3
digital-copyright
Stamp your code with a trackable digital copyright
Stars: ✭ 17 (-22.73%)
Mutual labels:  web3
cyberevents
The protocol for EVENTs and TICKETs
Stars: ✭ 16 (-27.27%)
Mutual labels:  web3
glosseta
Glosseta is an open-source glossary meant to help people explore and learn the terminology behind web3
Stars: ✭ 23 (+4.55%)
Mutual labels:  web3
superhighway84
USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
Stars: ✭ 437 (+1886.36%)
Mutual labels:  web3
OpenLoginSdk
Pluggable auth infrastructure for Web3 wallets and dapps
Stars: ✭ 108 (+390.91%)
Mutual labels:  web3
agollo
🚀Go client for ctrip/apollo (https://github.com/apolloconfig/apollo)
Stars: ✭ 563 (+2459.09%)
Mutual labels:  client-library
Milvasoft.Iyzipay
Iyzico client for .Net 6
Stars: ✭ 15 (-31.82%)
Mutual labels:  client-library
MultiDexArbBot
This is an arbitrage bot that uses existing price aggregators such as 1inch, Paraswap, dex.ag, matcha and more to get the best exchange rates across different decentralized exchanges on different blockchains and ecosystems.
Stars: ✭ 67 (+204.55%)
Mutual labels:  web3
braze-php-sdk
A PHP client to interact with Braze API
Stars: ✭ 15 (-31.82%)
Mutual labels:  client-library
TheGame
The platform that MetaGame will be played on aka MetaOS - an open source framework for running decentralized societies. Currently featuring MetaSys, MyMeta Profiles, Dashboard, MetaMenu & Quests
Stars: ✭ 100 (+354.55%)
Mutual labels:  web3
dapp-starter
Opinionated Dapp Starter Template
Stars: ✭ 207 (+840.91%)
Mutual labels:  web3
typescript-eth-starter
🔌 Ethereum Dapp Basic Typescript Starter
Stars: ✭ 125 (+468.18%)
Mutual labels:  web3
launch
Matic network mainnet v1 launch
Stars: ✭ 56 (+154.55%)
Mutual labels:  web3

circles-core

Common methods to interact with the Circles ecosystem


This library provides common methods for JavaScript clients and wallets to interact with the circles-contracts and off-chain services.

Features

  • Interact with circles-contracts and off-chain services like safe-relay-service, graph and circles-api
  • Register and maintain user accounts and organizations
  • Create and search off-chain data like transfer descriptions, usernames and profile pictures
  • Trust other users in the network and retreive trust network
  • List owned Circles tokens and their current balance
  • Show last activities like transfers, trusts and Safe ownership changes
  • Calculate transitive transfer steps to send Circles

Example

import CirclesCore from '@circles/core';
import Web3 from 'web3';

// Initialize web3
const web3 = new Web3();

// Initialize core with default configs when running against local `circles-docker` setup
const core = new CirclesCore(web3, {
  hubAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601',
  proxyFactoryAddress: '0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb',
  safeMasterAddress: '0xC89Ce4735882C9F0f0FE26686c53074E09B0D550',
  apiServiceEndpoint: 'http://api.circles.local',
  graphNodeEndpoint: 'http://graph.circles.local',
  databaseSource: 'graph',
  relayServiceEndpoint: 'http://relay.circles.local',
  subgraphName: 'CirclesUBI/circles-subgraph',
});

// Create existing account from private key which owns a Safe
const account = web3.eth.accounts.privateKeyToAccount('0x...');

// Find out the address of the owned Safe
const [safeAddress] = await core.safe.getAddresses(account, {
  ownerAddress: account.address,
});

// Request Circles UBI payout
await core.token.requestUBIPayout(account, {
  safeAddress,
});

Installation

npm i @circles/core

Make sure you have all peer dependencies isomorphic-fetch and web3 installed as well. Check out the circles-docker repository for running your code locally against Circles services during development.

Development

circles-core is a JavaScript module, tested with Jest, transpiled with Babel and bundled with Rollup. Most of the tests are designed to test end-to-end against all external services and require a running circles-docker environment to work in your development setup.

# Install NodeJS dependencies
npm install

# Copy config file and edit variables according to your needs.
# When running against the default docker setup no changes are required here
cp .env.example .env

# Run e2e test suite. Make sure services are running in the background
# via `circles-docker` repository
npm run test

# Run tests automatically during development when changes have been made
npm run test:watch

# Check code formatting
npm run lint

# Build it!
npm run build

License

GNU Affero General Public License v3.0 AGPL-3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].