diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0c15f01..1c73d18 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,7 @@ on: - develop - beta - stable + - wallets jobs: build: diff --git a/bun.lockb b/bun.lockb index ae60204..bfc9e9e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index ab28ccf..940c7c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skalenetwork/metaport", - "version": "2.0.3", + "version": "2.1.0", "description": "SKALE Metaport Widget", "keywords": [ "skale", @@ -34,13 +34,13 @@ "version": "node -e \"console.log(require('./package.json').version);\"" }, "devDependencies": { - "@storybook/addon-essentials": "7.4.0", - "@storybook/addon-interactions": "7.4.0", - "@storybook/addon-links": "7.4.0", + "@storybook/addon-essentials": "^7.6.10", + "@storybook/addon-interactions": "^7.6.10", + "@storybook/addon-links": "^7.6.10", "@storybook/addon-styling": "1.3.7", - "@storybook/blocks": "7.4.0", - "@storybook/react": "7.4.0", - "@storybook/react-vite": "7.4.0", + "@storybook/blocks": "^7.6.10", + "@storybook/react": "^7.6.10", + "@storybook/react-vite": "^7.6.10", "@storybook/testing-library": "0.2.0", "@testing-library/react": "14.0.0", "@types/node": "20.4.9", @@ -67,7 +67,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "sass": "^1.65.1", - "storybook": "7.4.0", + "storybook": "^7.6.10", "typescript": "5.1.6", "vite": "4.4.9", "vite-plugin-dts": "3.5.1", @@ -75,18 +75,18 @@ "vitest": "0.34.1" }, "dependencies": { - "@mui/material": "^5.14.8", - "@mui/lab": "^5.0.0-alpha.143", - "@mui/icons-material": "^5.14.8", + "@mui/material": "^5.15.6", + "@mui/lab": "^5.0.0-alpha.162", + "@mui/icons-material": "^5.15.6", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", - "@rainbow-me/rainbowkit": "^1.1.1", + "@rainbow-me/rainbowkit": "^1.3.6", "@skalenetwork/ima-js": "2.0.0-beta.0", "coingecko-api-v3": "^0.0.29", "react-jazzicon": "^1.0.4", - "viem": "^1.10.8", - "wagmi": "^1.4.1", - "zustand": "^4.4.1" + "viem": "^1.21.4", + "wagmi": "^1.4.13", + "zustand": "^4.5.0" }, "peerDependencies": { "react": "18.2.0", @@ -100,4 +100,4 @@ "prettier -w" ] } -} \ No newline at end of file +} diff --git a/src/components/MetaportProvider.tsx b/src/components/MetaportProvider.tsx index 05fedfa..17e7d40 100644 --- a/src/components/MetaportProvider.tsx +++ b/src/components/MetaportProvider.tsx @@ -29,12 +29,7 @@ import { jsonRpcProvider } from 'wagmi/providers/jsonRpc' import { connectorsForWallets } from '@rainbow-me/rainbowkit' import { PaletteMode } from '@mui/material' -import { - injectedWallet, - // coinbaseWallet, - metaMaskWallet - // enkryptWallet -} from '@rainbow-me/rainbowkit/wallets' +import { injectedWallet, metaMaskWallet, enkryptWallet } from '@rainbow-me/rainbowkit/wallets' import { MetaportConfig, ActionStateUpdate } from '../core/interfaces' @@ -73,11 +68,7 @@ export default function MetaportProvider(props: { ] ) - const wallets = [ - // enkryptWallet({ chains }), - injectedWallet({ chains }) - // coinbaseWallet({ chains, appName: 'SKALE Metaport' }) - ] + const wallets = [enkryptWallet({ chains }), injectedWallet({ chains })] if (props.config.projectId) { wallets.push(metaMaskWallet({ chains, projectId: props.config.projectId })) diff --git a/src/core/constants.ts b/src/core/constants.ts index cbdaf16..34a30e7 100644 --- a/src/core/constants.ts +++ b/src/core/constants.ts @@ -45,6 +45,7 @@ export const DEFAULT_MIN_SFUEL_WEI = 21000000000000n export const DEFAULT_ERC20_DECIMALS = '18' export const DEFAULT_ERROR_MSG = 'Ooops... Something went wrong...' export const TRANSFER_ERROR_MSG = 'Error during the transfer' +export const TRANSACTION_ERROR_MSG = 'Transaction sending failed' export const DEFAULT_MP_MARGIN = '20pt' export const DEFAULT_MP_Z_INDEX = 99000 diff --git a/src/core/interfaces/Transactions.ts b/src/core/interfaces/Transactions.ts index e1d1df7..8b40255 100644 --- a/src/core/interfaces/Transactions.ts +++ b/src/core/interfaces/Transactions.ts @@ -21,7 +21,7 @@ * @copyright SKALE Labs 2023-Present */ -import { type TransactionResponse } from 'ethers'; +import { type TransactionResponse } from 'ethers' export interface TxResponse { status: boolean @@ -32,4 +32,4 @@ export interface TxResponse { export interface TxResponseError { name: string msg: string -} \ No newline at end of file +} diff --git a/src/core/transactions.ts b/src/core/transactions.ts index 72b27e8..23d0da2 100644 --- a/src/core/transactions.ts +++ b/src/core/transactions.ts @@ -21,11 +21,10 @@ * @copyright SKALE Labs 2023-Present */ -import { type TransactionResponse } from 'ethers'; -import { TRANSFER_ERROR_MSG } from './constants' +import { type TransactionResponse } from 'ethers' +import { TRANSACTION_ERROR_MSG } from './constants' import { TxResponse } from './interfaces' - export async function sendTransaction(func: any, args: any[]): Promise { try { const response: TransactionResponse = await func(...args) @@ -38,8 +37,10 @@ export async function sendTransaction(func: any, args: any[]): Promise