@unifold/connect-react-native 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -1
- package/dist/index.d.mts +0 -48
- package/dist/index.d.ts +0 -48
package/README.md
CHANGED
|
@@ -83,6 +83,58 @@ function DepositScreen() {
|
|
|
83
83
|
}
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
## Theming & Customization
|
|
87
|
+
|
|
88
|
+
The SDK provides comprehensive theming options. For full documentation, see [docs/theming.mdx](./docs/theming.mdx).
|
|
89
|
+
|
|
90
|
+
### Quick Theme Setup
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<UnifoldProvider
|
|
94
|
+
publishableKey="pk_live_..."
|
|
95
|
+
config={{
|
|
96
|
+
appearance: "dark", // 'light' | 'dark' | 'auto'
|
|
97
|
+
accentColor: "#8B5CF6", // Brand color
|
|
98
|
+
|
|
99
|
+
// Custom fonts (must be loaded by your app)
|
|
100
|
+
fonts: {
|
|
101
|
+
regular: "Inter-Regular",
|
|
102
|
+
medium: "Inter-Medium",
|
|
103
|
+
semibold: "Inter-SemiBold",
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
// Full color customization
|
|
107
|
+
theme: {
|
|
108
|
+
dark: {
|
|
109
|
+
primary: "#8B5CF6",
|
|
110
|
+
background: "#0F0F10",
|
|
111
|
+
card: "#1A1A1D",
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
// Granular component overrides
|
|
116
|
+
components: {
|
|
117
|
+
header: { titleColor: "#FFFFFF" },
|
|
118
|
+
card: { backgroundColor: "#1A1A1D" },
|
|
119
|
+
}
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Pre-selecting Source Token
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
await beginDeposit({
|
|
128
|
+
externalUserId: "user_123",
|
|
129
|
+
// ... destination params
|
|
130
|
+
|
|
131
|
+
// Pre-select USDC on Polygon as the source token
|
|
132
|
+
defaultChainType: "ethereum",
|
|
133
|
+
defaultChainId: "137",
|
|
134
|
+
defaultTokenAddress: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
86
138
|
## API Reference
|
|
87
139
|
|
|
88
140
|
### UnifoldProvider
|
|
@@ -93,6 +145,12 @@ function DepositScreen() {
|
|
|
93
145
|
| `config.appearance` | `'light' \| 'dark' \| 'auto'` | No | Theme mode (default: `'dark'`) |
|
|
94
146
|
| `config.modalTitle` | `string` | No | Custom modal title |
|
|
95
147
|
| `config.hideDepositTracker` | `boolean` | No | Hide the deposit tracker button |
|
|
148
|
+
| `config.transferInputVariant` | `'single_input' \| 'double_input'` | No | Token selector style (default: `'double_input'`) |
|
|
149
|
+
| `config.accentColor` | `string` | No | Primary brand color |
|
|
150
|
+
| `config.theme` | `ThemeConfig` | No | Full color customization |
|
|
151
|
+
| `config.fontFamily` | `string` | No | Single font family for all text |
|
|
152
|
+
| `config.fonts` | `FontConfig` | No | Granular font weight configuration |
|
|
153
|
+
| `config.components` | `ComponentConfig` | No | Component-specific token overrides |
|
|
96
154
|
|
|
97
155
|
### useUnifold Hook
|
|
98
156
|
|
|
@@ -116,6 +174,9 @@ const { beginDeposit, closeDeposit, publishableKey } = useUnifold();
|
|
|
116
174
|
| `destinationTokenAddress` | `string` | No | Target token contract address |
|
|
117
175
|
| `destinationTokenSymbol` | `string` | No | Target token symbol (e.g., `'USDC'`) |
|
|
118
176
|
| `recipientAddress` | `string` | No | Wallet address to receive funds |
|
|
177
|
+
| `defaultChainType` | `'ethereum' \| 'solana' \| 'bitcoin'` | No | Pre-select source network type |
|
|
178
|
+
| `defaultChainId` | `string` | No | Pre-select source chain ID |
|
|
179
|
+
| `defaultTokenAddress` | `string` | No | Pre-select source token address |
|
|
119
180
|
| `onSuccess` | `(data: DepositResult) => void` | No | Called when deposit succeeds |
|
|
120
181
|
| `onError` | `(error: DepositError) => void` | No | Called when an error occurs |
|
|
121
182
|
|
|
@@ -149,6 +210,9 @@ import type {
|
|
|
149
210
|
DepositResult,
|
|
150
211
|
DepositError,
|
|
151
212
|
ThemeMode,
|
|
213
|
+
ThemeConfig,
|
|
214
|
+
FontConfig,
|
|
215
|
+
ComponentConfig,
|
|
152
216
|
UnifoldProviderProps,
|
|
153
217
|
} from '@unifold/connect-react-native';
|
|
154
218
|
```
|