-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathassets-api.yaml
More file actions
205 lines (199 loc) · 7 KB
/
assets-api.yaml
File metadata and controls
205 lines (199 loc) · 7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
openapi: 3.0.3
info:
title: OIF Solver Assets API
description: |
API endpoints for querying supported assets and networks configured in the OIF Solver.
These endpoints allow third-party services to discover which assets and networks
the solver supports for executing cross-chain intents.
version: 1.0.0
servers:
- url: http://localhost:3000/api/v1
description: Local development server
- url: https://api.solver.example.com/api/v1
description: Production server (replace with actual URL)
paths:
/assets:
get:
summary: Get all supported assets
description: |
Returns all supported assets across all configured networks.
This endpoint provides a comprehensive view of the solver's capabilities,
showing which assets can be used for intents on each supported blockchain.
operationId: getAllAssets
tags:
- Assets
responses:
"200":
description: Successful response with all supported assets
content:
application/json:
schema:
$ref: "#/components/schemas/AssetsResponse"
example:
networks:
"1":
chain_id: 1
name: "ethereum"
type: "parent"
input_settler: "0x1234567890abcdef1234567890abcdef12345678"
output_settler: "0xabcdef1234567890abcdef1234567890abcdef12"
assets:
- address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
symbol: "USDC"
name: "USD Coin"
decimals: 6
- address: "0xdac17f958d2ee523a2206206994597c13d831ec7"
symbol: "USDT"
name: "Tether USD"
decimals: 6
"42161":
chain_id: 42161
name: "arbitrum"
type: "new"
input_settler: "0x9876543210fedcba9876543210fedcba98765432"
output_settler: "0xfedcba9876543210fedcba9876543210fedcba98"
assets:
- address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831"
symbol: "USDC"
name: "USD Coin"
decimals: 6
- address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"
symbol: "USDT"
name: "Tether USD"
decimals: 6
/assets/{chain_id}:
get:
summary: Get assets for specific chain
description: |
Returns supported assets for a specific blockchain network.
Use this endpoint to check if the solver supports a particular chain
and which assets are available for intents on that chain.
operationId: getAssetsForChain
tags:
- Assets
parameters:
- name: chain_id
in: path
required: true
description: The blockchain network ID (e.g., 1 for Ethereum mainnet, 42161 for Arbitrum)
schema:
type: integer
format: int64
example: 1
responses:
"200":
description: Successful response with assets for the specified chain
content:
application/json:
schema:
$ref: "#/components/schemas/NetworkAssets"
example:
chain_id: 1
name: "ethereum"
type: "parent"
input_settler: "0x1234567890abcdef1234567890abcdef12345678"
output_settler: "0xabcdef1234567890abcdef1234567890abcdef12"
assets:
- address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
symbol: "USDC"
name: "USD Coin"
decimals: 6
- address: "0xdac17f958d2ee523a2206206994597c13d831ec7"
symbol: "USDT"
name: "Tether USD"
decimals: 6
"404":
description: Chain not supported by this solver
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "Chain ID 999 is not supported"
components:
schemas:
AssetsResponse:
type: object
description: Response containing all supported assets across all networks
required:
- networks
properties:
networks:
type: object
description: Map of chain ID (as string) to network asset information
additionalProperties:
$ref: "#/components/schemas/NetworkAssets"
NetworkAssets:
type: object
description: Asset information for a specific blockchain network
required:
- chain_id
- input_settler
- output_settler
- assets
properties:
chain_id:
type: integer
format: int64
description: The blockchain network ID
example: 1
name:
type: string
nullable: true
description: Optional human-readable network name
example: "ethereum"
type:
type: string
description: Network role classification
enum: ["parent", "hub", "new"]
example: "parent"
input_settler:
type: string
pattern: "^0x[a-fA-F0-9]{40}$"
description: Input settler contract address for this network
example: "0x1234567890abcdef1234567890abcdef12345678"
output_settler:
type: string
pattern: "^0x[a-fA-F0-9]{40}$"
description: Output settler contract address for this network
example: "0xabcdef1234567890abcdef1234567890abcdef12"
assets:
type: array
description: List of supported assets on this network
items:
$ref: "#/components/schemas/AssetInfo"
AssetInfo:
type: object
description: Information about a specific asset
required:
- address
- symbol
- decimals
properties:
address:
type: string
pattern: "^0x[a-fA-F0-9]{40}$"
description: Asset contract address
example: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
symbol:
type: string
description: Asset symbol (e.g., "USDC", "USDT", "WETH")
example: "USDC"
name:
type: string
nullable: true
description: Optional asset name (e.g., "USD Coin")
example: "USD Coin"
decimals:
type: integer
minimum: 0
maximum: 255
description: Number of decimal places for the asset
example: 6
tags:
- name: Assets
description: |
Endpoints for querying supported assets and networks.
Use these endpoints to discover solver supported network-asset routes.