dApp용 Redoubt
Redoubt는 Burst Labs가 만든 Flare, Songbird, XRP Ledger용 비수탁형 지갑입니다. 자체 web3 브라우저와 WalletConnect를 갖춘 Android 앱이며, 브라우저 확장 프로그램도 나올 예정입니다.
이 페이지에는 dApp의 지갑 목록에 Redoubt를 이름으로 올리는 데 필요한 내용이 있습니다.
로고 다운로드
앱 아이콘
지갑 목록용으로, 자두색 배경 위에 놓인 정사각형 앱 아이콘입니다. 밝은 페이지와 어두운 페이지 모두에서 쓸 수 있습니다. 대부분의 목록은 모서리를 직접 둥글게 처리하며, SVG 버전은 이미 모서리가 둥글게 되어 있습니다.
마크
배경 없이 탑만 있는 버전입니다.
이름이 들어간 로고
마크에 REDOUBT라는 단어를 더한 로고로, Redoubt에 관한 페이지와 기사에 사용합니다.
로고 사용하기
- 최소 크기: 앱 아이콘과 마크는 24픽셀, 이름이 들어간 로고는 너비 96픽셀입니다.
- 로고 주위에는 로고 높이의 4분의 1 이상의 여백을 두세요.
- 색상이나 비율을 바꾸지 말고, 효과를 추가하지 마세요.
- 색상: 로즈 골드 #E8A987, 짙은 자두색 #2E0829.
Redoubt가 페이지에 나타나는 방식
Redoubt의 브라우저는 모든 https 페이지에 EIP-1193 프로바이더를 제공하며, 이를 EIP-6963으로 알리고 window.ethereum에도 설정합니다:
- 이름
Redoubt- 식별자(rdns)
io.burstlabs.redoubt- 프로바이더 플래그
isRedoubt: true- 아이콘
- 앱 아이콘, data URI 형식의 96 x 96픽셀 PNG
- isMetaMask는 false입니다. 단, 사용자가 MetaMask 호환 기능을 켠 사이트에서는 예외입니다. Redoubt는 rdns나 isRedoubt로 찾고, 절대 isMetaMask로 찾지 마세요.
- 프로바이더는 https 페이지의 최상위 프레임에만 추가되며, iframe에는 추가되지 않습니다.
- 브라우저 확장 프로그램이 나오면, 같은 이름과 rdns를 알립니다.
네트워크
- Flare: 체인 ID 14 (0xe)
- Songbird: 체인 ID 19 (0x13)
- Coston2: 체인 ID 114 (0x72), 테스트 전용입니다. Redoubt에서 테스트 네트워크를 켜면 표시됩니다. 켜는 방법은 저희에게 문의하세요.
연결은 이 EVM 네트워크에서만 가능합니다. 사이트마다 네트워크가 따로 유지됩니다. wallet_switchEthereumChain과 wallet_addEthereumChain은 전환하기 전에 사용자에게 묻습니다. 그다음 Redoubt는 사이트가 보낸 RPC 주소가 아니라 자체 노드를 사용하며, 다른 네트워크는 모두 거부합니다.
메서드와 이벤트
서명(각각 사용자가 Redoubt의 보안 화면에서 승인):
personal_signeth_signTypedData_v4eth_signTypedData_v3eth_sendTransaction
계정과 네트워크:
eth_requestAccountseth_accountseth_coinbaseeth_chainIdnet_versionwallet_switchEthereumChainwallet_addEthereumChainwallet_requestPermissionswallet_getPermissionswallet_revokePermissions
조회(Redoubt의 브라우저가 직접 또는 자체 노드를 통해 응답하며, eth_getLogs는 한 번 호출에 최대 10,000개 블록까지 조회합니다):
eth_blockNumbereth_calleth_estimateGaseth_gasPriceeth_maxPriorityFeePerGaseth_feeHistoryeth_getBalanceeth_getCodeeth_getStorageAteth_getTransactionCounteth_getTransactionByHasheth_getTransactionReceipteth_getBlockByNumbereth_getBlockByHasheth_getLogseth_syncingweb3_clientVersionpersonal_ecRecover
오류 4200으로 거부되는 메서드(이 페이지에 없는 모든 메서드와 마찬가지):
eth_signeth_signTypedDataeth_signTransactioneth_sendRawTransactioneth_decrypteth_getEncryptionPublicKeywallet_watchAssetwallet_sendCallswallet_getCapabilitieseth_subscribeeth_newFilter
이벤트:
connectaccountsChangedchainChanged
Redoubt는 사이트를 위해 컨트랙트를 배포하지 않으므로, eth_sendTransaction에는 to 주소가 있어야 합니다. nonce와 수수료는 Redoubt가 직접 설정합니다.
WalletConnect 연결
다른 브라우저나 컴퓨터에서는 dApp이 WalletConnect v2로 Redoubt에 연결합니다. Redoubt는 Reown의 WalletKit으로 만든 지갑입니다.
- 이름
Redoubt- 리디렉션(네이티브)
redoubt://- 페어링 링크
redoubt://wc?uri=<wc: URI>wc:- 네트워크(CAIP-2)
eip155:14eip155:19eip155:114- 메서드
personal_signeth_signTypedData_v4eth_signTypedData_v3eth_sendTransactionwallet_switchEthereumChainwallet_addEthereumChain- 이벤트
accountsChangedchainChanged- WalletGuide 등록
- 진행 중입니다. 등록이 게시되면 Redoubt의 WalletGuide ID를 여기에 추가하겠습니다.
optionalNamespaces에서 Flare와 Songbird를 요청하세요. Redoubt는 다른 네트워크나 eip155 이외의 네임스페이스를 필수로 요구하는 세션을 승인할 수 없습니다.
지갑 목록에 Redoubt 추가하기
간단한 예제입니다. 각 예제에는 작성 기준이 된 라이브러리 버전이 적혀 있으며, 해당 버전의 공개된 코드와 대조해 확인했습니다. YOUR_REOWN_PROJECT_ID는 Reown에서 받은 본인의 프로젝트 ID로 바꾸세요.
wagmi
wagmi는 EIP-6963(multiInjectedProviderDiscovery, 기본값으로 켜짐)을 통해 Redoubt를 자동으로 찾으며, 커넥터의 id는 Redoubt의 rdns입니다. Redoubt를 우선 표시하려면 해당 커넥터를 맨 앞에 두세요:
import { createConfig, http, useConnect, useConnectors } from 'wagmi'
import { flare, songbird } from 'wagmi/chains'
// EIP-6963 discovery (multiInjectedProviderDiscovery) is on by default:
// inside Redoubt, a connector with id 'io.burstlabs.redoubt' appears by itself.
export const config = createConfig({
chains: [flare, songbird],
transports: { [flare.id]: http(), [songbird.id]: http() },
})
const REDOUBT = 'io.burstlabs.redoubt'
export function WalletList() {
const connectors = useConnectors()
const { mutate: connect } = useConnect()
// Redoubt first, the others in their usual order
const sorted = [...connectors].sort((a, b) => Number(b.id === REDOUBT) - Number(a.id === REDOUBT))
return (
<>
{sorted.map((c) => (
<button key={c.uid} onClick={() => connect({ connector: c })}>{c.name}</button>
))}
</>
)
}
RainbowKit
RainbowKit용 Redoubt 항목입니다. Redoubt 밖에서는 WalletConnect로 연결하고, Android 휴대폰에서는 앱을 엽니다. Redoubt의 브라우저 안에서는 RainbowKit이 이 항목 대신 설치된 지갑들 사이에 Redoubt 자체의 EIP-6963 항목을 보여 주며, 둘은 rdns로 매칭됩니다.
import { connectorsForWallets, getWalletConnectConnector, type RainbowKitWalletConnectParameters, type Wallet } from '@rainbow-me/rainbowkit'
import { injectedWallet, walletConnectWallet } from '@rainbow-me/rainbowkit/wallets'
import { createConfig, http } from 'wagmi'
import { flare, songbird } from 'wagmi/chains'
const projectId = 'YOUR_REOWN_PROJECT_ID'
const redoubtWallet = ({ projectId, walletConnectParameters }: {
projectId: string
walletConnectParameters?: RainbowKitWalletConnectParameters
}): Wallet => ({
id: 'redoubt',
name: 'Redoubt',
rdns: 'io.burstlabs.redoubt', // in Redoubt's browser, its EIP-6963 entry takes this one's place
iconUrl: 'https://redoubtwallet.com/static/images/wallet/kit/redoubt-icon-256.png',
iconBackground: '#2E0829',
mobile: { getUri: (uri: string) => `redoubt://wc?uri=${encodeURIComponent(uri)}` },
qrCode: { getUri: (uri: string) => uri },
createConnector: getWalletConnectConnector({ projectId, walletConnectParameters }),
})
const connectors = connectorsForWallets(
[{ groupName: 'Recommended', wallets: [redoubtWallet, injectedWallet, walletConnectWallet] }],
{ appName: 'Your dApp', projectId },
)
export const config = createConfig({
connectors,
chains: [flare, songbird],
transports: { [flare.id]: http(), [songbird.id]: http() },
})
Reown AppKit
AppKit은 EIP-6963 지갑을 자동으로 표시하므로, Redoubt의 브라우저 안에서는 아무것도 바꾸지 않아도 Redoubt가 나타납니다. Redoubt의 WalletGuide 등록이 게시되면, featuredWalletIds에 그 ID를 추가해 어디서나 Redoubt를 맨 앞에 표시하세요.
import { createAppKit } from '@reown/appkit/react'
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import { flare, songbird } from '@reown/appkit/networks'
const projectId = 'YOUR_REOWN_PROJECT_ID'
const wagmiAdapter = new WagmiAdapter({ networks: [flare, songbird], projectId })
createAppKit({
adapters: [wagmiAdapter],
networks: [flare, songbird],
projectId,
// enableEIP6963 is on by default: inside Redoubt's browser, Redoubt is listed.
// Once Redoubt's WalletGuide listing is live:
// featuredWalletIds: ['<Redoubt WalletGuide ID>'],
})
web3-onboard
injected-wallets 모듈도 EIP-6963 지갑을 인식합니다. 이 사용자 지정 항목은 isRedoubt로 Redoubt를 알아보고, Redoubt의 아이콘을 사용하며, Redoubt를 맨 앞에 표시합니다:
import Onboard from '@web3-onboard/core'
import injectedModule from '@web3-onboard/injected-wallets'
const isRedoubt = (provider) => !!provider && !!provider.isRedoubt
const redoubt = {
label: 'Redoubt',
injectedNamespace: 'ethereum',
checkProviderIdentity: ({ provider }) => isRedoubt(provider),
getIcon: async () => 'https://redoubtwallet.com/static/images/wallet/kit/redoubt-icon-256.png',
getInterface: async () => ({
provider: [window.ethereum, ...(window.ethereum?.providers ?? [])].find(isRedoubt),
}),
platforms: ['all'],
}
const onboard = Onboard({
wallets: [
injectedModule({
custom: [redoubt],
sort: (wallets) => [...wallets.filter((w) => w.label === 'Redoubt'), ...wallets.filter((w) => w.label !== 'Redoubt')],
}),
],
chains: [
{ id: '0xe', token: 'FLR', label: 'Flare', rpcUrl: 'https://flare-api.flare.network/ext/C/rpc' },
{ id: '0x13', token: 'SGB', label: 'Songbird', rpcUrl: 'https://songbird-api.flare.network/ext/C/rpc' },
],
})
라이브러리 없이
Redoubt의 EIP-6963 알림을 수신하고 그 프로바이더를 저장하세요:
const REDOUBT_RDNS = 'io.burstlabs.redoubt'
let redoubt // Redoubt's EIP-1193 provider, once it announces itself
window.addEventListener('eip6963:announceProvider', (event) => {
const { info, provider } = event.detail // info.name 'Redoubt', info.icon a data: URI
if (info.rdns === REDOUBT_RDNS) redoubt = provider
})
window.dispatchEvent(new Event('eip6963:requestProvider'))
async function connectRedoubt() {
const [account] = await redoubt.request({ method: 'eth_requestAccounts' })
const chainId = await redoubt.request({ method: 'eth_chainId' }) // '0xe' Flare, '0x13' Songbird
return { account, chainId }
}
테스트용 Redoubt 받기
Redoubt는 곧 Google Play에 출시됩니다. 그전까지 dApp을 Redoubt로 테스트하고 싶다면 [email protected]로 이메일을 보내 주세요.
문의하기
Redoubt 추가에 관한 질문이나, Redoubt가 올라가야 할 지갑 목록이 있으신가요? [email protected]로 이메일을 보내 주세요.