-
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 commit using code from relay-sdk
- Loading branch information
0 parents
commit 398d2e0
Showing
57 changed files
with
5,318 additions
and
0 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,4 @@ | ||
cache | ||
dist | ||
node_modules | ||
test |
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,74 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "12", | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"env": { | ||
"node": true | ||
}, | ||
"plugins": ["@typescript-eslint", "prettier", "import"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
"prettier" | ||
], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"no-console": "warn", | ||
"import/order": ["error", { "newlines-between": "always" }], | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/no-explicit-any": "error", | ||
"@typescript-eslint/no-var-requires": "error", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "variable", | ||
"format": ["camelCase", "UPPER_CASE"], | ||
"leadingUnderscore": "allow", | ||
"trailingUnderscore": "allow" | ||
}, | ||
{ | ||
"selector": "parameter", | ||
"format": ["camelCase"], | ||
"leadingUnderscore": "allow" | ||
}, | ||
{ | ||
"selector": ["classProperty"], | ||
"modifiers": ["private", "static"], | ||
"format": ["PascalCase", "UPPER_CASE"] | ||
}, | ||
{ | ||
"selector": ["classProperty"], | ||
"modifiers": ["public", "static"], | ||
"format": ["PascalCase", "UPPER_CASE"] | ||
}, | ||
{ | ||
"selector": ["classProperty", "classMethod"], | ||
"modifiers": ["private"], | ||
"format": ["camelCase"], | ||
"leadingUnderscore": "require" | ||
}, | ||
{ | ||
"selector": ["classProperty", "classMethod"], | ||
"modifiers": ["protected"], | ||
"format": ["camelCase"], | ||
"leadingUnderscore": "require" | ||
} | ||
] | ||
}, | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts"] | ||
}, | ||
"import/resolver": { | ||
"typescript": { | ||
"alwaysTryTypes": true | ||
} | ||
} | ||
} | ||
} |
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,44 @@ | ||
name: Scan | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- feature/sonarcloud | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
sonarcloud: | ||
name: SonarCloud | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
# - name: yarn install and build | ||
# run: | | ||
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | ||
# yarn install | ||
# yarn build | ||
# rm .npmrc | ||
|
||
# - name: Run unit and integration test | ||
# run: yarn test:unit --coverage | ||
|
||
# - name: Upload coverage report | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: test-coverage | ||
# path: ${{ github.workspace }}/coverage | ||
# retention-days: 2 | ||
|
||
- name: Cleanup for SonarCloud | ||
run: rm -rf ./node_modules .ops .github docs | ||
|
||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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,43 @@ | ||
# Dependency directory | ||
node_modules | ||
|
||
# local env variables | ||
.env | ||
.env.testing | ||
|
||
# npm | ||
.npmrc | ||
|
||
# hardhat | ||
artifacts | ||
cache | ||
deployments/localhost | ||
|
||
# cache | ||
.eslintcache | ||
|
||
# VS Code | ||
.vscode | ||
|
||
# macOS | ||
.DS_Store | ||
*.icloud | ||
|
||
dist | ||
.idea | ||
|
||
# redis | ||
dump.rdb | ||
|
||
# coverage | ||
coverage | ||
.nyc_output | ||
|
||
# typechain | ||
typechain | ||
|
||
test/contracts/types | ||
src/logs/ | ||
|
||
# yarn | ||
yarn-error.log |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint-staged |
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,3 @@ | ||
cache | ||
dist | ||
node_modules |
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 @@ | ||
{} |
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 @@ | ||
nodeLinker: node-modules |
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,3 @@ | ||
# Gelato Relay SDK <!-- omit in toc --> | ||
|
||
- [Documentation](https://docs.gelato.network/developer-products/gelato-relay-sdk) |
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,50 @@ | ||
{ | ||
"name": "@gelatonetwork/relay-sdk", | ||
"version": "5.5.5", | ||
"description": "SDK to integrate with Gelato Relay", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/**/*" | ||
], | ||
"scripts": { | ||
"build": "rm -rf dist && npx tsc", | ||
"format:check": "prettier --check \"*/**/*.{js,json,md,ts}\"", | ||
"format": "prettier --write */**/*.{js,json,md,ts}", | ||
"lint": "eslint --cache .", | ||
"prepare": "husky install" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@tsconfig/recommended": "1.0.2", | ||
"@types/node": "16.18.25", | ||
"@typescript-eslint/eslint-plugin": "^5.59.1", | ||
"@typescript-eslint/parser": "^5.59.1", | ||
"dotenv": "^16.0.3", | ||
"eslint": "^8.39.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-import-resolver-typescript": "^3.5.5", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^13.2.2", | ||
"minimize-js": "^1.3.1", | ||
"prettier": "^2.8.8", | ||
"typescript": "5.0.4" | ||
}, | ||
"dependencies": { | ||
"axios": "0.27.2", | ||
"ethers": "6.7.0", | ||
"isomorphic-ws": "^5.0.0", | ||
"ws": "^8.5.0" | ||
}, | ||
"lint-staged": { | ||
"*.{js,json,md,ts}": "yarn format", | ||
"*.{ts,js}": "yarn lint" | ||
} | ||
} |
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,14 @@ | ||
sonar.projectKey=relay-sdk | ||
sonar.organization=gelato-network | ||
|
||
sonar.javascript.lcov.reportPaths=./coverage/lcov.info | ||
|
||
# This is the name and version displayed in the SonarCloud UI. | ||
#sonar.projectName= | ||
#sonar.projectVersion=1.0 | ||
|
||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. | ||
#sonar.sources=. | ||
|
||
# Encoding of the source code. Default is default system encoding | ||
#sonar.sourceEncoding=UTF-8 |
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,30 @@ | ||
export const GELATO_RELAY_URL = "https://api.gelato.digital"; //Relay GW | ||
|
||
export const SIGN_TYPED_DATA_V4 = "eth_signTypedData_v4"; | ||
|
||
export const DEFAULT_INTERNAL_ERROR_MESSAGE = "Internal Error"; | ||
|
||
export const DEFAULT_DEADLINE_GAP = 86_400; //24H | ||
export const USER_NONCE_ABI = [ | ||
"function userNonce(address account) external view returns (uint256)", | ||
]; | ||
|
||
export const GELATO_RELAY_ERC2771_ADDRESS = | ||
"0xb539068872230f20456CF38EC52EF2f91AF4AE49"; | ||
export const GELATO_RELAY_1BALANCE_ERC2771_ADDRESS = | ||
"0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"; | ||
|
||
export const GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS = | ||
"0x22DCC39b2AC376862183dd35A1664798dafC7Da6"; | ||
export const GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS = | ||
"0x97015cD4C3d456997DD1C40e2a18c79108FCc412"; | ||
|
||
export const GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS = | ||
"0x8598806401A63Ddf52473F1B3C55bC9E33e2d73b"; | ||
export const GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS = | ||
"0xc65d82ECE367EF06bf2AB791B3f3CF037Dc0e816"; | ||
|
||
export const GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS = | ||
"0xBa4082F4961c8Fb76231995C967CD9aa40f321b5"; | ||
export const GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS = | ||
"0xB8828e4c662D1a7e4f3d1f622EfAE6B63D852ED8"; |
Oops, something went wrong.