@ultraos/wallet-sdk 0.0.12 → 0.0.13
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/package.json
CHANGED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# Ultra Wallet SDK
|
|
2
|
-
|
|
3
|
-
Ultra Wallet SDK provides an easy-to-use client for interacting with the Ultra blockchain wallet, either through the
|
|
4
|
-
browser extension or via a web fallback.
|
|
5
|
-
|
|
6
|
-
## ✨ Features
|
|
7
|
-
|
|
8
|
-
- Automatically detects and uses the Ultra Wallet Extension if available.
|
|
9
|
-
- Falls back to a Web Wallet if the extension is not installed.
|
|
10
|
-
- Connect, sign messages, sign transactions, and initiate purchases with a simple API.
|
|
11
|
-
- Environment support: `mainnet`, `testnet`, or custom wallet URLs.
|
|
12
|
-
|
|
13
|
-
## 📦 Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @ultraos/wallet-sdk
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
or
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
yarn add @ultraos/wallet-sdk
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## 🚀 Usage
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
import { UltraWalletSDK } from '@ultraos/wallet-sdk';
|
|
29
|
-
|
|
30
|
-
// Basic initialization (auto-detect extension or fallback to mainnet Web Wallet)
|
|
31
|
-
const ultra = new UltraWalletSDK();
|
|
32
|
-
|
|
33
|
-
// Optionally initialize with environment configuration
|
|
34
|
-
const ultraTestnet = new UltraWalletSDK({ environment: 'testnet' });
|
|
35
|
-
|
|
36
|
-
// Connect
|
|
37
|
-
await ultra.connect();
|
|
38
|
-
|
|
39
|
-
// Sign a message
|
|
40
|
-
const signature = await ultra.signMessage('message: Hello, Ultra!');
|
|
41
|
-
|
|
42
|
-
// Sign a transaction
|
|
43
|
-
await ultra.signTransaction({
|
|
44
|
-
contract: 'eosio.token',
|
|
45
|
-
action: 'transfer',
|
|
46
|
-
data: { from: 'user', to: 'receiver', quantity: '1.00000000 UOS', memo: '' },
|
|
47
|
-
authorizations: ['user@active'],
|
|
48
|
-
});
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## ⚙️ Configuration
|
|
52
|
-
|
|
53
|
-
You can pass options during initialization:
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
new UltraWalletSDK({
|
|
57
|
-
environment: 'testnet', // or 'mainnet', or provide custom URL
|
|
58
|
-
});
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## 📚 API
|
|
62
|
-
|
|
63
|
-
### Methods
|
|
64
|
-
|
|
65
|
-
- `connect(): Promise<ConnectResult>`
|
|
66
|
-
- `disconnect(): Promise<void>`
|
|
67
|
-
- `signMessage(message: string): Promise<string>`
|
|
68
|
-
- `signTransaction(transaction: BlockchainTransaction | BlockchainTransaction[]): Promise<SignTransactionResult>`
|
|
69
|
-
- `getChainId(): Promise<string>`
|
|
70
|
-
- `purchaseItem(itemType: PurchaseItemType, itemId: string): Promise<PurchaseItemResult>`
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
Tests are run with [Jest](https://jestjs.io).
|