Skip to content

Commit 754c378

Browse files
authored
Merge branch 'develop' into patch-1
2 parents 91bb1dd + dd18c61 commit 754c378

File tree

9 files changed

+449
-181
lines changed

9 files changed

+449
-181
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ For full documentation, check out the README.md for each package or the [docs pa
115115
- [Frame](packages/frame/README.md)
116116
- [Frontier](packages/frontier/README.md)
117117
- [Infinity Wallet](packages/infinity-wallet/README.md)
118+
- [Keplr](packages/keplr/README.md)
118119
- [Magic](packages/magic/README.md)
119120
- [MetaMask](packages/metamask/README.md)
120121
- [MEW-Wallet](packages/mew-wallet/README.md)

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@safe-global/safe-apps-sdk": "^8.1.0",
5555
"@web3-onboard/bitget": "^2.1.1",
5656
"@web3-onboard/blocto": "^2.1.1",
57-
"@web3-onboard/capsule": "^2.3.0",
57+
"@web3-onboard/capsule": "^2.4.0-alpha.1",
5858
"@web3-onboard/cede-store": "^2.3.1",
5959
"@web3-onboard/coinbase": "^2.3.1",
6060
"@web3-onboard/core": "^2.23.0",

docs/src/lib/services/onboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ const intiOnboard = async theme => {
118118
const finoaconnect = finoaConnectModule(finoaConnectOptions)
119119

120120
const uauthOptions = {
121-
clientID: 'a25c3a65-a1f2-46cc-a515-a46fe7acb78c',
122-
redirectUri: 'http://localhost:8080/',
121+
clientID: "a7371c4a-a61e-4fac-af48-4471c2e69e93",
122+
redirectUri: "https://onboard.blocknative.com",
123123
scope: 'openid wallet email:optional humanity_check:optional profile:optional social:optional',
124124
walletConnectProjectId: 'f6bd6e2911b56f5ac3bc8b2d0e2d7ad5'
125125
}

packages/capsule/README.md

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,87 @@
11
# @web3-onboard/capsule
22

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

5-
[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
5+
[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.
66

7-
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.
7+
### Getting Started
88

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

11-
### Install
14+
### Installation
1215

1316
```bash
14-
yarn add @web3-onboard/capsule
15-
# OR
17+
# Using npm
1618
npm install @web3-onboard/capsule
17-
# OR
19+
20+
# Using yarn
21+
yarn add @web3-onboard/capsule
22+
23+
# Using pnpm
1824
pnpm install @web3-onboard/capsule
25+
26+
# Using bun
27+
bun add @web3-onboard/capsule
1928
```
2029

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

2432
```typescript
25-
type CapsuleInitOptions = {
26-
environment: string
33+
export type CapsuleInitOptions = {
34+
// The environment to connect to (PROD or BETA)
35+
environment: Environment
36+
37+
// Your Capsule API key from the developer portal
2738
apiKey: string
28-
/** @optional capsule object opts */
29-
constructorOpts?: ConstructorOpts
30-
appName: string
31-
/** @optional capsule modal props */
32-
modalProps?: CapsuleModalProps
39+
40+
// Optional: Additional constructor options for the Capsule client
41+
constructorOpts?: Partial<ConstructorOpts>
42+
43+
// Optional: Customization props for the Capsule modal
44+
modalProps?: Partial<CapsuleModalProps>
45+
46+
// Optional: Custom function to load wallet icon
47+
walletIcon?: () => Promise<string>
48+
49+
// Optional: Custom label for the wallet
50+
walletLabel?: string
3351
}
3452
```
35-
## Usage
53+
54+
## Implementation
55+
3656
```typescript
3757
import Onboard from '@web3-onboard/core'
38-
import Capsule, { Environment } from '@usecapsule/react-sdk';
58+
import Capsule, { Environment } from '@usecapsule/react-sdk'
3959
import capsuleModule from '@web3-onboard/capsule'
4060

41-
// initialize capsule
61+
// Initialize Capsule client
4262
const capsule = new Capsule(
43-
Environment.BETA, // for production, use ENVIRONMENT.PROD
44-
"YOUR_API_KEY"
45-
{ opts } // find these at docs.usecapsule.com
46-
);
63+
Environment.BETA, // Use Environment.PROD for production
64+
'YOUR_API_KEY' // Your API key from developer.usecapsule.com
65+
)
4766

48-
// initialize the module with options
67+
// Initialize the Capsule module
4968
const capsuleWallet = capsuleModule(capsule)
5069

70+
// Initialize web3-onboard
5171
const onboard = Onboard({
5272
// ... other Onboard options
5373
wallets: [
54-
capsule
74+
capsuleWallet
5575
//... other wallets
5676
]
5777
})
5878

79+
// Connect wallet
5980
const connectedWallets = await onboard.connectWallet()
6081
console.log(connectedWallets)
6182
```
6283

63-
## Build env settings (webpack config)
84+
## Additional Resources
6485

65-
You may need to add the following rule to your webpack config module
66-
in order to handle certain styling files (See the config for the
67-
Blocknative demo app):
68-
69-
```typescript
70-
{
71-
test: /\.(woff(2)?|eot|ttf|otf|svg)$/,
72-
type: 'asset/resource',
73-
generator: {
74-
filename: 'fonts/[name][ext][query]'
75-
}
76-
}
77-
```
86+
- [Capsule Documentation](https://docs.usecapsule.com/)
87+
- [Developer Portal](https://developer.usecapsule.com)

packages/capsule/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/capsule",
3-
"version": "2.3.0",
3+
"version": "2.4.0-alpha.1",
44
"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.",
55
"module": "dist/index.js",
66
"browser": "dist/index.js",
@@ -57,8 +57,8 @@
5757
],
5858
"dependencies": {
5959
"@tanstack/react-query": "^5.29.0",
60-
"@usecapsule/react-sdk": "^3.17.0",
61-
"@usecapsule/wagmi-v2-integration": "^2.18.0",
60+
"@usecapsule/react-sdk": "4.10.0",
61+
"@usecapsule/wagmi-v2-integration": "3.10.0",
6262
"@wagmi/chains": "^1.8.0",
6363
"@web3-onboard/common": "^2.4.1",
6464
"react-dom": "^18.2.0",

packages/core/src/i18n/zh.json

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
"connect": {
3+
"selectingWallet": {
4+
"header": "可用钱包",
5+
"sidebar": {
6+
"heading": "",
7+
"subheading": "连接您的钱包",
8+
"paragraph": "连接钱包就像是“登录”到Web3。请选择一个钱包开始使用。",
9+
"IDontHaveAWallet": "我没有钱包"
10+
},
11+
"recommendedWalletsPart1": "{app}仅支持",
12+
"recommendedWalletsPart2": "在该平台上。请使用或安装受支持的钱包以继续。",
13+
"installWallet": "您未安装{app}支持的任何钱包,请使用受支持的钱包。",
14+
"agreement": {
15+
"agree": "我同意",
16+
"terms": "条款与条件",
17+
"and": "",
18+
"privacy": "隐私政策"
19+
},
20+
"whyDontISeeMyWallet": "为什么我看不到我的钱包?",
21+
"learnMore": "点击这里了解更多"
22+
},
23+
"connectingWallet": {
24+
"header": "{connectionRejected, select, false {正在连接{wallet}...} other {连接被拒绝}}",
25+
"sidebar": {
26+
"subheading": "批准连接",
27+
"paragraph": "请在您的钱包中批准连接并授权访问以继续。"
28+
},
29+
"mainText": "正在连接...",
30+
"paragraph": "请确保选择所有您想授予访问权限的账户。",
31+
"previousConnection": "{wallet}已有待处理的连接请求,请打开{wallet}应用登录并连接。",
32+
"rejectedText": "连接被拒绝!",
33+
"rejectedCTA": "点击这里重试",
34+
"primaryButton": "返回钱包"
35+
},
36+
"connectedWallet": {
37+
"header": "连接成功",
38+
"sidebar": {
39+
"subheading": "连接成功!",
40+
"paragraph": "您的钱包现已连接到{app}"
41+
},
42+
"mainText": "已连接"
43+
}
44+
},
45+
"modals": {
46+
"actionRequired": {
47+
"heading": "{wallet}中需要操作",
48+
"paragraph": "请在钱包中切换活跃账户。",
49+
"linkText": "了解更多。",
50+
"buttonText": "好的"
51+
},
52+
"switchChain": {
53+
"heading": "切换网络",
54+
"paragraph1": "{app}需要您将钱包切换到{nextNetworkName}网络以继续。",
55+
"paragraph2": "*某些钱包可能不支持更换网络。如果您无法在钱包中切换网络,可以考虑切换到其他钱包。"
56+
},
57+
"confirmDisconnectAll": {
58+
"heading": "断开所有钱包连接",
59+
"description": "您确定要断开所有钱包连接吗?",
60+
"confirm": "确认",
61+
"cancel": "取消"
62+
},
63+
"confirmTransactionProtection": {
64+
"heading": "启用交易保护",
65+
"description": "保护RPC端点以防止您的交易被抢先交易和三明治攻击。",
66+
"link": "了解更多",
67+
"enable": "启用",
68+
"dismiss": "忽略"
69+
}
70+
},
71+
"accountCenter": {
72+
"connectAnotherWallet": "连接另一个钱包",
73+
"disconnectAllWallets": "断开所有钱包连接",
74+
"currentNetwork": "当前网络",
75+
"enableTransactionProtection": "启用交易保护",
76+
"appInfo": "应用信息",
77+
"learnMore": "了解更多",
78+
"gettingStartedGuide": "入门指南",
79+
"smartContracts": "智能合约",
80+
"explore": "探索",
81+
"poweredBy": "技术支持",
82+
"addAccount": "添加账户",
83+
"setPrimaryAccount": "设为主要账户",
84+
"disconnectWallet": "断开钱包连接",
85+
"copyAddress": "复制钱包地址"
86+
},
87+
"notify": {
88+
"transaction": {
89+
"txRequest": "您的交易等待确认",
90+
"nsfFail": "您的资金不足,无法进行此交易",
91+
"txUnderpriced": "您的交易Gas费过低,请尝试设置更高的Gas费",
92+
"txRepeat": "这可能是重复交易",
93+
"txAwaitingApproval": "您有一个待确认的交易",
94+
"txConfirmReminder": "请确认交易以继续",
95+
"txSendFail": "您已拒绝该交易",
96+
"txSent": "您的交易已发送到网络",
97+
"txStallPending": "您的交易在发送前被卡住了,请重试",
98+
"txStuck": "由于nonce差异,您的交易被卡住了",
99+
"txPool": "您的交易已开始",
100+
"txStallConfirmed": "您的交易未确认且已暂停",
101+
"txSpeedUp": "您的交易已加速",
102+
"txCancel": "您的交易正在取消",
103+
"txFailed": "您的交易失败了",
104+
"txConfirmed": "您的交易成功了",
105+
"txError": "出了点问题,请重试",
106+
"txReplaceError": "替换交易时出错,请重试"
107+
},
108+
"watched": {
109+
"txPool": "您的账户正在{verb}{formattedValue}{asset}{preposition}{counterpartyShortened}",
110+
"txSpeedUp": "关于{formattedValue}{asset}{preposition}{counterpartyShortened}的交易已加速",
111+
"txCancel": "关于{formattedValue}{asset}{preposition}{counterpartyShortened}的交易已取消",
112+
"txConfirmed": "您的账户已成功{verb}{formattedValue}{asset}{preposition}{counterpartyShortened}",
113+
"txFailed": "您的账户未能{verb}{formattedValue}{asset}{preposition}{counterpartyShortened}",
114+
"txStuck": "由于nonce差异,您的交易被卡住了"
115+
},
116+
"time": {
117+
"minutes": "分钟",
118+
"seconds": ""
119+
}
120+
}
121+
}

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@web3-onboard/bitget": "2.1.1",
3333
"@web3-onboard/blocto": "^2.1.1",
3434
"@web3-onboard/bloom": "2.0.0",
35-
"@web3-onboard/capsule": "^2.3.0",
35+
"@web3-onboard/capsule": "^2.4.0-alpha.1",
3636
"@web3-onboard/cede-store": "^2.3.1",
3737
"@web3-onboard/core": "2.23.0",
3838
"@web3-onboard/coinbase": "^2.4.1",

packages/demo/src/App.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
import finoaConnectModule from '@web3-onboard/finoaconnect'
4242
import keplrModule from '@web3-onboard/keplr'
4343
import capsuleModule, {
44-
Environment,
45-
OAuthMethod
44+
Environment as CapsuleEnvironment,
45+
OAuthMethod as CapsuleOAuthMethods
4646
} from '@web3-onboard/capsule'
4747
import {
4848
recoverAddress,
@@ -276,16 +276,16 @@
276276
environment: 'staging'
277277
})
278278
const capsule = capsuleModule({
279-
environment: Environment.DEVELOPMENT,
279+
environment: CapsuleEnvironment.DEVELOPMENT,
280280
apiKey: '992bbd9146d5de8ad0419f141d9a7ca7',
281281
modalProps: {
282-
oAuthMethods: [OAuthMethod.GOOGLE, OAuthMethod.TWITTER, OAuthMethod.APPLE,OAuthMethod.DISCORD]
282+
appName: 'Capsule',
283+
disableEmailLogin: false,
284+
disablePhoneLogin: false,
285+
oAuthMethods: Object.values(CapsuleOAuthMethods)
283286
},
284-
constructorOpts: {
285-
portalBackgroundColor: '#5e5656',
286-
portalPrimaryButtonColor: '#ff6700',
287-
portalTextColor: '#ffffff'
288-
}
287+
288+
walletLabel: 'Capsule'
289289
})
290290
291291
const onboard = Onboard({

0 commit comments

Comments
 (0)