Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] - remote snippets #231

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6f70fc4
fix: asset transfer api missing links
nhussein11 Dec 3, 2024
f0afa5a
fix: format snippet
nhussein11 Dec 4, 2024
329a3bb
fix: saset transfer api snippets
nhussein11 Dec 4, 2024
5c881ca
fix: typo
nhussein11 Dec 4, 2024
f216419
fix: vbles
nhussein11 Dec 4, 2024
1937b83
fix: config trait for utility pallet
nhussein11 Dec 4, 2024
e7873a3
fix: account snippets
nhussein11 Dec 4, 2024
2e766c2
fix: typo
nhussein11 Dec 16, 2024
fc1ca3d
Update .snippets/code/develop/toolkit/interoperability/asset-transfer…
nhussein11 Dec 16, 2024
8822633
fix: bounding polkadot-sdk references to polkadot-stable2412
nhussein11 Dec 19, 2024
de16373
fix: polkadot js references to v15.0.2
nhussein11 Dec 19, 2024
fad3a3d
fix: adding fungible trait example (#226)
nhussein11 Dec 4, 2024
809afd6
Tutorials > Interoperability > XCM Transfers (#221)
nhussein11 Dec 10, 2024
2e45a80
[FIX] - Adding references to tutorials (#230)
nhussein11 Dec 12, 2024
d6ed591
Tutorials > Polkadot SDK > Parachains > Build Custom Pallet > Build t…
0xLucca Dec 12, 2024
322ddde
fix: hidding polkaVM instances and adding informational banner (#251)
nhussein11 Dec 12, 2024
65164cc
Restructure Get Started section (#246)
0xLucca Dec 12, 2024
8771c21
Tutorials > Polkadot SDK > Parachains > Build Custom Pallet > Pallet …
nhussein11 Dec 12, 2024
e648fa3
changes block-beta mermaid diagrams to flowchart to correct rendering…
dawnkelly09 Dec 13, 2024
daba535
Tutorials: Update parachain tutorial (#234)
CrackTheCode016 Dec 13, 2024
1dcafb1
[FIX] - Refactoring testing section (#248)
nhussein11 Dec 13, 2024
1e8df7f
fix: typo (#258)
nhussein11 Dec 16, 2024
462ca7d
Obtain Coretime Tutorial (#250)
CrackTheCode016 Dec 16, 2024
286ecd0
add pages for legal policies and info (#255)
eshaben Dec 17, 2024
34ae526
fix: replace old links (#260)
0xLucca Dec 17, 2024
443ef31
add script to fix created dates (#259)
eshaben Dec 17, 2024
81df544
Merge dev-pathways into develop/index (#249)
dawnkelly09 Dec 17, 2024
98a01a0
Zero to Hero Tutorial (#254)
0xLucca Dec 17, 2024
dad621d
Merge branch 'master' into nhussein11/fix-remote-snippets
nhussein11 Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Options for customizing the claim assets transaction. These options allow you to
??? child "Type `Format`"

```ts
--8<-- 'code/build-on-polkadot/xcm/asset-transfer-api/reference/format.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:122:122'
```

---
Expand Down Expand Up @@ -59,7 +59,13 @@ Options for customizing the claim assets transaction. These options allow you to

??? child "Type `AssetTransferType`"

--8<-- 'code/build-on-polkadot/xcm/asset-transfer-api/reference/asset-transfer-type.md'
```ts
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:480:480'
```

!!! note
To use the `assetTransferType` parameter, which is a string, you should use the `AssetTransferType` type as if each of its variants are strings. For example: `assetTransferType = 'LocalReserve'`.


---

Expand All @@ -75,7 +81,12 @@ Options for customizing the claim assets transaction. These options allow you to

??? child "Type `AssetTransferType`"

--8<-- 'code/build-on-polkadot/xcm/asset-transfer-api/reference/asset-transfer-type.md'
```ts
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:480:480'
```

!!! note
To use the `feesTransferType` parameter, which is a string, you should use the `AssetTransferType` type as if each of its variants are strings. For example: `feesTransferType = 'LocalReserve'`.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A promise containing the result of constructing the transaction.
??? child "Type `Format`"

```ts
--8<-- 'code/build-on-polkadot/xcm/asset-transfer-api/reference/format.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:122:122'
```

---
Expand Down Expand Up @@ -109,32 +109,14 @@ A promise containing the result of constructing the transaction.
??? child "Type `Methods`"

```ts
type Methods =
| LocalTransferTypes
| 'transferAssets'
| 'transferAssetsUsingTypeAndThen'
| 'limitedReserveTransferAssets'
| 'limitedTeleportAssets'
| 'transferMultiasset'
| 'transferMultiassets'
| 'transferMultiassetWithFee'
| 'claimAssets';
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:153:162'
```

??? child "Type `LocalTransferTypes`"


```ts
type LocalTransferTypes =
| 'assets::transfer'
| 'assets::transferKeepAlive'
| 'foreignAssets::transfer'
| 'foreignAssets::transferKeepAlive'
| 'balances::transfer'
| 'balances::transferKeepAlive'
| 'poolAssets::transfer'
| 'poolAssets::transferKeepAlive'
| 'tokens::transfer'
| 'tokens::transferKeepAlive';
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:138:148'
```

---
Expand All @@ -145,4 +127,12 @@ A promise containing the result of constructing the transaction.

??? child "Type `ConstructedFormat<T>`"

--8<-- 'code/build-on-polkadot/xcm/asset-transfer-api/reference/constructed-format.md'
```ts
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:127:133'
```

The `ConstructedFormat` type is a conditional type that returns a specific type based on the value of the TxResult `format` field.
nhussein11 marked this conversation as resolved.
Show resolved Hide resolved

- Payload format - if the format field is set to `'payload'`, the `ConstructedFormat` type will return a [`GenericExtrinsicPayload`](https://github.com/polkadot-js/api/blob/3b7b44f048ff515579dd233ea6964acec39c0589/packages/types/src/extrinsic/ExtrinsicPayload.ts#L48){target=\_blank}
- Call format - if the format field is set to `'call'`, the `ConstructedFormat` type will return a hexadecimal string (`0x${string}`). This is the encoded representation of the extrinsic call
- Submittable format - if the format field is set to `'submittable'`, the `ConstructedFormat` type will return a [`SubmittableExtrinsic`](https://github.com/polkadot-js/api/blob/3b7b44f048ff515579dd233ea6964acec39c0589/packages/api-base/src/types/submittable.ts#L56){target=\_blank}. This is a Polkadot.js type that represents a transaction that can be submitted to the blockchain
nhussein11 marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Generates an XCM transaction for transferring assets between chains. It simplifi
After obtaining the transaction, you must handle the signing and submission process separately.

```ts
--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/ctt-fn-signature.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/{{dependencies.asset_transfer_api.version}}/src/AssetTransferApi.ts:169:175'
```

??? interface "Request parameters"
Expand Down Expand Up @@ -76,7 +76,7 @@ After obtaining the transaction, you must handle the signing and submission proc

`opts` ++"TransferArgsOpts<T>"++

--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/transfer-arg-opts.md'
--8<-- './code/develop/toolkit/interoperability/asset-transfer-api/reference/transfer-arg-opts.md'
nhussein11 marked this conversation as resolved.
Show resolved Hide resolved

??? interface "Response parameters"

Expand All @@ -102,7 +102,7 @@ Creates a local XCM transaction to retrieve trapped assets. This function can be


```ts
--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/ca-fn-signature.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/AssetTransferApi.ts:344:349'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using a variable for v0.3.1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eshaben I got the following error when trying to do that:

http.client.InvalidURL: URL can't contain control characters. '/paritytech/asset-transfer-api/refs/tags/{{ dependencies.asset_transfer_api.version }}/src/types.ts' (found at least ' ')

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah ok. Thanks for trying!

```

??? interface "Request parameters"
Expand Down Expand Up @@ -153,7 +153,7 @@ Creates a local XCM transaction to retrieve trapped assets. This function can be
Decodes the hex of an extrinsic into a string readable format.

```ts
--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/de-fn-signature.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/AssetTransferApi.ts:466:466'
```

??? interface "Request parameters"
Expand All @@ -171,7 +171,7 @@ Decodes the hex of an extrinsic into a string readable format.
??? child "Type `Format`"

```ts
--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/format.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:122:122'
```

??? interface "Response parameters"
Expand All @@ -197,7 +197,7 @@ Decodes the hex of an extrinsic into a string readable format.
Fetch estimated fee information for an extrinsic.

```ts
--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/ffi-fn-signature.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/AssetTransferApi.ts:420:423'
```

??? interface "Request parameters"
Expand All @@ -208,7 +208,15 @@ Fetch estimated fee information for an extrinsic.

??? child "Type `ConstructedFormat<T>`"

--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/constructed-format.md'
```ts
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:127:133'
```

The `ConstructedFormat` type is a conditional type that returns a specific type based on the value of the TxResult `format` field.

- Payload format - if the format field is set to `'payload'`, the `ConstructedFormat` type will return a [`GenericExtrinsicPayload`](https://github.com/polkadot-js/api/blob/3b7b44f048ff515579dd233ea6964acec39c0589/packages/types/src/extrinsic/ExtrinsicPayload.ts#L48){target=\_blank}
- Call format - if the format field is set to `'call'`, the `ConstructedFormat` type will return a hexadecimal string (`0x${string}`). This is the encoded representation of the extrinsic call
- Submittable format - if the format field is set to `'submittable'`, the `ConstructedFormat` type will return a [`SubmittableExtrinsic`](https://github.com/polkadot-js/api/blob/3b7b44f048ff515579dd233ea6964acec39c0589/packages/api-base/src/types/submittable.ts#L56){target=\_blank}. This is a Polkadot.js type that represents a transaction that can be submitted to the blockchain
nhussein11 marked this conversation as resolved.
Show resolved Hide resolved

---

Expand All @@ -219,7 +227,7 @@ Fetch estimated fee information for an extrinsic.
??? child "Type `Format`"

```ts
--8<-- 'code/develop/toolkit/interoperability/asset-transfer-api/reference/format.ts'
--8<-- 'https://raw.githubusercontent.com/paritytech/asset-transfer-api/refs/tags/v0.3.1/src/types.ts:122:122'
```

??? interface "Response parameters"
Expand Down
4 changes: 2 additions & 2 deletions polkadot-protocol/basics/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The [`Account` data type](https://paritytech.github.io/polkadot-sdk/master/frame
The code snippet below shows how accounts are defined:

```rs
--8<-- 'code/polkadot-protocol/basics/accounts/account-data-structure-1.rs'
--8<-- 'https://raw.githubusercontent.com/paritytech/polkadot-sdk/refs/tags/v1.16.2-rc1/substrate/frame/system/src/lib.rs:893:902'
```

The preceding code block defines a storage map named `Account`. The `StorageMap` is a type of on-chain storage that maps keys to values. In the `Account` map, the key is an account ID, and the value is the account's information. Here, `T` represents the generic parameter for the runtime configuration, which is defined by the pallet's configuration trait (`Config`).
Expand All @@ -45,7 +45,7 @@ The `StorageMap` consists of the following parameters:
The `AccountInfo` structure is another key element within the [System pallet](https://paritytech.github.io/polkadot-sdk/master/src/frame_system/lib.rs.html){target=\_blank}, providing more granular details about each account's state. This structure tracks vital data, such as the number of transactions and the account’s relationships with other modules.

```rs
--8<-- 'code/polkadot-protocol/basics/accounts/account-data-structure-2.rs'
--8<-- 'https://raw.githubusercontent.com/paritytech/polkadot-sdk/refs/tags/v1.16.2-rc1/substrate/frame/system/src/lib.rs:1115:1132'
```

The `AccountInfo` structure includes the following components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ To configure the Utility pallet, take the following steps:
1. Implement the [`Config`](https://paritytech.github.io/polkadot-sdk/master/pallet_utility/pallet/trait.Config.html){target=\_blank} trait for the Utility pallet:

```rust
--8<-- 'code/tutorials/polkadot-sdk/parachains/local-chain/upgrade-a-running-network/config-trait-impl.rs'
...
/// Configure the pallet-template in pallets/template
--8<-- 'https://raw.githubusercontent.com/paritytech/polkadot-sdk-solochain-template/refs/tags/v0.0.2/runtime/src/lib.rs:251:251'
...
--8<-- 'https://raw.githubusercontent.com/paritytech/polkadot-sdk-solochain-template/refs/tags/v0.0.2/runtime/src/lib.rs:254:254'

// Add here after all the other pallets implementations
--8<-- 'https://raw.githubusercontent.com/paritytech/polkadot-sdk/refs/tags/v1.16.2-rc1/substrate/bin/node/runtime/src/lib.rs:334:339'
...
```

2. Locate the `#[frame_support::runtime]` macro and add the Utility pallet:
Expand Down
3 changes: 3 additions & 0 deletions variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ dependencies:
polkadot_sdk_solochain_template:
repository_url: https://github.com/paritytech/polkadot-sdk-solochain-template
version: v0.0.2
polkadot_sdk:
repository_url: https://github.com/paritytech/polkadot-sdk
version: v1.16.2-rc1
nhussein11 marked this conversation as resolved.
Show resolved Hide resolved
srtool:
repository_url: https://github.com/paritytech/srtool
version: v0.16.0
Expand Down