Skip to content

Commit 9de2184

Browse files
authored
Supported Darwinia (#11)
* Support Darwinia of sdk-core * Bump version of sdk-core * Publish sdk-core * Supported of v2-sdk and v3-sdk * Bump version of v2-sdk and v3-sdk * Publish v2-sdk and v3-sdk * Update dependencies for router-sdk * Bump version of router-sdk * Publish router-sdk * Update dependencies for uniswapx-sdk * Bump version of uniswapx-sdk * Publish uniswapx-sdk * Supported of universal-router-sdk * Bump version of universal-router-sdk * Publish universal-router-sdk
1 parent d9a8ab6 commit 9de2184

File tree

14 files changed

+92
-73
lines changed

14 files changed

+92
-73
lines changed

.github/workflows/release-packages.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ jobs:
3030
3131
- name: Build packages
3232
# run: yarn g:build
33-
run: |
34-
yarn sdk @helix-bridge/universal-router-sdk build
33+
# run: yarn sdk @helix-bridge/sdk-core build
34+
# run: |
35+
# yarn sdk @helix-bridge/v2-sdk build
36+
# yarn sdk @helix-bridge/v3-sdk build
37+
# run: yarn sdk @helix-bridge/router-sdk build
38+
# run: yarn sdk @helix-bridge/uniswapx-sdk build
39+
run: yarn sdk @helix-bridge/universal-router-sdk build
3540

3641
- name: Publish to GitHub Packages
37-
run: |
38-
npm publish -w @helix-bridge/universal-router-sdk
39-
# npm publish -w @helix-bridge/uniswapx-sdk
40-
# npm publish -w @helix-bridge/router-sdk
41-
# npm publish -w @helix-bridge/v2-sdk
42-
# npm publish -w @helix-bridge/v3-sdk
43-
# npm publish -w @helix-bridge/sdk-core
42+
# run: npm publish -w @helix-bridge/sdk-core
43+
# run: |
44+
# npm publish -w @helix-bridge/v2-sdk
45+
# npm publish -w @helix-bridge/v3-sdk
46+
# run: npm publish -w @helix-bridge/router-sdk
47+
# run: npm publish -w @helix-bridge/uniswapx-sdk
48+
run: npm publish -w @helix-bridge/universal-router-sdk
4449
env:
4550
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

sdks/router-sdk/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helix-bridge/router-sdk",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "An sdk for routing swaps using Uniswap v2 and Uniswap v3.",
55
"repository": "https://github.com/Uniswap/sdks.git",
66
"keywords": [
@@ -22,9 +22,9 @@
2222
},
2323
"dependencies": {
2424
"@ethersproject/abi": "^5.5.0",
25-
"@helix-bridge/sdk-core": "1.0.5",
26-
"@helix-bridge/v2-sdk": "1.0.5",
27-
"@helix-bridge/v3-sdk": "1.0.5",
25+
"@helix-bridge/sdk-core": "1.1.0",
26+
"@helix-bridge/v2-sdk": "1.1.0",
27+
"@helix-bridge/v3-sdk": "1.1.0",
2828
"@uniswap/swap-router-contracts": "^1.3.0"
2929
},
3030
"devDependencies": {

sdks/sdk-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helix-bridge/sdk-core",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "⚒️ An SDK for building applications on top of Uniswap V3",
55
"repository": "https://github.com/Uniswap/sdks.git",
66
"keywords": [

sdks/sdk-core/src/addresses.ts

+8
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ const BITLAYER_ADDRESSES: ChainAddresses = {
250250
nonfungiblePositionManagerAddress: '0xFBAD806Bdf9cEC2943be281FB355Da05068DE925',
251251
}
252252

253+
const DARWINIA_ADDRESSES: ChainAddresses = {
254+
v3CoreFactoryAddress: '0xF118eAEcCFc037986D08A6CBC97A4F2C8de9108e',
255+
multicallAddress: '0xD1167316a70d5566ED18BCfe1e265D59338447bE',
256+
quoterAddress: '0x54692837aC72A54d38069Ac6Ec8c4C56590e8679',
257+
nonfungiblePositionManagerAddress: '0x00DEba7612403e8bDa0b82186548EE59C86CBf98',
258+
}
259+
253260
export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses> = {
254261
[ChainId.MAINNET]: MAINNET_ADDRESSES,
255262
[ChainId.OPTIMISM]: OPTIMISM_ADDRESSES,
@@ -274,6 +281,7 @@ export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>
274281
[ChainId.BLAST]: BLAST_ADDRESSES,
275282
[ChainId.BITLAYER_TESTNET]: BITLAYER_TESTNET_ADDRESSES,
276283
[ChainId.BITLAYER]: BITLAYER_ADDRESSES,
284+
[ChainId.DARWINIA]: DARWINIA_ADDRESSES,
277285
}
278286

279287
/* V3 Contract Addresses */

sdks/sdk-core/src/chains.ts

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export enum ChainId {
2424
BLAST = 81457,
2525
BITLAYER_TESTNET = 200810,
2626
BITLAYER = 200901,
27+
DARWINIA = 46,
2728
}
2829

2930
export const SUPPORTED_CHAINS = [
@@ -50,6 +51,7 @@ export const SUPPORTED_CHAINS = [
5051
ChainId.BLAST,
5152
ChainId.BITLAYER_TESTNET,
5253
ChainId.BITLAYER,
54+
ChainId.DARWINIA,
5355
] as const
5456
export type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number]
5557

@@ -62,10 +64,13 @@ export enum NativeCurrencyName {
6264
MOONBEAM = 'GLMR',
6365
BNB = 'BNB',
6466
AVAX = 'AVAX',
67+
BTC = 'BTC',
68+
RING = 'RING',
6569
// ROOTSTOCK = 'RBTC',
6670
}
6771

6872
export const CHAINS_SUPPORTED_BY_HELIXSWAP = [
6973
ChainId.BITLAYER_TESTNET,
7074
ChainId.BITLAYER,
75+
ChainId.DARWINIA,
7176
]

sdks/sdk-core/src/entities/ether.ts

+7
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ import { NativeCurrency } from './nativeCurrency'
44
import { Token } from './token'
55
import { WETH9 } from './weth9'
66

7+
/**
8+
* Specify the symbol and name of specific chains
9+
* @param chainId Chain ID of the chain
10+
* @returns [Symbol, Name]
11+
*/
712
function getSymbolAndName(chainId: number) {
813
switch (chainId) {
914
case 200810:
1015
case 200901:
1116
return ['BTC', 'BTC']
17+
case 46:
18+
return ['RING', 'RING']
1219
default:
1320
return ['ETH', 'Ether']
1421
}

sdks/sdk-core/src/entities/weth9.ts

+2
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ export const WETH9: { [chainId: number]: Token } = {
2828
200810: new Token(200810, '0x5F8D4232367759bCe5d9488D3ade77FCFF6B9b6B', 18, 'WBTC', 'Wrapped BTC'),
2929
// Bitlayer
3030
200901: new Token(200901, '0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F', 18, 'WBTC', 'Wrapped BTC'),
31+
// Darwinia
32+
46: new Token(46, '0xE7578598Aac020abFB918f33A20faD5B71d670b4', 18, 'WRING', 'Wrapped RING'),
3133
}

sdks/uniswapx-sdk/integration/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@ethersproject/bytes": "^5.7.0",
32-
"@helix-bridge/sdk-core": "1.0.1",
32+
"@helix-bridge/sdk-core": "1.1.0",
3333
"@typechain/ethers-v5": "^10.1.0",
3434
"@typechain/hardhat": "^6.1.2",
3535
"ethers": "^5.7.0",

sdks/uniswapx-sdk/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helix-bridge/uniswapx-sdk",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"author": "Uniswap",
55
"repository": "https://github.com/Uniswap/sdks.git",
66
"keywords": [
@@ -31,7 +31,7 @@
3131
"dependencies": {
3232
"@ethersproject/bytes": "^5.7.0",
3333
"@ethersproject/providers": "^5.7.0",
34-
"@helix-bridge/sdk-core": "1.0.5",
34+
"@helix-bridge/sdk-core": "1.1.0",
3535
"@uniswap/permit2-sdk": "^1.2.1",
3636
"ethers": "^5.7.0"
3737
},

sdks/universal-router-sdk/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helix-bridge/universal-router-sdk",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "sdk for integrating with the Universal Router contracts",
55
"repository": "https://github.com/Uniswap/sdks.git",
66
"keywords": [
@@ -31,10 +31,10 @@
3131
"test:hardhat": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' hardhat test"
3232
},
3333
"dependencies": {
34-
"@helix-bridge/router-sdk": "1.0.5",
35-
"@helix-bridge/sdk-core": "1.0.5",
36-
"@helix-bridge/v2-sdk": "1.0.5",
37-
"@helix-bridge/v3-sdk": "1.0.5",
34+
"@helix-bridge/router-sdk": "1.1.0",
35+
"@helix-bridge/sdk-core": "1.1.0",
36+
"@helix-bridge/v2-sdk": "1.1.0",
37+
"@helix-bridge/v3-sdk": "1.1.0",
3838
"@uniswap/permit2-sdk": "^1.2.1",
3939
"@uniswap/universal-router": "1.6.0",
4040
"bignumber.js": "^9.0.2",

sdks/universal-router-sdk/src/utils/constants.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ const CHAIN_CONFIGS: { [key: number]: ChainConfig } = {
120120
router: '0x0ac58df0cc3542bec4cda71b16d06c3ccc39f405',
121121
weth: '0xfF204e2681A6fA0e2C3FaDe68a1B28fb90E4Fc5F',
122122
creationBlock: 2753030,
123-
}
123+
},
124+
// darwinia
125+
[46]: {
126+
router: '0xF8cD37bfC0f8a377b8A82C574c1bC4370EDc480B',
127+
weth: '0xE7578598Aac020abFB918f33A20faD5B71d670b4',
128+
creationBlock: 3087706,
129+
},
124130
}
125131

126132
export const UNIVERSAL_ROUTER_ADDRESS = (chainId: number): string => {

sdks/v2-sdk/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helix-bridge/v2-sdk",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "🛠 An SDK for building applications on top of Uniswap V2",
55
"repository": "https://github.com/Uniswap/sdks.git",
66
"keywords": [
@@ -27,7 +27,7 @@
2727
"dependencies": {
2828
"@ethersproject/address": "^5.0.2",
2929
"@ethersproject/solidity": "^5.0.9",
30-
"@helix-bridge/sdk-core": "1.0.5",
30+
"@helix-bridge/sdk-core": "1.1.0",
3131
"tiny-invariant": "^1.1.0",
3232
"tiny-warning": "^1.0.3"
3333
},

sdks/v3-sdk/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@helix-bridge/v3-sdk",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "⚒️ An SDK for building applications on top of Uniswap V3",
55
"repository": "https://github.com/Uniswap/sdks.git",
66
"keywords": [
@@ -27,7 +27,7 @@
2727
"dependencies": {
2828
"@ethersproject/abi": "^5.5.0",
2929
"@ethersproject/solidity": "^5.0.9",
30-
"@helix-bridge/sdk-core": "1.0.5",
30+
"@helix-bridge/sdk-core": "1.1.0",
3131
"@uniswap/swap-router-contracts": "^1.3.0",
3232
"@uniswap/v3-periphery": "^1.1.1",
3333
"@uniswap/v3-staker": "1.0.0",

0 commit comments

Comments
 (0)