
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
@circles/core
Advanced tools
This library provides common methods for JavaScript clients and wallets to interact with the circles-contracts
and off-chain services.
circles-contracts
and off-chain services like safe-relay-service
, graph
and circles-api
v1.3.0
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: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0',
safeMasterAddress: '0x59d3631c86BbE35EF041872d502F218A39FBa150',
apiServiceEndpoint: 'http://api.circles.local',
pathfinderServiceEndpoint: 'http://pathfinder.circles.local',
pathfinderType: 'server', // other option: 'cli'
graphNodeEndpoint: 'http://graph.circles.local',
databaseSource: 'graph',
relayServiceEndpoint: 'http://relay.circles.local',
subgraphName: 'circlesubi/circles-subgraph',
fallbackHandlerAddress: '0x67B5656d60a809915323Bf2C40A8bEF15A152e3e',
});
// 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,
});
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.
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
GNU Affero General Public License v3.0 AGPL-3.0
FAQs
Common methods to interact with the Circles ecosystem
We found that @circles/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.