uniport-sdk 0.0.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 ADDED
@@ -0,0 +1,101 @@
1
+ # Uniport
2
+
3
+ [![npm version](https://img.shields.io/npm/v/uniport-sdk.svg)](https://www.npmjs.com/package/uniport-sdk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Cross-chain payment SDK. Accept crypto payments from any blockchain with one line of code.
7
+
8
+ [GitHub Repository](https://github.com/officialcmg/uniport)
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install uniport-sdk
14
+ ```
15
+
16
+ ## Quick Start
17
+
18
+ ```tsx
19
+ import { initUniport, UniportButton } from 'uniport-sdk'
20
+
21
+ // Initialize once at app startup
22
+ // Get your API key from https://partners.near-intents.org/
23
+ initUniport({
24
+ apiKey: 'your-near-intents-api-key',
25
+ })
26
+
27
+ // Add the payment button
28
+ <UniportButton
29
+ recipient="0x..." // Your Sui wallet address
30
+ onSuccess={(result) => console.log('Paid!', result.txHash)}
31
+ />
32
+ ```
33
+
34
+ That's it! Users can now pay you from 21+ blockchains. The token received is USDC on Sui by default.
35
+
36
+ ## UniportButton Props
37
+
38
+ | Prop | Type | Required | Default | Description |
39
+ |------|------|----------|---------|-------------|
40
+ | `recipient` | `string` | ✅ | - | Recipient wallet address |
41
+ | `destinationToken` | - | ❌ | `'suiUSDC'` | Token to receive on Sui |
42
+ | `amount` | `string` | ❌ | - | Fixed amount (user selects if omitted) |
43
+ | `refundAddress` | `string` | ❌ | - | Refund address if payment fails* |
44
+ | `label` | `string` | ❌ | `'Pay with Crypto'` | Button text |
45
+ | `variant` | `'default' \| 'compact' \| 'outline'` | ❌ | `'default'` | Button style |
46
+ | `disabled` | `boolean` | ❌ | `false` | Disable the button |
47
+ | `className` | `string` | ❌ | - | Custom CSS class |
48
+ | `onSuccess` | `(result) => void` | ❌ | - | Called when payment completes |
49
+ | `onError` | `(error) => void` | ❌ | - | Called when payment fails |
50
+ | `onOpenChange` | `(open) => void` | ❌ | - | Called when modal opens/closes |
51
+
52
+ > *Note: In a future version, refund address input will be added directly in the modal UI, removing the need to pass it as a prop.
53
+
54
+ ### Button Variants
55
+
56
+ - **`default`** - Gradient purple button with shadow (recommended)
57
+ - **`compact`** - Smaller version for tight spaces
58
+ - **`outline`** - Transparent with purple border
59
+
60
+ ## Supported Chains & Tokens
61
+
62
+ | Chain | Tokens |
63
+ |-------|--------|
64
+ | **Sui** (destination) | SUI, USDC |
65
+ | **Ethereum** | ETH, USDC, USDT, WBTC, DAI, AAVE, UNI, LINK, SHIB, PEPE, TURBO, SAFE |
66
+ | **Solana** | SOL, USDC, USDT, TRUMP, WIF, MELANIA |
67
+ | **Bitcoin** | BTC |
68
+ | **Optimism** | ETH, USDC, USDT, OP |
69
+ | **Base** | ETH, USDC, cbBTC, BRETT |
70
+ | **Polygon** | POL, USDC, USDT |
71
+ | **Arbitrum** | ETH, USDC, USDT, ARB, GMX |
72
+ | **Avalanche** | AVAX, USDC, USDT |
73
+ | **BSC** | BNB, USDC, USDT |
74
+ | **TON** | TON, USDT |
75
+ | **Tron** | TRX, USDT |
76
+ | **NEAR** | wNEAR, USDC, USDT |
77
+ | **Cardano** | ADA |
78
+ | **XRP Ledger** | XRP |
79
+ | **Dogecoin** | DOGE |
80
+ | **Litecoin** | LTC |
81
+ | **Bitcoin Cash** | BCH |
82
+ | **Aptos** | APT |
83
+ | **Starknet** | STRK |
84
+ | **Berachain** | BERA |
85
+ | **Zcash** | ZEC |
86
+
87
+ ## Features
88
+
89
+ - 🌐 Accept payments from 21+ blockchains
90
+ - ⚡ Sub-minute settlement via NEAR Intents
91
+ - 💎 Premium glassmorphism UI
92
+ - 📱 Mobile-responsive modal
93
+ - 🔧 Zero wallet connection required from payers
94
+
95
+ ## Advanced Usage
96
+
97
+ For custom implementations, the SDK also exports `UniportModal`, `useUniportPayment` hook, and core functions like `getQuote` and `getExecutionStatus`. See the source code for details.
98
+
99
+ ## License
100
+
101
+ MIT