|
1 | 1 | {
|
2 | 2 | "openapi": "3.0.0",
|
3 | 3 | "paths": {
|
4 |
| - "/v5.2/1/quote": { |
| 4 | + "/v6.0/1/quote": { |
5 | 5 | "get": {
|
6 | 6 | "operationId": "getQuote",
|
7 | 7 | "summary": "Find the best quote to swap with 1inch Router",
|
|
12 | 12 | "in": "query",
|
13 | 13 | "example": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
14 | 14 | "schema": {
|
15 |
| - "type": "string", |
16 |
| - "x-go-type-skip-optional-pointer": true |
| 15 | + "type": "string" |
17 | 16 | }
|
18 | 17 | },
|
19 | 18 | {
|
|
22 | 21 | "in": "query",
|
23 | 22 | "example": "0x111111111117dc0aa78b770fa6a738034120c302",
|
24 | 23 | "schema": {
|
25 |
| - "type": "string", |
26 |
| - "x-go-type-skip-optional-pointer": true |
| 24 | + "type": "string" |
27 | 25 | }
|
28 | 26 | },
|
29 | 27 | {
|
|
32 | 30 | "in": "query",
|
33 | 31 | "example": "10000000000000000",
|
34 | 32 | "schema": {
|
35 |
| - "type": "string", |
36 |
| - "x-go-type-skip-optional-pointer": true |
| 33 | + "type": "string" |
37 | 34 | }
|
38 | 35 | },
|
39 | 36 | {
|
|
152 | 149 | "type": "string",
|
153 | 150 | "x-go-type-skip-optional-pointer": true
|
154 | 151 | }
|
| 152 | + }, |
| 153 | + { |
| 154 | + "name": "excludedProtocols", |
| 155 | + "required": false, |
| 156 | + "in": "query", |
| 157 | + "description": "excluded supported liquidity sources", |
| 158 | + "schema": { |
| 159 | + "type": "string", |
| 160 | + "x-go-type-skip-optional-pointer": true |
| 161 | + } |
155 | 162 | }
|
156 | 163 | ],
|
157 | 164 | "responses": {
|
|
181 | 188 | ]
|
182 | 189 | }
|
183 | 190 | },
|
184 |
| - "/v5.2/1/swap": { |
| 191 | + "/v6.0/1/swap": { |
185 | 192 | "get": {
|
186 | 193 | "operationId": "getSwap",
|
187 | 194 | "summary": "Generate calldata to swap on 1inch Router",
|
|
192 | 199 | "in": "query",
|
193 | 200 | "example": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
194 | 201 | "schema": {
|
195 |
| - "type": "string", |
196 |
| - "x-go-type-skip-optional-pointer": true |
| 202 | + "type": "string" |
197 | 203 | }
|
198 | 204 | },
|
199 | 205 | {
|
|
202 | 208 | "in": "query",
|
203 | 209 | "example": "0x111111111117dc0aa78b770fa6a738034120c302",
|
204 | 210 | "schema": {
|
205 |
| - "type": "string", |
206 |
| - "x-go-type-skip-optional-pointer": true |
| 211 | + "type": "string" |
207 | 212 | }
|
208 | 213 | },
|
209 | 214 | {
|
|
212 | 217 | "in": "query",
|
213 | 218 | "example": "10000000000000000",
|
214 | 219 | "schema": {
|
215 |
| - "type": "string", |
216 |
| - "x-go-type-skip-optional-pointer": true |
| 220 | + "type": "string" |
217 | 221 | }
|
218 | 222 | },
|
219 | 223 | {
|
|
222 | 226 | "in": "query",
|
223 | 227 | "description": "The address that calls the 1inch contract",
|
224 | 228 | "schema": {
|
225 |
| - "type": "string", |
226 |
| - "x-go-type-skip-optional-pointer": true |
| 229 | + "type": "string" |
| 230 | + } |
| 231 | + }, |
| 232 | + { |
| 233 | + "name": "origin", |
| 234 | + "required": true, |
| 235 | + "in": "query", |
| 236 | + "description": "An EOA address that initiate the transaction", |
| 237 | + "schema": { |
| 238 | + "type": "string" |
227 | 239 | }
|
228 | 240 | },
|
229 | 241 | {
|
|
235 | 247 | "schema": {
|
236 | 248 | "minimum": 0,
|
237 | 249 | "maximum": 50,
|
238 |
| - "type": "number", |
239 |
| - "x-go-type-skip-optional-pointer": true |
| 250 | + "type": "number" |
240 | 251 | }
|
241 | 252 | },
|
242 | 253 | {
|
|
356 | 367 | "x-go-type-skip-optional-pointer": true
|
357 | 368 | }
|
358 | 369 | },
|
| 370 | + { |
| 371 | + "name": "excludedProtocols", |
| 372 | + "required": false, |
| 373 | + "in": "query", |
| 374 | + "description": "excluded supported liquidity sources", |
| 375 | + "schema": { |
| 376 | + "type": "string", |
| 377 | + "x-go-type-skip-optional-pointer": true |
| 378 | + } |
| 379 | + }, |
359 | 380 | {
|
360 | 381 | "name": "permit",
|
361 | 382 | "required": false,
|
|
404 | 425 | "type": "boolean",
|
405 | 426 | "x-go-type-skip-optional-pointer": true
|
406 | 427 | }
|
| 428 | + }, |
| 429 | + { |
| 430 | + "name": "usePermit2", |
| 431 | + "required": false, |
| 432 | + "in": "query", |
| 433 | + "description": "Enable this flag in case you did an approval to permit2 smart contract", |
| 434 | + "schema": { |
| 435 | + "type": "boolean", |
| 436 | + "x-go-type-skip-optional-pointer": true |
| 437 | + } |
407 | 438 | }
|
408 | 439 | ],
|
409 | 440 | "responses": {
|
|
433 | 464 | ]
|
434 | 465 | }
|
435 | 466 | },
|
436 |
| - "/v5.2/1/approve/spender": { |
| 467 | + "/v6.0/1/approve/spender": { |
437 | 468 | "get": {
|
438 | 469 | "operationId": "getSpender",
|
439 | 470 | "summary": "Address of the 1inch Router that is trusted to spend funds for the swap",
|
|
455 | 486 | ]
|
456 | 487 | }
|
457 | 488 | },
|
458 |
| - "/v5.2/1/approve/transaction": { |
| 489 | + "/v6.0/1/approve/transaction": { |
459 | 490 | "get": {
|
460 | 491 | "operationId": "getApprove",
|
461 | 492 | "summary": "Generate approve calldata to allow 1inch Router to perform a swap",
|
|
467 | 498 | "example": "0x111111111117dc0aa78b770fa6a738034120c302",
|
468 | 499 | "description": "Token address you want to swap",
|
469 | 500 | "schema": {
|
470 |
| - "type": "string", |
471 |
| - "x-go-type-skip-optional-pointer": true |
| 501 | + "type": "string" |
472 | 502 | }
|
473 | 503 | },
|
474 | 504 | {
|
|
500 | 530 | ]
|
501 | 531 | }
|
502 | 532 | },
|
503 |
| - "/v5.2/1/approve/allowance": { |
| 533 | + "/v6.0/1/approve/allowance": { |
504 | 534 | "get": {
|
505 | 535 | "operationId": "getAllowance",
|
506 | 536 | "summary": "Get the number of tokens that the 1inch Router is allowed to swap",
|
|
512 | 542 | "example": "0x111111111117dc0aa78b770fa6a738034120c302",
|
513 | 543 | "description": "Token address you want to swap",
|
514 | 544 | "schema": {
|
515 |
| - "type": "string", |
516 |
| - "x-go-type-skip-optional-pointer": true |
| 545 | + "type": "string" |
517 | 546 | }
|
518 | 547 | },
|
519 | 548 | {
|
|
522 | 551 | "in": "query",
|
523 | 552 | "description": "Wallet address for which you want to check",
|
524 | 553 | "schema": {
|
525 |
| - "type": "string", |
526 |
| - "x-go-type-skip-optional-pointer": true |
| 554 | + "type": "string" |
527 | 555 | }
|
528 | 556 | }
|
529 | 557 | ],
|
|
544 | 572 | ]
|
545 | 573 | }
|
546 | 574 | },
|
547 |
| - "/v5.2/1/liquidity-sources": { |
| 575 | + "/v6.0/1/liquidity-sources": { |
548 | 576 | "get": {
|
549 | 577 | "operationId": "getLiquiditySources",
|
550 | 578 | "summary": "List of liquidity sources that are available for routing in the 1inch Aggregation Protocol",
|
|
566 | 594 | ]
|
567 | 595 | }
|
568 | 596 | },
|
569 |
| - "/v5.2/1/tokens": { |
| 597 | + "/v6.0/1/tokens": { |
570 | 598 | "get": {
|
571 | 599 | "operationId": "getTokens",
|
572 | 600 | "summary": "List of tokens that are available for swap in the 1inch Aggregation protocol",
|
|
577 | 605 | "content": {
|
578 | 606 | "application/json": {
|
579 | 607 | "schema": {
|
580 |
| - "$ref": "#/components/schemas/TokensResponse" |
| 608 | + "type": "object", |
| 609 | + "properties": { |
| 610 | + "tokens": { |
| 611 | + "type": "object", |
| 612 | + "properties": { |
| 613 | + "0x111111111117dc0aa78b770fa6a738034120c302": { |
| 614 | + "$ref": "#/components/schemas/TokenInfo" |
| 615 | + } |
| 616 | + } |
| 617 | + } |
| 618 | + } |
581 | 619 | }
|
582 | 620 | }
|
583 | 621 | }
|
|
592 | 630 | "info": {
|
593 | 631 | "title": "1inch Swap API",
|
594 | 632 | "description": "\n<h2>Ethereum Network</h2>\nUsing 1inch Swap API, you can find the best route to exchange assets and make the exchange.\n<br><br>\nStep by step:\n1. Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for DAI -> 1INCH\n2. Check for allowance of 1inch router contract to spend source asset (/approve/allowance)\n3. If necessary, give approval for 1inch router to spend source token (/approve/transaction)\n4. Monitor the best exchange route using (/quote)\n5. When you ready use to perform swap (/swap)",
|
595 |
| - "version": "5.2", |
| 633 | + "version": "6.0", |
596 | 634 | "contact": {}
|
597 | 635 | },
|
598 | 636 | "tags": [],
|
599 | 637 | "servers": [],
|
600 | 638 | "components": {
|
601 | 639 | "schemas": {
|
602 |
| - "TokensResponse": { |
603 |
| - "type": "object", |
604 |
| - "properties": { |
605 |
| - "tokens": { |
606 |
| - "type": "object", |
607 |
| - "additionalProperties": { |
608 |
| - "$ref": "#/components/schemas/TokenInfo" |
609 |
| - }, |
610 |
| - "x-go-type-skip-optional-pointer": true |
611 |
| - } |
612 |
| - }, |
613 |
| - "required": [ |
614 |
| - "tokens" |
615 |
| - ] |
616 |
| - }, |
617 | 640 | "TokenInfo": {
|
618 | 641 | "type": "object",
|
619 | 642 | "properties": {
|
|
678 | 701 | "QuoteResponse": {
|
679 | 702 | "type": "object",
|
680 | 703 | "properties": {
|
681 |
| - "fromToken": { |
682 |
| - "$ref": "#/components/schemas/TokenInfo", |
683 |
| - "x-go-type-skip-optional-pointer": true |
| 704 | + "srcToken": { |
| 705 | + "$ref": "#/components/schemas/TokenInfo" |
684 | 706 | },
|
685 |
| - "toToken": { |
686 |
| - "$ref": "#/components/schemas/TokenInfo", |
687 |
| - "x-go-type-skip-optional-pointer": true |
| 707 | + "dstToken": { |
| 708 | + "$ref": "#/components/schemas/TokenInfo" |
688 | 709 | },
|
689 |
| - "toAmount": { |
| 710 | + "dstAmount": { |
690 | 711 | "type": "string",
|
691 | 712 | "description": "Expected amount of destination token",
|
692 | 713 | "example": "62131879850006790961",
|
|
714 | 735 | }
|
715 | 736 | },
|
716 | 737 | "required": [
|
717 |
| - "toAmount" |
| 738 | + "dstAmount" |
718 | 739 | ]
|
719 | 740 | },
|
720 | 741 | "HttpExceptionMeta": {
|
|
828 | 849 | "SwapResponse": {
|
829 | 850 | "type": "object",
|
830 | 851 | "properties": {
|
831 |
| - "fromToken": { |
832 |
| - "$ref": "#/components/schemas/TokenInfo", |
833 |
| - "x-go-type-skip-optional-pointer": true |
| 852 | + "srcToken": { |
| 853 | + "$ref": "#/components/schemas/TokenInfo" |
834 | 854 | },
|
835 |
| - "toToken": { |
836 |
| - "$ref": "#/components/schemas/TokenInfo", |
837 |
| - "x-go-type-skip-optional-pointer": true |
| 855 | + "dstToken": { |
| 856 | + "$ref": "#/components/schemas/TokenInfo" |
838 | 857 | },
|
839 |
| - "toAmount": { |
| 858 | + "dstAmount": { |
840 | 859 | "type": "string",
|
841 | 860 | "description": "Expected amount of destination token",
|
842 | 861 | "example": "62131879850006790961",
|
|
857 | 876 | "x-go-type-skip-optional-pointer": true
|
858 | 877 | },
|
859 | 878 | "tx": {
|
860 |
| - "$ref": "#/components/schemas/TransactionData", |
861 |
| - "x-go-type-skip-optional-pointer": true |
| 879 | + "$ref": "#/components/schemas/TransactionData" |
862 | 880 | }
|
863 | 881 | },
|
864 | 882 | "required": [
|
865 |
| - "toAmount", |
| 883 | + "dstAmount", |
866 | 884 | "tx"
|
867 | 885 | ]
|
868 | 886 | },
|
|
0 commit comments