@connect-xyz/withdraw-js 0.41.4 → 0.42.1
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 +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,14 +23,14 @@ You can import the script in your index file and use the Withdraw class provided
|
|
|
23
23
|
```html
|
|
24
24
|
<script
|
|
25
25
|
type="module"
|
|
26
|
-
src="https://sdk.connect.xyz/withdraw-
|
|
26
|
+
src="https://sdk.connect.xyz/withdraw-web/index.js"
|
|
27
27
|
></script>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
Or you can directly import in your javascript code.
|
|
31
31
|
|
|
32
32
|
```javascript
|
|
33
|
-
import { Withdraw } from 'https://sdk.connect.xyz/withdraw-
|
|
33
|
+
import { Withdraw } from 'https://sdk.connect.xyz/withdraw-web/index.js';
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## Getting Started
|
|
@@ -46,7 +46,7 @@ import { Withdraw } from '@connect-xyz/withdraw-js';
|
|
|
46
46
|
### 1.1 Or import via CDN
|
|
47
47
|
|
|
48
48
|
```javascript
|
|
49
|
-
import { Withdraw } from 'https://sdk.connect.xyz/withdraw-
|
|
49
|
+
import { Withdraw } from 'https://sdk.connect.xyz/withdraw-web/index.js';
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
### 2. Initialize the Withdraw module into Your App
|
|
@@ -56,8 +56,8 @@ import { Withdraw } from 'https://sdk.connect.xyz/withdraw-js/index.js';
|
|
|
56
56
|
const withdraw = new Withdraw({
|
|
57
57
|
jwt: 'your-jwt-token',
|
|
58
58
|
env: 'production', // or 'sandbox'
|
|
59
|
-
onError: ({
|
|
60
|
-
console.error('Withdraw error:',
|
|
59
|
+
onError: ({ errorCode, reason }) => {
|
|
60
|
+
console.error('Withdraw error:', errorCode, 'Reason:', reason);
|
|
61
61
|
},
|
|
62
62
|
onClose: () => {
|
|
63
63
|
console.log('Withdraw widget closed');
|
|
@@ -100,6 +100,7 @@ withdraw.destroy();
|
|
|
100
100
|
| -------------- | --------------------------------- | -------- | -------------- | -------------------------------------------------- |
|
|
101
101
|
| `jwt` | `string` | Yes | - | JWT token for authentication with Connect Withdraw |
|
|
102
102
|
| `env` | `"production" \| "sandbox"` | No | `"production"` | Target environment |
|
|
103
|
+
| `theme` | `"auto" \| "light" \| "dark"` | No | `"auto"` | Theme mode for the interface |
|
|
103
104
|
| `onError` | `({ errorCode, reason }) => void` | No | - | Callback for error events |
|
|
104
105
|
| `onClose` | `() => void` | No | - | Callback when the widget is closed |
|
|
105
106
|
| `onWithdrawal` | `({ data }) => void` | No | - | Callback for withdrawal completed |
|
|
@@ -119,6 +120,7 @@ Creates a new Withdraw instance with the provided configuration.
|
|
|
119
120
|
- `config` (WithdrawConfig): Configuration object
|
|
120
121
|
- `jwt` (string, required): JWT token for authentication
|
|
121
122
|
- `env` (string, optional): Environment - 'production' (default) or 'sandbox'
|
|
123
|
+
- `theme` (string, optional): Theme mode - 'auto' (default), 'light', or 'dark'
|
|
122
124
|
- `onError` (function, optional): Error callback
|
|
123
125
|
- `onClose` (function, optional): Close callback
|
|
124
126
|
- `onWithdrawal` (function, optional): Withdrawal callback
|