synor/sdk/shared/schemas/wallet.json
Gulshan Yadav 59a7123535 feat(sdk): implement Phase 1 SDKs for Wallet, RPC, and Storage
Implements comprehensive SDK support for three core services across
four programming languages (JavaScript/TypeScript, Python, Go, Rust).

## New SDKs

### Wallet SDK
- Key management (create, import, export)
- Transaction signing
- Message signing and verification
- Balance and UTXO queries
- Stealth address support

### RPC SDK
- Block and transaction queries
- Chain state information
- Fee estimation
- Mempool information
- WebSocket subscriptions for real-time updates

### Storage SDK
- Content upload and download
- Pinning operations
- CAR file support
- Directory management
- Gateway URL generation

## Shared Infrastructure

- JSON Schema definitions for all 11 services
- Common type definitions (Address, Amount, UTXO, etc.)
- Unified error handling patterns
- Builder patterns for configuration

## Package Updates

- JavaScript: Updated to @synor/sdk with module exports
- Python: Updated to synor-sdk with websockets dependency
- Go: Added gorilla/websocket dependency
- Rust: Added base64, urlencoding, multipart support

## Fixes

- Fixed Tensor Default trait implementation
- Fixed ProcessorType enum casing
2026-01-27 00:46:24 +05:30

208 lines
5.7 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://synor.io/schemas/wallet.json",
"title": "Synor Wallet SDK",
"description": "Wallet management, key operations, and transaction signing",
"$defs": {
"WalletConfig": {
"type": "object",
"allOf": [{ "$ref": "common.json#/$defs/SynorConfig" }],
"properties": {
"network": {
"type": "string",
"enum": ["mainnet", "testnet"],
"default": "mainnet"
},
"derivationPath": {
"type": "string",
"default": "m/44'/60'/0'/0"
}
}
},
"Wallet": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"address": { "$ref": "common.json#/$defs/Address" },
"publicKey": { "$ref": "common.json#/$defs/PublicKey" },
"createdAt": { "$ref": "common.json#/$defs/Timestamp" },
"type": {
"type": "string",
"enum": ["standard", "multisig", "stealth", "hardware"]
}
},
"required": ["id", "address", "publicKey", "type"]
},
"CreateWalletRequest": {
"type": "object",
"properties": {
"passphrase": { "type": "string", "minLength": 8 },
"type": {
"type": "string",
"enum": ["standard", "stealth"],
"default": "standard"
}
}
},
"CreateWalletResponse": {
"type": "object",
"properties": {
"wallet": { "$ref": "#/$defs/Wallet" },
"mnemonic": {
"type": "string",
"description": "BIP39 mnemonic phrase (24 words)"
}
},
"required": ["wallet", "mnemonic"]
},
"ImportWalletRequest": {
"type": "object",
"properties": {
"mnemonic": { "type": "string" },
"passphrase": { "type": "string" }
},
"required": ["mnemonic"]
},
"StealthAddress": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"viewKey": { "$ref": "common.json#/$defs/PublicKey" },
"spendKey": { "$ref": "common.json#/$defs/PublicKey" },
"ephemeralKey": { "$ref": "common.json#/$defs/PublicKey" }
},
"required": ["address", "viewKey", "spendKey"]
},
"TransactionInput": {
"type": "object",
"properties": {
"txid": { "$ref": "common.json#/$defs/TxHash" },
"vout": { "type": "integer", "minimum": 0 },
"amount": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["txid", "vout", "amount"]
},
"TransactionOutput": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"amount": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["address", "amount"]
},
"Transaction": {
"type": "object",
"properties": {
"version": { "type": "integer" },
"inputs": {
"type": "array",
"items": { "$ref": "#/$defs/TransactionInput" }
},
"outputs": {
"type": "array",
"items": { "$ref": "#/$defs/TransactionOutput" }
},
"lockTime": { "type": "integer" },
"fee": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["version", "inputs", "outputs"]
},
"SignedTransaction": {
"type": "object",
"properties": {
"raw": { "type": "string", "description": "Hex-encoded signed transaction" },
"txid": { "$ref": "common.json#/$defs/TxHash" },
"size": { "type": "integer" },
"weight": { "type": "integer" }
},
"required": ["raw", "txid"]
},
"SignMessageRequest": {
"type": "object",
"properties": {
"message": { "type": "string" },
"format": {
"type": "string",
"enum": ["text", "hex", "base64"],
"default": "text"
}
},
"required": ["message"]
},
"SignMessageResponse": {
"type": "object",
"properties": {
"signature": { "$ref": "common.json#/$defs/Signature" },
"publicKey": { "$ref": "common.json#/$defs/PublicKey" },
"address": { "$ref": "common.json#/$defs/Address" }
},
"required": ["signature", "publicKey", "address"]
},
"GetBalanceRequest": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"includeTokens": { "type": "boolean", "default": false }
},
"required": ["address"]
},
"TokenBalance": {
"type": "object",
"properties": {
"token": { "$ref": "common.json#/$defs/Address" },
"symbol": { "type": "string" },
"decimals": { "type": "integer" },
"balance": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["token", "balance"]
},
"GetBalanceResponse": {
"type": "object",
"properties": {
"native": { "$ref": "common.json#/$defs/Balance" },
"tokens": {
"type": "array",
"items": { "$ref": "#/$defs/TokenBalance" }
}
},
"required": ["native"]
},
"GetUtxosRequest": {
"type": "object",
"properties": {
"address": { "$ref": "common.json#/$defs/Address" },
"minConfirmations": { "type": "integer", "default": 1 },
"minAmount": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["address"]
},
"GetUtxosResponse": {
"type": "object",
"properties": {
"utxos": {
"type": "array",
"items": { "$ref": "common.json#/$defs/UTXO" }
},
"total": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["utxos", "total"]
}
}
}