Rainbow logo
RainbowKit
2.2.11

कस्टम वॉलेट्स

कस्टम वॉलेट्स

एक कस्टम वॉलेट बनाएं

नोट: यह API अस्थिर है और निकट भविष्य में बदल सकता है। हम समय के साथ अधिक बिल्ट-इन वॉलेट जोड़ेंगे। हमें बताएं यदि कोई विशेष वॉलेट हैं जिनमें आप रुचि रखते हैं।

वॉलेट फ़ंक्शन प्रकार आपके अपने कस्टम वॉलेट को परिभाषित करने में मदद करने के लिए प्रदान किया गया है। आपकी वॉलेट फ़ंक्शन के रिटर्न मान पर निम्नलिखित प्रॉपर्टीज़ को कॉन्फ़िगर किया जा सकता है:

PropTypeDefault
id*string –
name*string –
rdnsstring –
shortNamestring | undefined –
iconUrl*string | (() => Promise<string>) –
iconAccentstring –
iconBackground*string –
installedboolean | undefined –
downloadUrlsडाउनलोडUrls | undefined –
hidden(args) => boolean | undefined –
createConnector*RainbowKitConnector –
mobileऑब्जेक्ट –
desktopऑब्जेक्ट –
qrCodeऑब्जेक्ट –
extensionऑब्जेक्ट –
createConnector*(details: WalletDetailsParams) => CreateConnectorFn –
PropTypeDefault
androidstring –
iosstring –
mobilestring –
qrCodestring –
chromestring –
edgestring –
firefoxstring –
operastring –
safaristring –
browserExtensionstring –

उदाहरण के लिए, WalletConnect का उपयोग करके एक कस्टम वॉलेट बनाने के लिए:

import { Wallet, getWalletConnectConnector } from '@rainbow-me/rainbowkit';
export interface MyWalletOptions {
projectId: string;
}
export const rainbow = ({ projectId }: MyWalletOptions): Wallet => ({
id: 'my-wallet',
name: 'My Wallet',
iconUrl: 'https://my-image.xyz',
iconBackground: '#0c2f78',
downloadUrls: {
android: 'https://play.google.com/store/apps/details?id=my.wallet',
ios: 'https://apps.apple.com/us/app/my-wallet',
chrome: 'https://chrome.google.com/webstore/detail/my-wallet',
qrCode: 'https://my-wallet/qr',
},
mobile: {
getUri: (uri: string) => uri,
},
qrCode: {
getUri: (uri: string) => uri,
instructions: {
learnMoreUrl: 'https://my-wallet/learn-more',
steps: [
{
description:
'We recommend putting My Wallet on your home screen for faster access to your wallet.',
step: 'install',
title: 'Open the My Wallet app',
},
{
description:
'After you scan, a connection prompt will appear for you to connect your wallet.',
step: 'scan',
title: 'Tap the scan button',
},
],
},
},
extension: {
instructions: {
learnMoreUrl: 'https://my-wallet/learn-more',
steps: [
{
description:
'We recommend pinning My Wallet to your taskbar for quicker access to your wallet.',
step: 'install',
title: 'Install the My Wallet extension',
},
{
description:
'Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone.',
step: 'create',
title: 'Create or Import a Wallet',
},
{
description:
'Once you set up your wallet, click below to refresh the browser and load up the extension.',
step: 'refresh',
title: 'Refresh your browser',
},
],
},
},
createConnector: getWalletConnectConnector({ projectId }),
});

फिर आप अपने कस्टम वॉलेट को वॉलेट सूची में जोड़ सकते हैं।