Skip to content

Commit eddd0df

Browse files
committed
add error responses for 1inch methods
1 parent 61e009e commit eddd0df

File tree

6 files changed

+184
-0
lines changed
  • src/pages/komodo-defi-framework/api/v20-dev

6 files changed

+184
-0
lines changed

src/pages/komodo-defi-framework/api/v20-dev/approve_token/index.mdx

+35
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,38 @@ Refer to the [1inch Classic Swap documentation](https://portal.1inch.dev/documen
5252
}
5353
```
5454
</CollapsibleSection>
55+
56+
57+
<CollapsibleSection expandedText="Hide Error Responses" collapsedText="Show Error Responses">
58+
59+
#### Error: Token config not activated
60+
61+
```json
62+
{
63+
"mmrpc": "2.0",
64+
"error": "No such coin USDT-ERC20",
65+
"error_path": "tokens",
66+
"error_trace": "tokens:171]",
67+
"error_type": "NoSuchCoin",
68+
"error_data": {
69+
"coin": "USDT-ERC20"
70+
},
71+
"id": null
72+
}
73+
```
74+
75+
#### Error: Insufficient funds
76+
77+
```json
78+
{
79+
"mmrpc": "2.0",
80+
"error": "Transaction error mm2src/coins/eth.rs:4834] eth:4720] Transport(\"request MethodCall(MethodCall { jsonrpc: Some(V2), method: \\\"eth_estimateGas\\\", params: Array([Object({\\\"from\\\": String(\\\"0x083c32b38e8050473f6999e22f670d1404235592\\\"), \\\"to\\\": String(\\\"0xd6df932a45c0f255f85145f286ea0b292b21c90b\\\"), \\\"gasPrice\\\": String(\\\"0x6fc23a56a\\\"), \\\"value\\\": String(\\\"0x0\\\"), \\\"data\\\": String(\\\"0x095ea7b3000000000000000000000000083c32b38e8050473f6999e22f670d14042355920000000000000000000000000000000000000000000000001111d67bb1bb0000\\\")})]), id: Num(1) }) failed: Invalid response: Server: 'https://electrum3.cipig.net:18755/', error: RPC error: Error { code: ServerError(-32000), message: \\\"insufficient funds for transfer\\\", data: None }\")",
81+
"error_path": "tokens",
82+
"error_trace": "tokens:161]",
83+
"error_type": "TransactionError",
84+
"error_data": "mm2src/coins/eth.rs:4834] eth:4720] Transport(\"request MethodCall(MethodCall { jsonrpc: Some(V2), method: \\\"eth_estimateGas\\\", params: Array([Object({\\\"from\\\": String(\\\"0x083c32b38e8050473f6999e22f670d1404235592\\\"), \\\"to\\\": String(\\\"0xd6df932a45c0f255f85145f286ea0b292b21c90b\\\"), \\\"gasPrice\\\": String(\\\"0x6fc23a56a\\\"), \\\"value\\\": String(\\\"0x0\\\"), \\\"data\\\": String(\\\"0x095ea7b3000000000000000000000000083c32b38e8050473f6999e22f670d14042355920000000000000000000000000000000000000000000000001111d67bb1bb0000\\\")})]), id: Num(1) }) failed: Invalid response: Server: 'https://electrum3.cipig.net:18755/', error: RPC error: Error { code: ServerError(-32000), message: \\\"insufficient funds for transfer\\\", data: None }\")",
85+
"id": null
86+
}
87+
```
88+
89+
</CollapsibleSection>

src/pages/komodo-defi-framework/api/v20-dev/get_token_allowance/index.mdx

+21
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,24 @@ Refer to the [1inch Classic Swap documentation](https://portal.1inch.dev/documen
5050
}
5151
```
5252
</CollapsibleSection>
53+
54+
55+
<CollapsibleSection expandedText="Hide Error Responses" collapsedText="Show Error Responses">
56+
57+
#### Error: Token config not activated
58+
59+
```json
60+
{
61+
"mmrpc": "2.0",
62+
"error": "No such coin USDT-ERC20",
63+
"error_path": "tokens",
64+
"error_trace": "tokens:171]",
65+
"error_type": "NoSuchCoin",
66+
"error_data": {
67+
"coin": "USDT-ERC20"
68+
},
69+
"id": null
70+
}
71+
```
72+
73+
</CollapsibleSection>

src/pages/komodo-defi-framework/api/v20-dev/one_inch_v6_0_classic_swap_create/index.mdx

+42
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,45 @@ Refer to the [1inch Classic Swap documentation](https://portal.1inch.dev/documen
167167
}
168168
```
169169
</CollapsibleSection>
170+
171+
172+
<CollapsibleSection expandedText="Hide Error Responses" collapsedText="Show Error Responses">
173+
174+
#### Error: Configuration missing
175+
176+
The `1inch_api` url not set in your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/).
177+
178+
```json
179+
{
180+
"mmrpc": "2.0",
181+
"error": "No API config param",
182+
"error_path": "rpcs.client",
183+
"error_trace": "rpcs:137] client:105]",
184+
"error_type": "InvalidParam",
185+
"error_data": "No API config param",
186+
"id": null
187+
}
188+
```
189+
190+
#### Error: Authentication failure
191+
192+
`ONE_INCH_API_TEST_AUTH` environment variable not set, or incorrect.
193+
194+
```json
195+
{
196+
"mmrpc": "2.0",
197+
"error": "1inch API error: General API error: Unauthorized description: ",
198+
"error_path": "rpcs.client",
199+
"error_trace": "rpcs:140] client:152]",
200+
"error_type": "OneInchError",
201+
"error_data": {
202+
"GeneralApiError": {
203+
"error_msg": "Unauthorized",
204+
"description": "",
205+
"status_code": 401
206+
}
207+
},
208+
"id": null
209+
}
210+
```
211+
</CollapsibleSection>

src/pages/komodo-defi-framework/api/v20-dev/one_inch_v6_0_classic_swap_liquidity_sources/index.mdx

+42
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,45 @@ Refer to the [1inch Classic Swap documentation](https://portal.1inch.dev/documen
7676
}
7777
```
7878
</CollapsibleSection>
79+
80+
81+
<CollapsibleSection expandedText="Hide Error Responses" collapsedText="Show Error Responses">
82+
83+
#### Error: Configuration missing
84+
85+
The `1inch_api` url not set in your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/).
86+
87+
```json
88+
{
89+
"mmrpc": "2.0",
90+
"error": "No API config param",
91+
"error_path": "rpcs.client",
92+
"error_trace": "rpcs:137] client:105]",
93+
"error_type": "InvalidParam",
94+
"error_data": "No API config param",
95+
"id": null
96+
}
97+
```
98+
99+
#### Error: Authentication failure
100+
101+
`ONE_INCH_API_TEST_AUTH` environment variable not set, or incorrect.
102+
103+
```json
104+
{
105+
"mmrpc": "2.0",
106+
"error": "1inch API error: General API error: Unauthorized description: ",
107+
"error_path": "rpcs.client",
108+
"error_trace": "rpcs:140] client:152]",
109+
"error_type": "OneInchError",
110+
"error_data": {
111+
"GeneralApiError": {
112+
"error_msg": "Unauthorized",
113+
"description": "",
114+
"status_code": 401
115+
}
116+
},
117+
"id": null
118+
}
119+
```
120+
</CollapsibleSection>

src/pages/komodo-defi-framework/api/v20-dev/one_inch_v6_0_classic_swap_quote/index.mdx

+42
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,45 @@ Refer to the [1inch Classic Swap documentation](https://portal.1inch.dev/documen
148148
}
149149
```
150150
</CollapsibleSection>
151+
152+
153+
<CollapsibleSection expandedText="Hide Error Responses" collapsedText="Show Error Responses">
154+
155+
#### Error: Configuration missing
156+
157+
The `1inch_api` url not set in your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/).
158+
159+
```json
160+
{
161+
"mmrpc": "2.0",
162+
"error": "No API config param",
163+
"error_path": "rpcs.client",
164+
"error_trace": "rpcs:137] client:105]",
165+
"error_type": "InvalidParam",
166+
"error_data": "No API config param",
167+
"id": null
168+
}
169+
```
170+
171+
#### Error: Authentication failure
172+
173+
`ONE_INCH_API_TEST_AUTH` environment variable not set, or incorrect.
174+
175+
```json
176+
{
177+
"mmrpc": "2.0",
178+
"error": "1inch API error: General API error: Unauthorized description: ",
179+
"error_path": "rpcs.client",
180+
"error_trace": "rpcs:140] client:152]",
181+
"error_type": "OneInchError",
182+
"error_data": {
183+
"GeneralApiError": {
184+
"error_msg": "Unauthorized",
185+
"description": "",
186+
"status_code": 401
187+
}
188+
},
189+
"id": null
190+
}
191+
```
192+
</CollapsibleSection>

src/pages/komodo-defi-framework/api/v20-dev/one_inch_v6_0_classic_swap_tokens/index.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ Refer to the [1inch Classic Swap documentation](https://portal.1inch.dev/documen
110110
}
111111
```
112112
</CollapsibleSection>
113+
114+

0 commit comments

Comments
 (0)