-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial configurations for integration
- Loading branch information
1 parent
5a7cd0c
commit 506f5fa
Showing
10 changed files
with
1,640 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// module.exports = require('@open-web3/dev-config/config/babel-config-cjs.cjs'); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,23 @@ | |
"name": "@polkawallet/bridge", | ||
"version": "0.1.5-20", | ||
"description": "polkawallet bridge sdk", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"author": "Polkawallet developers <[email protected]>", | ||
"license": "Apache-2.0", | ||
"sideEffects": false, | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"engines": { | ||
"yarn": "^1.10.1" | ||
}, | ||
|
@@ -17,8 +29,9 @@ | |
"repository": "https://github.com/polkawallet-io/bridge.git", | ||
"homepage": "https://github.com/polkawallet-io/bridge", | ||
"scripts": { | ||
"clain": "rm -rf build", | ||
"clain": "rm -r build", | ||
"build": "tsc", | ||
"build2": "rollup -c", | ||
"test": "jest --runInBand --detectOpenHandles --forceExit", | ||
"lint": "polkadot-dev-run-lint", | ||
"build:docs": "ts-node ./scripts/generate-bridge-document.ts", | ||
|
@@ -49,11 +62,19 @@ | |
}, | ||
"devDependencies": { | ||
"@acala-network/eth-providers": "^2.7.1", | ||
"@babel/plugin-syntax-import-assertions": "^7.23.3", | ||
"@babel/preset-env": "^7.23.3", | ||
"@open-web3/dev-config": "^0.2.3", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-json": "^6.0.1", | ||
"@rollup/plugin-typescript": "^11.1.5", | ||
"@types/jest": "^28.1.1", | ||
"@types/lodash": "^4.14.161", | ||
"eslint-plugin-unused-imports": "^2.0.0", | ||
"jest": "^28.1.1", | ||
"rollup": "^4.9.1", | ||
"rollup-plugin-dts": "^6.1.0", | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"typescript": "^4.7.4" | ||
}, | ||
"stableVersion": "0.1.5-19" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import typescript from 'rollup-plugin-typescript2' | ||
import babel from '@rollup/plugin-babel'; | ||
import json from '@rollup/plugin-json'; | ||
import dts from 'rollup-plugin-dts'; | ||
|
||
export default [ | ||
{ | ||
input: './src/index.ts', // Your main TypeScript file | ||
output: [ | ||
{ file: './dist/index.cjs', format: 'cjs' }, | ||
{ file: './dist/index.mjs', format: 'es' } | ||
], | ||
plugins: [ | ||
json(), | ||
typescript(), // Compile TypeScript files | ||
babel({ | ||
plugins: ['@babel/plugin-syntax-import-assertions'], | ||
babelHelpers: 'bundled', | ||
presets: ['@babel/preset-env'], | ||
extensions: ['.js', '.ts'], | ||
}), | ||
], | ||
}, | ||
{ | ||
input: 'src/index.ts', | ||
output: [{ file: 'dist/index.d.ts', format: 'es' }], | ||
plugins: [dts()], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
export * from "./"; | ||
export * from "./acala"; | ||
export * from "./astar"; | ||
export * from "./bifrost"; | ||
export * from "./darwinia"; | ||
export * from "./centrifuge"; | ||
export * from "./crust"; | ||
export * from "./hydradx"; | ||
export * from "./polkadot"; | ||
export * from "./integritee"; | ||
export * from "./interlay"; | ||
export * from "./kico"; | ||
export * from "./kylin"; | ||
export * from "./listen"; | ||
export * from "./mangata"; | ||
export * from "./manta"; | ||
export * from "./moonbeam"; | ||
export * from "./phala"; | ||
export * from "./oak"; | ||
export * from "./parallel"; | ||
export * from "./phala"; | ||
export * from "./robonomics"; | ||
export * from "./statemint"; | ||
export * from "./tinkernet"; | ||
export * from "./unique"; | ||
export * from "./zeitgeist"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { ListenAdapter, KicoAdapter, KaruraAdapter, ShidenAdapter, BifrostAdapter, AltairAdapter, ShadowAdapter, CrabAdapter, BasiliskAdapter, IntegriteeAdapter, KintsugiAdapter, PichiuAdapter, MangataAdapter, CalamariAdapter, MoonriverAdapter, TuringAdapter, HeikoAdapter, KhalaAdapter, KusamaAdapter, RobonomicsAdapter, StatemineAdapter, TinkernetAdapter, QuartzAdapter} from './adapters/index' | ||
|
||
export function getAdapter(paraId: number){ | ||
if(paraId == 0){ | ||
return new KusamaAdapter() | ||
} | ||
|
||
if(paraId == 1000){ | ||
return new StatemineAdapter() | ||
} | ||
if(paraId == 2001){ | ||
return new BifrostAdapter() | ||
} | ||
if(paraId == 2000){ | ||
return new KaruraAdapter() | ||
} | ||
if(paraId == 2004){ | ||
return new KhalaAdapter() | ||
} | ||
if(paraId == 2095){ | ||
return new QuartzAdapter() | ||
} | ||
if(paraId == 2092){ | ||
return new KintsugiAdapter() | ||
} | ||
if(paraId == 2023){ | ||
return new MoonriverAdapter() | ||
} | ||
if(paraId == 2085){ | ||
return new HeikoAdapter() | ||
} | ||
if(paraId == 2107){ | ||
return new KicoAdapter() | ||
} | ||
if(paraId == 2012){ | ||
return new ShadowAdapter() | ||
} | ||
if(paraId == 2084){ | ||
return new CalamariAdapter() | ||
} | ||
if(paraId == 2015){ | ||
return new IntegriteeAdapter() | ||
} | ||
if(paraId == 2088){ | ||
return new AltairAdapter() | ||
} | ||
if(paraId == 2105){ | ||
return new CrabAdapter() | ||
} | ||
if(paraId == 2114){ | ||
return new TuringAdapter() | ||
} | ||
if(paraId == 2007){ | ||
return new ShidenAdapter() | ||
} | ||
if(paraId == 2102){ | ||
return new PichiuAdapter() | ||
} | ||
if(paraId == 2090){ | ||
return new BasiliskAdapter() | ||
} | ||
if(paraId == 2118){ | ||
return new ListenAdapter() | ||
} | ||
|
||
if(paraId == 2048){ | ||
return new RobonomicsAdapter() | ||
} | ||
if(paraId == 2125){ | ||
return new TinkernetAdapter() | ||
} | ||
if(paraId == 2110){ | ||
return new MangataAdapter() | ||
} | ||
throw new Error("No adapter for paraId " + paraId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
{ | ||
|
||
"exclude": ["build/**/*", "**/build/**/*", "scripts/**/*", "docs/**/*", "**/*.spec.ts"], | ||
"compilerOptions": { | ||
"target": "es2019", | ||
"module": "CommonJS", | ||
"target": "es2015", | ||
"module": "esnext", | ||
"baseUrl": ".", | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"emitDeclarationOnly": false, | ||
"outDir": "build", | ||
"typeRoots": ["./node_modules/@polkadot/ts", "./node_modules/@types"], | ||
"jsx": "preserve", | ||
"declaration": true, | ||
"strict": true, | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"noImplicitReturns": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"experimentalDecorators": true | ||
} | ||
"experimentalDecorators": true, | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"strict": true, | ||
}, | ||
"include": ["src"] | ||
} |
Oops, something went wrong.