Skip to content

Commit

Permalink
Merge pull request #2329 from blocknative/release/2.28.2
Browse files Browse the repository at this point in the history
Release 2.28.2 (docs)
  • Loading branch information
Adamj1232 authored Dec 27, 2024
2 parents 00caaac + 7966d6c commit 0e361c8
Show file tree
Hide file tree
Showing 24 changed files with 1,627 additions and 500 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ For full documentation, check out the README.md for each package or the [docs pa
- [Frame](packages/frame/README.md)
- [Frontier](packages/frontier/README.md)
- [Infinity Wallet](packages/infinity-wallet/README.md)
- [Keplr](packages/keplr/README.md)
- [Magic](packages/magic/README.md)
- [MetaMask](packages/metamask/README.md)
- [MEW-Wallet](packages/mew-wallet/README.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"@safe-global/safe-apps-sdk": "^8.1.0",
"@web3-onboard/bitget": "^2.1.1",
"@web3-onboard/blocto": "^2.1.1",
"@web3-onboard/capsule": "^2.3.0",
"@web3-onboard/capsule": "^2.4.0",
"@web3-onboard/cede-store": "^2.3.1",
"@web3-onboard/coinbase": "^2.3.1",
"@web3-onboard/core": "^2.23.0",
"@web3-onboard/core": "^2.23.1-alpha.1",
"@web3-onboard/dcent": "^2.2.8",
"@web3-onboard/enkrypt": "^2.1.1",
"@web3-onboard/finoaconnect": "^2.0.0",
Expand All @@ -67,7 +67,7 @@
"@web3-onboard/gas": "^2.2.1",
"@web3-onboard/gnosis": "^2.3.1",
"@web3-onboard/infinity-wallet": "^2.1.1",
"@web3-onboard/injected-wallets": "^2.11.1",
"@web3-onboard/injected-wallets": "^2.11.3",
"@web3-onboard/keepkey": "^2.3.8",
"@web3-onboard/keystone": "^2.3.8",
"@web3-onboard/ledger": "^2.7.1",
Expand All @@ -86,7 +86,7 @@
"@web3-onboard/trust": "^2.1.1",
"@web3-onboard/uauth": "^2.2.1",
"@web3-onboard/venly": "^2.1.1",
"@web3-onboard/walletconnect": "^2.6.1",
"@web3-onboard/walletconnect": "^2.6.2",
"@web3-onboard/web3auth": "^2.3.1",
"@web3-onboard/xdefi": "^2.1.1",
"@web3-onboard/zeal": "^2.1.1",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ const intiOnboard = async theme => {
const finoaconnect = finoaConnectModule(finoaConnectOptions)

const uauthOptions = {
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
redirectUri: 'http://localhost:8080/',
clientID: "a7371c4a-a61e-4fac-af48-4471c2e69e93",
redirectUri: "https://onboard.blocknative.com",
scope: 'openid wallet email:optional humanity_check:optional profile:optional social:optional',
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5'
}
Expand Down
5 changes: 4 additions & 1 deletion docs/src/routes/docs/[...3]modules/[...1]core/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,12 @@ type ConnectModalOptions = {
#### i18n
An object that defines the display text for different locales. Can also be used to override the default text. To override the default text, pass in an object for the `en` locale.
Currently there is built-in support for:
- English (`en`) - Default
- Simplified Chinese (`zh`)
```typescript
type Locale = string // eg 'en', 'es'
type Locale = string // eg 'en', 'zh', 'es'
type i18nOptions = Record<Locale, i18n>
```
Expand Down
819 changes: 569 additions & 250 deletions docs/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-onboard-monorepo",
"version": "2.28.1",
"version": "2.28.2",
"private": true,
"workspaces": {
"packages": [
Expand Down
90 changes: 50 additions & 40 deletions packages/capsule/README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,87 @@
# @web3-onboard/capsule

## Wallet module for connecting Capsule Embedded Wallets to web3-onboard
## Wallet module for connecting Capsule Embedded Wallets to Web3-Onboard

[Capsule](https://usecapsule.com/) is a signing solution that you can use to create secure embedded MPC wallets to onboard your users with just an email or social login. Capsule wallets are recoverable, portable, and permissioned across different crypto applications, so your users don't need to create different signers or contract accounts for every app they use
[Capsule](https://usecapsule.com/) is a signing solution that enables you to create secure embedded MPC wallets, allowing users to onboard with just an email or social login. Capsule wallets are recoverable, portable, and permissioned across different crypto applications, eliminating the need for users to create separate signers or contract accounts for each app.

If you'd like to use Capsule's full functionality within the web3onboard package without any extra integration steps, you can also [request a Capsule API Key](https://usecapsule.com/api) and use it with this package.
### Getting Started

To learn more, check out the [Capsule Developer Docs](https://docs.usecapsule.com/)
1. Visit the [Capsule Developer Portal](https://developer.usecapsule.com)
2. Create a new project
3. Generate an API key for your project
4. Configure your project settings and environments

### Install
### Installation

```bash
yarn add @web3-onboard/capsule
# OR
# Using npm
npm install @web3-onboard/capsule
# OR

# Using yarn
yarn add @web3-onboard/capsule

# Using pnpm
pnpm install @web3-onboard/capsule

# Using bun
bun add @web3-onboard/capsule
```

## Options
For configuration options, check out the [Integration Guide Docs](https://docs.usecapsule.com/integration-guide)
## Configuration Options

```typescript
type CapsuleInitOptions = {
environment: string
export type CapsuleInitOptions = {
// The environment to connect to (PROD or BETA)
environment: Environment

// Your Capsule API key from the developer portal
apiKey: string
/** @optional capsule object opts */
constructorOpts?: ConstructorOpts
appName: string
/** @optional capsule modal props */
modalProps?: CapsuleModalProps

// Optional: Additional constructor options for the Capsule client
constructorOpts?: Partial<ConstructorOpts>

// Optional: Customization props for the Capsule modal
modalProps?: Partial<CapsuleModalProps>

// Optional: Custom function to load wallet icon
walletIcon?: () => Promise<string>

// Optional: Custom label for the wallet
walletLabel?: string
}
```
## Usage
## Implementation
```typescript
import Onboard from '@web3-onboard/core'
import Capsule, { Environment } from '@usecapsule/react-sdk';
import Capsule, { Environment } from '@usecapsule/react-sdk'
import capsuleModule from '@web3-onboard/capsule'

// initialize capsule
// Initialize Capsule client
const capsule = new Capsule(
Environment.BETA, // for production, use ENVIRONMENT.PROD
"YOUR_API_KEY"
{ opts } // find these at docs.usecapsule.com
);
Environment.BETA, // Use Environment.PROD for production
'YOUR_API_KEY' // Your API key from developer.usecapsule.com
)

// initialize the module with options
// Initialize the Capsule module
const capsuleWallet = capsuleModule(capsule)

// Initialize web3-onboard
const onboard = Onboard({
// ... other Onboard options
wallets: [
capsule
capsuleWallet
//... other wallets
]
})

// Connect wallet
const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

## Build env settings (webpack config)
## Additional Resources

You may need to add the following rule to your webpack config module
in order to handle certain styling files (See the config for the
Blocknative demo app):

```typescript
{
test: /\.(woff(2)?|eot|ttf|otf|svg)$/,
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext][query]'
}
}
```
- [Capsule Documentation](https://docs.usecapsule.com/)
- [Developer Portal](https://developer.usecapsule.com)
6 changes: 3 additions & 3 deletions packages/capsule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/capsule",
"version": "2.3.0",
"version": "2.4.0",
"description": "Capsule SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"module": "dist/index.js",
"browser": "dist/index.js",
Expand Down Expand Up @@ -57,8 +57,8 @@
],
"dependencies": {
"@tanstack/react-query": "^5.29.0",
"@usecapsule/react-sdk": "^3.17.0",
"@usecapsule/wagmi-v2-integration": "^2.18.0",
"@usecapsule/react-sdk": "4.10.0",
"@usecapsule/wagmi-v2-integration": "3.10.0",
"@wagmi/chains": "^1.8.0",
"@web3-onboard/common": "^2.4.1",
"react-dom": "^18.2.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,12 @@ type disableFontDownload = boolean // defaults to false
**`i18n`**
An object that defines the display text for different locales. Can also be used to override the default text. To override the default text, pass in a object for the `en` locale.
Currently there is built-in support for:
- English (`en`) - Default
- Simplified Chinese (`zh`)
```typescript
type Locale = string // eg 'en', 'es'
type Locale = string // eg 'en', 'zh', 'es'
type i18nOptions = Record<Locale, i18n>
```
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/core",
"version": "2.23.0",
"version": "2.23.1",
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -96,7 +96,7 @@
"nanoid": "^4.0.0",
"rxjs": "^7.5.5",
"svelte": "^3.49.0",
"svelte-i18n": "^3.3.13",
"svelte-i18n": "^4.0.1",
"viem": "2.12.0"
},
"engines": {
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"subheading": "Connection Successful!",
"paragraph": "Your wallet is now connected to {app}"
},
"mainText": "Connected"
"mainText": "Connected",
"accountSelected": "Account Selected",
"availableWallet": "available wallet"
}
},
"modals": {
Expand Down
123 changes: 123 additions & 0 deletions packages/core/src/i18n/zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"connect": {
"selectingWallet": {
"header": "可用钱包",
"sidebar": {
"heading": "",
"subheading": "连接您的钱包",
"paragraph": "连接钱包就像是“登录”到Web3。请选择一个钱包开始使用。",
"IDontHaveAWallet": "我没有钱包"
},
"recommendedWalletsPart1": "{app}仅支持",
"recommendedWalletsPart2": "在该平台上。请使用或安装受支持的钱包以继续。",
"installWallet": "您未安装{app}支持的任何钱包,请使用受支持的钱包。",
"agreement": {
"agree": "我同意",
"terms": "条款与条件",
"and": "",
"privacy": "隐私政策"
},
"whyDontISeeMyWallet": "为什么我看不到我的钱包?",
"learnMore": "点击这里了解更多"
},
"connectingWallet": {
"header": "{connectionRejected, select, false {正在连接{wallet}...} other {连接被拒绝}}",
"sidebar": {
"subheading": "批准连接",
"paragraph": "请在您的钱包中批准连接并授权访问以继续。"
},
"mainText": "正在连接...",
"paragraph": "请确保选择所有您想授予访问权限的账户。",
"previousConnection": "{wallet}已有待处理的连接请求,请打开{wallet}应用登录并连接。",
"rejectedText": "连接被拒绝!",
"rejectedCTA": "点击这里重试",
"primaryButton": "返回钱包"
},
"connectedWallet": {
"header": "连接成功",
"sidebar": {
"subheading": "连接成功!",
"paragraph": "您的钱包现已连接到{app}"
},
"mainText": "已连接",
"accountSelected": "已选择账户",
"availableWallet": "可用钱包"
}
},
"modals": {
"actionRequired": {
"heading": "{wallet}中需要操作",
"paragraph": "请在钱包中切换活跃账户。",
"linkText": "了解更多。",
"buttonText": "好的"
},
"switchChain": {
"heading": "切换网络",
"paragraph1": "{app}需要您将钱包切换到{nextNetworkName}网络以继续。",
"paragraph2": "*某些钱包可能不支持更换网络。如果您无法在钱包中切换网络,可以考虑切换到其他钱包。"
},
"confirmDisconnectAll": {
"heading": "断开所有钱包连接",
"description": "您确定要断开所有钱包连接吗?",
"confirm": "确认",
"cancel": "取消"
},
"confirmTransactionProtection": {
"heading": "启用交易保护",
"description": "保护RPC端点以防止您的交易被抢先交易和三明治攻击。",
"link": "了解更多",
"enable": "启用",
"dismiss": "忽略"
}
},
"accountCenter": {
"connectAnotherWallet": "连接另一个钱包",
"disconnectAllWallets": "断开所有钱包连接",
"currentNetwork": "当前网络",
"enableTransactionProtection": "启用交易保护",
"appInfo": "应用信息",
"learnMore": "了解更多",
"gettingStartedGuide": "入门指南",
"smartContracts": "智能合约",
"explore": "探索",
"poweredBy": "技术支持",
"addAccount": "添加账户",
"setPrimaryAccount": "设为主要账户",
"disconnectWallet": "断开钱包连接",
"copyAddress": "复制钱包地址"
},
"notify": {
"transaction": {
"txRequest": "您的交易等待确认",
"nsfFail": "您的资金不足,无法进行此交易",
"txUnderpriced": "您的交易Gas费过低,请尝试设置更高的Gas费",
"txRepeat": "这可能是重复交易",
"txAwaitingApproval": "您有一个待确认的交易",
"txConfirmReminder": "请确认交易以继续",
"txSendFail": "您已拒绝该交易",
"txSent": "您的交易已发送到网络",
"txStallPending": "您的交易在发送前被卡住了,请重试",
"txStuck": "由于nonce差异,您的交易被卡住了",
"txPool": "您的交易已开始",
"txStallConfirmed": "您的交易未确认且已暂停",
"txSpeedUp": "您的交易已加速",
"txCancel": "您的交易正在取消",
"txFailed": "您的交易失败了",
"txConfirmed": "您的交易成功了",
"txError": "出了点问题,请重试",
"txReplaceError": "替换交易时出错,请重试"
},
"watched": {
"txPool": "您的账户正在{verb}{formattedValue}{asset}{preposition}{counterpartyShortened}",
"txSpeedUp": "关于{formattedValue}{asset}{preposition}{counterpartyShortened}的交易已加速",
"txCancel": "关于{formattedValue}{asset}{preposition}{counterpartyShortened}的交易已取消",
"txConfirmed": "您的账户已成功{verb}{formattedValue}{asset}{preposition}{counterpartyShortened}",
"txFailed": "您的账户未能{verb}{formattedValue}{asset}{preposition}{counterpartyShortened}",
"txStuck": "由于nonce差异,您的交易被卡住了"
},
"time": {
"minutes": "分钟",
"seconds": ""
}
}
}
2 changes: 1 addition & 1 deletion packages/core/src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fromEventPattern, Observable } from 'rxjs'
import { fromEventPattern, type Observable } from 'rxjs'
import { filter, takeUntil, take, share, switchMap } from 'rxjs/operators'
import partition from 'lodash.partition'
import { isAddress, weiHexToEth } from '@web3-onboard/common'
Expand Down
Loading

0 comments on commit 0e361c8

Please sign in to comment.