rango-basic-sdk 0.0.1__py3-none-any.whl
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.
- rango_basic_sdk/__init__.py +8 -0
- rango_basic_sdk/client.py +2008 -0
- rango_basic_sdk/models.py +1853 -0
- rango_basic_sdk/py.typed +0 -0
- rango_basic_sdk-0.0.1.dist-info/METADATA +186 -0
- rango_basic_sdk-0.0.1.dist-info/RECORD +8 -0
- rango_basic_sdk-0.0.1.dist-info/WHEEL +4 -0
- rango_basic_sdk-0.0.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,1853 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, List, Optional, Union
|
|
4
|
+
|
|
5
|
+
from enum import Enum
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
from decimal import Decimal
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class _WireStrEnum(str, Enum):
|
|
12
|
+
"""String enums: ``str(member)``, ``f"{member}"``, and ``"x" + member`` use the wire value (like ``StrEnum``)."""
|
|
13
|
+
|
|
14
|
+
__str__ = str.__str__
|
|
15
|
+
__format__ = str.__format__
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BasicApiQuoteResponseRouteRestrictionType(_WireStrEnum):
|
|
19
|
+
INCLUSIVE = "INCLUSIVE"
|
|
20
|
+
EXCLUSIVE = "EXCLUSIVE"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class BasicApiReportTransactionRequestEventType(_WireStrEnum):
|
|
24
|
+
"""Type of the event that happened"""
|
|
25
|
+
|
|
26
|
+
FETCH_TX_FAILED = "FETCH_TX_FAILED"
|
|
27
|
+
USER_REJECT = "USER_REJECT"
|
|
28
|
+
USER_CANCEL = "USER_CANCEL"
|
|
29
|
+
CALL_WALLET_FAILED = "CALL_WALLET_FAILED"
|
|
30
|
+
SEND_TX_FAILED = "SEND_TX_FAILED"
|
|
31
|
+
CLIENT_UNEXPECTED_BEHAVIOUR = "CLIENT_UNEXPECTED_BEHAVIOUR"
|
|
32
|
+
TX_EXPIRED = "TX_EXPIRED"
|
|
33
|
+
INSUFFICIENT_APPROVE = "INSUFFICIENT_APPROVE"
|
|
34
|
+
USER_CANCELED_TX = "USER_CANCELED_TX"
|
|
35
|
+
CALL_OR_SEND_FAILED = "CALL_OR_SEND_FAILED"
|
|
36
|
+
TX_FAILED_IN_BLOCKCHAIN = "TX_FAILED_IN_BLOCKCHAIN"
|
|
37
|
+
WRONG_TX_HASH = "WRONG_TX_HASH"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class BasicApiStarkNetTransactionFeeDataAvailabilityMode(_WireStrEnum):
|
|
41
|
+
"""Fee data availability mode"""
|
|
42
|
+
|
|
43
|
+
L1 = "L1"
|
|
44
|
+
L2 = "L2"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class BasicApiSwapFeeExpenseType(_WireStrEnum):
|
|
48
|
+
FROM_SOURCE_WALLET = "FROM_SOURCE_WALLET"
|
|
49
|
+
DECREASE_FROM_OUTPUT = "DECREASE_FROM_OUTPUT"
|
|
50
|
+
FROM_DESTINATION_WALLET = "FROM_DESTINATION_WALLET"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class BasicApiSwapResponseResultType(_WireStrEnum):
|
|
54
|
+
"""Route state"""
|
|
55
|
+
|
|
56
|
+
OK = "OK"
|
|
57
|
+
HIGH_IMPACT = "HIGH_IMPACT"
|
|
58
|
+
INPUT_LIMIT_ISSUE = "INPUT_LIMIT_ISSUE"
|
|
59
|
+
NO_ROUTE = "NO_ROUTE"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class Blockchain(_WireStrEnum):
|
|
63
|
+
"""The blockchain which this token belongs to"""
|
|
64
|
+
|
|
65
|
+
BTC = "BTC"
|
|
66
|
+
ETH = "ETH"
|
|
67
|
+
MEGAETH = "MEGAETH"
|
|
68
|
+
BSC = "BSC"
|
|
69
|
+
SONIC = "SONIC"
|
|
70
|
+
SOLANA = "SOLANA"
|
|
71
|
+
BASE = "BASE"
|
|
72
|
+
SUI = "SUI"
|
|
73
|
+
LINEA = "LINEA"
|
|
74
|
+
ARBITRUM = "ARBITRUM"
|
|
75
|
+
OPTIMISM = "OPTIMISM"
|
|
76
|
+
AVAX_CCHAIN = "AVAX_CCHAIN"
|
|
77
|
+
TRON = "TRON"
|
|
78
|
+
TON = "TON"
|
|
79
|
+
POLYGON = "POLYGON"
|
|
80
|
+
ZKSYNC = "ZKSYNC"
|
|
81
|
+
FANTOM = "FANTOM"
|
|
82
|
+
DOGE = "DOGE"
|
|
83
|
+
TAIKO = "TAIKO"
|
|
84
|
+
ZORA = "ZORA"
|
|
85
|
+
MODE = "MODE"
|
|
86
|
+
BERACHAIN = "BERACHAIN"
|
|
87
|
+
STARKNET = "STARKNET"
|
|
88
|
+
POLYGONZK = "POLYGONZK"
|
|
89
|
+
SCROLL = "SCROLL"
|
|
90
|
+
BLAST = "BLAST"
|
|
91
|
+
COSMOS = "COSMOS"
|
|
92
|
+
OSMOSIS = "OSMOSIS"
|
|
93
|
+
NEUTRON = "NEUTRON"
|
|
94
|
+
NOBLE = "NOBLE"
|
|
95
|
+
DYDX = "DYDX"
|
|
96
|
+
CRONOS = "CRONOS"
|
|
97
|
+
BNB = "BNB"
|
|
98
|
+
AURORA = "AURORA"
|
|
99
|
+
MAYA = "MAYA"
|
|
100
|
+
THOR = "THOR"
|
|
101
|
+
BOBA = "BOBA"
|
|
102
|
+
MOONBEAM = "MOONBEAM"
|
|
103
|
+
MOONRIVER = "MOONRIVER"
|
|
104
|
+
OKC = "OKC"
|
|
105
|
+
BOBA_BNB = "BOBA_BNB"
|
|
106
|
+
BOBA_AVALANCHE = "BOBA_AVALANCHE"
|
|
107
|
+
LTC = "LTC"
|
|
108
|
+
BCH = "BCH"
|
|
109
|
+
HARMONY = "HARMONY"
|
|
110
|
+
EVMOS = "EVMOS"
|
|
111
|
+
HECO = "HECO"
|
|
112
|
+
METIS = "METIS"
|
|
113
|
+
SIF = "SIF"
|
|
114
|
+
BRISE = "BRISE"
|
|
115
|
+
STARGAZE = "STARGAZE"
|
|
116
|
+
FUSE = "FUSE"
|
|
117
|
+
CRYPTO_ORG = "CRYPTO_ORG"
|
|
118
|
+
CHIHUAHUA = "CHIHUAHUA"
|
|
119
|
+
BANDCHAIN = "BANDCHAIN"
|
|
120
|
+
COMDEX = "COMDEX"
|
|
121
|
+
REGEN = "REGEN"
|
|
122
|
+
IRIS = "IRIS"
|
|
123
|
+
EMONEY = "EMONEY"
|
|
124
|
+
GNOSIS = "GNOSIS"
|
|
125
|
+
JUNO = "JUNO"
|
|
126
|
+
AXELAR = "AXELAR"
|
|
127
|
+
STRIDE = "STRIDE"
|
|
128
|
+
KCC = "KCC"
|
|
129
|
+
MARS = "MARS"
|
|
130
|
+
TERRA = "TERRA"
|
|
131
|
+
TELOS = "TELOS"
|
|
132
|
+
BITSONG = "BITSONG"
|
|
133
|
+
AKASH = "AKASH"
|
|
134
|
+
KI = "KI"
|
|
135
|
+
PERSISTENCE = "PERSISTENCE"
|
|
136
|
+
MEDIBLOC = "MEDIBLOC"
|
|
137
|
+
KUJIRA = "KUJIRA"
|
|
138
|
+
SENTINEL = "SENTINEL"
|
|
139
|
+
INJECTIVE = "INJECTIVE"
|
|
140
|
+
SECRET = "SECRET"
|
|
141
|
+
KONSTELLATION = "KONSTELLATION"
|
|
142
|
+
STARNAME = "STARNAME"
|
|
143
|
+
BITCANNA = "BITCANNA"
|
|
144
|
+
UMEE = "UMEE"
|
|
145
|
+
DESMOS = "DESMOS"
|
|
146
|
+
LUMNETWORK = "LUMNETWORK"
|
|
147
|
+
TERRA_CLASSIC = "TERRA_CLASSIC"
|
|
148
|
+
CELO = "CELO"
|
|
149
|
+
DASH = "DASH"
|
|
150
|
+
SHIMMER = "SHIMMER"
|
|
151
|
+
XLAYER = "XLAYER"
|
|
152
|
+
IOTA = "IOTA"
|
|
153
|
+
UNICHAIN = "UNICHAIN"
|
|
154
|
+
SONEIUM = "SONEIUM"
|
|
155
|
+
KATANA = "KATANA"
|
|
156
|
+
MONAD = "MONAD"
|
|
157
|
+
PLASMA = "PLASMA"
|
|
158
|
+
HYPEREVM = "HYPEREVM"
|
|
159
|
+
NEAR = "NEAR"
|
|
160
|
+
CITREA = "CITREA"
|
|
161
|
+
POLKADOT = "POLKADOT"
|
|
162
|
+
ZETA_CHAIN = "ZETA_CHAIN"
|
|
163
|
+
XRPL = "XRPL"
|
|
164
|
+
STELLAR = "STELLAR"
|
|
165
|
+
GOERLI = "GOERLI"
|
|
166
|
+
GOERLI_ARBITRUM = "GOERLI_ARBITRUM"
|
|
167
|
+
GOERLI_OPTIMISM = "GOERLI_OPTIMISM"
|
|
168
|
+
SEPOLIA = "SEPOLIA"
|
|
169
|
+
SEPOLIA_ARBITRUM = "SEPOLIA_ARBITRUM"
|
|
170
|
+
SEPOLIA_OPTIMISM = "SEPOLIA_OPTIMISM"
|
|
171
|
+
HYPERLIQUID = "HYPERLIQUID"
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class CheckApprovalResponseTxStatus(_WireStrEnum):
|
|
175
|
+
"""status of given txId"""
|
|
176
|
+
|
|
177
|
+
RUNNING = "running"
|
|
178
|
+
FAILED = "failed"
|
|
179
|
+
SUCCESS = "success"
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class CosmosMessageSignType(_WireStrEnum):
|
|
183
|
+
"""
|
|
184
|
+
Sign type is important field to consider, you should use AMINO or DIRECT mode of
|
|
185
|
+
wallet depending on value of this field
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
AMINO = "AMINO"
|
|
189
|
+
DIRECT = "DIRECT"
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class GenericTransactionPrerequisiteType(_WireStrEnum):
|
|
193
|
+
"""Transaction Prerequisite type. e.g. StellarTrustLine"""
|
|
194
|
+
|
|
195
|
+
EVM_APPROVE = "EVM_APPROVE"
|
|
196
|
+
STELLAR_CHANGE_TRUSTLINE = "STELLAR_CHANGE_TRUSTLINE"
|
|
197
|
+
XRPL_CHANGE_TRUSTLINE = "XRPL_CHANGE_TRUSTLINE"
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class GenericTransactionType(_WireStrEnum):
|
|
201
|
+
"""Blockchain transaction type. e.g. EVM"""
|
|
202
|
+
|
|
203
|
+
EVM = "EVM"
|
|
204
|
+
TRANSFER = "TRANSFER"
|
|
205
|
+
COSMOS = "COSMOS"
|
|
206
|
+
SOLANA = "SOLANA"
|
|
207
|
+
ZK_ROLLUP = "ZK_ROLLUP"
|
|
208
|
+
TRON = "TRON"
|
|
209
|
+
TON = "TON"
|
|
210
|
+
STARKNET = "STARKNET"
|
|
211
|
+
SUI = "SUI"
|
|
212
|
+
NEAR = "NEAR"
|
|
213
|
+
STELLAR = "STELLAR"
|
|
214
|
+
XRPL = "XRPL"
|
|
215
|
+
HYPERLIQUID = "HYPERLIQUID"
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class ParamMessagingProtocolsItem(_WireStrEnum):
|
|
219
|
+
CBRIDGE = "CBRIDGE"
|
|
220
|
+
ANYCALL = "ANYCALL"
|
|
221
|
+
SATELLITE = "SATELLITE"
|
|
222
|
+
LAYER_ZERO = "LAYER_ZERO"
|
|
223
|
+
WORMHOLE = "WORMHOLE"
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class SolanaTransactionTxType(_WireStrEnum):
|
|
227
|
+
"""type of Solana transaction. available values are {LEGACY, VERSIONED}"""
|
|
228
|
+
|
|
229
|
+
LEGACY = "LEGACY"
|
|
230
|
+
VERSIONED = "VERSIONED"
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class StatusOutputType(_WireStrEnum):
|
|
234
|
+
REVERTED_TO_INPUT = "REVERTED_TO_INPUT"
|
|
235
|
+
MIDDLE_ASSET_IN_SRC = "MIDDLE_ASSET_IN_SRC"
|
|
236
|
+
MIDDLE_ASSET_IN_DEST = "MIDDLE_ASSET_IN_DEST"
|
|
237
|
+
DESIRED_OUTPUT = "DESIRED_OUTPUT"
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
class SwapperMetaDtoTypesItem(_WireStrEnum):
|
|
241
|
+
"""Swapper type"""
|
|
242
|
+
|
|
243
|
+
BRIDGE = "BRIDGE"
|
|
244
|
+
DEX = "DEX"
|
|
245
|
+
AGGREGATOR = "AGGREGATOR"
|
|
246
|
+
OFF_CHAIN = "OFF_CHAIN"
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class TransferTransactionMemoType(_WireStrEnum):
|
|
250
|
+
"""Specifies the type of memo that dApps should use for decoding."""
|
|
251
|
+
|
|
252
|
+
UTF8 = "UTF8"
|
|
253
|
+
HEX = "HEX"
|
|
254
|
+
SCRIPT = "SCRIPT"
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class AbstractBlockchainMetaInfo(BaseModel):
|
|
258
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
259
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
260
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
261
|
+
address_url: str = Field(alias="addressUrl")
|
|
262
|
+
info_type: str = Field(alias="infoType")
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class Amount(BaseModel):
|
|
266
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
267
|
+
"""
|
|
268
|
+
The amount of an asset, including value & decimals. The amount is machine-readable,
|
|
269
|
+
to make it human-readable it should be shifted by decimals.
|
|
270
|
+
"""
|
|
271
|
+
amount: int = Field(
|
|
272
|
+
alias="amount",
|
|
273
|
+
description="The machine-readable amount shifted by decimals",
|
|
274
|
+
examples=[1000000000000000000],
|
|
275
|
+
)
|
|
276
|
+
decimals: int = Field(
|
|
277
|
+
alias="decimals",
|
|
278
|
+
description="The decimals of the token in blockchain",
|
|
279
|
+
examples=[18],
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
class Asset(BaseModel):
|
|
284
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
285
|
+
"""An asset unique by triple of (blockchain, symbol, address)"""
|
|
286
|
+
blockchain: Blockchain = Field(
|
|
287
|
+
alias="blockchain",
|
|
288
|
+
description="The blockchain which this token belongs to",
|
|
289
|
+
examples=[Blockchain.BSC],
|
|
290
|
+
)
|
|
291
|
+
symbol: str = Field(
|
|
292
|
+
alias="symbol",
|
|
293
|
+
description="The display symbol, e.g. USDT, BTC, etc.",
|
|
294
|
+
examples=["USDC"],
|
|
295
|
+
)
|
|
296
|
+
address: Optional[str] = Field(
|
|
297
|
+
default=None,
|
|
298
|
+
alias="address",
|
|
299
|
+
description="Smart contract address of token, null for native tokens",
|
|
300
|
+
examples=["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"],
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class AssetWithTicker(BaseModel):
|
|
305
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
306
|
+
"""An asset with its ticker"""
|
|
307
|
+
blockchain: Blockchain = Field(
|
|
308
|
+
alias="blockchain", description="Blockchain of asset"
|
|
309
|
+
)
|
|
310
|
+
symbol: str = Field(
|
|
311
|
+
alias="symbol", description="Symbol of an asset", examples=["BUSD"]
|
|
312
|
+
)
|
|
313
|
+
address: Optional[str] = Field(
|
|
314
|
+
default=None,
|
|
315
|
+
alias="address",
|
|
316
|
+
description="Contract address of the asset, null for native tokens",
|
|
317
|
+
examples=["bc1"],
|
|
318
|
+
)
|
|
319
|
+
ticker: str = Field(
|
|
320
|
+
alias="ticker",
|
|
321
|
+
description=("""
|
|
322
|
+
The ticker of the asset which normally is a combination of symbol and
|
|
323
|
+
address, required by some javascript wallets
|
|
324
|
+
"""),
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
class BaseResponse(BaseModel):
|
|
329
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
330
|
+
error: Optional[str] = Field(default=None, alias="error")
|
|
331
|
+
error_code: Optional[int] = Field(default=None, alias="errorCode")
|
|
332
|
+
trace_id: Optional[int] = Field(default=None, alias="traceId")
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
class BasicApiEvmBridgeData(BaseModel):
|
|
336
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
337
|
+
"""EVM bridging data"""
|
|
338
|
+
src_chain_id: int = Field(alias="srcChainId")
|
|
339
|
+
src_tx_hash: Optional[str] = Field(default=None, alias="srcTxHash")
|
|
340
|
+
src_token: Optional[str] = Field(default=None, alias="srcToken")
|
|
341
|
+
src_token_amt: int = Field(alias="srcTokenAmt")
|
|
342
|
+
src_token_decimals: int = Field(alias="srcTokenDecimals")
|
|
343
|
+
src_token_price: Optional[Decimal] = Field(default=None, alias="srcTokenPrice")
|
|
344
|
+
dest_chain_id: int = Field(alias="destChainId")
|
|
345
|
+
dest_tx_hash: Optional[str] = Field(default=None, alias="destTxHash")
|
|
346
|
+
dest_token: Optional[str] = Field(default=None, alias="destToken")
|
|
347
|
+
dest_token_decimals: int = Field(alias="destTokenDecimals")
|
|
348
|
+
dest_token_amt: Optional[int] = Field(default=None, alias="destTokenAmt")
|
|
349
|
+
dest_token_price: Optional[Decimal] = Field(default=None, alias="destTokenPrice")
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
class BasicApiQuoteResponseRouteRestriction(BaseModel):
|
|
353
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
354
|
+
"""Amount restriction for a swapper"""
|
|
355
|
+
min: Optional[int] = Field(default=None, alias="min")
|
|
356
|
+
max: Optional[int] = Field(default=None, alias="max")
|
|
357
|
+
type_: BasicApiQuoteResponseRouteRestrictionType = Field(alias="type")
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
class BasicApiReportTransactionRequest(BaseModel):
|
|
361
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
362
|
+
"""Data of the event including its type and an extra metadata"""
|
|
363
|
+
request_id: str = Field(
|
|
364
|
+
alias="requestId",
|
|
365
|
+
description="RequestId from best route endpoint",
|
|
366
|
+
examples=["688b308e-a06b-4a4e-a837-220d458b8642"],
|
|
367
|
+
)
|
|
368
|
+
event_type: BasicApiReportTransactionRequestEventType = Field(
|
|
369
|
+
alias="eventType",
|
|
370
|
+
description="Type of the event that happened",
|
|
371
|
+
examples=[BasicApiReportTransactionRequestEventType.USER_REJECT],
|
|
372
|
+
)
|
|
373
|
+
data: Optional[Dict[str, str]] = Field(
|
|
374
|
+
default=None,
|
|
375
|
+
alias="data",
|
|
376
|
+
description=("""
|
|
377
|
+
A list of key-value for extra details. (String to String map). it is
|
|
378
|
+
deprecated
|
|
379
|
+
"""),
|
|
380
|
+
examples=[{"message": "user rejected the transaction"}],
|
|
381
|
+
)
|
|
382
|
+
reason: Optional[str] = Field(
|
|
383
|
+
default=None, alias="reason", description="Reason of problem in transaction"
|
|
384
|
+
)
|
|
385
|
+
tags: Optional[Dict[str, str]] = Field(
|
|
386
|
+
default=None, alias="tags", description="List of tags"
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
class BasicApiReportTransactionResponse(BaseModel):
|
|
391
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
392
|
+
"""Response of report-tx endpoint"""
|
|
393
|
+
error: Optional[str] = Field(
|
|
394
|
+
default=None, alias="error", description="Error occurred during operation"
|
|
395
|
+
)
|
|
396
|
+
error_code: Optional[int] = Field(
|
|
397
|
+
default=None,
|
|
398
|
+
alias="errorCode",
|
|
399
|
+
description="Error code show error type in rango",
|
|
400
|
+
)
|
|
401
|
+
trace_id: Optional[int] = Field(
|
|
402
|
+
default=None,
|
|
403
|
+
alias="traceId",
|
|
404
|
+
description="Trace id help Rango support to resolve the issue",
|
|
405
|
+
)
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
class BasicApiToken(BaseModel):
|
|
409
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
410
|
+
"""A token's metadata, which is unique by (blockchain, symbol, and address)"""
|
|
411
|
+
blockchain: Blockchain = Field(alias="blockchain")
|
|
412
|
+
symbol: str = Field(alias="symbol")
|
|
413
|
+
name: Optional[str] = Field(default=None, alias="name")
|
|
414
|
+
is_popular: bool = Field(alias="isPopular")
|
|
415
|
+
chain_id: Optional[str] = Field(default=None, alias="chainId")
|
|
416
|
+
address: Optional[str] = Field(default=None, alias="address")
|
|
417
|
+
decimals: int = Field(alias="decimals")
|
|
418
|
+
image: str = Field(alias="image")
|
|
419
|
+
blockchain_image: Optional[str] = Field(default=None, alias="blockchainImage")
|
|
420
|
+
usd_price: Optional[float] = Field(default=None, alias="usdPrice")
|
|
421
|
+
supported_swappers: List[str] = Field(
|
|
422
|
+
alias="supportedSwappers",
|
|
423
|
+
description="Supported swappers for this token",
|
|
424
|
+
examples=[["oneInch"]],
|
|
425
|
+
)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
class BlockchainNativeCurrency(BaseModel):
|
|
429
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
430
|
+
name: str = Field(alias="name")
|
|
431
|
+
symbol: str = Field(alias="symbol")
|
|
432
|
+
decimals: int = Field(alias="decimals")
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
class CheckApprovalResponse(BaseModel):
|
|
436
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
437
|
+
"""Check approve response body"""
|
|
438
|
+
is_approved: bool = Field(
|
|
439
|
+
alias="isApproved",
|
|
440
|
+
description="A flag indicating whether the approve tx was successful or not",
|
|
441
|
+
examples=[True],
|
|
442
|
+
)
|
|
443
|
+
tx_status: Optional[CheckApprovalResponseTxStatus] = Field(
|
|
444
|
+
default=None,
|
|
445
|
+
alias="txStatus",
|
|
446
|
+
description="status of given txId",
|
|
447
|
+
examples=["running, failed, success, null"],
|
|
448
|
+
)
|
|
449
|
+
current_approved_amount: Optional[Decimal] = Field(
|
|
450
|
+
default=None,
|
|
451
|
+
alias="currentApprovedAmount",
|
|
452
|
+
description="current approved amount",
|
|
453
|
+
examples=[Decimal("8.0")],
|
|
454
|
+
)
|
|
455
|
+
required_approved_amount: Optional[Decimal] = Field(
|
|
456
|
+
default=None,
|
|
457
|
+
alias="requiredApprovedAmount",
|
|
458
|
+
description="required approve amount",
|
|
459
|
+
examples=[Decimal("10.0")],
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
class Coin(BaseModel):
|
|
464
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
465
|
+
denom: str = Field(alias="denom")
|
|
466
|
+
amount: str = Field(alias="amount")
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
class CosmosChainBech32Config(BaseModel):
|
|
470
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
471
|
+
bech32_prefix_acc_addr: str = Field(alias="bech32PrefixAccAddr")
|
|
472
|
+
bech32_prefix_acc_pub: str = Field(alias="bech32PrefixAccPub")
|
|
473
|
+
bech32_prefix_val_addr: str = Field(alias="bech32PrefixValAddr")
|
|
474
|
+
bech32_prefix_val_pub: str = Field(alias="bech32PrefixValPub")
|
|
475
|
+
bech32_prefix_cons_addr: str = Field(alias="bech32PrefixConsAddr")
|
|
476
|
+
bech32_prefix_cons_pub: str = Field(alias="bech32PrefixConsPub")
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
class CosmosChainBip44(BaseModel):
|
|
480
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
481
|
+
coin_type: int = Field(alias="coinType")
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
class CosmosChainCurrency(BaseModel):
|
|
485
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
486
|
+
coin_denom: str = Field(alias="coinDenom")
|
|
487
|
+
coin_minimal_denom: str = Field(alias="coinMinimalDenom")
|
|
488
|
+
coin_decimals: int = Field(alias="coinDecimals")
|
|
489
|
+
coin_gecko_id: str = Field(alias="coinGeckoId")
|
|
490
|
+
coin_image_url: str = Field(alias="coinImageUrl")
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
class CosmosChainStakeCurrency(BaseModel):
|
|
494
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
495
|
+
coin_denom: str = Field(alias="coinDenom")
|
|
496
|
+
coin_minimal_denom: str = Field(alias="coinMinimalDenom")
|
|
497
|
+
coin_decimals: int = Field(alias="coinDecimals")
|
|
498
|
+
coin_gecko_id: str = Field(alias="coinGeckoId")
|
|
499
|
+
coin_image_url: str = Field(alias="coinImageUrl")
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
class CosmosGasPriceStep(BaseModel):
|
|
503
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
504
|
+
low: float = Field(alias="low")
|
|
505
|
+
average: float = Field(alias="average")
|
|
506
|
+
high: float = Field(alias="high")
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
class EvmApprovePrerequisite(BaseModel):
|
|
510
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
511
|
+
type_: GenericTransactionPrerequisiteType = Field(
|
|
512
|
+
alias="type", description="Transaction Prerequisite type. e.g. StellarTrustLine"
|
|
513
|
+
)
|
|
514
|
+
block_chain: Blockchain = Field(
|
|
515
|
+
alias="blockChain",
|
|
516
|
+
description="The blockchain that this approve prerequisite must be executed on",
|
|
517
|
+
)
|
|
518
|
+
wallet: Optional[str] = Field(
|
|
519
|
+
default=None,
|
|
520
|
+
alias="wallet",
|
|
521
|
+
description="User's wallet address that should approve allowance",
|
|
522
|
+
)
|
|
523
|
+
from_: Optional[str] = Field(
|
|
524
|
+
default=None,
|
|
525
|
+
alias="from",
|
|
526
|
+
description="Token contract address that should be approved",
|
|
527
|
+
)
|
|
528
|
+
spender: Optional[str] = Field(
|
|
529
|
+
default=None,
|
|
530
|
+
alias="spender",
|
|
531
|
+
description="Spender contract address that will use the allowance",
|
|
532
|
+
)
|
|
533
|
+
amount: Optional[int] = Field(
|
|
534
|
+
default=None,
|
|
535
|
+
alias="amount",
|
|
536
|
+
description="Minimum expected allowance in machine-readable units",
|
|
537
|
+
examples=[1000000000000000000],
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
class EvmNetworkFeeMeta(BaseModel):
|
|
542
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
543
|
+
type_: str = Field(alias="type")
|
|
544
|
+
gas_limit: Optional[int] = Field(default=None, alias="gasLimit")
|
|
545
|
+
gas_price: Optional[int] = Field(default=None, alias="gasPrice")
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
class ExplorerUrl(BaseModel):
|
|
549
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
550
|
+
"""
|
|
551
|
+
A transaction's url that can be displayed to advanced user to track the progress
|
|
552
|
+
"""
|
|
553
|
+
url: str = Field(
|
|
554
|
+
alias="url",
|
|
555
|
+
description="Url of the transaction in bscscan/harmony explorer/plygonscan/etc.",
|
|
556
|
+
examples=[
|
|
557
|
+
"https://etherscan.io/tx/0xa1a37ce2063c4764da27d990a22a0c89ed8ac585286a77aa02e1c1998203de19",
|
|
558
|
+
],
|
|
559
|
+
)
|
|
560
|
+
description: Optional[str] = Field(
|
|
561
|
+
default=None,
|
|
562
|
+
alias="description",
|
|
563
|
+
description=("""
|
|
564
|
+
A custom display name to help user distinguish the transactions from
|
|
565
|
+
eachother. Ex: `Inbound`, `Outbound`, `Bridge`, or null
|
|
566
|
+
"""),
|
|
567
|
+
examples=["Inbound"],
|
|
568
|
+
)
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class GenericTransactionPrerequisite(BaseModel):
|
|
572
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
573
|
+
"""Prerequisite of a transaction"""
|
|
574
|
+
type_: GenericTransactionPrerequisiteType = Field(
|
|
575
|
+
alias="type", description="Transaction Prerequisite type. e.g. StellarTrustLine"
|
|
576
|
+
)
|
|
577
|
+
block_chain: Blockchain = Field(
|
|
578
|
+
alias="blockChain",
|
|
579
|
+
description="The blockchain that this transaction prerequisite must be executed on",
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
class HyperliquidMetaInfo(BaseModel):
|
|
584
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
585
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
586
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
587
|
+
address_url: str = Field(alias="addressUrl")
|
|
588
|
+
info_type: str = Field(alias="infoType")
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
class MessagingProtocolModel(BaseModel):
|
|
592
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
593
|
+
id: str = Field(alias="id")
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
class Msg(BaseModel):
|
|
597
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
598
|
+
type_: str = Field(alias="type")
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
class PSBTInputToSign(BaseModel):
|
|
602
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
603
|
+
address: str = Field(alias="address")
|
|
604
|
+
signing_indexes: List[int] = Field(alias="signingIndexes")
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
class ProtoMsg(BaseModel):
|
|
608
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
609
|
+
type_url: str = Field(alias="type_url")
|
|
610
|
+
value: List[int] = Field(alias="value")
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
class SolanaInstructionKey(BaseModel):
|
|
614
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
615
|
+
pubkey: str = Field(alias="pubkey")
|
|
616
|
+
is_signer: bool = Field(alias="isSigner")
|
|
617
|
+
is_writable: bool = Field(alias="isWritable")
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
class SolanaMetaInfo(BaseModel):
|
|
621
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
622
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
623
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
624
|
+
address_url: str = Field(alias="addressUrl")
|
|
625
|
+
info_type: str = Field(alias="infoType")
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
class SolanaSignature(BaseModel):
|
|
629
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
630
|
+
"""List of signatures. fills only if message is already partially signed"""
|
|
631
|
+
public_key: str = Field(alias="publicKey")
|
|
632
|
+
signature: str = Field(alias="signature")
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
class StarkNetResourceBound(BaseModel):
|
|
636
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
637
|
+
"""Resource bound for a specific gas type"""
|
|
638
|
+
max_amount: str = Field(
|
|
639
|
+
alias="maxAmount", description="Maximum amount of the resource"
|
|
640
|
+
)
|
|
641
|
+
max_price_per_unit: str = Field(
|
|
642
|
+
alias="maxPricePerUnit", description="Maximum price per unit of the resource"
|
|
643
|
+
)
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
class StarknetCallData(BaseModel):
|
|
647
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
648
|
+
"""Single calldata to call a contract"""
|
|
649
|
+
contract_address: str = Field(
|
|
650
|
+
alias="contractAddress", description="Contract address to call"
|
|
651
|
+
)
|
|
652
|
+
entrypoint: str = Field(alias="entrypoint", description="Function name to call")
|
|
653
|
+
calldata: Optional[List[str]] = Field(
|
|
654
|
+
default=None, alias="calldata", description="Function inputs"
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
class StellarChangeTrustLinePrerequisite(BaseModel):
|
|
659
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
660
|
+
type_: GenericTransactionPrerequisiteType = Field(
|
|
661
|
+
alias="type", description="Transaction Prerequisite type. e.g. StellarTrustLine"
|
|
662
|
+
)
|
|
663
|
+
block_chain: Blockchain = Field(alias="blockChain")
|
|
664
|
+
code: Optional[str] = Field(
|
|
665
|
+
default=None, alias="code", description="Stellar Asset Code"
|
|
666
|
+
)
|
|
667
|
+
issuer: Optional[str] = Field(
|
|
668
|
+
default=None, alias="issuer", description="Stellar Asset Issuer"
|
|
669
|
+
)
|
|
670
|
+
value: Optional[Decimal] = Field(
|
|
671
|
+
default=None, alias="value", description="Minimum expected value of trustline"
|
|
672
|
+
)
|
|
673
|
+
wallet: Optional[str] = Field(
|
|
674
|
+
default=None, alias="wallet", description="User's wallet address"
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
class StellarMetaInfo(BaseModel):
|
|
679
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
680
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
681
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
682
|
+
address_url: str = Field(alias="addressUrl")
|
|
683
|
+
info_type: str = Field(alias="infoType")
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
class SuiMetaInfo(BaseModel):
|
|
687
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
688
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
689
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
690
|
+
address_url: str = Field(alias="addressUrl")
|
|
691
|
+
info_type: str = Field(alias="infoType")
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
class SwapFeeMeta(BaseModel):
|
|
695
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
696
|
+
"""Meta data of swap fee"""
|
|
697
|
+
type_: str = Field(alias="type")
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
class SwapperMetaDto(BaseModel):
|
|
701
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
702
|
+
"""Metadata of Swapper"""
|
|
703
|
+
id: str = Field(alias="id")
|
|
704
|
+
title: str = Field(alias="title")
|
|
705
|
+
logo: str = Field(alias="logo")
|
|
706
|
+
swapper_group: str = Field(alias="swapperGroup")
|
|
707
|
+
types: Optional[List[SwapperMetaDtoTypesItem]] = Field(default=None, alias="types")
|
|
708
|
+
enabled: bool = Field(alias="enabled")
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
class SwapperSupportedBlockchain(BaseModel):
|
|
712
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
713
|
+
"""Supported blockchains of Swapper"""
|
|
714
|
+
source: Blockchain = Field(alias="source")
|
|
715
|
+
destinations: List[Blockchain] = Field(alias="destinations")
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
class TokenBalanceResponse(BaseModel):
|
|
719
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
720
|
+
balance: Optional[int] = Field(
|
|
721
|
+
default=None, alias="balance", description="The balance of the asset"
|
|
722
|
+
)
|
|
723
|
+
price: Optional[float] = Field(
|
|
724
|
+
default=None, alias="price", description="The price unit of the asset"
|
|
725
|
+
)
|
|
726
|
+
error: Optional[str] = Field(
|
|
727
|
+
default=None, alias="error", description="Error occurred during operation"
|
|
728
|
+
)
|
|
729
|
+
error_code: Optional[int] = Field(
|
|
730
|
+
default=None,
|
|
731
|
+
alias="errorCode",
|
|
732
|
+
description="Error code show error type in rango",
|
|
733
|
+
)
|
|
734
|
+
trace_id: Optional[int] = Field(
|
|
735
|
+
default=None,
|
|
736
|
+
alias="traceId",
|
|
737
|
+
description="Trace id help Rango support to resolve the issue",
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
class TonMetaInfo(BaseModel):
|
|
742
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
743
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
744
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
745
|
+
address_url: str = Field(alias="addressUrl")
|
|
746
|
+
info_type: str = Field(alias="infoType")
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
class TonTransactionMessage(BaseModel):
|
|
750
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
751
|
+
"""TON message model"""
|
|
752
|
+
address: str = Field(alias="address", description="Receiver's address.")
|
|
753
|
+
amount: str = Field(alias="amount", description="Amount to send in nanoTon")
|
|
754
|
+
state_init: Optional[str] = Field(
|
|
755
|
+
default=None,
|
|
756
|
+
alias="stateInit",
|
|
757
|
+
description="Base64 encoded contract specific stateInit to add to the transaction.",
|
|
758
|
+
)
|
|
759
|
+
payload: Optional[str] = Field(
|
|
760
|
+
default=None,
|
|
761
|
+
alias="payload",
|
|
762
|
+
description="Base64 encoded contract specific payload to add to the transaction.",
|
|
763
|
+
)
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
class TransferMetaInfo(BaseModel):
|
|
767
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
768
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
769
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
770
|
+
address_url: str = Field(alias="addressUrl")
|
|
771
|
+
info_type: str = Field(alias="infoType")
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
class TronTransaction(BaseModel):
|
|
775
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
776
|
+
"""Payload of Trx Transaction"""
|
|
777
|
+
owner_address: str = Field(alias="owner_address")
|
|
778
|
+
type_: str = Field(alias="type")
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
class TrxContractWrapperParameterValue(BaseModel):
|
|
782
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
783
|
+
type_: str = Field(alias="type")
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
class XRPLMetaInfo(BaseModel):
|
|
787
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
788
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
789
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
790
|
+
address_url: str = Field(alias="addressUrl")
|
|
791
|
+
info_type: str = Field(alias="infoType")
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
class XrplChangeTrustLinePrerequisite(BaseModel):
|
|
795
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
796
|
+
type_: GenericTransactionPrerequisiteType = Field(
|
|
797
|
+
alias="type", description="Transaction Prerequisite type. e.g. StellarTrustLine"
|
|
798
|
+
)
|
|
799
|
+
block_chain: Blockchain = Field(alias="blockChain")
|
|
800
|
+
currency: Optional[str] = Field(
|
|
801
|
+
default=None, alias="currency", description="Xrpl Currency"
|
|
802
|
+
)
|
|
803
|
+
issuer: Optional[str] = Field(
|
|
804
|
+
default=None, alias="issuer", description="Xrpl Asset Issuer"
|
|
805
|
+
)
|
|
806
|
+
value: Optional[str] = Field(
|
|
807
|
+
default=None, alias="value", description="Minimum expected value of trust"
|
|
808
|
+
)
|
|
809
|
+
wallet: Optional[str] = Field(
|
|
810
|
+
default=None, alias="wallet", description="User's wallet address"
|
|
811
|
+
)
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
class AssetBalance(BaseModel):
|
|
815
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
816
|
+
"""Balance of Asset in specified wallet"""
|
|
817
|
+
asset: Asset = Field(
|
|
818
|
+
alias="asset",
|
|
819
|
+
description="An asset unique by triple of (blockchain, symbol, address)",
|
|
820
|
+
)
|
|
821
|
+
amount: Amount = Field(
|
|
822
|
+
alias="amount",
|
|
823
|
+
description=("""
|
|
824
|
+
The amount of an asset, including value & decimals. The amount is
|
|
825
|
+
machine-readable, to make it human-readable it should be shifted by
|
|
826
|
+
decimals.
|
|
827
|
+
"""),
|
|
828
|
+
)
|
|
829
|
+
price: Optional[float] = Field(
|
|
830
|
+
default=None, alias="price", description="The price unit of the asset"
|
|
831
|
+
)
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
class BasicApiBlockchainMetaSummary(BaseModel):
|
|
835
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
836
|
+
"""Blockchain metadata"""
|
|
837
|
+
name: str = Field(alias="name")
|
|
838
|
+
default_decimals: int = Field(
|
|
839
|
+
alias="defaultDecimals", description="Native token decimals"
|
|
840
|
+
)
|
|
841
|
+
address_patterns: List[str] = Field(
|
|
842
|
+
alias="addressPatterns", description="Wallet address patterns"
|
|
843
|
+
)
|
|
844
|
+
fee_assets: List[Asset] = Field(alias="feeAssets")
|
|
845
|
+
type_: Optional[GenericTransactionType] = Field(
|
|
846
|
+
default=None, alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
847
|
+
)
|
|
848
|
+
chain_id: Optional[str] = Field(default=None, alias="chainId")
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
class BasicApiQuotePath(BaseModel):
|
|
852
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
853
|
+
"""A single step form a multi step route"""
|
|
854
|
+
swapper: SwapperMetaDto = Field(alias="swapper", description="Metadata of Swapper")
|
|
855
|
+
swapper_type: SwapperMetaDtoTypesItem = Field(
|
|
856
|
+
alias="swapperType", description="Swapper type"
|
|
857
|
+
)
|
|
858
|
+
from_: BasicApiToken = Field(
|
|
859
|
+
alias="from",
|
|
860
|
+
description=("""
|
|
861
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
862
|
+
"""),
|
|
863
|
+
)
|
|
864
|
+
to: BasicApiToken = Field(
|
|
865
|
+
alias="to",
|
|
866
|
+
description=("""
|
|
867
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
868
|
+
"""),
|
|
869
|
+
)
|
|
870
|
+
input_amount: int = Field(alias="inputAmount", description="Swap inputAmount")
|
|
871
|
+
expected_output: int = Field(alias="expectedOutput", description="Swap output")
|
|
872
|
+
estimated_time_in_seconds: int = Field(
|
|
873
|
+
alias="estimatedTimeInSeconds", description="Swap estimated time"
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
class BasicApiSwapFee(BaseModel):
|
|
878
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
879
|
+
token: BasicApiToken = Field(
|
|
880
|
+
alias="token",
|
|
881
|
+
description=("""
|
|
882
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
883
|
+
"""),
|
|
884
|
+
)
|
|
885
|
+
expense_type: BasicApiSwapFeeExpenseType = Field(alias="expenseType")
|
|
886
|
+
amount: int = Field(alias="amount")
|
|
887
|
+
name: str = Field(alias="name")
|
|
888
|
+
meta: Optional[EvmNetworkFeeMeta] = Field(default=None, alias="meta")
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
class BasicCustomTokenResponse(BaseModel):
|
|
892
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
893
|
+
token: Optional[BasicApiToken] = Field(
|
|
894
|
+
default=None,
|
|
895
|
+
alias="token",
|
|
896
|
+
description=("""
|
|
897
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
898
|
+
"""),
|
|
899
|
+
)
|
|
900
|
+
error: Optional[str] = Field(
|
|
901
|
+
default=None, alias="error", description="Error occurred during operation"
|
|
902
|
+
)
|
|
903
|
+
error_code: Optional[int] = Field(
|
|
904
|
+
default=None,
|
|
905
|
+
alias="errorCode",
|
|
906
|
+
description="Error code show error type in rango",
|
|
907
|
+
)
|
|
908
|
+
trace_id: Optional[int] = Field(
|
|
909
|
+
default=None,
|
|
910
|
+
alias="traceId",
|
|
911
|
+
description="Trace id help Rango support to resolve the issue",
|
|
912
|
+
)
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
class CosmosMetaInfo(BaseModel):
|
|
916
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
917
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
918
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
919
|
+
address_url: str = Field(alias="addressUrl")
|
|
920
|
+
info_type: str = Field(alias="infoType")
|
|
921
|
+
experimental: Optional[bool] = Field(default=None, alias="experimental")
|
|
922
|
+
rpc: Optional[str] = Field(default=None, alias="rpc")
|
|
923
|
+
rest: Optional[str] = Field(default=None, alias="rest")
|
|
924
|
+
cosmostation_lcd_url: Optional[str] = Field(
|
|
925
|
+
default=None, alias="cosmostationLcdUrl"
|
|
926
|
+
)
|
|
927
|
+
cosmostation_api_url: Optional[str] = Field(
|
|
928
|
+
default=None, alias="cosmostationApiUrl"
|
|
929
|
+
)
|
|
930
|
+
cosmostation_denom_trace_path: Optional[str] = Field(
|
|
931
|
+
default=None, alias="cosmostationDenomTracePath"
|
|
932
|
+
)
|
|
933
|
+
mint_scan_name: Optional[str] = Field(default=None, alias="mintScanName")
|
|
934
|
+
chain_name: Optional[str] = Field(default=None, alias="chainName")
|
|
935
|
+
stake_currency: Optional[CosmosChainStakeCurrency] = Field(
|
|
936
|
+
default=None, alias="stakeCurrency"
|
|
937
|
+
)
|
|
938
|
+
bip44: Optional[CosmosChainBip44] = Field(default=None, alias="bip44")
|
|
939
|
+
bech32_config: Optional[CosmosChainBech32Config] = Field(
|
|
940
|
+
default=None, alias="bech32Config"
|
|
941
|
+
)
|
|
942
|
+
currencies: Optional[List[CosmosChainCurrency]] = Field(
|
|
943
|
+
default=None, alias="currencies"
|
|
944
|
+
)
|
|
945
|
+
fee_currencies: Optional[List[CosmosChainCurrency]] = Field(
|
|
946
|
+
default=None, alias="feeCurrencies"
|
|
947
|
+
)
|
|
948
|
+
features: Optional[List[str]] = Field(default=None, alias="features")
|
|
949
|
+
explorer_url_to_tx: Optional[str] = Field(default=None, alias="explorerUrlToTx")
|
|
950
|
+
gas_price_step: Optional[CosmosGasPriceStep] = Field(
|
|
951
|
+
default=None, alias="gasPriceStep"
|
|
952
|
+
)
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
class CosmosRawTransferData(BaseModel):
|
|
956
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
957
|
+
"""
|
|
958
|
+
An alternative to CosmosMessage object for the cosmos wallets that do not support
|
|
959
|
+
generic Cosmos messages
|
|
960
|
+
"""
|
|
961
|
+
method: str = Field(
|
|
962
|
+
alias="method", description="The method value", examples=["transfer"]
|
|
963
|
+
)
|
|
964
|
+
asset: AssetWithTicker = Field(
|
|
965
|
+
alias="asset", description="An asset with its ticker"
|
|
966
|
+
)
|
|
967
|
+
amount: int = Field(
|
|
968
|
+
alias="amount",
|
|
969
|
+
description="The machine-readable amount to transfer",
|
|
970
|
+
examples=[1000000000000000000],
|
|
971
|
+
)
|
|
972
|
+
decimals: int = Field(
|
|
973
|
+
alias="decimals", description="The decimals for this asset", examples=[18]
|
|
974
|
+
)
|
|
975
|
+
recipient: str = Field(
|
|
976
|
+
alias="recipient", description="The recipient address of transaction"
|
|
977
|
+
)
|
|
978
|
+
memo: Optional[str] = Field(
|
|
979
|
+
default=None, alias="memo", description="Memo of transaction, can be null"
|
|
980
|
+
)
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
class CosmosStdFee(BaseModel):
|
|
984
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
985
|
+
gas: str = Field(alias="gas")
|
|
986
|
+
amount: List[Coin] = Field(alias="amount")
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
class EvmMetaInfo(BaseModel):
|
|
990
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
991
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
992
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
993
|
+
address_url: str = Field(alias="addressUrl")
|
|
994
|
+
info_type: str = Field(alias="infoType")
|
|
995
|
+
chain_name: Optional[str] = Field(default=None, alias="chainName")
|
|
996
|
+
native_currency: Optional[BlockchainNativeCurrency] = Field(
|
|
997
|
+
default=None, alias="nativeCurrency"
|
|
998
|
+
)
|
|
999
|
+
rpc_urls: Optional[List[str]] = Field(default=None, alias="rpcUrls")
|
|
1000
|
+
enable_gas_v2: Optional[bool] = Field(default=None, alias="enableGasV2")
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
class GenericTransaction(BaseModel):
|
|
1004
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1005
|
+
"""Transaction's raw data"""
|
|
1006
|
+
type_: GenericTransactionType = Field(
|
|
1007
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1008
|
+
)
|
|
1009
|
+
prerequisites: List[
|
|
1010
|
+
Union[
|
|
1011
|
+
EvmApprovePrerequisite,
|
|
1012
|
+
StellarChangeTrustLinePrerequisite,
|
|
1013
|
+
XrplChangeTrustLinePrerequisite,
|
|
1014
|
+
]
|
|
1015
|
+
] = Field(alias="prerequisites")
|
|
1016
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
class MessagingProtocolsResponse(BaseModel):
|
|
1020
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1021
|
+
protocols: List[MessagingProtocolModel] = Field(alias="protocols")
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
class PSBT(BaseModel):
|
|
1025
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1026
|
+
"""Partially signed bitcoin transaction"""
|
|
1027
|
+
unsigned_psbt_base64: str = Field(alias="unsignedPsbtBase64")
|
|
1028
|
+
inputs_to_sign: Optional[List[PSBTInputToSign]] = Field(
|
|
1029
|
+
default=None, alias="inputsToSign"
|
|
1030
|
+
)
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
class RoutingAccessItem(BaseModel):
|
|
1034
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1035
|
+
blockchain: Blockchain = Field(alias="blockchain")
|
|
1036
|
+
assets: List[Asset] = Field(alias="assets")
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
class SolanaInstruction(BaseModel):
|
|
1040
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1041
|
+
"""List of instructions"""
|
|
1042
|
+
keys: List[SolanaInstructionKey] = Field(alias="keys")
|
|
1043
|
+
program_id: str = Field(alias="programId")
|
|
1044
|
+
data: str = Field(alias="data")
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
class StarkNetMetaInfo(BaseModel):
|
|
1048
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1049
|
+
block_explorer_urls: List[str] = Field(alias="blockExplorerUrls")
|
|
1050
|
+
transaction_url: str = Field(alias="transactionUrl")
|
|
1051
|
+
address_url: str = Field(alias="addressUrl")
|
|
1052
|
+
info_type: str = Field(alias="infoType")
|
|
1053
|
+
chain_name: Optional[str] = Field(default=None, alias="chainName")
|
|
1054
|
+
native_currency: Optional[BlockchainNativeCurrency] = Field(
|
|
1055
|
+
default=None, alias="nativeCurrency"
|
|
1056
|
+
)
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
class StarkNetResourceBounds(BaseModel):
|
|
1060
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1061
|
+
"""Resource bounds for different gas types"""
|
|
1062
|
+
l1_gas: StarkNetResourceBound = Field(
|
|
1063
|
+
alias="l1Gas", description="Resource bound for a specific gas type"
|
|
1064
|
+
)
|
|
1065
|
+
l2_gas: StarkNetResourceBound = Field(
|
|
1066
|
+
alias="l2Gas", description="Resource bound for a specific gas type"
|
|
1067
|
+
)
|
|
1068
|
+
l1_data_gas: StarkNetResourceBound = Field(
|
|
1069
|
+
alias="l1DataGas", description="Resource bound for a specific gas type"
|
|
1070
|
+
)
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
class StatusOutput(BaseModel):
|
|
1074
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1075
|
+
"""Transactions output"""
|
|
1076
|
+
amount: int = Field(alias="amount")
|
|
1077
|
+
received_token: BasicApiToken = Field(
|
|
1078
|
+
alias="receivedToken",
|
|
1079
|
+
description=("""
|
|
1080
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
1081
|
+
"""),
|
|
1082
|
+
)
|
|
1083
|
+
type_: StatusOutputType = Field(alias="type")
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
class StellarTransaction(BaseModel):
|
|
1087
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1088
|
+
type_: GenericTransactionType = Field(
|
|
1089
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1090
|
+
)
|
|
1091
|
+
prerequisites: List[
|
|
1092
|
+
Union[
|
|
1093
|
+
EvmApprovePrerequisite,
|
|
1094
|
+
StellarChangeTrustLinePrerequisite,
|
|
1095
|
+
XrplChangeTrustLinePrerequisite,
|
|
1096
|
+
]
|
|
1097
|
+
] = Field(alias="prerequisites")
|
|
1098
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1099
|
+
xdr_base64: Optional[str] = Field(
|
|
1100
|
+
default=None,
|
|
1101
|
+
alias="xdrBase64",
|
|
1102
|
+
description="Base64-encoded XDR string representing the full transaction",
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
class SuiTransaction(BaseModel):
|
|
1107
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1108
|
+
type_: GenericTransactionType = Field(
|
|
1109
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1110
|
+
)
|
|
1111
|
+
prerequisites: List[
|
|
1112
|
+
Union[
|
|
1113
|
+
EvmApprovePrerequisite,
|
|
1114
|
+
StellarChangeTrustLinePrerequisite,
|
|
1115
|
+
XrplChangeTrustLinePrerequisite,
|
|
1116
|
+
]
|
|
1117
|
+
] = Field(alias="prerequisites")
|
|
1118
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1119
|
+
block_chain: Optional[Blockchain] = Field(
|
|
1120
|
+
default=None, alias="blockChain", description="Transaction blockchain"
|
|
1121
|
+
)
|
|
1122
|
+
unsigned_ptb_base64: Optional[str] = Field(
|
|
1123
|
+
default=None,
|
|
1124
|
+
alias="unsignedPtbBase64",
|
|
1125
|
+
description="Transaction ByteArray that should be send to the wallet for signing",
|
|
1126
|
+
)
|
|
1127
|
+
json_tx_parameters: Optional[Dict[str, Any]] = Field(
|
|
1128
|
+
default=None,
|
|
1129
|
+
alias="jsonTxParameters",
|
|
1130
|
+
description="Transaction Json string that should be con select and sign in wallet",
|
|
1131
|
+
)
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
class SwapperMetaFullDto(BaseModel):
|
|
1135
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1136
|
+
"""Metadata of Swapper"""
|
|
1137
|
+
id: str = Field(alias="id")
|
|
1138
|
+
title: str = Field(alias="title")
|
|
1139
|
+
logo: str = Field(alias="logo")
|
|
1140
|
+
swapper_group: str = Field(alias="swapperGroup")
|
|
1141
|
+
types: Optional[List[SwapperMetaDtoTypesItem]] = Field(default=None, alias="types")
|
|
1142
|
+
enabled: bool = Field(alias="enabled")
|
|
1143
|
+
supported_blockchains: List[SwapperSupportedBlockchain] = Field(
|
|
1144
|
+
alias="supportedBlockchains"
|
|
1145
|
+
)
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
class TonTransaction(BaseModel):
|
|
1149
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1150
|
+
type_: GenericTransactionType = Field(
|
|
1151
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1152
|
+
)
|
|
1153
|
+
prerequisites: List[
|
|
1154
|
+
Union[
|
|
1155
|
+
EvmApprovePrerequisite,
|
|
1156
|
+
StellarChangeTrustLinePrerequisite,
|
|
1157
|
+
XrplChangeTrustLinePrerequisite,
|
|
1158
|
+
]
|
|
1159
|
+
] = Field(alias="prerequisites")
|
|
1160
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1161
|
+
block_chain: Optional[Blockchain] = Field(
|
|
1162
|
+
default=None,
|
|
1163
|
+
alias="blockChain",
|
|
1164
|
+
description="The blockchain that this transaction is going to run in",
|
|
1165
|
+
)
|
|
1166
|
+
valid_until: Optional[int] = Field(
|
|
1167
|
+
default=None,
|
|
1168
|
+
alias="validUntil",
|
|
1169
|
+
description="Sending transaction deadline in unix epoch seconds.",
|
|
1170
|
+
)
|
|
1171
|
+
network: Optional[str] = Field(
|
|
1172
|
+
default=None,
|
|
1173
|
+
alias="network",
|
|
1174
|
+
description=("""
|
|
1175
|
+
The network (mainnet or testnet) where DApp intends to send the
|
|
1176
|
+
transaction. If not set, the transaction is sent to the network
|
|
1177
|
+
currently set in the wallet, but this is not safe and DApp should always
|
|
1178
|
+
strive to set the network. If the network parameter is set, but the
|
|
1179
|
+
wallet has a different network set, the wallet should show an alert and
|
|
1180
|
+
DO NOT ALLOW TO SEND this transaction. +mainnet: "-239" testnet: "-3"
|
|
1181
|
+
"""),
|
|
1182
|
+
)
|
|
1183
|
+
from_: Optional[str] = Field(
|
|
1184
|
+
default=None,
|
|
1185
|
+
alias="from",
|
|
1186
|
+
description=("""
|
|
1187
|
+
The sender address in '<wc>:<hex>' format from which DApp intends to
|
|
1188
|
+
send the transaction. Current account.address by default.
|
|
1189
|
+
"""),
|
|
1190
|
+
)
|
|
1191
|
+
messages: Optional[List[TonTransactionMessage]] = Field(
|
|
1192
|
+
default=None,
|
|
1193
|
+
alias="messages",
|
|
1194
|
+
description="Messages to send: min is 1, max is 4.",
|
|
1195
|
+
)
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
class TrxContractWrapperParameter(BaseModel):
|
|
1199
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1200
|
+
type_url: Optional[str] = Field(default=None, alias="type_url")
|
|
1201
|
+
value: Optional[TrxContractWrapperParameterValue] = Field(
|
|
1202
|
+
default=None, alias="value"
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
class XrplTransaction(BaseModel):
|
|
1207
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1208
|
+
type_: GenericTransactionType = Field(
|
|
1209
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1210
|
+
)
|
|
1211
|
+
prerequisites: List[
|
|
1212
|
+
Union[
|
|
1213
|
+
EvmApprovePrerequisite,
|
|
1214
|
+
StellarChangeTrustLinePrerequisite,
|
|
1215
|
+
XrplChangeTrustLinePrerequisite,
|
|
1216
|
+
]
|
|
1217
|
+
] = Field(alias="prerequisites")
|
|
1218
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1219
|
+
block_chain: Optional[Blockchain] = Field(
|
|
1220
|
+
default=None,
|
|
1221
|
+
alias="blockChain",
|
|
1222
|
+
description="The blockchain that this transaction is going to run in",
|
|
1223
|
+
)
|
|
1224
|
+
binary_serialized_tx: Optional[str] = Field(
|
|
1225
|
+
default=None,
|
|
1226
|
+
alias="binarySerializedTx",
|
|
1227
|
+
description=("""
|
|
1228
|
+
Serialized Transaction in Binary Format Based on [Xrpl
|
|
1229
|
+
Docs](https://xrpl.org/docs/references/protocol/binary-format)
|
|
1230
|
+
"""),
|
|
1231
|
+
)
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
class BasicApiBlockchainMeta(BaseModel):
|
|
1235
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1236
|
+
"""List of all supported blockchains"""
|
|
1237
|
+
name: str = Field(alias="name")
|
|
1238
|
+
default_decimals: int = Field(
|
|
1239
|
+
alias="defaultDecimals", description="Native token decimals"
|
|
1240
|
+
)
|
|
1241
|
+
address_patterns: List[str] = Field(
|
|
1242
|
+
alias="addressPatterns", description="Wallet address patterns"
|
|
1243
|
+
)
|
|
1244
|
+
fee_assets: List[Asset] = Field(alias="feeAssets")
|
|
1245
|
+
type_: Optional[GenericTransactionType] = Field(
|
|
1246
|
+
default=None, alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1247
|
+
)
|
|
1248
|
+
chain_id: Optional[str] = Field(default=None, alias="chainId")
|
|
1249
|
+
logo: str = Field(alias="logo")
|
|
1250
|
+
display_name: str = Field(alias="displayName")
|
|
1251
|
+
short_name: str = Field(alias="shortName")
|
|
1252
|
+
sort: int = Field(alias="sort")
|
|
1253
|
+
color: str = Field(alias="color")
|
|
1254
|
+
enabled: bool = Field(alias="enabled")
|
|
1255
|
+
info: Optional[
|
|
1256
|
+
Union[
|
|
1257
|
+
CosmosMetaInfo,
|
|
1258
|
+
EvmMetaInfo,
|
|
1259
|
+
HyperliquidMetaInfo,
|
|
1260
|
+
SolanaMetaInfo,
|
|
1261
|
+
StarkNetMetaInfo,
|
|
1262
|
+
StellarMetaInfo,
|
|
1263
|
+
SuiMetaInfo,
|
|
1264
|
+
TonMetaInfo,
|
|
1265
|
+
TransferMetaInfo,
|
|
1266
|
+
XRPLMetaInfo,
|
|
1267
|
+
]
|
|
1268
|
+
] = Field(default=None, alias="info")
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
class BasicApiEvmTransaction(BaseModel):
|
|
1272
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1273
|
+
type_: GenericTransactionType = Field(
|
|
1274
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1275
|
+
)
|
|
1276
|
+
prerequisites: List[
|
|
1277
|
+
Union[
|
|
1278
|
+
EvmApprovePrerequisite,
|
|
1279
|
+
StellarChangeTrustLinePrerequisite,
|
|
1280
|
+
XrplChangeTrustLinePrerequisite,
|
|
1281
|
+
]
|
|
1282
|
+
] = Field(alias="prerequisites")
|
|
1283
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1284
|
+
block_chain: Optional[BasicApiBlockchainMetaSummary] = Field(
|
|
1285
|
+
default=None, alias="blockChain", description="Blockchain metadata"
|
|
1286
|
+
)
|
|
1287
|
+
from_: Optional[str] = Field(
|
|
1288
|
+
default=None,
|
|
1289
|
+
alias="from",
|
|
1290
|
+
description="The source wallet address, it can be null",
|
|
1291
|
+
)
|
|
1292
|
+
tx_to: Optional[str] = Field(
|
|
1293
|
+
default=None,
|
|
1294
|
+
alias="txTo",
|
|
1295
|
+
description="Address of smart contract that is going to be called",
|
|
1296
|
+
)
|
|
1297
|
+
approve_to: Optional[str] = Field(
|
|
1298
|
+
default=None,
|
|
1299
|
+
alias="approveTo",
|
|
1300
|
+
description=("""
|
|
1301
|
+
Address of token contract which should be called with approveData (This
|
|
1302
|
+
is not the spender address, the spender is encoded in approveData).
|
|
1303
|
+
"""),
|
|
1304
|
+
)
|
|
1305
|
+
approve_data: Optional[str] = Field(
|
|
1306
|
+
default=None,
|
|
1307
|
+
alias="approveData",
|
|
1308
|
+
description=("""
|
|
1309
|
+
The data of approve transaction. If it's null means that there is no
|
|
1310
|
+
need to approve.
|
|
1311
|
+
"""),
|
|
1312
|
+
)
|
|
1313
|
+
tx_data: Optional[str] = Field(
|
|
1314
|
+
default=None,
|
|
1315
|
+
alias="txData",
|
|
1316
|
+
description=("""
|
|
1317
|
+
The data of smart contract call, it can be null in case of native token
|
|
1318
|
+
transfer
|
|
1319
|
+
"""),
|
|
1320
|
+
)
|
|
1321
|
+
value: Optional[str] = Field(
|
|
1322
|
+
default=None,
|
|
1323
|
+
alias="value",
|
|
1324
|
+
description="The amount of transaction in case of native token transfer",
|
|
1325
|
+
)
|
|
1326
|
+
gas_limit: Optional[str] = Field(
|
|
1327
|
+
default=None,
|
|
1328
|
+
alias="gasLimit",
|
|
1329
|
+
description="Recommended gas limit for transaction",
|
|
1330
|
+
)
|
|
1331
|
+
gas_price: Optional[int] = Field(
|
|
1332
|
+
default=None,
|
|
1333
|
+
alias="gasPrice",
|
|
1334
|
+
description="Recommended gas price for transaction (For non eip1559 transactions)",
|
|
1335
|
+
)
|
|
1336
|
+
priority_gas_price: Optional[int] = Field(
|
|
1337
|
+
default=None,
|
|
1338
|
+
alias="priorityGasPrice",
|
|
1339
|
+
description=("""
|
|
1340
|
+
The maximum price of the consumed gas to be included as a tip to the
|
|
1341
|
+
validator
|
|
1342
|
+
"""),
|
|
1343
|
+
)
|
|
1344
|
+
max_priority_fee_per_gas: Optional[int] = Field(
|
|
1345
|
+
default=None,
|
|
1346
|
+
alias="maxPriorityFeePerGas",
|
|
1347
|
+
description=("""
|
|
1348
|
+
The maximum price of the consumed gas to be included as a tip to the
|
|
1349
|
+
validator
|
|
1350
|
+
"""),
|
|
1351
|
+
)
|
|
1352
|
+
max_gas_price: Optional[int] = Field(
|
|
1353
|
+
default=None,
|
|
1354
|
+
alias="maxGasPrice",
|
|
1355
|
+
description=("""
|
|
1356
|
+
The maximum fee per unit of gas willing to be paid for the transaction
|
|
1357
|
+
(inclusive of baseFeePerGas and maxPriorityFeePerGas)
|
|
1358
|
+
"""),
|
|
1359
|
+
)
|
|
1360
|
+
max_fee_per_gas: Optional[int] = Field(
|
|
1361
|
+
default=None,
|
|
1362
|
+
alias="maxFeePerGas",
|
|
1363
|
+
description=("""
|
|
1364
|
+
The maximum fee per unit of gas willing to be paid for the transaction
|
|
1365
|
+
(inclusive of baseFeePerGas and maxPriorityFeePerGas)
|
|
1366
|
+
"""),
|
|
1367
|
+
)
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
class BasicApiQuoteResponseRoute(BaseModel):
|
|
1371
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1372
|
+
"""Route found by Rango"""
|
|
1373
|
+
output_amount: int = Field(alias="outputAmount", description="Swap output")
|
|
1374
|
+
output_amount_min: int = Field(
|
|
1375
|
+
alias="outputAmountMin", description="Minimum swap output"
|
|
1376
|
+
)
|
|
1377
|
+
output_amount_usd: Optional[float] = Field(
|
|
1378
|
+
default=None, alias="outputAmountUsd", description="Swap output in usd"
|
|
1379
|
+
)
|
|
1380
|
+
swapper: SwapperMetaDto = Field(alias="swapper", description="Metadata of Swapper")
|
|
1381
|
+
from_: BasicApiToken = Field(
|
|
1382
|
+
alias="from",
|
|
1383
|
+
description=("""
|
|
1384
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
1385
|
+
"""),
|
|
1386
|
+
)
|
|
1387
|
+
to: BasicApiToken = Field(
|
|
1388
|
+
alias="to",
|
|
1389
|
+
description=("""
|
|
1390
|
+
A token's metadata, which is unique by (blockchain, symbol, and address)
|
|
1391
|
+
"""),
|
|
1392
|
+
)
|
|
1393
|
+
fee: List[BasicApiSwapFee] = Field(alias="fee")
|
|
1394
|
+
fee_usd: Optional[float] = Field(
|
|
1395
|
+
default=None, alias="feeUsd", description="fee in usd"
|
|
1396
|
+
)
|
|
1397
|
+
amount_restriction: Optional[BasicApiQuoteResponseRouteRestriction] = Field(
|
|
1398
|
+
default=None,
|
|
1399
|
+
alias="amountRestriction",
|
|
1400
|
+
description="Amount restriction for a swapper",
|
|
1401
|
+
)
|
|
1402
|
+
estimated_time_in_seconds: int = Field(alias="estimatedTimeInSeconds")
|
|
1403
|
+
path: Optional[List[BasicApiQuotePath]] = Field(
|
|
1404
|
+
default=None,
|
|
1405
|
+
alias="path",
|
|
1406
|
+
description="List of swap steps which make whole route",
|
|
1407
|
+
)
|
|
1408
|
+
price_impact_usd: Optional[Decimal] = Field(
|
|
1409
|
+
default=None,
|
|
1410
|
+
alias="priceImpactUsd",
|
|
1411
|
+
description="Price change amount based on usd",
|
|
1412
|
+
examples=[Decimal("0.244168")],
|
|
1413
|
+
)
|
|
1414
|
+
price_impact_usd_percent: Optional[Decimal] = Field(
|
|
1415
|
+
default=None,
|
|
1416
|
+
alias="priceImpactUsdPercent",
|
|
1417
|
+
description="Percentage change in price based on usd",
|
|
1418
|
+
examples=[Decimal("0.0011")],
|
|
1419
|
+
)
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
class BasicApiStarkNetTransaction(BaseModel):
|
|
1423
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1424
|
+
type_: GenericTransactionType = Field(
|
|
1425
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1426
|
+
)
|
|
1427
|
+
prerequisites: List[
|
|
1428
|
+
Union[
|
|
1429
|
+
EvmApprovePrerequisite,
|
|
1430
|
+
StellarChangeTrustLinePrerequisite,
|
|
1431
|
+
XrplChangeTrustLinePrerequisite,
|
|
1432
|
+
]
|
|
1433
|
+
] = Field(alias="prerequisites")
|
|
1434
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1435
|
+
block_chain: Optional[Blockchain] = Field(default=None, alias="blockChain")
|
|
1436
|
+
calls: Optional[List[StarknetCallData]] = Field(
|
|
1437
|
+
default=None,
|
|
1438
|
+
alias="calls",
|
|
1439
|
+
description="List of calldata to sign a multiple transaction",
|
|
1440
|
+
)
|
|
1441
|
+
approve_calls: Optional[List[StarknetCallData]] = Field(
|
|
1442
|
+
default=None, alias="approveCalls", description="List of approves calldata"
|
|
1443
|
+
)
|
|
1444
|
+
resource_bounds: Optional[StarkNetResourceBounds] = Field(
|
|
1445
|
+
default=None,
|
|
1446
|
+
alias="resourceBounds",
|
|
1447
|
+
description="Resource bounds for different gas types",
|
|
1448
|
+
)
|
|
1449
|
+
tip: Optional[int] = Field(
|
|
1450
|
+
default=None, alias="tip", description="Tip for the sequencer"
|
|
1451
|
+
)
|
|
1452
|
+
fee_data_availability_mode: Optional[
|
|
1453
|
+
BasicApiStarkNetTransactionFeeDataAvailabilityMode
|
|
1454
|
+
] = Field(
|
|
1455
|
+
default=None,
|
|
1456
|
+
alias="feeDataAvailabilityMode",
|
|
1457
|
+
description="Fee data availability mode",
|
|
1458
|
+
)
|
|
1459
|
+
nonce_data_availability_mode: Optional[
|
|
1460
|
+
BasicApiStarkNetTransactionFeeDataAvailabilityMode
|
|
1461
|
+
] = Field(
|
|
1462
|
+
default=None,
|
|
1463
|
+
alias="nonceDataAvailabilityMode",
|
|
1464
|
+
description="Nonce data availability mode",
|
|
1465
|
+
)
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
class BasicApiStatusResponse(BaseModel):
|
|
1469
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1470
|
+
"""Transaction status response"""
|
|
1471
|
+
status: Optional[CheckApprovalResponseTxStatus] = Field(
|
|
1472
|
+
default=None, alias="status"
|
|
1473
|
+
)
|
|
1474
|
+
error: Optional[str] = Field(default=None, alias="error")
|
|
1475
|
+
diagnosis_url: Optional[str] = Field(
|
|
1476
|
+
default=None,
|
|
1477
|
+
alias="diagnosisUrl",
|
|
1478
|
+
description=("""
|
|
1479
|
+
Some times transaction will fail and user need follow this diagnosis to
|
|
1480
|
+
redeem the assets
|
|
1481
|
+
"""),
|
|
1482
|
+
)
|
|
1483
|
+
explorer_url: Optional[List[ExplorerUrl]] = Field(
|
|
1484
|
+
default=None, alias="explorerUrl", description="Transactions explorer urls"
|
|
1485
|
+
)
|
|
1486
|
+
output: Optional[StatusOutput] = Field(
|
|
1487
|
+
default=None, alias="output", description="Transactions output"
|
|
1488
|
+
)
|
|
1489
|
+
bridge_data: Optional[BasicApiEvmBridgeData] = Field(
|
|
1490
|
+
default=None, alias="bridgeData", description="EVM bridging data"
|
|
1491
|
+
)
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
class ConnectedAssetsResponse(BaseModel):
|
|
1495
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1496
|
+
data: List[RoutingAccessItem] = Field(alias="data")
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
class CosmosMessage(BaseModel):
|
|
1500
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1501
|
+
"""
|
|
1502
|
+
A real cosmos message, most fields of this object should be directly passed to
|
|
1503
|
+
wallet for signing by user, the important part is `msgs` field that contains all the
|
|
1504
|
+
cosmos actions that should be performed.
|
|
1505
|
+
"""
|
|
1506
|
+
chain_id: Optional[str] = Field(default=None, alias="chainId")
|
|
1507
|
+
account_number: Optional[int] = Field(default=None, alias="account_number")
|
|
1508
|
+
sequence: Optional[int] = Field(default=None, alias="sequence")
|
|
1509
|
+
msgs: List[Msg] = Field(alias="msgs")
|
|
1510
|
+
proto_msgs: List[ProtoMsg] = Field(alias="protoMsgs")
|
|
1511
|
+
memo: Optional[str] = Field(default=None, alias="memo")
|
|
1512
|
+
source: Optional[int] = Field(default=None, alias="source")
|
|
1513
|
+
fee: Optional[CosmosStdFee] = Field(default=None, alias="fee")
|
|
1514
|
+
sign_type: CosmosMessageSignType = Field(
|
|
1515
|
+
alias="signType",
|
|
1516
|
+
description=("""
|
|
1517
|
+
Sign type is important field to consider, you should use AMINO or DIRECT
|
|
1518
|
+
mode of wallet depending on value of this field
|
|
1519
|
+
"""),
|
|
1520
|
+
)
|
|
1521
|
+
rpc_url: Optional[str] = Field(default=None, alias="rpcUrl")
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
class SolanaTransaction(BaseModel):
|
|
1525
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1526
|
+
type_: GenericTransactionType = Field(
|
|
1527
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1528
|
+
)
|
|
1529
|
+
prerequisites: List[
|
|
1530
|
+
Union[
|
|
1531
|
+
EvmApprovePrerequisite,
|
|
1532
|
+
StellarChangeTrustLinePrerequisite,
|
|
1533
|
+
XrplChangeTrustLinePrerequisite,
|
|
1534
|
+
]
|
|
1535
|
+
] = Field(alias="prerequisites")
|
|
1536
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1537
|
+
block_chain: Optional[Blockchain] = Field(
|
|
1538
|
+
default=None, alias="blockChain", description="Transaction blockchain"
|
|
1539
|
+
)
|
|
1540
|
+
from_: Optional[str] = Field(
|
|
1541
|
+
default=None,
|
|
1542
|
+
alias="from",
|
|
1543
|
+
description="Wallet address of transaction initiator",
|
|
1544
|
+
)
|
|
1545
|
+
identifier: Optional[str] = Field(
|
|
1546
|
+
default=None,
|
|
1547
|
+
alias="identifier",
|
|
1548
|
+
description="Transaction identifier in case of retry",
|
|
1549
|
+
)
|
|
1550
|
+
instructions: Optional[List[SolanaInstruction]] = Field(
|
|
1551
|
+
default=None, alias="instructions", description="List of instructions"
|
|
1552
|
+
)
|
|
1553
|
+
recent_blockhash: Optional[str] = Field(
|
|
1554
|
+
default=None,
|
|
1555
|
+
alias="recentBlockhash",
|
|
1556
|
+
description="Recent blockHash. fills only if message is already partially signed",
|
|
1557
|
+
)
|
|
1558
|
+
signatures: Optional[List[SolanaSignature]] = Field(
|
|
1559
|
+
default=None,
|
|
1560
|
+
alias="signatures",
|
|
1561
|
+
description="List of signatures. fills only if message is already partially signed",
|
|
1562
|
+
)
|
|
1563
|
+
serialized_message: Optional[str] = Field(default=None, alias="serializedMessage")
|
|
1564
|
+
tx_type: Optional[SolanaTransactionTxType] = Field(
|
|
1565
|
+
default=None,
|
|
1566
|
+
alias="txType",
|
|
1567
|
+
description="type of Solana transaction. available values are {LEGACY, VERSIONED}",
|
|
1568
|
+
)
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
class TransferTransaction(BaseModel):
|
|
1572
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1573
|
+
type_: GenericTransactionType = Field(
|
|
1574
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1575
|
+
)
|
|
1576
|
+
prerequisites: List[
|
|
1577
|
+
Union[
|
|
1578
|
+
EvmApprovePrerequisite,
|
|
1579
|
+
StellarChangeTrustLinePrerequisite,
|
|
1580
|
+
XrplChangeTrustLinePrerequisite,
|
|
1581
|
+
]
|
|
1582
|
+
] = Field(alias="prerequisites")
|
|
1583
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1584
|
+
method: Optional[str] = Field(
|
|
1585
|
+
default=None,
|
|
1586
|
+
alias="method",
|
|
1587
|
+
description=("""
|
|
1588
|
+
The method that should be passed to wallet including `deposit`,
|
|
1589
|
+
`transfer`
|
|
1590
|
+
"""),
|
|
1591
|
+
)
|
|
1592
|
+
from_wallet_address: Optional[str] = Field(
|
|
1593
|
+
default=None,
|
|
1594
|
+
alias="fromWalletAddress",
|
|
1595
|
+
description="Source wallet address that can sign this transaction",
|
|
1596
|
+
)
|
|
1597
|
+
recipient_address: Optional[str] = Field(
|
|
1598
|
+
default=None,
|
|
1599
|
+
alias="recipientAddress",
|
|
1600
|
+
description="Destination wallet address that the fund should be sent to",
|
|
1601
|
+
)
|
|
1602
|
+
memo: Optional[str] = Field(
|
|
1603
|
+
default=None, alias="memo", description="The memo of transaction, can be null"
|
|
1604
|
+
)
|
|
1605
|
+
memo_type: Optional[TransferTransactionMemoType] = Field(
|
|
1606
|
+
default=None,
|
|
1607
|
+
alias="memoType",
|
|
1608
|
+
description="Specifies the type of memo that dApps should use for decoding.",
|
|
1609
|
+
)
|
|
1610
|
+
amount: Optional[int] = Field(
|
|
1611
|
+
default=None,
|
|
1612
|
+
alias="amount",
|
|
1613
|
+
description="The machine-readable amount of transaction",
|
|
1614
|
+
examples=[1000000000000000000],
|
|
1615
|
+
)
|
|
1616
|
+
decimals: Optional[int] = Field(
|
|
1617
|
+
default=None, alias="decimals", description="The decimals of the asset"
|
|
1618
|
+
)
|
|
1619
|
+
asset: Optional[AssetWithTicker] = Field(
|
|
1620
|
+
default=None, alias="asset", description="An asset with its ticker"
|
|
1621
|
+
)
|
|
1622
|
+
psbt: Optional[PSBT] = Field(
|
|
1623
|
+
default=None, alias="psbt", description="Partially signed bitcoin transaction"
|
|
1624
|
+
)
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
class TrxContractWrapper(BaseModel):
|
|
1628
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1629
|
+
type_: str = Field(alias="type")
|
|
1630
|
+
parameter: TrxContractWrapperParameter = Field(alias="parameter")
|
|
1631
|
+
|
|
1632
|
+
|
|
1633
|
+
class WalletDetails(BaseModel):
|
|
1634
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1635
|
+
"""A wallet's details"""
|
|
1636
|
+
block_chain: Blockchain = Field(
|
|
1637
|
+
alias="blockChain",
|
|
1638
|
+
description="The blockchain which this wallet belongs to",
|
|
1639
|
+
examples=[Blockchain.BSC],
|
|
1640
|
+
)
|
|
1641
|
+
address: str = Field(
|
|
1642
|
+
alias="address",
|
|
1643
|
+
description="Address of the wallet",
|
|
1644
|
+
examples=["0x55d398326f99059ff775485246999027b3197955"],
|
|
1645
|
+
)
|
|
1646
|
+
failed: bool = Field(
|
|
1647
|
+
alias="failed",
|
|
1648
|
+
description=("""
|
|
1649
|
+
If it's true, it means that Rango could not fetch this wallet's balance;
|
|
1650
|
+
maybe trying again later could solve the problem.
|
|
1651
|
+
"""),
|
|
1652
|
+
examples=[False],
|
|
1653
|
+
)
|
|
1654
|
+
explorer_url: str = Field(
|
|
1655
|
+
alias="explorerUrl",
|
|
1656
|
+
description="The explorer url of the wallet, e.g. bscscan or harmony explorer",
|
|
1657
|
+
examples=[
|
|
1658
|
+
"https://bscscan.com/address/0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88",
|
|
1659
|
+
],
|
|
1660
|
+
)
|
|
1661
|
+
balances: Optional[List[AssetBalance]] = Field(
|
|
1662
|
+
default=None,
|
|
1663
|
+
alias="balances",
|
|
1664
|
+
description=("""
|
|
1665
|
+
Balance of the wallet, null value means server failed to fetch balances,
|
|
1666
|
+
empty list indicates that the wallet is empty
|
|
1667
|
+
"""),
|
|
1668
|
+
)
|
|
1669
|
+
|
|
1670
|
+
|
|
1671
|
+
class BasicApiMetaResponse(BaseModel):
|
|
1672
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1673
|
+
"""A wrapper class for all tokens, blockchains, and swappers' metadata of Rango"""
|
|
1674
|
+
tokens: List[BasicApiToken] = Field(
|
|
1675
|
+
alias="tokens", description="List of all tokens"
|
|
1676
|
+
)
|
|
1677
|
+
blockchains: List[BasicApiBlockchainMeta] = Field(
|
|
1678
|
+
alias="blockchains", description="List of all supported blockchains"
|
|
1679
|
+
)
|
|
1680
|
+
swappers: List[SwapperMetaDto] = Field(
|
|
1681
|
+
alias="swappers", description="List of all DEXes & Bridges"
|
|
1682
|
+
)
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
class BasicApiQuoteResponse(BaseModel):
|
|
1686
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1687
|
+
"""The best route response was found by Rango."""
|
|
1688
|
+
request_id: str = Field(
|
|
1689
|
+
alias="requestId",
|
|
1690
|
+
description=("""
|
|
1691
|
+
The unique requestId generated for this request by server. It should be
|
|
1692
|
+
passed down to all other endpoints if this swap continues on
|
|
1693
|
+
"""),
|
|
1694
|
+
examples=["d10657ce-b13a-405c-825b-b47f8a5096aa"],
|
|
1695
|
+
)
|
|
1696
|
+
result_type: BasicApiSwapResponseResultType = Field(
|
|
1697
|
+
alias="resultType", description="Route state"
|
|
1698
|
+
)
|
|
1699
|
+
route: Optional[BasicApiQuoteResponseRoute] = Field(
|
|
1700
|
+
default=None, alias="route", description="Route found by Rango"
|
|
1701
|
+
)
|
|
1702
|
+
error: Optional[str] = Field(
|
|
1703
|
+
default=None, alias="error", description="Error occurred during operation"
|
|
1704
|
+
)
|
|
1705
|
+
error_code: Optional[int] = Field(
|
|
1706
|
+
default=None,
|
|
1707
|
+
alias="errorCode",
|
|
1708
|
+
description="Error code show error type in rango",
|
|
1709
|
+
)
|
|
1710
|
+
trace_id: Optional[int] = Field(
|
|
1711
|
+
default=None,
|
|
1712
|
+
alias="traceId",
|
|
1713
|
+
description="Trace id help Rango support to resolve the issue",
|
|
1714
|
+
)
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
class CosmosTransaction(BaseModel):
|
|
1718
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1719
|
+
type_: GenericTransactionType = Field(
|
|
1720
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1721
|
+
)
|
|
1722
|
+
prerequisites: List[
|
|
1723
|
+
Union[
|
|
1724
|
+
EvmApprovePrerequisite,
|
|
1725
|
+
StellarChangeTrustLinePrerequisite,
|
|
1726
|
+
XrplChangeTrustLinePrerequisite,
|
|
1727
|
+
]
|
|
1728
|
+
] = Field(alias="prerequisites")
|
|
1729
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1730
|
+
from_wallet_address: Optional[str] = Field(
|
|
1731
|
+
default=None,
|
|
1732
|
+
alias="fromWalletAddress",
|
|
1733
|
+
description=("""
|
|
1734
|
+
Address of wallet that this transaction should be executed in, same as
|
|
1735
|
+
the create transaction request's input
|
|
1736
|
+
"""),
|
|
1737
|
+
)
|
|
1738
|
+
block_chain: Optional[Blockchain] = Field(
|
|
1739
|
+
default=None,
|
|
1740
|
+
alias="blockChain",
|
|
1741
|
+
description=("""
|
|
1742
|
+
The blockchain that this transaction will be executed in, same as the
|
|
1743
|
+
input blockchainof create transaction
|
|
1744
|
+
"""),
|
|
1745
|
+
)
|
|
1746
|
+
data: Optional[CosmosMessage] = Field(
|
|
1747
|
+
default=None,
|
|
1748
|
+
alias="data",
|
|
1749
|
+
description=("""
|
|
1750
|
+
A real cosmos message, most fields of this object should be directly
|
|
1751
|
+
passed to wallet for signing by user, the important part is `msgs` field
|
|
1752
|
+
that contains all the cosmos actions that should be performed.
|
|
1753
|
+
"""),
|
|
1754
|
+
)
|
|
1755
|
+
raw_transfer: Optional[CosmosRawTransferData] = Field(
|
|
1756
|
+
default=None,
|
|
1757
|
+
alias="rawTransfer",
|
|
1758
|
+
description=("""
|
|
1759
|
+
An alternative to CosmosMessage object for the cosmos wallets that do
|
|
1760
|
+
not support generic Cosmos messages
|
|
1761
|
+
"""),
|
|
1762
|
+
)
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
class TrxRawData(BaseModel):
|
|
1766
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1767
|
+
"""Raw data of TrxTransaction"""
|
|
1768
|
+
contract: List[TrxContractWrapper] = Field(alias="contract")
|
|
1769
|
+
ref_block_bytes: str = Field(alias="ref_block_bytes")
|
|
1770
|
+
ref_block_hash: str = Field(alias="ref_block_hash")
|
|
1771
|
+
expiration: int = Field(alias="expiration")
|
|
1772
|
+
fee_limit: Optional[int] = Field(default=None, alias="fee_limit")
|
|
1773
|
+
timestamp: int = Field(alias="timestamp")
|
|
1774
|
+
data: str = Field(alias="data")
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
class WalletDetailsResponse(BaseModel):
|
|
1778
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1779
|
+
"""A list of wallets details"""
|
|
1780
|
+
wallets: List[WalletDetails] = Field(alias="wallets")
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
class TrxTransaction(BaseModel):
|
|
1784
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1785
|
+
type_: GenericTransactionType = Field(
|
|
1786
|
+
alias="type", description="Blockchain transaction type. e.g. EVM"
|
|
1787
|
+
)
|
|
1788
|
+
prerequisites: List[
|
|
1789
|
+
Union[
|
|
1790
|
+
EvmApprovePrerequisite,
|
|
1791
|
+
StellarChangeTrustLinePrerequisite,
|
|
1792
|
+
XrplChangeTrustLinePrerequisite,
|
|
1793
|
+
]
|
|
1794
|
+
] = Field(alias="prerequisites")
|
|
1795
|
+
expected_output: Decimal = Field(alias="expectedOutput")
|
|
1796
|
+
block_chain: Optional[Blockchain] = Field(
|
|
1797
|
+
default=None, alias="blockChain", description="Transaction blockchain"
|
|
1798
|
+
)
|
|
1799
|
+
is_approval_tx: Optional[bool] = Field(
|
|
1800
|
+
default=None,
|
|
1801
|
+
alias="isApprovalTx",
|
|
1802
|
+
description=("""
|
|
1803
|
+
Determines that this transaction is an approval transaction or not, if
|
|
1804
|
+
true user should approve the transaction and call `create transaction`
|
|
1805
|
+
endpoint again to get the original tx. Beware that most of the fields of
|
|
1806
|
+
this object will be passed directly to the wallet without any change.
|
|
1807
|
+
"""),
|
|
1808
|
+
)
|
|
1809
|
+
raw_data: Optional[TrxRawData] = Field(
|
|
1810
|
+
default=None, alias="raw_data", description="Raw data of TrxTransaction"
|
|
1811
|
+
)
|
|
1812
|
+
raw_data_hex: Optional[str] = Field(
|
|
1813
|
+
default=None,
|
|
1814
|
+
alias="raw_data_hex",
|
|
1815
|
+
description="The hex data for smart contract call",
|
|
1816
|
+
)
|
|
1817
|
+
external_tx_id: Optional[str] = Field(default=None, alias="externalTxId")
|
|
1818
|
+
payload: Optional[TronTransaction] = Field(
|
|
1819
|
+
default=None, alias="__payload__", description="Payload of Trx Transaction"
|
|
1820
|
+
)
|
|
1821
|
+
tx_id: Optional[str] = Field(
|
|
1822
|
+
default=None, alias="txID", description="The txID for wallet call"
|
|
1823
|
+
)
|
|
1824
|
+
visible: Optional[bool] = Field(
|
|
1825
|
+
default=None, alias="visible", description="The visible for wallet call"
|
|
1826
|
+
)
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
class BasicApiSwapResponse(BaseModel):
|
|
1830
|
+
model_config = ConfigDict(populate_by_name=True, extra="ignore")
|
|
1831
|
+
"""Swap response"""
|
|
1832
|
+
request_id: str = Field(alias="requestId")
|
|
1833
|
+
result_type: BasicApiSwapResponseResultType = Field(alias="resultType")
|
|
1834
|
+
route: Optional[BasicApiQuoteResponseRoute] = Field(
|
|
1835
|
+
default=None, alias="route", description="Route found by Rango"
|
|
1836
|
+
)
|
|
1837
|
+
error: Optional[str] = Field(default=None, alias="error")
|
|
1838
|
+
error_code: Optional[int] = Field(default=None, alias="errorCode")
|
|
1839
|
+
trace_id: Optional[int] = Field(default=None, alias="traceId")
|
|
1840
|
+
tx: Optional[
|
|
1841
|
+
Union[
|
|
1842
|
+
BasicApiEvmTransaction,
|
|
1843
|
+
BasicApiStarkNetTransaction,
|
|
1844
|
+
CosmosTransaction,
|
|
1845
|
+
SolanaTransaction,
|
|
1846
|
+
StellarTransaction,
|
|
1847
|
+
SuiTransaction,
|
|
1848
|
+
TonTransaction,
|
|
1849
|
+
TransferTransaction,
|
|
1850
|
+
TrxTransaction,
|
|
1851
|
+
XrplTransaction,
|
|
1852
|
+
]
|
|
1853
|
+
] = Field(default=None, alias="tx")
|