Skip to content

Commit

Permalink
Merge branch 'main' into DX-2625/port-core-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeSchwert authored Feb 27, 2024
2 parents 7f02c9d + d4633d7 commit a6d7865
Show file tree
Hide file tree
Showing 25 changed files with 610 additions and 109 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties

[*.{yml,yaml}]
indent_style = space
indent_size = 2
quote_type = double
2 changes: 1 addition & 1 deletion .github/workflows/build-lint-typecheck-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
cache: "yarn"

Expand Down
56 changes: 28 additions & 28 deletions .github/workflows/functional-tests-imx.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
name: Functional Tests (IMX)
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Install root dependencies
run: npm install -g yarn && yarn install --immutable
- name: Install root dependencies
run: npm install -g yarn && yarn install --immutable

- name: Build SDK
run: yarn build
- name: Build SDK
run: yarn build

- name: Install functional tests dependencies
run: cd tests/func-tests/imx && yarn install --no-immutable
- name: Install functional tests dependencies
run: cd tests/func-tests/imx && yarn install --no-immutable

- name: Run tests
env:
NETWORK: sepolia
TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }}
PUBLIC_API_URL: 'https://api.sandbox.x.immutable.com/v1'
TEST_STARK_CONTRACT_ADDRESS: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98'
TEST_REGISTRATION_CONTRACT_ADDRESS: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97'
TEST_TOKEN_ADDRESS: '0xfA5539fBEd27887EEbb2515672D80412D1A3ADa3'
TEST_WALLET1_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_PRIVATE_KEY }}
TEST_WALLET1_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_STARK_PRIVATE_KEY }}
TEST_WALLET2_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_PRIVATE_KEY }}
TEST_WALLET2_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_STARK_PRIVATE_KEY }}
TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }}
TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }}
TEST_STARKEX_BATCH_SIZE: 500
run: cd tests/func-tests/imx && yarn test:ci
- name: Run tests
env:
NETWORK: sepolia
TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }}
PUBLIC_API_URL: "https://api.sandbox.x.immutable.com/v1"
TEST_STARK_CONTRACT_ADDRESS: "0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98"
TEST_REGISTRATION_CONTRACT_ADDRESS: "0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97"
TEST_TOKEN_ADDRESS: "0xfA5539fBEd27887EEbb2515672D80412D1A3ADa3"
TEST_WALLET1_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_PRIVATE_KEY }}
TEST_WALLET1_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_STARK_PRIVATE_KEY }}
TEST_WALLET2_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_PRIVATE_KEY }}
TEST_WALLET2_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_STARK_PRIVATE_KEY }}
TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }}
TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }}
TEST_STARKEX_BATCH_SIZE: 500
run: cd tests/func-tests/imx && yarn test:ci
44 changes: 22 additions & 22 deletions .github/workflows/functional-tests-zkevm.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: Functional Tests (zkEVM)
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Install root dependencies
run: npm install -g yarn && yarn install --immutable
- name: Install root dependencies
run: npm install -g yarn && yarn install --immutable

- name: Build SDK
run: yarn build
- name: Build SDK
run: yarn build

- name: Install functional tests dependencies
run: cd tests/func-tests/zkevm && yarn install --no-immutable
- name: Install functional tests dependencies
run: cd tests/func-tests/zkevm && yarn install --no-immutable

- name: Run tests
env:
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
ZKEVM_ORDERBOOK_ERC721: '0xBE8B131f39825282Ace9eFf99C0Bb14972417b49'
SEAPORT_CONTRACT_ADDRESS: '0x7d117aA8BD6D31c4fa91722f246388f38ab1942c'
ZONE_CONTRACT_ADDRESS: '0x8831867E347AB87FA30199C5B695F0A31604Bb52'
ZKEVM_RPC_ENDPOINT: 'https://rpc.testnet.immutable.com'
ORDERBOOK_MR_API_URL: 'https://api.sandbox.immutable.com'
ZKEVM_CHAIN_NAME: 'imtbl-zkevm-testnet'
run: cd tests/func-tests/zkevm && yarn test:ci
- name: Run tests
env:
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
ZKEVM_ORDERBOOK_ERC721: "0xBE8B131f39825282Ace9eFf99C0Bb14972417b49"
SEAPORT_CONTRACT_ADDRESS: "0x7d117aA8BD6D31c4fa91722f246388f38ab1942c"
ZONE_CONTRACT_ADDRESS: "0x8831867E347AB87FA30199C5B695F0A31604Bb52"
ZKEVM_RPC_ENDPOINT: "https://rpc.testnet.immutable.com"
ORDERBOOK_MR_API_URL: "https://api.sandbox.immutable.com"
ZKEVM_CHAIN_NAME: "imtbl-zkevm-testnet"
run: cd tests/func-tests/zkevm && yarn test:ci
4 changes: 2 additions & 2 deletions .github/workflows/passport-sdk-sample-app-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Passport SDK Sample App Deployment
on:
push:
paths:
- 'packages/passport/**'
- "packages/passport/**"
branches:
- main
workflow_dispatch:
Expand Down Expand Up @@ -64,4 +64,4 @@ jobs:
- name: Clear the cloudfront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_PASSPORT_PROD_DISTRIBUTION_ID }} --paths "/*"
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_PASSPORT_PROD_DISTRIBUTION_ID }} --paths "/*"
56 changes: 28 additions & 28 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
branches: [main, master]
pull_request:
branches: [ main, master ]
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.40.0-jammy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: samples/apps/ts-immutable-sample/.nvmrc

- name: Install root dependencies
run: npm install -g yarn && yarn install --immutable
- name: Install root dependencies
run: npm install -g yarn && yarn install --immutable

- name: Build SDK
run: yarn build
- name: Build SDK
run: yarn build

- name: Install sample apps dependencies
run: cd samples/apps/ts-immutable-sample && yarn install --no-immutable
- name: Install sample apps dependencies
run: cd samples/apps/ts-immutable-sample && yarn install --no-immutable

- name: Run Unit tests
run: cd samples/apps/ts-immutable-sample && yarn test
- name: Run Playwright tests
env:
# Required for Firefox to run
# https://github.com/microsoft/playwright/issues/6500#issuecomment-838515115
HOME: /root
working-directory: samples/apps/ts-immutable-sample
run: yarn playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Run Unit tests
run: cd samples/apps/ts-immutable-sample && yarn test

- name: Run Playwright tests
env:
# Required for Firefox to run
# https://github.com/microsoft/playwright/issues/6500#issuecomment-838515115
HOME: /root
working-directory: samples/apps/ts-immutable-sample
run: yarn playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
4 changes: 2 additions & 2 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
node-version-file: .nvmrc
cache: "yarn"

- name: Update SDK package.json version
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-major-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
id: allowed_actors_check
# only allow certain SDK team members to run this workflow
if: ${{ contains(fromJson(env.SDK_PUBLISH_MAJOR_VERSION_ACTORS), github.triggering_actor) }}
run: echo "ALLOWED_ACTOR=true" >> $GITHUB_OUTPUT
run: echo "ALLOWED_ACTOR=true" >> $GITHUB_OUTPUT

- name: Allowed Actors Filter
if: ${{ steps.allowed_actors_check.outputs.ALLOWED_ACTOR != 'true' }}
Expand All @@ -85,8 +85,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
node-version-file: .nvmrc
cache: "yarn"

- name: Workout next version string
run: |
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
# Wait for 30 seconds to make sure the tag is available on GitHub
- uses: GuillaumeFalourd/wait-sleep-action@v1
with:
time: '30'
time: "30"

- name: Create GitHub Release
id: gh_release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
node-version-file: .nvmrc
cache: "yarn"

- name: Workout next version string
run: |
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
# Wait for 30 seconds to make sure the tag is available on GitHub
- uses: GuillaumeFalourd/wait-sleep-action@v1
with:
time: '30'
time: "30"

- name: Create GitHub Release
id: gh_release
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function WalletList(props: WalletListProps) {
const [wallets, setWallets] = useState<WalletInfo[]>([]);
const { track } = useAnalytics();

const selectWeb3Provider = useCallback((web3Provider: any) => {
const selectWeb3Provider = useCallback((web3Provider: any, providerName: string) => {
connectDispatch({
payload: {
type: ConnectActions.SET_PROVIDER,
Expand All @@ -52,7 +52,7 @@ export function WalletList(props: WalletListProps) {
connectDispatch({
payload: {
type: ConnectActions.SET_WALLET_PROVIDER_NAME,
walletProviderName: WalletProviderName.METAMASK,
walletProviderName: providerName as WalletProviderName,
},
});
}, []);
Expand All @@ -62,7 +62,7 @@ export function WalletList(props: WalletListProps) {
const connectCallback = async (ethereumProvider) => {
if (ethereumProvider.connected && ethereumProvider.session) {
const web3Provider = new Web3Provider(ethereumProvider as any);
selectWeb3Provider(web3Provider);
selectWeb3Provider(web3Provider, 'walletconnect');

const chainId = await web3Provider.getSigner().getChainId();
if (chainId !== targetChainId) {
Expand Down Expand Up @@ -130,7 +130,7 @@ export function WalletList(props: WalletListProps) {
walletProviderName,
});
const web3Provider = providerResult.provider;
selectWeb3Provider(web3Provider);
selectWeb3Provider(web3Provider, walletProviderName);

viewDispatch({
payload: {
Expand Down
7 changes: 6 additions & 1 deletion packages/internal/bridge/bridge-sample-app/.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,9 @@ FLOW_RATE_TOKEN_DECIMALS=18
# Values are in whole tokens and will be converted to wei using the decimals above
FLOW_RATE_CAPACITY=15516
FLOW_RATE_REFILL_RATE=4.31
FLOW_RATE_LARGE_TRANSFER_THRESHOLD=7758
FLOW_RATE_LARGE_TRANSFER_THRESHOLD=7758

# ISSUE SEPOLIA USDC ----------------------------------------------------------

SEPOLIA_USDC=0x40b87d235A5B010a20A241F15797C9debf1ecd01
AMOUNT_10000=100
1 change: 1 addition & 0 deletions packages/internal/bridge/bridge-sample-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"fees": "node --loader ts-node/esm ./src/fees.ts",
"flowRateInfo": "node --loader ts-node/esm ./src/flowRateInfo.ts",
"getMapping": "node --loader ts-node/esm ./src/getMapping.ts",
"issueUSDC": "node --loader ts-node/esm ./src/issueUSDC.ts",
"lint": "eslint ./src --ext .ts --max-warnings=0",
"mapToken": "node --loader ts-node/esm ./src/mapToken.ts",
"pending": "node --loader ts-node/esm ./src/pending.ts",
Expand Down
Loading

0 comments on commit a6d7865

Please sign in to comment.