Skip to content

Commit

Permalink
Merge branch 'master' into 3627-remove-isdev-from-exposed-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee348 authored Dec 2, 2024
2 parents 8e513a5 + c07c1bd commit e691a31
Show file tree
Hide file tree
Showing 23 changed files with 423 additions and 429 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[![npm version](https://badge.fury.io/js/@0xsequence%2Fkit.svg)](https://badge.fury.io/js/@0xsequence%2Fkit)

Sequence Kit 🧰 is a library enabling developers to easily integrate web3 wallets in their app. It is based on [wagmi](https://wagmi.sh/) and supports all wagmi features.
Easily integrate web3 wallets in your app with Sequence Kit 🧰. Based on [wagmi](https://wagmi.sh/), and supporting all wagmi features.

- Connect via social logins eg: facebook, google, discord, etc...! 🔐🪪
- Connect to popular web3 wallets eg: walletConnect, metamask ! 🦊 ⛓️
Expand Down
4 changes: 2 additions & 2 deletions examples/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"typescript": "^5.6.3"
},
"peerDependencies": {
"@0xsequence/design-system": ">= 1.7.8",
"@0xsequence/network": ">=2.0.12",
"@0xsequence/design-system": "*",
"@0xsequence/network": "*",
"wagmi": "*"
},
"private": true
Expand Down
3 changes: 2 additions & 1 deletion examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"@0xsequence/kit-checkout": "workspace:*",
"@0xsequence/kit-wallet": "workspace:*",
"@0xsequence/kit-example-shared-components": "workspace:*",
"@0xsequence/network": "2.0.12",
"@0xsequence/network": "2.1.3",
"@0xsequence/waas": "2.1.3",
"@tanstack/react-query": "^5.37.1",
"next": "14.2.3",
"react": "^18.3.1",
Expand Down
8 changes: 7 additions & 1 deletion examples/next/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ export const kitConfig: KitConfig = {
export const config = createConfig('waas', {
...kitConfig,
appName: 'Kit Demo',
chainIds: [ChainId.ARBITRUM_NOVA, ChainId.ARBITRUM_SEPOLIA, ChainId.POLYGON],
chainIds: [
ChainId.ARBITRUM_NOVA,
ChainId.ARBITRUM_SEPOLIA,
ChainId.POLYGON,
ChainId.IMMUTABLE_ZKEVM,
ChainId.IMMUTABLE_ZKEVM_TESTNET
],
defaultChainId: ChainId.ARBITRUM_NOVA,

// Waas specific config options
Expand Down
3 changes: 2 additions & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"@0xsequence/kit-wallet": "workspace:*",
"@0xsequence/kit-example-shared-components": "workspace:*",
"@tanstack/react-query": "^5.37.1",
"@0xsequence/network": "2.0.12",
"@0xsequence/network": "2.1.3",
"@0xsequence/waas": "2.1.3",
"framer-motion": "^8.5.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
16 changes: 14 additions & 2 deletions examples/react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ export const config =
? createConfig('waas', {
...kitConfig,
appName: 'Kit Demo',
chainIds: [ChainId.ARBITRUM_NOVA, ChainId.ARBITRUM_SEPOLIA, ChainId.POLYGON],
chainIds: [
ChainId.ARBITRUM_NOVA,
ChainId.ARBITRUM_SEPOLIA,
ChainId.POLYGON,
ChainId.IMMUTABLE_ZKEVM,
ChainId.IMMUTABLE_ZKEVM_TESTNET
],
defaultChainId: ChainId.ARBITRUM_NOVA,
waasConfigKey: isDebugMode
? 'eyJwcm9qZWN0SWQiOjY5NCwicnBjU2VydmVyIjoiaHR0cHM6Ly9kZXYtd2Fhcy5zZXF1ZW5jZS5hcHAiLCJlbWFpbFJlZ2lvbiI6ImNhLWNlbnRyYWwtMSIsImVtYWlsQ2xpZW50SWQiOiI1NGF0bjV1cGk2M3FjNTlhMWVtM3ZiaHJzbiJ9'
Expand All @@ -80,7 +86,13 @@ export const config =
: createConfig('universal', {
...kitConfig,
appName: 'Kit Demo',
chainIds: [ChainId.ARBITRUM_NOVA, ChainId.ARBITRUM_SEPOLIA, ChainId.POLYGON],
chainIds: [
ChainId.ARBITRUM_NOVA,
ChainId.ARBITRUM_SEPOLIA,
ChainId.POLYGON,
ChainId.IMMUTABLE_ZKEVM,
ChainId.IMMUTABLE_ZKEVM_TESTNET
],
defaultChainId: ChainId.ARBITRUM_NOVA,

walletConnect: {
Expand Down
9 changes: 9 additions & 0 deletions packages/checkout/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @0xsequence/kit-connectors

## 4.4.5

### Patch Changes

- Fixing waas time drift

- Updated dependencies []:
- @0xsequence/kit@4.4.5

## 4.4.4

### Patch Changes
Expand Down
14 changes: 7 additions & 7 deletions packages/checkout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-checkout",
"version": "4.4.4",
"version": "4.4.5",
"description": "Checkout UI for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/checkout",
"author": "Horizon Blockchain Games",
Expand Down Expand Up @@ -36,14 +36,14 @@
"timeago-react": "^3.0.6"
},
"peerDependencies": {
"0xsequence": ">= 2.0.20",
"@0xsequence/api": ">= 2.0.20",
"0xsequence": ">= 2.1.3",
"@0xsequence/api": ">= 2.1.3",
"@0xsequence/design-system": ">= 1.7.8",
"@0xsequence/indexer": ">= 2.0.20",
"@0xsequence/metadata": ">= 2.0.20",
"@0xsequence/network": ">= 2.0.20",
"@0xsequence/indexer": ">= 2.1.3",
"@0xsequence/metadata": ">= 2.1.3",
"@0xsequence/network": ">= 2.1.3",
"@0xsequence/kit": "workspace:*",
"@0xsequence/waas": ">= 2.0.20",
"@0xsequence/waas": ">= 2.1.3",
"@tanstack/react-query": ">= 5.0.0",
"ethers": ">= 6.13.0",
"framer-motion": ">= 8.5.2",
Expand Down
2 changes: 2 additions & 0 deletions packages/checkout/src/contexts/AddFundsModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { createGenericContext } from './genericContext'

export interface AddFundsSettings {
walletAddress: string | Hex
fiatAmount?: string
fiatCurrency?: string
defaultFiatAmount?: string
defaultCryptoCurrency?: string
cryptoCurrencyList?: string
networks?: string
onClose?: () => void
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const NavigationHeader = ({ secondaryText, primaryText, disableBack = fal
<Box
background="backgroundPrimary"
zIndex="20"
position="fixed"
width="full"
flexDirection="row"
alignItems="center"
Expand Down
2 changes: 2 additions & 0 deletions packages/checkout/src/utils/transak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ export const getTransakLink = (addFundsSettings: AddFundsSettings) => {
apiKey: TRANSAK_API_KEY,
referrerDomain: window.location.origin,
walletAddress: addFundsSettings.walletAddress,
fiatAmount: addFundsSettings?.fiatAmount,
fiatCurrency: addFundsSettings?.fiatCurrency,
disableWalletAddressForm: 'true',
defaultFiatAmount: addFundsSettings?.defaultFiatAmount || '50',
defaultCryptoCurrency: addFundsSettings?.defaultCryptoCurrency || 'USDC',
cryptoCurrencyList: addFundsSettings?.cryptoCurrencyList,
networks: addFundsSettings?.networks || defaultNetworks
}

Expand Down
5 changes: 5 additions & 0 deletions packages/checkout/src/views/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ export const Swap = () => {
return swapTransactions
}

const walletClientChainId = await walletClient.getChainId()
if (walletClientChainId !== chainId) {
await walletClient.switchChain({ id: chainId })
}

const txHash = await sendTransactions({
connector,
walletClient,
Expand Down
6 changes: 5 additions & 1 deletion packages/checkout/src/views/TransactionStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export const TransactionStatus = () => {
items,
txHash,
currencyAddress,
blockConfirmations = TRANSACTION_CONFIRMATIONS_DEFAULT
blockConfirmations = TRANSACTION_CONFIRMATIONS_DEFAULT,
onSuccess,
onError
} = transactionStatusSettings!
const networkConfig = findSupportedNetwork(chainId)
const blockExplorerUrl = `${networkConfig?.blockExplorer?.rootUrl}/tx/${txHash}`
Expand All @@ -103,9 +105,11 @@ export const TransactionStatus = () => {
confirmations: blockConfirmations
})
setStatus('success')
onSuccess && onSuccess(txnHash)
} catch (e) {
console.error('An error occurred while waiting for transaction confirmation', e)
setStatus('error')
onError && onError(e as Error)
}
}

Expand Down
6 changes: 6 additions & 0 deletions packages/kit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @0xsequence/kit

## 4.4.5

### Patch Changes

- Fixing waas time drift

## 4.4.4

### Patch Changes
Expand Down
24 changes: 12 additions & 12 deletions packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit",
"version": "4.4.4",
"version": "4.4.5",
"description": "Core package for Sequence Kit",
"keywords": [
"sequence",
Expand Down Expand Up @@ -38,22 +38,22 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@0xsequence/api": ">= 2.0.20",
"@0xsequence/auth": ">= 2.0.20",
"@0xsequence/core": ">= 2.0.20",
"@0xsequence/api": "^2.1.3",
"@0xsequence/auth": "^2.1.3",
"@0xsequence/core": "^2.1.3",
"@0xsequence/design-system": "^1.7.8",
"@0xsequence/ethauth": "^1.0.0",
"@0xsequence/indexer": ">= 2.0.20",
"@0xsequence/metadata": ">= 2.0.20",
"@0xsequence/network": ">= 2.0.20",
"@0xsequence/provider": ">= 2.0.20",
"@0xsequence/utils": ">= 2.0.20",
"@0xsequence/waas": ">= 2.0.20",
"@0xsequence/indexer": "^2.1.3",
"@0xsequence/metadata": "^2.1.3",
"@0xsequence/network": "^2.1.3",
"@0xsequence/provider": "^2.1.3",
"@0xsequence/utils": "^2.1.3",
"@0xsequence/waas": "^2.1.3",
"framer-motion": "^8.5.2",
"uuid": "^10.0.0"
},
"peerDependencies": {
"0xsequence": ">= 2.0.20",
"0xsequence": ">= 2.1.3",
"@react-oauth/google": ">= 0.11.1",
"@tanstack/react-query": ">= 5.0.0",
"ethers": ">= 6.13.0",
Expand All @@ -64,7 +64,7 @@
"wagmi": ">= 2.0.0"
},
"devDependencies": {
"0xsequence": ">= 2.0.20",
"0xsequence": "^2.1.3",
"@tanstack/react-query": "^5.37.1",
"@types/uuid": "^9.0.8",
"ethers": "6.13.0",
Expand Down
Loading

0 comments on commit e691a31

Please sign in to comment.