synor/sdk/shared/schemas/bridge.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

209 lines
6.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://synor.io/schemas/bridge.json",
"title": "Synor Bridge SDK",
"description": "Cross-chain asset transfers and bridging operations",
"$defs": {
"BridgeConfig": {
"type": "object",
"allOf": [{ "$ref": "common.json#/$defs/SynorConfig" }]
},
"Asset": {
"type": "object",
"properties": {
"chain": { "$ref": "common.json#/$defs/ChainId" },
"address": { "type": "string" },
"symbol": { "type": "string" },
"decimals": { "type": "integer" },
"isNative": { "type": "boolean" },
"isWrapped": { "type": "boolean" }
},
"required": ["chain", "symbol", "decimals"]
},
"Chain": {
"type": "object",
"properties": {
"id": { "$ref": "common.json#/$defs/ChainId" },
"name": { "type": "string" },
"rpcUrl": { "type": "string", "format": "uri" },
"explorerUrl": { "type": "string", "format": "uri" },
"nativeCurrency": { "$ref": "#/$defs/Asset" },
"confirmationsRequired": { "type": "integer" }
},
"required": ["id", "name"]
},
"TransferStatus": {
"type": "string",
"enum": ["pending", "locked", "minting", "minted", "burning", "unlocking", "completed", "failed", "refunded"]
},
"Transfer": {
"type": "object",
"properties": {
"id": { "type": "string" },
"status": { "$ref": "#/$defs/TransferStatus" },
"sourceChain": { "$ref": "common.json#/$defs/ChainId" },
"targetChain": { "$ref": "common.json#/$defs/ChainId" },
"sourceAddress": { "type": "string" },
"targetAddress": { "type": "string" },
"asset": { "$ref": "#/$defs/Asset" },
"amount": { "$ref": "common.json#/$defs/Amount" },
"fee": { "$ref": "common.json#/$defs/Amount" },
"sourceTxHash": { "type": "string" },
"targetTxHash": { "type": "string" },
"createdAt": { "$ref": "common.json#/$defs/Timestamp" },
"completedAt": { "$ref": "common.json#/$defs/Timestamp" }
},
"required": ["id", "status", "sourceChain", "targetChain", "asset", "amount"]
},
"LockRequest": {
"type": "object",
"properties": {
"asset": { "$ref": "#/$defs/Asset" },
"amount": { "$ref": "common.json#/$defs/Amount" },
"targetChain": { "$ref": "common.json#/$defs/ChainId" },
"targetAddress": { "type": "string" }
},
"required": ["asset", "amount", "targetChain", "targetAddress"]
},
"LockReceipt": {
"type": "object",
"properties": {
"transferId": { "type": "string" },
"txHash": { "type": "string" },
"lockProof": { "$ref": "#/$defs/LockProof" },
"estimatedCompletion": { "$ref": "common.json#/$defs/Timestamp" }
},
"required": ["transferId", "txHash"]
},
"LockProof": {
"type": "object",
"properties": {
"blockHash": { "type": "string" },
"blockNumber": { "type": "integer" },
"txHash": { "type": "string" },
"logIndex": { "type": "integer" },
"proof": {
"type": "array",
"items": { "type": "string" }
},
"signatures": {
"type": "array",
"items": { "$ref": "common.json#/$defs/Signature" }
}
},
"required": ["blockHash", "blockNumber", "txHash", "proof"]
},
"MintRequest": {
"type": "object",
"properties": {
"proof": { "$ref": "#/$defs/LockProof" },
"targetAddress": { "type": "string" }
},
"required": ["proof", "targetAddress"]
},
"BurnRequest": {
"type": "object",
"properties": {
"wrappedAsset": { "$ref": "#/$defs/Asset" },
"amount": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["wrappedAsset", "amount"]
},
"BurnReceipt": {
"type": "object",
"properties": {
"transferId": { "type": "string" },
"txHash": { "type": "string" },
"burnProof": { "$ref": "#/$defs/BurnProof" }
},
"required": ["transferId", "txHash"]
},
"BurnProof": {
"type": "object",
"properties": {
"blockHash": { "type": "string" },
"blockNumber": { "type": "integer" },
"txHash": { "type": "string" },
"proof": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["blockHash", "txHash", "proof"]
},
"UnlockRequest": {
"type": "object",
"properties": {
"proof": { "$ref": "#/$defs/BurnProof" }
},
"required": ["proof"]
},
"TransferFilter": {
"type": "object",
"properties": {
"status": { "$ref": "#/$defs/TransferStatus" },
"sourceChain": { "$ref": "common.json#/$defs/ChainId" },
"targetChain": { "$ref": "common.json#/$defs/ChainId" },
"address": { "type": "string" }
},
"allOf": [{ "$ref": "common.json#/$defs/PaginationParams" }]
},
"ExchangeRate": {
"type": "object",
"properties": {
"from": { "$ref": "#/$defs/Asset" },
"to": { "$ref": "#/$defs/Asset" },
"rate": { "$ref": "common.json#/$defs/Amount" },
"fee": { "$ref": "common.json#/$defs/Amount" },
"minAmount": { "$ref": "common.json#/$defs/Amount" },
"maxAmount": { "$ref": "common.json#/$defs/Amount" },
"estimatedTime": { "$ref": "common.json#/$defs/Duration" }
},
"required": ["from", "to", "rate", "fee"]
},
"GetSupportedChainsResponse": {
"type": "object",
"properties": {
"chains": {
"type": "array",
"items": { "$ref": "#/$defs/Chain" }
}
},
"required": ["chains"]
},
"GetSupportedAssetsRequest": {
"type": "object",
"properties": {
"chain": { "$ref": "common.json#/$defs/ChainId" }
},
"required": ["chain"]
},
"GetExchangeRateRequest": {
"type": "object",
"properties": {
"from": { "$ref": "#/$defs/Asset" },
"to": { "$ref": "#/$defs/Asset" },
"amount": { "$ref": "common.json#/$defs/Amount" }
},
"required": ["from", "to"]
}
}
}