Skip to content

Commit

Permalink
Release @argent-x/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
gergold committed Dec 14, 2023
1 parent db57f32 commit dcaa6bb
Show file tree
Hide file tree
Showing 553 changed files with 17,492 additions and 6,702 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# FEATURE flags
FEATURE_PRIVACY_SETTINGS: "true"
FEATURE_EXPERIMENTAL_SETTINGS: "false"
FEATURE_BETA_FEATURES: "true"
FEATURE_BETA_FEATURES: "false"
FEATURE_BANXA: "true"
FEATURE_LAYERSWAP: "true"
FEATURE_ORBITER: "true"
Expand All @@ -29,6 +29,7 @@ jobs:
# API URLs
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_TESTNET_RPC_URL: ${{ vars.ARGENT_TESTNET_RPC_URL }}

# API ENVIRONMENT
ARGENT_X_ENVIRONMENT: ${{ matrix.env }}
Expand All @@ -50,6 +51,9 @@ jobs:
SLOW: 60 * 5 # 5m
VERY_SLOW: 24 * 60 * 60 # 1d

#For testing only
FEE_OVERHEAD: 2

steps:
# Setup Project
- uses: actions/checkout@v4
Expand Down Expand Up @@ -120,12 +124,13 @@ jobs:

env:
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TESTNET_RPC_URL: ${{ vars.ARGENT_TESTNET_RPC_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_X_ENVIRONMENT: "hydrogen"

services:
devnet:
image: shardlabs/starknet-devnet:latest-seed0
image: shardlabs/starknet-devnet-rs:latest-seed0
ports:
- 5050:5050

Expand Down Expand Up @@ -184,6 +189,7 @@ jobs:
shardTotal: [8]
env:
ARGENT_X_ENVIRONMENT: "hydrogen"
ARGENT_API_BASE_URL: ${{ secrets.ARGENT_API_BASE_URL }}
E2E_TESTNET_SEED1: ${{ secrets.E2E_TESTNET_SEED1 }}
E2E_TESTNET_SEED2: ${{ secrets.E2E_TESTNET_SEED2 }}
E2E_TESTNET_SEED3: ${{ secrets.E2E_TESTNET_SEED3 }}
Expand All @@ -195,6 +201,7 @@ jobs:
E2E_SENDER_SEED: ${{ secrets.E2E_SENDER_SEED }}
STARKNET_TESTNET_URL: ${{ secrets.STARKNET_TESTNET_URL }}
STARKSCAN_TESTNET_URL: ${{ secrets.STARKSCAN_TESTNET_URL }}
ARGENT_TESTNET_RPC_URL: ${{ secrets.ARGENT_TESTNET_RPC_URL }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -397,6 +404,7 @@ jobs:
NEXT_PUBLIC_RAMP_API_KEY: ${{ secrets.RAMP_API_KEY }}
NEXT_PUBLIC_FEATURE_COSIGNER: "true"
NEXT_PUBLIC_ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
NEXT_PUBLIC_ARGENT_TESTNET_RPC_URL: ${{ vars.ARGENT_TESTNET_RPC_URL }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -445,7 +453,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v3
with:
name: all-blob-reports
name: all-blob-reports-webwallet
path: packages/e2e/blob-report/
retention-days: 5

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
FEATURE_PRIVACY_SETTINGS: "true"
FEATURE_EXPERIMENTAL_SETTINGS: "false"
FEATURE_BETA_FEATURES: "true"
FEATURE_BETA_FEATURES: "false"
FEATURE_BANXA: "true"
FEATURE_LAYERSWAP: "true"
FEATURE_ORBITER: "true"
Expand All @@ -26,9 +26,8 @@ env:
FILENAME: argent-extension
SAFE_ENV_VARS: true
ARGENT_API_BASE_URL: ${{ vars.ARGENT_API_BASE_URL }}
ARGENT_TRANSACTION_REVIEW_API_BASE_URL: ${{ vars.ARGENT_TRANSACTION_REVIEW_API_BASE_URL }}
ARGENT_TESTNET_RPC_URL: ${{ vars.ARGENT_TESTNET_RPC_URL }}
ARGENT_X_STATUS_URL: ${{ vars.ARGENT_X_STATUS_URL }}
ARGENT_EXPLORER_BASE_URL: ${{ vars.ARGENT_EXPLORER_BASE_URL }}
ARGENT_X_ENVIRONMENT: "prod"
MULTICALL_MAX_BATCH_SIZE: 20
FAST: 20 # 20s
Expand Down Expand Up @@ -136,7 +135,7 @@ jobs:
pnpm --filter @argent/get-starknet publish --no-git-checks --access public || exit 0
pnpm --filter @argent/web-sdk publish --no-git-checks --access public || exit 0
pnpm --filter @argent/starknet-react-webwallet-connector publish --no-git-checks --access public || exit 0
pnpm --filter @argent-x/sessions publish --no-git-checks --access public || exit 0
pnpm --filter @argent/x-sessions publish --no-git-checks --access public || exit 0
- name: Get product version
id: product-version
Expand All @@ -149,7 +148,7 @@ jobs:
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
title: extension@${{ steps.product-version.outputs.current-version }}
name: extension@${{ steps.product-version.outputs.current-version }}
files: |
${{ env.FILENAME }}-chrome.zip
${{ env.FILENAME }}-firefox.zip
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.1
18.18.2
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"homepage": "https://github.com/argentlabs/argent-x/#readme",
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@lavamoat/preinstall-always-fail": "^2.0.0",
"@lavamoat/allow-scripts": "^3.0.0",
"@lavamoat/preinstall-always-fail": "^2.0.0",
"bundlewatch": "^0.3.3",
"husky": "^8.0.3",
"import-sort-style-module": "^6.0.0",
"lint-staged": "^15.0.0",
"nx": "^16.2.2",
"nx": "^17.0.0",
"patch-package": "^8.0.0",
"prettier": ">=2.8.8",
"prettier-plugin-import-sort": "^0.0.7",
Expand Down
2 changes: 2 additions & 0 deletions packages/dapp/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_WEBWALLET_URL="http://localhost:3005"
NEXT_PUBLIC_ARGENT_CHAIN_ID=SN_GOERLI
5 changes: 5 additions & 0 deletions packages/dapp/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
module.exports = {
reactStrictMode: true,
swcMinify: false, // we need to use terser, as swc doesn't support svelte and `@argent/get-starknet`
publicRuntimeConfig: {
webWalletUrl:
process.env.NEXT_PUBLIC_WEBWALLET_URL ?? "http://localhost:3005",
argentMobileChainId: process.env.NEXT_PUBLIC_ARGENT_CHAIN_ID ?? "SN_GOERLI",
},
}
14 changes: 9 additions & 5 deletions packages/dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@
},
"dependencies": {
"@argent/shared": "^6.3.1",
"@argent/get-starknet": "^6.3.1",
"@argent/ui": "^6.3.1",
"@argent/x-sessions": "^6.3.1",
"@chakra-ui/react": "^2.6.1",
"@starknet-react/chains": "0.1.0-next.1",
"@starknet-react/core": "2.0.0-next.6",
"micro-starknet": "^0.2.3",
"next": "^13.4.6",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"starknet": "5.19.5",
"micro-starknet": "^0.2.3"
"starknet": "5.24.3",
"starknetkit": "^1.0.21"
},
"devDependencies": {
"@types/node": "20.8.4",
"@types/node": "20.8.10",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"eslint": "8",
"eslint-config-next": "13.5.4",
"eslint-config-next": "13.5.6",
"typescript": "^5.0.4"
}
}
39 changes: 39 additions & 0 deletions packages/dapp/src/components/AddNetwork.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { H2 } from "@argent/ui"
import { Flex } from "@chakra-ui/react"
import { addNetwork } from "../services/wallet.service"
import { useState } from "react"

const AddNetwork = () => {
const [addNetworkError, setAddNetworkError] = useState("")

const handleAddNetwork = async () => {
try {
await addNetwork({
id: "dapp-test",
chainId: "SN_DAPP_TEST",
chainName: "Test chain name",
baseUrl: "http://localhost:5050",
})
setAddNetworkError("")
} catch (error) {
setAddNetworkError((error as any).message)
}
}

return (
<Flex direction="column" gap="3" flex="1">
<H2>Network</H2>
<Flex
as="button"
color="#0097fc"
fontWeight="bold"
onClick={handleAddNetwork}
>
Add network to wallet
</Flex>
<span className="error-message">{addNetworkError}</span>
</Flex>
)
}

export { AddNetwork }
72 changes: 72 additions & 0 deletions packages/dapp/src/components/AddToken.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { Button, H2 } from "@argent/ui"
import { truncateAddress } from "../services/address.service"
import { DAITokenAddress, ETHTokenAddress } from "../services/token.service"
import { addToken } from "../services/wallet.service"
import { useState } from "react"
import { Code, Flex } from "@chakra-ui/react"

const AddToken = () => {
const [addTokenError, setAddTokenError] = useState("")

const handleAddEth = async () => {
try {
await addToken(ETHTokenAddress)
setAddTokenError("")
} catch (error) {
setAddTokenError((error as any).message)
}
}

const handleAddDai = async () => {
try {
await addToken(DAITokenAddress)
setAddTokenError("")
} catch (error) {
setAddTokenError((error as any).message)
}
}

return (
<Flex direction="column" gap="3" flex="1">
<H2>ERC20</H2>
ETH token address
<Code
backgroundColor="#0097fc4f"
borderRadius="8px"
p="0 0.5rem"
width="fit-content"
>
<a
target="_blank"
rel="noreferrer"
style={{
color: "#0097fc",
display: "inline-block",
textDecoration: "none",
}}
>
{truncateAddress(ETHTokenAddress)}
</a>
</Code>
<Flex
as="button"
color="#0097fc"
fontWeight="bold"
onClick={handleAddEth}
>
Add ETH token to wallet
</Flex>
<Flex
as="button"
color="#0097fc"
fontWeight="bold"
onClick={handleAddDai}
>
Add DAI token to wallet
</Flex>
<span className="error-message">{addTokenError}</span>
</Flex>
)
}

export { AddToken }
Loading

0 comments on commit dcaa6bb

Please sign in to comment.