From 18f2b8a1cc682153ea19e9f2c322a88d4d6ece25 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Tue, 2 Aug 2022 08:54:50 +0800 Subject: [PATCH 1/9] xcm list support --- source/includes/_xcm.md | 95 +++++++++++++++++++++++++++++++++++++++++ source/index.html.md | 1 + 2 files changed, 96 insertions(+) create mode 100644 source/includes/_xcm.md diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md new file mode 100644 index 0000000..3d97075 --- /dev/null +++ b/source/includes/_xcm.md @@ -0,0 +1,95 @@ +# XCM API (Unstable) + + +## xcm list + +```shell +curl -X POST 'https://rococo.api.subscan.io/api/scan/xcm/list' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "row": 10, + "page":0 +}' +``` + +### Request URL + +`POST /api/scan/xcm/list` + +### Payload + +| Parameter | Type | Require | Default | Description | +|-----------------|--------|---------|---------|-----------------------------------------------------------| +| row | INT | yes | | | +| page | INT | yes | | | +| address | string | yes | | send or dest address(ss58 or h160) | +| origin_para_id | INT | yes | | | +| dest_para_id | INT | yes | | | +| extrinsic_index | string | yes | | | +| block_range | string | yes | | block range(like 1-100 or 10000-20000) | +| status | string | yes | | status filter, it can be (pending relayed success failed) | + + +> Example Response + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1659401329, + "data": { + "count": 1, + "list": [ + { + "message_hash": "0xc1efee382afb40bfc434855ae476ca8f9bba4cd3b70a3bfb1485f69a7877d051", + "origin_event_index": "2462336-5", + "from_account_id": "6091891026519e68c7e482382f1fff6258e2b5cc282066d619586bd3858f5a3e", + "origin_para_id": 1000, + "origin_block_timestamp": 1657756518, + "relayed_block_timestamp": 1657756530, + "block_num": 13549764, + "status": "success", + "relayed_event_index": "13549764-1", + "dest_event_index": "2267277-7", + "dest_para_id": 2000, + "dest_raw": { + "V0": { + "X2": { + "col0": { + "Parent": "" + }, + "col1": { + "Parachain": 2000 + } + } + } + }, + "to_account_id": "6091891026519e68c7e482382f1fff6258e2b5cc282066d619586bd3858f5a3e", + "to_account_raw": { + "V0": { + "X1": { + "AccountId32": { + "id": "0x6091891026519e68c7e482382f1fff6258e2b5cc282066d619586bd3858f5a3e", + "network": { + "Any": "" + } + } + } + } + }, + "confirm_block_timestamp": 1657756530, + "assets": [ + { + "enum_key": "ConcreteFungible", + "asset_module": "Assets", + "amount": "4999000000", + "decimals": 6, + "symbol": "USDt" + } + ], + "extrinsic_index": "2462336-5" + } + ] + } +} +``` diff --git a/source/index.html.md b/source/index.html.md index 818b7a6..b22497f 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -16,6 +16,7 @@ includes: - v2 - para - evm + - xcm - crust search: false From 810e76a50410d2d6b2f72d849f60bc0ce8faff09 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Tue, 30 Aug 2022 14:42:52 +0800 Subject: [PATCH 2/9] Add xcm channels api --- source/includes/_xcm.md | 243 ++++++++++++++++++++++++++++++++-------- 1 file changed, 196 insertions(+), 47 deletions(-) diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index 3d97075..334d7cf 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -1,10 +1,9 @@ # XCM API (Unstable) - ## xcm list ```shell -curl -X POST 'https://rococo.api.subscan.io/api/scan/xcm/list' \ +curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/list' \ --header 'Content-Type: application/json' \ --data-raw '{ "row": 10, @@ -29,67 +28,217 @@ curl -X POST 'https://rococo.api.subscan.io/api/scan/xcm/list' \ | block_range | string | yes | | block range(like 1-100 or 10000-20000) | | status | string | yes | | status filter, it can be (pending relayed success failed) | - > Example Response ```json { "code": 0, "message": "Success", - "generated_at": 1659401329, + "generated_at": 1661840427, "data": { "count": 1, "list": [ { - "message_hash": "0xc1efee382afb40bfc434855ae476ca8f9bba4cd3b70a3bfb1485f69a7877d051", - "origin_event_index": "2462336-5", - "from_account_id": "6091891026519e68c7e482382f1fff6258e2b5cc282066d619586bd3858f5a3e", - "origin_para_id": 1000, - "origin_block_timestamp": 1657756518, - "relayed_block_timestamp": 1657756530, - "block_num": 13549764, + "message_hash": "0x3c7f751839a0f3723511358242e36f30e59800d4fdf0fee20ff54dca2e6b44e1", + "origin_event_index": "1074412-10", + "from_account_id": "1a90d0431b84c3be14bcc627d3d1999ce2146d5280e5dbf49d9525bec916cb55", + "origin_para_id": 2032, + "origin_block_timestamp": 1661685330, + "relayed_block_timestamp": 1661685342, + "block_num": 11800671, "status": "success", - "relayed_event_index": "13549764-1", - "dest_event_index": "2267277-7", - "dest_para_id": 2000, - "dest_raw": { - "V0": { - "X2": { - "col0": { - "Parent": "" - }, - "col1": { - "Parachain": 2000 - } - } - } - }, - "to_account_id": "6091891026519e68c7e482382f1fff6258e2b5cc282066d619586bd3858f5a3e", - "to_account_raw": { - "V0": { - "X1": { - "AccountId32": { - "id": "0x6091891026519e68c7e482382f1fff6258e2b5cc282066d619586bd3858f5a3e", - "network": { - "Any": "" - } - } - } - } - }, - "confirm_block_timestamp": 1657756530, + "relayed_event_index": "11800671-2", + "dest_event_index": "1747720-2", + "dest_para_id": 2004, + "to_account_id": "0x2bf7145b9da25567569c15c57758e6a13bbc00f2", + "confirm_block_timestamp": 1661685348, + "extrinsic_index": "1074412-2", + "relayed_extrinsic_index": "11800671-1", + "dest_extrinsic_index": "1747720-0", + "child_para_id": 0, + "child_dest": "", "assets": [ { - "enum_key": "ConcreteFungible", - "asset_module": "Assets", - "amount": "4999000000", - "decimals": 6, - "symbol": "USDt" + "enum_key": "Concrete", + "asset_module": "tokens", + "amount": "300000000000", + "decimals": 10, + "symbol": "INTR" } - ], - "extrinsic_index": "2462336-5" + ] } ] } } ``` + +## xcm meta + +```shell +curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/meta' \ +--header 'Content-Type: application/json' \ +--data-raw '{}' +``` + +### Request URL + +`POST /api/scan/xcm/meta` + +### Payload + +| Parameter | Type | Require | Default | Description | +|-----------|------|---------|---------|---------------------------| +| para_id | INT | no | 0 | filter parachain metadata | + +> Example Response + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1661841040, + "data": { + "online_parachain": 0, + "support_parachain": 17, + "open_channel": 2, + "all_channel": 8, + "relayed_transfer_count": 1 + } +} +``` + +## xcm channels + +```shell +curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/channels' \ +--header 'Content-Type: application/json' \ +--data-raw '{}' +``` + +### Request URL + +`POST /api/scan/xcm/channels` + +### Payload + +| Parameter | Type | Require | Default | Description | +|----------------|--------|---------|---------|------------------------------------| +| sender | INT | no | 0 | para_id | +| recipient | INT | no | 0 | para_id | +| status | String | no | | closed accepted canceled requested | +| filter_para_id | INT | no | 0 | filter para_id channel | + +> Example Response + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1661841178, + "data": { + "list": [ + { + "sender": 2012, + "recipient": 1000, + "status": "requested", + "transfer_count": 2, + "active_at": 0, + "proposed_max_capacity": 1000, + "proposed_max_message_size": 102400 + } + ] + } +} +``` + +## xcm channel info + +```shell +curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/channel' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "sender": 2000,"recipient":2001 +}' +``` + +### Request URL + +`POST /api/scan/xcm/channel` + +### Payload + +| Parameter | Type | Require | Default | Description | +|----------------|--------|---------|---------|------------------------------------| +| sender | INT | yes | 0 | para_id | +| recipient | INT | yes | 0 | para_id | + +> Example Response + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1661841260, + "data": { + "sender": 2000, + "recipient": 2004, + "status": "accepted", + "transfer_count": 0, + "active_at": 1652243898, + "proposed_max_capacity": 1000, + "proposed_max_message_size": 102400 + } +} +``` + +## xcm stat + +```shell +curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/stat' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "start": "2022-08-01","recipient":"2002-08-31" +}' +``` + +### Request URL + +`POST /api/scan/xcm/stat` + +### Payload + +| Parameter | Type | Require | Default | Description | +|----------------|--------|---------|---------|----------------------| +| start | string | yes | | timeDate(2022-08-01) | +| end | string | yes | | timeDate(2022-08-01) | +| filter_para_id | INT | no | 0 | para_id | + +> Example Response + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1661841586, + "data": { + "receiver": [ + { + "time_utc": "2022-08-31", + "total": 2 + } + ], + "send": [ + { + "time_utc": "2022-08-30", + "total": 1 + } + ], + "all": [ + { + "time_utc": "2022-08-30", + "total": 1 + } + ] + } +} +``` \ No newline at end of file From 51a07689505eecebaf768d6d49b030e8797e0873 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Fri, 9 Sep 2022 13:46:57 +0800 Subject: [PATCH 3/9] Add xcm info api --- source/includes/_xcm.md | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index 334d7cf..74e21e5 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -241,4 +241,67 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/stat' \ ] } } +``` + + +## xcm info + +```shell +curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/info' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "origin_para_id": 2004, + "page":"1523869-036"} +}' +``` + +### Request URL + +`POST /api/scan/xcm/info` + +### Payload + +| Parameter | Type | Require | Default | Description | +|-----------------|--------|---------|---------|-------------| +| origin_para_id | INT | yes | | | +| origin_event_id | string | yes | | | + + +> Example Response + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1662702180, + "data": { + "message_hash": "0x59200eea7a3a3578a29d9196389c5570addc73a7a7e1124dba09abf5c72a70bb", + "origin_event_index": "1523869-36", + "from_account_id": "0x3a531c90e52a02817c0d31794d0ac4ea35a66602", + "origin_para_id": 2004, + "origin_block_timestamp": 1658889546, + "relayed_block_timestamp": 0, + "block_num": 11338971, + "status": "success", + "relayed_event_index": "0-0", + "dest_event_index": "11338971-23", + "dest_para_id": 0, + "to_account_id": "c83bab32181ce772142dda747403916a41bd9cc59d0abe6621636bef36ca8e32", + "confirm_block_timestamp": 1658889558, + "extrinsic_index": "1523869-6", + "relayed_extrinsic_index": "", + "dest_extrinsic_index": "11338971-1", + "child_para_id": 0, + "child_dest": "", + "assets": [ + { + "enum_key": "Concrete", + "asset_module": "Balances", + "amount": "40990048395687", + "decimals": 9, + "symbol": "CRAB" + } + ] + } +} ``` \ No newline at end of file From 681c772e94cea2c93d5f57cdc477e90837aeddde Mon Sep 17 00:00:00 2001 From: freehere107 Date: Wed, 14 Sep 2022 12:21:32 +0800 Subject: [PATCH 4/9] Bump xcm list api --- source/includes/_xcm.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index 74e21e5..f8c6397 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -20,13 +20,14 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/list' \ | Parameter | Type | Require | Default | Description | |-----------------|--------|---------|---------|-----------------------------------------------------------| | row | INT | yes | | | -| page | INT | yes | | | -| address | string | yes | | send or dest address(ss58 or h160) | -| origin_para_id | INT | yes | | | -| dest_para_id | INT | yes | | | -| extrinsic_index | string | yes | | | -| block_range | string | yes | | block range(like 1-100 or 10000-20000) | -| status | string | yes | | status filter, it can be (pending relayed success failed) | +| page | INT | NO | | | +| address | string | NO | | send or dest address(ss58 or h160) | +| origin_para_id | INT | NO | | | +| dest_para_id | INT | NO | | | +| extrinsic_index | string | NO | | | +| block_range | string | NO | | block range(like 1-100 or 10000-20000) | +| status | string | NO | | status filter, it can be (pending relayed success failed) | +| protocol | string | NO | | protocol filter, it can be (VMP HRMP UMP DMP) | > Example Response From 19ff1c8b631e8467874d16d9e2ac8a0079f8c794 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Thu, 15 Sep 2022 14:24:31 +0800 Subject: [PATCH 5/9] Bump xcm list api --- source/includes/_xcm.md | 1 + 1 file changed, 1 insertion(+) diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index f8c6397..3d97629 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -28,6 +28,7 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/list' \ | block_range | string | NO | | block range(like 1-100 or 10000-20000) | | status | string | NO | | status filter, it can be (pending relayed success failed) | | protocol | string | NO | | protocol filter, it can be (VMP HRMP UMP DMP) | +| filter_para_id | INT | no | 0 | filter by para_id | > Example Response From bfd5896c21ba87d26078ac00e7f9d773ee704dd3 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Mon, 19 Sep 2022 11:17:52 +0800 Subject: [PATCH 6/9] check_hash add xcm_messages support --- source/includes/_general.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/includes/_general.md b/source/includes/_general.md index 486175d..fd26817 100644 --- a/source/includes/_general.md +++ b/source/includes/_general.md @@ -1038,6 +1038,26 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/check_hash' \ } ``` +xcm message + +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1663557135, + "data": { + "hash_type": "xcm_messages", + "messages": [ + { + "origin_para_id": 2004, + "origin_event_index": "1670182-5" + } + ] + } +} +``` + + ## token Current network tokens detail From 26cb06b3a9464e3221f7b47158ea0f5e921ed025 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Mon, 24 Oct 2022 09:42:14 +0800 Subject: [PATCH 7/9] xcm add message_hash param --- source/includes/_xcm.md | 1 + 1 file changed, 1 insertion(+) diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index 3d97629..aa9f983 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -29,6 +29,7 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/list' \ | status | string | NO | | status filter, it can be (pending relayed success failed) | | protocol | string | NO | | protocol filter, it can be (VMP HRMP UMP DMP) | | filter_para_id | INT | no | 0 | filter by para_id | +| message_hash | string | no | | filter by message_hash | > Example Response From 42286e1c6187778b328025ea10fd341085c098fc Mon Sep 17 00:00:00 2001 From: freehere107 Date: Thu, 27 Oct 2022 14:04:14 +0800 Subject: [PATCH 8/9] update xcm/info and message_type --- source/includes/_general.md | 3 +-- source/includes/_xcm.md | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/source/includes/_general.md b/source/includes/_general.md index fd26817..b4d9648 100644 --- a/source/includes/_general.md +++ b/source/includes/_general.md @@ -1049,8 +1049,7 @@ xcm message "hash_type": "xcm_messages", "messages": [ { - "origin_para_id": 2004, - "origin_event_index": "1670182-5" + "unique_id": "2be37445d2c64b8042447117715f3d070fcdc297" } ] } diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index aa9f983..9b7057d 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -30,6 +30,7 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/list' \ | protocol | string | NO | | protocol filter, it can be (VMP HRMP UMP DMP) | | filter_para_id | INT | no | 0 | filter by para_id | | message_hash | string | no | | filter by message_hash | +| message_type | string | no | | filter by message_type(transfer message) | > Example Response @@ -253,8 +254,7 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/stat' \ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/info' \ --header 'Content-Type: application/json' \ --data-raw '{ - "origin_para_id": 2004, - "page":"1523869-036"} + "unique_id": "2be37445d2c64b8042447117715f3d070fcdc297" }' ``` @@ -264,10 +264,9 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/info' \ ### Payload -| Parameter | Type | Require | Default | Description | -|-----------------|--------|---------|---------|-------------| -| origin_para_id | INT | yes | | | -| origin_event_id | string | yes | | | +| Parameter | Type | Require | Default | Description | +|-----------|--------|---------|---------|-------------| +| unique_id | string | yes | | | > Example Response From d7e1db9239dac22ba90fc8df72f537ed3fcb30c8 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Wed, 2 Nov 2022 15:25:38 +0800 Subject: [PATCH 9/9] Add xcm/check_hash --- source/includes/_xcm.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/source/includes/_xcm.md b/source/includes/_xcm.md index 9b7057d..c51f8fe 100644 --- a/source/includes/_xcm.md +++ b/source/includes/_xcm.md @@ -306,4 +306,43 @@ curl -X POST 'https://polkadot.api.subscan.io/api/scan/xcm/info' \ ] } } +``` + +## xcm-check-hash + +```shell +curl -X POST 'https://kusama.api.subscan.io/api/scan/xcm/check_hash' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "dest_event_id":"2344759-4", + "dest_para_id":2001, + "message_hash":"0x8421ad7e06bade144621069fd70d25ec71dcac3bf3d0703447a3bbc72e248850" +}' +``` + +### Request URL + +`POST /api/scan/xcm/check_hash` + +### Payload + +| Parameter | Type | Require | Default | Description | +|-----------------|--------|---------|---------|-------------| +| message_hash | string | yes | | | +| dest_event_id | string | no | | | +| dest_para_id | int | no | 0 | | +| origin_event_id | string | no | | | +| origin_para_id | int | no | 0 | | + + +> Example Response + +Will return xcm message unique id +```json +{ + "code": 0, + "message": "Success", + "generated_at": 1667373481, + "data": "29b1e4d077e4f29213cf331bed714787ad43452b" +} ``` \ No newline at end of file