Skip to content

Commit

Permalink
Account32Hash command (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard authored Oct 18, 2022
1 parent a5f1e1c commit 29b31c1
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docs/xcm/integration/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,25 @@ pallet_assets: 42424242424242
EVM XC20: 0xffffffff000000000000000000002695a9e649b2
```

You can input standard asset Id (as seen by pallet-assets) and as output you get H160 address of that asset.
You can input standard asset Id (as seen by pallet-assets) and as output you get H160 address of that asset.

## Account32Hash

For calculating `Account32Hash` ([here](https://github.com/paritytech/polkadot/blob/master/xcm/xcm-builder/src/location_conversion.rs#L25)), we provide a dedicated command. However, the possible `MultiLocation`s format is limited to:

1. `{ parents: 1, interior: X1(AccountId32{ network: Any, id: 0x<id>}) }`
2. `{ parents: 1, interior: X2(Parachain(para_id), AccountId32{ network: Any, id: 0x<id>}) }`

For the first case, use the following command:
```bash
xcm-tools account32-hash -a 0x84746218b9858233f45f99d742aa3ea2f31aeb5a525938f240fdee3000000000
5EKFVedcKtGBPytwgj9sbCTmjSr8wJTmhHuuWTz9RhMRrv1h
```
The value under `-a` is a SS58 public key.

For the second case, use the following command:
```bash
xcm-tools account32-hash -p 1000 -a 0x84746218b9858233f45f99d742aa3ea2f31aeb5a525938f240fdee3000000000
5G9fvUEXj93MBeaAzzXQh4RpsTygPssbrVcpuWCzE9u8K4KD
```
The value under `-p` is parachain Id, while `-a` is again public key.

0 comments on commit 29b31c1

Please sign in to comment.