Repository Public
1// SP Wallet Core2// File: Sources/SPWalletCore/Domains/NFT/NFTAPI.swift3// Description: Every route of the NFT domain (services/api/src/nft/routes.ts, transfer-routes.ts, market/routes.ts): capability4// matrix, inventory, item, events, collections, lookup / tracking, receive addresses, the media proxy, market READ5// data, the opt-in floor estimate, NFT transfers, the NFT destination allow-list and the Bitcoin outpoint lock list.6// The three passkey-approved objects are checked against the request, bound to the challenge, and only then approved.7// Nothing here requests a metadata or media URL: remote content only ever arrives through the server's proxy.8// There is no market write: the backend has none.9//10// Author: Simon-Pierre Boucher11// Contact: contact@spboucher.ai12import Foundation1314/** A prepared allow-list change: the intent bound to the verified challenge. Only `NFTAPI` builds it. */15public struct NFTAllowApproval: Sendable {16 public let approval: VerifiedApproval<NFTAllowIntent>17 public var intent: NFTAllowIntent { approval.object }18}1920/** A prepared lock-list change: the intent bound to the verified challenge. Only `NFTAPI` builds it. */21public struct UTXOLockApproval: Sendable {22 public let approval: VerifiedApproval<UTXOLockIntent>23 public var intent: UTXOLockIntent { approval.object }24}2526public struct NFTAPI: Sendable {27 let client: APIClient28 public init(_ client: APIClient) { self.client = client }2930 private struct Items<T: Decodable & Sendable>: Decodable, Sendable { let items: [T] }31 private struct KeyBody: Encodable, Sendable { let key: String }3233 // MARK: capability matrix, inventory, item3435 /** The real matrix: every network of the registry, what can be read / prepared for it and why not. Read it instead of assuming. */36 public func capabilities() async throws -> NFTCapabilities { try await client.get("/nfts/capabilities") }3738 /** The inventory as stored now (the server refreshes stale chains in the background). */39 public func list(_ q: NFTListQuery = NFTListQuery()) async throws -> NFTList {40 try await client.get("/nfts", query: [41 "chain": q.chain, "collection": q.collection, "status": q.status?.rawValue, "q": q.search, "sort": q.sort?.rawValue, "spam": q.spam?.rawValue,42 "cursor": q.cursor.map(String.init), "limit": q.limit.map(String.init),43 ])44 }4546 /** Start (or join) a synchronisation of one chain, or of every chain that has a provider and an address. Rate-limited (6 / minute). */47 public func sync(chain: String? = nil) async throws -> NFTSyncStarted {48 struct Body: Encodable, Sendable { let chain: String? }49 return try await client.post("/nfts/sync", body: Body(chain: chain))50 }5152 /** One asset of the inventory with its transfer verdict; the ownership is re-read on-chain when older than a minute. 404 `nft_not_found` otherwise. */53 public func item(key: String) async throws -> NFTAsset { try await client.get("/nfts/item", query: ["key": key]) }5455 /** On-chain events of one asset. `loadOlder` continues the chain scan where it stopped (`canLoadOlder`). */56 public func activity(key: String, cursor: String? = nil, limit: Int? = nil, type: NFTEventType? = nil, loadOlder: Bool = false) async throws -> NFTActivity {57 try await client.get("/nfts/activity", query: ["key": key, "cursor": cursor, "limit": limit.map(String.init), "type": type?.rawValue, "more": loadOlder ? "1" : nil])58 }5960 /** The collections the wallet holds items of, with the count held. */61 public func collections() async throws -> [NFTCollectionCount] {62 let r: Items<NFTCollectionCount> = try await client.get("/nfts/collections")63 return r.items64 }6566 /** What the chain (and the collection's own metadata) says about one collection. */67 public func collection(key: String) async throws -> NFTCollectionDetail { try await client.get("/nfts/collection", query: ["key": key]) }6869 /** Explicit lookup of ANY asset by its chain identifier (the owner typed it). Stored as `lookup`: never part of the inventory. Rate-limited (20 / minute). */70 public func lookup(_ ref: NFTReference) async throws -> NFTAsset { try await client.post("/nfts/lookup", body: ref) }7172 /** Re-read what the CREATOR declares (and the stored market snapshot). Ownership and identity stay what the chain says. One refresh a minute per asset (429 `nft_provider_rate_limited`). */73 public func refreshMetadata(key: String) async throws -> NFTAsset { try await client.post("/nfts/refresh-metadata", body: KeyBody(key: key)) }7475 /** Track an asset by hand (verified on-chain before it is tracked) — the way an EVM NFT enters the inventory without an indexer. */76 public func track(_ ref: NFTReference) async throws -> NFTAsset { try await client.post("/nfts/manual", body: ref) }7778 public func untrack(key: String) async throws -> NFTUntracked { try await client.send(.delete, "/nfts/manual", query: ["key": key]) }7980 /** Where an NFT can be received, with the warnings that apply on each network. */81 public func receiveAddresses() async throws -> [NFTReceiveAddress] {82 let r: Items<NFTReceiveAddress> = try await client.get("/nfts/receive")83 return r.items84 }8586 // MARK: media proxy8788 private static func mediaPath(_ id: String) throws -> String {89 guard id.range(of: "^m[0-9a-f]{40}$", options: .regularExpression) != nil else { throw APIError(status: 0, code: "bad_media_id", message: "not a media id of the NFT proxy") }90 return "/nfts/media/\(id)"91 }9293 /** What a media file IS (decided by the server from its bytes), without downloading it. A refusal is an answer here (`status` ≠ `available`), not an error. */94 public func mediaInfo(id: String) async throws -> NFTMediaInfo { try await client.get(try Self.mediaPath(id), query: ["info": "1"]) }9596 /**97 The bytes of one media file through the server's proxy — the ONLY way remote NFT content reaches the client. The id is the98 opaque one of `NFTMedia.id` / `NFTSummary.image.id`; no URL is ever accepted.99100 Server limits: the file is fetched once by the server (at most `capabilities().mediaMaxBytes`, 25 MiB by default, hard ceiling101 200 MiB), its type is decided from its bytes and must be one of `NFTMediaContent.servedTypes`; a file announced as one kind102 whose bytes are another is refused. Refusals are `APIError`s: 403 `media_blocked`, 413 `media_blocked` (too large),103 502 / 503 `media_unreachable`, 404 `not_found`; `data.code` carries the reason. The route allows 240 requests a minute.104105 The proxy's `run=1` mode (a Content-Security-Policy that lets an HTML animation run scripts inside a sandboxed iframe) is106 deliberately not offered: a native client has no header-enforced sandbox, so nothing from an NFT is ever executed. See107 `NFTMediaContent.isActiveContent`.108 - Parameter maxBytes: a local ceiling on what is accepted (defaults to the server's hard ceiling).109 */110 public func media(id: String, maxBytes: Int = 200 * 1024 * 1024) async throws -> NFTMediaContent {111 let (data, http) = try await client.raw(.get, try Self.mediaPath(id), headers: ["Accept": "image/*, video/*, audio/*, */*;q=0.1"])112 let contentType = http.value(forHTTPHeaderField: "Content-Type") ?? ""113 let mime = (contentType.split(separator: ";").first.map(String.init) ?? "").trimmingCharacters(in: .whitespaces).lowercased()114 guard let kind = NFTMediaContent.servedTypes[mime] else { throw APIError(status: http.statusCode, code: "media_unexpected_type", message: "the media proxy answered a type outside its allow-list") }115 guard data.count <= maxBytes else { throw APIError(status: http.statusCode, code: "media_too_large", message: "the media file is larger than accepted") }116 return NFTMediaContent(data: data, contentType: contentType, mime: mime, kind: kind)117 }118119 // MARK: market READ (no write exists)120121 /** Every market provider slot of the server, the market actions (all unavailable, with their reason) and the notice about external sites. */122 public func marketProviders() async throws -> NFTMarketProviders { try await client.get("/nfts/market/providers") }123124 /** The market snapshot of one asset: one row per source, with its source and date. `refresh` bypasses the server's cache. */125 public func market(key: String, refresh: Bool = false) async throws -> NFTMarketAnswer {126 try await client.get("/nfts/market", query: ["key": key, "refresh": refresh ? "1" : nil])127 }128129 public func marketListings(key: String, provider: String? = nil, cursor: String? = nil) async throws -> NFTMarketOrders<NFTMarketListing> {130 try await client.get("/nfts/market/listings", query: ["key": key, "provider": provider, "cursor": cursor])131 }132133 public func marketOffers(key: String, provider: String? = nil, cursor: String? = nil) async throws -> NFTMarketOrders<NFTMarketOffer> {134 try await client.get("/nfts/market/offers", query: ["key": key, "provider": provider, "cursor": cursor])135 }136137 /** Market events of one asset, one page per source. A cursor is only accepted together with its `provider` (400 `bad_request` otherwise). */138 public func marketActivity(key: String, _ q: NFTMarketEventQuery = NFTMarketEventQuery()) async throws -> NFTMarketEvents {139 try await client.get("/nfts/market/activity", query: [140 "key": key, "provider": q.provider, "cursor": q.cursor, "type": q.types.flatMap { $0.isEmpty ? nil : $0.map(\.rawValue).joined(separator: ",") },141 "after": q.after.map(ISO8601.string), "before": q.before.map(ISO8601.string), "limit": q.limit.map(String.init),142 ])143 }144145 /** What each source says about a collection (by collection key). */146 public func marketCollection(key: String) async throws -> NFTCollectionMarketAnswer { try await client.get("/nfts/market/collection", query: ["key": key]) }147148 /** Trait frequency of ONE item, only from sources that give collection-level counts with a stated item total. */149 public func traitFrequency(key: String) async throws -> NFTTraitAnswer { try await client.get("/nfts/market/traits", query: ["key": key]) }150151 /** The opt-in indicative floor-based estimate (default off). Not a valuation; never part of the wallet's total. */152 public func floorEstimate() async throws -> NFTFloorEstimate { try await client.get("/nfts/valuation") }153154 public func setFloorEstimate(enabled: Bool) async throws -> NFTFloorEstimateSetting {155 try await client.post("/nfts/valuation", body: NFTFloorEstimateSetting(enabled: enabled))156 }157158 // MARK: transfers159160 /** The per-asset verdict, what the signer says about NFT transfers right now, and whether this server relays. A display, not an authorization. */161 public func transferVerdict(key: String) async throws -> NFTTransferVerdictAnswer { try await client.get("/nfts/transfer/verdict", query: ["key": key]) }162163 /**164 Prepare ONE NFT transfer: the server re-reads the chain on every endpoint, builds the intent, simulates it and issues the165 passkey challenge. Then, locally: the intent is parsed strictly, compared with the request (network, contract / mint, token id,166 standard, quantity, destination), with the review and with the proposal, and the challenge must be exactly the hash of the167 intent. Any difference throws and nothing can be approved.168 Repeating the call with the same key answers the same proposal and challenge (`replayed`). A refusal of the server is an169 `APIError` with a stable code `nft_transfer_<reason>` and the facts in `data`.170 */171 public func prepareTransfer(_ r: NFTTransferRequest, idempotencyKey: String, now: Date = Date()) async throws -> NFTTransferApproval {172 struct Body: Encodable, Sendable { let key: String; let to: String; let quantity: String }173 struct Answer: Decodable, Sendable { let proposal: NFTTransfer; let intent: NFTIntent; let review: NFTReview?; let options: PasskeyRequestOptions?; let replayed: Bool? }174 try Self.validate(r)175 let a: Answer = try await client.post("/nfts/transfer/prepare", body: Body(key: r.key, to: r.to, quantity: r.quantity), idempotencyKey: idempotencyKey)176 try Self.check(intent: a.intent, against: r, now: now)177 if let review = a.review { try Self.check(intent: a.intent, against: review, key: r.key) }178 if let stored = a.proposal.review, let review = a.review, stored != review { throw ApprovalError.inconsistent("review") }179 try Self.check(intent: a.intent, against: a.proposal.proposal)180 // a replayed proposal that can no longer be approved (expired, already approved) carries no challenge181 guard let options = a.options else { throw ApprovalError.expired }182 return NFTTransferApproval(transfer: a.proposal, review: a.review ?? a.proposal.review,183 approval: try ApprovalBinding.verify(a.intent, options: options, rpId: client.configuration.rpId), replayed: a.replayed ?? false)184 }185186 /** What can be refused before any request: an unreadable key, a standard of the other family, a quantity that is not the standard's. */187 static func validate(_ r: NFTTransferRequest) throws {188 guard let k = NFTKey(r.key) else { throw ApprovalError.inconsistent("asset key") }189 switch k.family {190 case "evm": guard r.standard.isEVM, k.evm != nil else { throw ApprovalError.inconsistent("standard") }191 case "sol": guard !r.standard.isEVM else { throw ApprovalError.inconsistent("standard") }192 default: throw ApprovalError.unsupported("NFT transfers are built for EVM networks and Solana only")193 }194 guard r.quantity.range(of: "^[1-9][0-9]{0,77}$", options: .regularExpression) != nil else { throw ApprovalError.inconsistent("quantity") }195 guard r.standard == .erc1155 || r.quantity == "1" else { throw ApprovalError.inconsistent("quantity") }196 }197198 /** The intent must be the transfer that was asked. Compared field by field, as exact strings (EVM addresses: same 20 bytes). */199 public static func check(intent i: NFTIntent, against r: NFTTransferRequest, now: Date) throws {200 guard let k = NFTKey(r.key) else { throw ApprovalError.inconsistent("asset key") }201 guard i.network == k.chainId else { throw ApprovalError.inconsistent("network") }202 guard i.standard == r.standard else { throw ApprovalError.inconsistent("standard") }203 switch k.family {204 case "evm":205 guard let e = k.evm, i.standard.isEVM, i.evm != nil, i.sol == nil else { throw ApprovalError.inconsistent("standard") }206 guard isEVMAddress(i.asset), i.asset.lowercased() == e.contract.lowercased() else { throw ApprovalError.inconsistent("contract") }207 guard i.tokenId == e.tokenId else { throw ApprovalError.inconsistent("token id") }208 guard i.program == i.asset else { throw ApprovalError.inconsistent("program") }209 case "sol":210 guard !i.standard.isEVM, i.sol != nil, i.evm == nil else { throw ApprovalError.inconsistent("standard") }211 guard i.asset == k.assetId else { throw ApprovalError.inconsistent("mint") }212 guard i.tokenId == nil else { throw ApprovalError.inconsistent("token id") }213 default: throw ApprovalError.unsupported("NFT transfers are built for EVM networks and Solana only")214 }215 guard i.quantity == r.quantity, i.standard == .erc1155 || i.quantity == "1" else { throw ApprovalError.inconsistent("quantity") }216 guard sameAddress(i.to, r.to) else { throw ApprovalError.inconsistent("destination") }217 guard !sameAddress(i.to, i.from) else { throw ApprovalError.inconsistent("destination is the source") }218 if let from = r.from { guard sameAddress(i.from, from) else { throw ApprovalError.inconsistent("source") } }219 guard i.expiry > now else { throw ApprovalError.expired }220 }221222 /** The review is what the owner reads: it must describe the intent, and name the call the standard implies. */223 public static func check(intent i: NFTIntent, against v: NFTReview, key: String) throws {224 guard v.key == key else { throw ApprovalError.inconsistent("review: asset key") }225 guard v.network == i.network else { throw ApprovalError.inconsistent("review: network") }226 guard v.standard.rawValue == i.standard.rawValue, v.method == i.standard.method else { throw ApprovalError.inconsistent("review: standard") }227 guard v.asset == i.asset, v.tokenId == i.tokenId else { throw ApprovalError.inconsistent("review: asset") }228 guard v.quantity == i.quantity else { throw ApprovalError.inconsistent("review: quantity") }229 guard v.program == i.program else { throw ApprovalError.inconsistent("review: program") }230 guard v.from == i.from, v.to == i.to else { throw ApprovalError.inconsistent("review: addresses") }231 guard v.fee.max == i.maxFee else { throw ApprovalError.inconsistent("review: fee ceiling") }232 }233234 /** The proposal must be the row of this intent. */235 public static func check(intent i: NFTIntent, against p: Proposal) throws {236 guard p.id == i.proposalId else { throw ApprovalError.inconsistent("proposal id") }237 guard p.kind == "nft" else { throw ApprovalError.inconsistent("proposal kind") }238 guard p.network == i.network else { throw ApprovalError.inconsistent("proposal: network") }239 guard p.asset == i.asset, p.amount == i.quantity else { throw ApprovalError.inconsistent("proposal: asset") }240 if let to = p.to { guard to == i.to else { throw ApprovalError.inconsistent("proposal: destination") } }241 if let from = p.from { guard from == i.from else { throw ApprovalError.inconsistent("proposal: source") } }242 if let maxFee = p.maxFee { guard maxFee == i.maxFee else { throw ApprovalError.inconsistent("proposal: fee ceiling") } }243 if let hash = p.intentHash {244 let digest = try i.approvalDigest().hex245 guard hash.lowercased() == digest || hash.lowercased() == "0x" + digest else { throw ApprovalError.challengeMismatch }246 }247 }248249 static func isEVMAddress(_ s: String) -> Bool { s.range(of: "^0x[0-9a-fA-F]{40}$", options: .regularExpression) != nil }250 /** Exact equality, except that two EVM addresses are equal when they are the same 20 bytes (the server answers the EIP-55 form). */251 static func sameAddress(_ a: String, _ b: String) -> Bool { isEVMAddress(a) && isEVMAddress(b) ? a.lowercased() == b.lowercased() : a == b }252253 /**254 Ask the passkey to sign the verified challenge and hand the assertion to the NFT approve route, which forwards it to the255 isolated signer's NFT route. The answer's state is `signed` → `broadcast` (or `not_broadcast` on a server that does not relay):256 follow `transfer(id:)` until the chain finalizes it. `PasskeyError.cancelled` leaves the proposal pending.257 */258 public func approveTransfer(_ a: NFTTransferApproval, with authenticator: PasskeyAuthenticator, now: Date = Date()) async throws -> NFTTransfer {259 guard a.intent.expiry > now else { throw ApprovalError.expired }260 let assertion = try await authenticator.assert(a.approval.options, rpId: client.configuration.rpId)261 return try await submitTransfer(a.approval, assertion: assertion)262 }263264 /** Second half of `approveTransfer`, separate so that a lost answer can be followed by `transfer(id:)` instead of a second signature. */265 public func submitTransfer(_ approval: VerifiedApproval<NFTIntent>, assertion: PasskeyAssertion) async throws -> NFTTransfer {266 struct Body: Encodable, Sendable { let assertion: PasskeyAssertion }267 return try await client.post("/nfts/transfer/\(APIClient.segment(approval.object.proposalId))/approve", body: Body(assertion: assertion))268 }269270 /** State, review and execution of one NFT transfer (404 for a proposal of another kind). */271 public func transfer(id: String) async throws -> NFTTransfer { try await client.get("/nfts/transfer/\(APIClient.segment(id))") }272273 /** The NFT transfers, newest first; optionally those of one asset. */274 public func transfers(key: String? = nil, limit: Int? = nil) async throws -> [NFTTransfer] {275 let r: Items<NFTTransfer> = try await client.get("/nfts/transfers", query: ["key": key, "limit": limit.map(String.init)])276 return r.items277 }278279 /** Reject a prepared NFT transfer: the backend has no NFT-specific route for it, the shared proposal route is used. */280 public func rejectTransfer(id: String) async throws -> Proposal { try await TransfersAPI(client).reject(id) }281282 // MARK: destination allow-list (signer state; passkey for every change)283284 public func allowList() async throws -> NFTAllowList { try await client.get("/nfts/allow") }285286 /** Prepare a change of the allow-list, then check the intent against the request and bind it to the challenge. */287 public func prepareAllowChange(_ r: NFTAllowRequest, now: Date = Date()) async throws -> NFTAllowApproval {288 struct Answer: Decodable, Sendable { let intent: NFTAllowIntent; let options: PasskeyRequestOptions }289 let a: Answer = try await client.post("/nfts/allow/prepare", body: r)290 try Self.check(intent: a.intent, against: r, now: now)291 return NFTAllowApproval(approval: try ApprovalBinding.verify(a.intent, options: a.options, rpId: client.configuration.rpId))292 }293294 public static func check(intent i: NFTAllowIntent, against r: NFTAllowRequest, now: Date) throws {295 guard i.network == r.network else { throw ApprovalError.inconsistent("network") }296 guard i.action == r.action else { throw ApprovalError.inconsistent("action") }297 guard sameAddress(i.address, r.address) else { throw ApprovalError.inconsistent("address") }298 guard i.expiry > now else { throw ApprovalError.expired }299 }300301 public func approveAllowChange(_ a: NFTAllowApproval, with authenticator: PasskeyAuthenticator, now: Date = Date()) async throws -> NFTAllowResult {302 guard a.intent.expiry > now else { throw ApprovalError.expired }303 let assertion = try await authenticator.assert(a.approval.options, rpId: client.configuration.rpId)304 return try await submitAllowChange(a.approval, assertion: assertion)305 }306307 /** The served intent goes back untouched with the assertion; the signer judges both. */308 public func submitAllowChange(_ approval: VerifiedApproval<NFTAllowIntent>, assertion: PasskeyAssertion) async throws -> NFTAllowResult {309 struct Body: Encodable, Sendable { let intent: JSONValue; let assertion: PasskeyAssertion }310 return try await client.post("/nfts/allow/approve", body: Body(intent: approval.object.served, assertion: assertion))311 }312313 // MARK: Bitcoin-style outpoint lock list (/api/v1/utxo-locks, routed with the NFT transfers)314315 /** The wallet's coins on one Bitcoin-style network, classified (signer locks, ord report or heuristic). */316 public func utxoLocks(network: String) async throws -> UTXOLocksView { try await client.get("/utxo-locks", query: ["network": network]) }317318 /** Prepare a change of the signer's lock list, then check the intent against the request and bind it to the challenge. */319 public func prepareUTXOLocks(_ r: UTXOLockRequest, now: Date = Date()) async throws -> UTXOLockApproval {320 struct Answer: Decodable, Sendable { let intent: UTXOLockIntent; let options: PasskeyRequestOptions; let hash: String? }321 let a: Answer = try await client.post("/utxo-locks/prepare", body: r)322 try Self.check(intent: a.intent, against: r, now: now)323 if let hash = a.hash { guard hash.lowercased() == (try a.intent.approvalDigest().hex) else { throw ApprovalError.challengeMismatch } }324 return UTXOLockApproval(approval: try ApprovalBinding.verify(a.intent, options: a.options, rpId: client.configuration.rpId))325 }326327 /** The intent must name exactly the requested outpoints (duplicates removed, order kept), action, reason and network. */328 public static func check(intent i: UTXOLockIntent, against r: UTXOLockRequest, now: Date) throws {329 guard i.network == r.network else { throw ApprovalError.inconsistent("network") }330 guard i.action == r.action else { throw ApprovalError.inconsistent("action") }331 guard i.reason == r.reason else { throw ApprovalError.inconsistent("reason") }332 var asked: [String] = []333 for o in r.outpoints {334 let p = o.split(separator: ":", omittingEmptySubsequences: false)335 guard p.count == 2, p[0].range(of: "^[0-9a-f]{64}$", options: .regularExpression) != nil, p[1].range(of: "^[0-9]{1,10}$", options: .regularExpression) != nil,336 let vout = Int(p[1]) else { throw ApprovalError.inconsistent("outpoints") }337 let key = "\(p[0]):\(vout)"338 if !asked.contains(key) { asked.append(key) }339 }340 guard i.outpoints.map(\.key) == asked else { throw ApprovalError.inconsistent("outpoints") }341 guard i.expiry > now else { throw ApprovalError.expired }342 }343344 public func approveUTXOLocks(_ a: UTXOLockApproval, with authenticator: PasskeyAuthenticator, now: Date = Date()) async throws -> UTXOLockResult {345 guard a.intent.expiry > now else { throw ApprovalError.expired }346 let assertion = try await authenticator.assert(a.approval.options, rpId: client.configuration.rpId)347 return try await submitUTXOLocks(a.approval, assertion: assertion)348 }349350 public func submitUTXOLocks(_ approval: VerifiedApproval<UTXOLockIntent>, assertion: PasskeyAssertion) async throws -> UTXOLockResult {351 struct Body: Encodable, Sendable { let intent: JSONValue; let assertion: PasskeyAssertion }352 return try await client.post("/utxo-locks/approve", body: Body(intent: approval.object.served, assertion: assertion))353 }354355 /**356 Declare a HEURISTICALLY flagged output an ordinary coin (or take that back). No passkey: it never lifts a signer lock or an357 ord report, it only tells the server's coin selection that the owner looked at this output.358 */359 public func reviewUTXO(network: String, outpoint: String, ordinary: Bool) async throws -> OKResponse {360 struct Body: Encodable, Sendable { let network: String; let outpoint: String; let ordinary: Bool }361 return try await client.post("/utxo-locks/review", body: Body(network: network, outpoint: outpoint, ordinary: ordinary))362 }363}364