Skip to content

Commit

Permalink
0.14.0: bridges
Browse files Browse the repository at this point in the history
  • Loading branch information
a17 committed Sep 23, 2024
1 parent 68d7c22 commit 552f12c
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 7 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,24 @@ Asset addresses, description, website, color.
import {tokenlist} from '@stabilitydao/stability'
```

### 🌉 Bridges

#### Types

* `Bridge`

#### Enums

* `const enum BridgeName`

#### Constants

* `bridges: Bridge[]`

#### Methods

* `getChainBridges(chainName: ChainName): Bridge[]`

## 👷 Develop

```shell
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stabilitydao/stability",
"version": "0.13.8",
"version": "0.14.0",
"description": "Stability Integration Library",
"main": "out/index.js",
"types": "out/index.d.ts",
Expand Down
101 changes: 101 additions & 0 deletions src/bridges.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import {ChainName} from "./chains";

export type Bridge = {
name: BridgeName,
dapp: string,
img: string,
chains: ChainName[],
}

export const enum BridgeName {
SUPERBRIDGE = 'Superbridge',
BRIDGG = 'Brid.gg',
ARBITRUM = 'Arbitrum',
POLYGON = 'Polygon portal',
ROOTSTOCK = 'Rootstock',
}

export const bridges: Bridge[] = [
{
name: BridgeName.ROOTSTOCK,
dapp: 'https://dapp.tokenbridge.rootstock.io/',
img: 'chains/rootstock.png',
chains: [
ChainName.ETHEREUM,
ChainName.ROOTSTOCK,
],
},
{
name: BridgeName.POLYGON,
dapp: 'https://portal.polygon.technology/bridge',
img: 'chains/polygon.svg',
chains: [
ChainName.ETHEREUM,
ChainName.POLYGON,
ChainName.POLYGON_ZKEVM,
],
},
{
name: BridgeName.ARBITRUM,
dapp: 'https://bridge.arbitrum.io/',
img: 'chains/arbitrum.svg',
chains: [
ChainName.ETHEREUM,
ChainName.ARBITRUM,
ChainName.ARBITRUM_NOVA,
// orbit: sanko, muster, l3x, pmon, superposition, proof of play apex...
],
},
{
name: BridgeName.BRIDGG,
dapp: 'https://www.brid.gg/',
img: 'assets/bridgg.png',
chains: [
ChainName.ETHEREUM,
ChainName.OPTIMISM,
ChainName.BASE,
ChainName.FRAXTAL,
ChainName.MODE,
// zora
// redstone
// lisk
],
},
{
name: BridgeName.SUPERBRIDGE,
dapp: 'https://superbridge.app/',
img: 'assets/superbridge.jpg',
chains: [
ChainName.ETHEREUM,
ChainName.BASE,
ChainName.OPTIMISM,
ChainName.MODE,
ChainName.FRAXTAL,
// zora
// public goods network
// lyra
// orderly
// lumic
// metal l2
// cyber
// mint
// lisk
// redstone
// xterio
// swan
// snaxchain
// world chain
// ChainName: soneium
],
},
]

export const getChainBridges = (chainName: ChainName): Bridge[] => {
const r: Bridge[] = []
for (const bridge of bridges) {
if (bridge.chains.includes(chainName)) {
r.push(bridge)
}
}
return r
}
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import tokenlist from "./stability.tokenlist.json"
import {almFactories} from "./addresses";
import {assets, Asset, getAsset} from "./assets";
import {seeds} from "./seeds";
import {bridges, Bridge, BridgeName, getChainBridges} from "./bridges";

export {
deployments,
Expand Down Expand Up @@ -65,4 +66,8 @@ export {
getChainsTotals,
getStrategiesTotals,
seeds,
bridges,
Bridge,
BridgeName,
getChainBridges,
}
8 changes: 8 additions & 0 deletions tests/bridges.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {bridges, ChainName, getChainBridges} from "../src";

describe('testing bridges', () => {
test('getBridges', () => {
expect(getChainBridges(ChainName.ROOTSTOCK).length).toBeGreaterThan(0)
expect(bridges.length).toBeGreaterThan(0)
})
})
5 changes: 4 additions & 1 deletion tools/overview-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
integrations,
IntegrationStatus,
chains, seeds,
strategies
strategies, bridges
} from "../src";
import {Table} from "console-table-printer";
import {version} from '../package.json';
Expand Down Expand Up @@ -41,6 +41,9 @@ for (const chain of Object.keys(chains)) {
console.log(`Chain libraries: ${networkTotal.AWAITING_DEPLOYMENT + networkTotal.SUPPORTED} available, ${networkTotal.CHAINLIB_DEVELOPMENT} development, ${networkTotal.AWAITING_DEVELOPER} awaiting dev. ${networkTotal.AWAITING_ISSUE_CREATION} awaiting creation. Multisigs: ${multisigsTotal}.`)
console.log(`${Object.keys(chains).map(n => `[${n}] ${chains[n].name}`).join(', ')}`)
console.log('')
console.log(`=== Bridges: ${bridges.length} ===`)
console.log(`${bridges.map(b => `${b.name}`).join(', ')}`)
console.log('')
const table = new Table({
columns: [
{ name: "Status", alignment: "left"},
Expand Down
9 changes: 4 additions & 5 deletions tools/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getSupportedChainNames,
integrations,
chains, seeds,
strategies
strategies, bridges
} from "../src";
import {version} from '../package.json';
import tokenlist from '../src/stability.tokenlist.json'
Expand All @@ -24,13 +24,12 @@ for (const chain of Object.keys(chains)) {
}
}

console.log(`## Stability Integration Library v${version}`)
console.log(`## 📦 Stability Integration Library v${version}`)
console.log(``)
console.log(`Deployments: ${Object.keys(deployments).length} (${getSupportedChainNames().join(', ')})`)
console.log(`Strategies: ${Object.keys(strategies).length}. Live: ${strategiesTotal.LIVE}, deploying: ${strategiesTotal.DEPLOYMENT}, development: ${strategiesTotal.DEVELOPMENT}, awaiting: ${strategiesTotal.AWAITING}, blocked: ${strategiesTotal.BLOCKED}, possible: ${strategiesTotal.POSSIBLE}, proposal: ${strategiesTotal.PROPOSAL}.`)
console.log(`Chains: ${Object.keys(chains).length}. ChainLib: ${networkTotal.AWAITING_DEPLOYMENT + networkTotal.SUPPORTED} available, ${networkTotal.CHAINLIB_DEVELOPMENT} development, ${networkTotal.AWAITING_DEVELOPER} awaiting dev. ${networkTotal.AWAITING_ISSUE_CREATION} awaiting creation. Multisigs: ${multisigsTotal}.`)
console.log(`Chains: ${Object.keys(chains).length}. ChainLib: ${networkTotal.AWAITING_DEPLOYMENT + networkTotal.SUPPORTED} available, ${networkTotal.CHAINLIB_DEVELOPMENT} development, ${networkTotal.AWAITING_DEVELOPER} awaiting dev. ${networkTotal.AWAITING_ISSUE_CREATION} awaiting creation. Multisigs: ${multisigsTotal}. Bridges: ${bridges.length}.`)
console.log(`DeFi organizations: ${Object.keys(integrations).length}. Protocols: ${protocolsTotal}.`)
console.log(`Assets: ${assets.length}`)
console.log(`Tokenlist ${tokenlist.version.major}.${tokenlist.version.minor}.${tokenlist.version.patch}: ${tokenlist.tokens.length} tokens for ${tokenlist.tokens.map(t => t.chainId).filter((value, index, array) => array.indexOf(value) === index).length} networks.`)
console.log(`Assets: ${assets.length}. Tokenlist ${tokenlist.version.major}.${tokenlist.version.minor}.${tokenlist.version.patch}: ${tokenlist.tokens.length} tokens for ${tokenlist.tokens.map(t => t.chainId).filter((value, index, array) => array.indexOf(value) === index).length} networks.`)
console.log(`Seed nodes: ${seeds.length}`)
console.log(``)

0 comments on commit 552f12c

Please sign in to comment.