diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/asset-transfer-type.md b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/asset-transfer-type.md deleted file mode 100644 index b9029d958..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/asset-transfer-type.md +++ /dev/null @@ -1,10 +0,0 @@ -```ts -export type AssetTransferType = - | LocalReserve - | DestinationReserve - | Teleport - | RemoteReserve; -``` - -!!! 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'`. \ No newline at end of file diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ca-fn-signature.ts b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ca-fn-signature.ts deleted file mode 100644 index 4303c60d1..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ca-fn-signature.ts +++ /dev/null @@ -1,6 +0,0 @@ -public async claimAssets( - assetIds: string[], - amounts: string[], - beneficiary: string, - opts: TransferArgsOpts -): Promise>; diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/constructed-format.md b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/constructed-format.md deleted file mode 100644 index 74c6974fd..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/constructed-format.md +++ /dev/null @@ -1,15 +0,0 @@ -```ts -export type ConstructedFormat = T extends 'payload' - ? GenericExtrinsicPayload - : T extends 'call' - ? `0x${string}` - : T extends 'submittable' - ? SubmittableExtrinsic<'promise', ISubmittableResult> - : never; -``` - -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 \ No newline at end of file diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ctt-fn-signature.ts b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ctt-fn-signature.ts deleted file mode 100644 index 0af1ef38c..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ctt-fn-signature.ts +++ /dev/null @@ -1,7 +0,0 @@ -public async createTransferTransaction( - destChainId: string, - destAddr: string, - assetIds: string[], - amounts: string[], - opts: TransferArgsOpts = {} -): Promise>; diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/de-fn-signature.ts b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/de-fn-signature.ts deleted file mode 100644 index 197d817df..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/de-fn-signature.ts +++ /dev/null @@ -1,4 +0,0 @@ -public decodeExtrinsic( - encodedTransaction: string, - format: T -): string; diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ffi-fn-signature.ts b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ffi-fn-signature.ts deleted file mode 100644 index 7f87e9aa8..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/ffi-fn-signature.ts +++ /dev/null @@ -1,4 +0,0 @@ -public async fetchFeeInfo( - tx: ConstructedFormat, - format: T -): Promise; diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/format.ts b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/format.ts deleted file mode 100644 index 9fe23a678..000000000 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/format.ts +++ /dev/null @@ -1 +0,0 @@ -export type Format = 'payload' | 'call' | 'submittable'; diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/transfer-arg-opts.md b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/transfer-arg-opts.md index 1d536c7ce..29b7f6570 100644 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/transfer-arg-opts.md +++ b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/transfer-arg-opts.md @@ -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' ``` --- @@ -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'`. + --- @@ -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'`. --- diff --git a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/tx-result.md b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/tx-result.md index e718b38e9..212568ec1 100644 --- a/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/tx-result.md +++ b/.snippets/code/develop/toolkit/interoperability/asset-transfer-api/reference/tx-result.md @@ -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' ``` --- @@ -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' ``` --- @@ -145,4 +127,12 @@ A promise containing the result of constructing the transaction. ??? child "Type `ConstructedFormat`" - --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. + + - **Payload format** - if the format field is set to `'payload'`, the `ConstructedFormat` type will return a [`GenericExtrinsicPayload`](https://github.com/polkadot-js/api/blob/{{ dependencies.polkadot_js_api.version}}/packages/types/src/extrinsic/ExtrinsicPayload.ts#L83){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/{{ dependencies.polkadot_js_api.version}}/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 diff --git a/.snippets/code/polkadot-protocol/basics/accounts/account-data-structure-1.rs b/.snippets/code/polkadot-protocol/basics/accounts/account-data-structure-1.rs deleted file mode 100644 index cb754aae0..000000000 --- a/.snippets/code/polkadot-protocol/basics/accounts/account-data-structure-1.rs +++ /dev/null @@ -1,10 +0,0 @@ -/// The full account information for a particular account ID -#[pallet::storage] -#[pallet::getter(fn account)] -pub type Account = StorageMap< - _, - Blake2_128Concat, - T::AccountId, - AccountInfo, - ValueQuery, ->; diff --git a/.snippets/code/polkadot-protocol/basics/accounts/account-data-structure-2.rs b/.snippets/code/polkadot-protocol/basics/accounts/account-data-structure-2.rs deleted file mode 100644 index a896cf0a3..000000000 --- a/.snippets/code/polkadot-protocol/basics/accounts/account-data-structure-2.rs +++ /dev/null @@ -1,8 +0,0 @@ -#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)] -pub struct AccountInfo { - pub nonce: Nonce, - pub consumers: RefCount, - pub providers: RefCount, - pub sufficients: RefCount, - pub data: AccountData, -} diff --git a/develop/interoperability/test-and-debug.md b/develop/interoperability/test-and-debug.md index 73e761009..08e3d18ac 100644 --- a/develop/interoperability/test-and-debug.md +++ b/develop/interoperability/test-and-debug.md @@ -13,7 +13,7 @@ This article explores two indispensable tools for XCM testing, the [XCM Simulato ## XCM Simulator -Setting up a live network with multiple interconnected parachains for XCM testing can be complex and resource-intensive. To address this, the [`xcm-simulator`](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot/xcm/xcm-simulator){target=\_blank} was developed. This versatile tool enables developers to test and experiment with XCM in a controlled, simulated network environment. +Setting up a live network with multiple interconnected parachains for XCM testing can be complex and resource-intensive. To address this, the [`xcm-simulator`](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-simulator){target=\_blank} was developed. This versatile tool enables developers to test and experiment with XCM in a controlled, simulated network environment. The `xcm-simulator` offers a fast and efficient way to test [XCM instructions](https://github.com/polkadot-fellows/xcm-format?tab=readme-ov-file#5-the-xcvm-instruction-set){target=\_blank} against the [`xcm-executor`](https://paritytech.github.io/polkadot-sdk/master/staging_xcm_executor/index.html){target=\_blank}. It serves as an experimental playground for developers, supporting features such as: @@ -26,7 +26,7 @@ The `xcm-simulator` achieves this by utilizing mocked runtimes for both the rela The `xcm-simulator` provides the following macros for building a mocked simulation environment: -- [**`decl_test_relay_chain`**](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-simulator/src/lib.rs#L110C14-L110C35){target=\_blank} - implements upward message passing (UMP) for the specified relay chain struct. The struct must define the XCM configuration for the relay chain: +- [**`decl_test_relay_chain`**](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-simulator/src/lib.rs#L110C14-L110C35){target=\_blank} - implements upward message passing (UMP) for the specified relay chain struct. The struct must define the XCM configuration for the relay chain: ```rust decl_test_relay_chain! { @@ -38,10 +38,10 @@ The `xcm-simulator` provides the following macros for building a mocked simulati } ``` - The [`relay_ext()`](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-simulator/example/src/lib.rs#L117C1-L139C2){target=\_blank} sets up a test environment for the relay chain with predefined storage, then returns a [`TestExternalities`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_frame/testing_prelude/type.TestExternalities.html){target=\_blank} instance for further testing. + The [`relay_ext()`](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-simulator/example/src/lib.rs#L117C1-L139C2){target=\_blank} sets up a test environment for the relay chain with predefined storage, then returns a [`TestExternalities`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_frame/testing_prelude/type.TestExternalities.html){target=\_blank} instance for further testing. -- [**`decl_test_parachain`**](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-simulator/src/lib.rs#L180){target=\_blank} - implements the [`XcmMessageHandlerT`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator/trait.XcmpMessageHandlerT.html){target=\_blank} and [`DmpMessageHandlerT`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator/trait.DmpMessageHandlerT.html){target=\_blank} traits for the specified parachain struct. Requires the parachain struct to include the `XcmpMessageHandler` and `DmpMessageHandler` pallets, which define the logic for processing messages (implemented through [`mock_message_queue`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator/mock_message_queue/index.html){target=\_blank}). The patter must be the following: +- [**`decl_test_parachain`**](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-simulator/src/lib.rs#L180){target=\_blank} - implements the [`XcmMessageHandlerT`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator/trait.XcmpMessageHandlerT.html){target=\_blank} and [`DmpMessageHandlerT`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator/trait.DmpMessageHandlerT.html){target=\_blank} traits for the specified parachain struct. Requires the parachain struct to include the `XcmpMessageHandler` and `DmpMessageHandler` pallets, which define the logic for processing messages (implemented through [`mock_message_queue`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator/mock_message_queue/index.html){target=\_blank}). The pattern must be the following: ```rust decl_test_parachain! { @@ -54,12 +54,12 @@ The `xcm-simulator` provides the following macros for building a mocked simulati } ``` - The [`para_ext(para_id: u32)`](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-simulator/example/src/lib.rs#L97C1-L115C2){target=\_blank} function initializes a test environment for a parachain with a specified `para_id`, sets the initial configuration of the parachain, returning a [`TestExternalities`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_frame/testing_prelude/type.TestExternalities.html){target=\_blank} instance for testing. + The [`para_ext(para_id: u32)`](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-simulator/example/src/lib.rs#L97C1-L115C2){target=\_blank} function initializes a test environment for a parachain with a specified `para_id`, sets the initial configuration of the parachain, returning a [`TestExternalities`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_frame/testing_prelude/type.TestExternalities.html){target=\_blank} instance for testing. !!!note Developers can take this idea and define as many parachains as they want, like `ParaA`, `ParaB`, `ParaC`, etc -- [**`decl_test_network`**](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-simulator/src/lib.rs#L292){target=\_blank} - defines a testing network consisting of a relay chain and multiple parachains. Takes a network struct as input and implements functionalities for testing, including [`ParachainXcmRouter`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator_example/struct.ParachainXcmRouter.html){target=\_blank} and [`RelayChainXcmRouter`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator_example/struct.RelayChainXcmRouter.html){target=\_blank}. The struct must specify the relay chain and an indexed list of parachains to be included in the network: +- [**`decl_test_network`**](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-simulator/src/lib.rs#L292){target=\_blank} - defines a testing network consisting of a relay chain and multiple parachains. Takes a network struct as input and implements functionalities for testing, including [`ParachainXcmRouter`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator_example/struct.ParachainXcmRouter.html){target=\_blank} and [`RelayChainXcmRouter`](https://paritytech.github.io/polkadot-sdk/master/xcm_simulator_example/struct.RelayChainXcmRouter.html){target=\_blank}. The struct must specify the relay chain and an indexed list of parachains to be included in the network: ```rust decl_test_network! { @@ -75,14 +75,14 @@ The `xcm-simulator` provides the following macros for building a mocked simulati By leveraging these macros, developers can customize their testing networks by defining relay chains and parachains tailored to their needs. -For guidance on implementing a mock runtime for a Polkadot SDK-based chain, refer to the [Pallet Testing](/develop/parachains/customize-parachain/pallet-testing/){target=\_blank} article. This framework enables thorough testing of runtime and cross-chain interactions. +For guidance on implementing a mock runtime for a Polkadot SDK-based chain, refer to the [Pallet Testing](/develop/parachains/testing/pallet-testing/){target=\_blank} article. This framework enables thorough testing of runtime and cross-chain interactions. For a complete example of how to use the `xcm-simulator`, explore the [`sample`](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot/xcm/xcm-simulator/example){target=\_blank} provided in the `xcm-simulator` codebase. ## XCM Emulator -The [`xcm-emulator`](https://github.com/paritytech/polkadot-sdk/tree/master/cumulus/xcm/xcm-emulator){target=\_blank} is a tool designed to simulate the execution of XCM programs using predefined runtime configurations. These configurations include those utilized by live networks like Kusama, Polkadot, and the Asset Hub. +The [`xcm-emulator`](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/cumulus/xcm/xcm-emulator){target=\_blank} is a tool designed to simulate the execution of XCM programs using predefined runtime configurations. These configurations include those utilized by live networks like Kusama, Polkadot, and the Asset Hub. This tool enables testing of cross-chain message passing, providing a way to verify outcomes, weights, and side effects efficiently. @@ -107,9 +107,9 @@ The XCM Emulator provides both advantages and limitations when testing cross-cha The `xcm-emulator` package builds upon the functionality provided by the `xcm-simulator` package, offering the same set of macros while extending their capabilities. In addition to the standard features, `xcm-emulator` introduces new tools that make testing cross-chain communication more comprehensive. -One of the key additions is the [`decl_test_bridges`](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/xcm/xcm-emulator/src/lib.rs#L1178){target=\_blank} macro. This macro allows developers to define and implement mock bridges for testing interoperability in the Polkadot ecosystem. +One of the key additions is the [`decl_test_bridges`](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/cumulus/xcm/xcm-emulator/src/lib.rs#L1178){target=\_blank} macro. This macro allows developers to define and implement mock bridges for testing interoperability in the Polkadot ecosystem. -- [**`decl_test_bridges`**](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/xcm/xcm-emulator/src/lib.rs#L1178){target=\_blank} - enables the creation of multiple bridges between chains, specifying their source chain, target chain, and the handler responsible for processing messages +- [**`decl_test_bridges`**](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/cumulus/xcm/xcm-emulator/src/lib.rs#L1178){target=\_blank} - enables the creation of multiple bridges between chains, specifying their source chain, target chain, and the handler responsible for processing messages ```rust decl_test_bridges! { diff --git a/develop/interoperability/xcm-config.md b/develop/interoperability/xcm-config.md index 9cfac6e97..80e84aa8a 100644 --- a/develop/interoperability/xcm-config.md +++ b/develop/interoperability/xcm-config.md @@ -15,7 +15,7 @@ The executor is highly configurable, with the [XCM builder](https://paritytech.g ## XCM Executor Configuration -The `Config` trait defines the XCM executor’s configuration, which requires several associated types. Each type has specific trait bounds that the concrete implementation must fulfill. Some types, such as `RuntimeCall`, come with a default implementation in most cases, while others use the unit type `()` as the default. For many of these types, selecting the appropriate implementation carefully is crucial. Predefined solutions and building blocks can be adapted to your specific needs. These solutions can be found in the [`xcm-builder`](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot/xcm/xcm-builder){target=\_blank} folder. +The `Config` trait defines the XCM executor’s configuration, which requires several associated types. Each type has specific trait bounds that the concrete implementation must fulfill. Some types, such as `RuntimeCall`, come with a default implementation in most cases, while others use the unit type `()` as the default. For many of these types, selecting the appropriate implementation carefully is crucial. Predefined solutions and building blocks can be adapted to your specific needs. These solutions can be found in the [`xcm-builder`](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/polkadot/xcm/xcm-builder){target=\_blank} folder. Each type is explained below, along with an overview of some of its implementations: diff --git a/develop/parachains/customize-parachain/add-existing-pallets.md b/develop/parachains/customize-parachain/add-existing-pallets.md index 4807ae387..f7ed7ecab 100644 --- a/develop/parachains/customize-parachain/add-existing-pallets.md +++ b/develop/parachains/customize-parachain/add-existing-pallets.md @@ -109,7 +109,7 @@ At its core, the `Config` trait typically looks like this: This basic structure shows that every pallet must define certain types, such as `RuntimeEvent` and `WeightInfo`, to function within the runtime. The actual implementation can vary depending on the pallet’s specific needs. ??? "Example - Utility Pallet" - For instance, in the [`utility pallet`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/utility){target=\_blank}, the `Config` trait is implemented with the following types: + For instance, in the [`utility pallet`](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/utility){target=\_blank}, the `Config` trait is implemented with the following types: ```rust --8<-- 'code/develop/parachains/customize-parachain/add-existing-pallets/utility-pallet-config-trait.rs' diff --git a/develop/parachains/customize-parachain/index.md b/develop/parachains/customize-parachain/index.md index 61da10cf6..75fdd0a52 100644 --- a/develop/parachains/customize-parachain/index.md +++ b/develop/parachains/customize-parachain/index.md @@ -10,7 +10,7 @@ template: index-page.html Learn how to build a custom parachain with Polkadot SDK's FRAME framework, which includes pallet development, testing, smart contracts, and runtime customization. Pallets are modular components within the FRAME ecosystem that contain specific blockchain functionalities. This modularity grants developers increased flexibility and control around which behaviors to include in the core logic of their parachain. -The [FRAME directory](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame){target=\_blank} includes a robust library of pre-built pallets you can use as examples or templates to ease development. +The [FRAME directory](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame){target=\_blank} includes a robust library of pre-built pallets you can use as examples or templates to ease development. ## In This Section @@ -20,7 +20,7 @@ The [FRAME directory](https://github.com/paritytech/polkadot-sdk/tree/master/sub
- +

FRAME Repository

View the source code of the FRAME development environment that provides pallets you can use, modify, and extend to build the runtime logic to suit the needs of your blockchain.

diff --git a/develop/parachains/customize-parachain/overview.md b/develop/parachains/customize-parachain/overview.md index dcf4450f5..5d079a385 100644 --- a/develop/parachains/customize-parachain/overview.md +++ b/develop/parachains/customize-parachain/overview.md @@ -29,7 +29,7 @@ Developers have the flexibility to implement any desired behavior in the core lo - Storing information - Enforcing business rules -Pallets also include necessary wiring code to ensure proper integration and functionality within the runtime. FRAME provides a range of [pre-built pallets](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame){target=\_blank} for standard and common blockchain functionalities, including consensus algorithms, staking mechanisms, governance systems, and more. These pre-existing pallets serve as building blocks or templates, which developers can use as-is, modify, or reference when creating custom functionalities. +Pallets also include necessary wiring code to ensure proper integration and functionality within the runtime. FRAME provides a range of [pre-built pallets](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame){target=\_blank} for standard and common blockchain functionalities, including consensus algorithms, staking mechanisms, governance systems, and more. These pre-existing pallets serve as building blocks or templates, which developers can use as-is, modify, or reference when creating custom functionalities. #### Pallet Structure diff --git a/develop/parachains/deployment/generate-chain-specs.md b/develop/parachains/deployment/generate-chain-specs.md index 8e79c9b1c..ed76e3ca3 100644 --- a/develop/parachains/deployment/generate-chain-specs.md +++ b/develop/parachains/deployment/generate-chain-specs.md @@ -93,8 +93,8 @@ chain-spec-builder create -r Ensure to replace `` with the path to the runtime Wasm file and `` with the command to insert the runtime into the chain specification. The available commands are: -- **`patch`** - overwrites the runtime's default genesis config with the provided patch. You can check the following [patch file](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable1985-rc1/substrate/bin/utils/chain-spec-builder/tests/input/patch.json){target=\_blank} as a reference -- **`full`** - build the genesis config for runtime using the JSON file. No defaults will be used. As a reference, you can check the following [full file](https://github.com/paritytech/polkadot-sdk/blob/polkadot-stable1985-rc1/substrate/bin/utils/chain-spec-builder/tests/input/full.json){target=\_blank} +- **`patch`** - overwrites the runtime's default genesis config with the provided patch. You can check the following [patch file](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/substrate/bin/utils/chain-spec-builder/tests/input/patch.json){target=\_blank} as a reference +- **`full`** - build the genesis config for runtime using the JSON file. No defaults will be used. As a reference, you can check the following [full file](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/substrate/bin/utils/chain-spec-builder/tests/input/full.json){target=\_blank} - **`default`** - gets the default genesis config for the runtime and uses it in `ChainSpec`. Please note that the default genesis config may not be valid. For some runtimes, initial values should be added there (e.g., session keys, BABE epoch) - **`named-preset`** - uses named preset provided by the runtime to build the chain spec diff --git a/develop/parachains/intro-polkadot-sdk.md b/develop/parachains/intro-polkadot-sdk.md index 47f08dacf..9745961da 100644 --- a/develop/parachains/intro-polkadot-sdk.md +++ b/develop/parachains/intro-polkadot-sdk.md @@ -7,7 +7,7 @@ description: Learn about the Polkadot SDK, a robust developer toolkit for buildi ## Introduction -The [Polkadot SDK](https://github.com/paritytech/polkadot-sdk){target=\_blank} is a powerful and versatile developer kit designed to facilitate building on the Polkadot network. It provides the necessary components for creating custom blockchains, parachains, generalized rollups, and more. Written in the Rust programming language, it puts security and robustness at the forefront of its design. +The [Polkadot SDK](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}){target=\_blank} is a powerful and versatile developer kit designed to facilitate building on the Polkadot network. It provides the necessary components for creating custom blockchains, parachains, generalized rollups, and more. Written in the Rust programming language, it puts security and robustness at the forefront of its design. Whether you're building a standalone chain or deploying a parachain on Polkadot, this SDK equips developers with the libraries and tools needed to manage runtime logic, compile the codebase, and utilize core features like staking, governance, and Cross-Consensus Messaging (XCM). It also provides a means for building generalized peer-to-peer systems beyond blockchains. The Polkadot SDK houses the following overall functionality: diff --git a/develop/parachains/maintenance/storage-migrations.md b/develop/parachains/maintenance/storage-migrations.md index 334aef4e8..da0ce826f 100644 --- a/develop/parachains/maintenance/storage-migrations.md +++ b/develop/parachains/maintenance/storage-migrations.md @@ -187,4 +187,4 @@ Multi-block migrations are ideal when dealing with: The primary trade-off is increased implementation complexity, as you must manage the migration state and handle partial completion scenarios. However, multi-block migrations' significant safety benefits and operational reliability are typically worth the increased complexity. -For a complete implementation example of multi-block migrations, refer to the [official example](https://github.com/paritytech/polkadot-sdk/tree/0d7d2177807ec6b3094f4491a45b0bc0d74d3c8b/substrate/frame/examples/multi-block-migrations){target=\_blank} in the Polkadot SDK. \ No newline at end of file +For a complete implementation example of multi-block migrations, refer to the [official example](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/examples/multi-block-migrations){target=\_blank} in the Polkadot SDK. \ No newline at end of file diff --git a/develop/smart-contracts/overview.md b/develop/smart-contracts/overview.md index c3f309c28..70276f332 100644 --- a/develop/smart-contracts/overview.md +++ b/develop/smart-contracts/overview.md @@ -45,7 +45,7 @@ These strengths do come with certain limitations. Some smart contracts environme Another downside is that smart contracts often follow a gas metering model, where program execution is associated with a given unit and a marketplace is set up to pay for such an execution unit. This fee system is often very rigid, and some complex flows, like account abstraction, have been developed to circumvent this problem. -In contrast, parachains can create their own custom logics (known as pallets or modules), and combine them as the state transition function (STF or runtime) thanks to the modularity provided by the [Polkadot-SDK](https://github.com/paritytech/polkadot-sdk/){target=\_blank}. The different pallets within the parachain runtime can give developers a lot of flexibility when building applications on top of it. +In contrast, parachains can create their own custom logics (known as pallets or modules), and combine them as the state transition function (STF or runtime) thanks to the modularity provided by the [Polkadot-SDK](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}){target=\_blank}. The different pallets within the parachain runtime can give developers a lot of flexibility when building applications on top of it. ``` mermaid flowchart LR diff --git a/develop/toolkit/interoperability/asset-transfer-api/reference.md b/develop/toolkit/interoperability/asset-transfer-api/reference.md index c7efabc55..5a6c9d24c 100644 --- a/develop/toolkit/interoperability/asset-transfer-api/reference.md +++ b/develop/toolkit/interoperability/asset-transfer-api/reference.md @@ -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" @@ -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' ``` ??? interface "Request parameters" @@ -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" @@ -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" @@ -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" @@ -208,7 +208,15 @@ Fetch estimated fee information for an extrinsic. ??? child "Type `ConstructedFormat`" - --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/{{ dependencies.polkadot_js_api.version}}/packages/types/src/extrinsic/ExtrinsicPayload.ts#L83){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/{{ dependencies.polkadot_js_api.version}}/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 --- @@ -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" @@ -238,7 +246,7 @@ Fetch estimated fee information for an extrinsic. } ``` - For more information on the underlying types and fields of `RuntimeDispatchInfo`, check the [RuntimeDispatchInfo](https://github.com/polkadot-js/api/blob/2329af239eaf194696daeaa58ebf89f0080a5e0d/packages/types/src/interfaces/payment/types.ts#L21){target=\_blank} source code. + For more information on the underlying types and fields of `RuntimeDispatchInfo`, check the [`RuntimeDispatchInfo`](https://github.com/polkadot-js/api/blob/{{ dependencies.polkadot_js_api.version}}/packages/types/src/interfaces/payment/types.ts#L21){target=\_blank} source code. ??? child "Type `RuntimeDispatchInfoV1`" @@ -251,7 +259,7 @@ Fetch estimated fee information for an extrinsic. } ``` - For more information on the underlying types and fields of `RuntimeDispatchInfoV1`, check the [RuntimeDispatchInfoV1](https://github.com/polkadot-js/api/blob/2329af239eaf194696daeaa58ebf89f0080a5e0d/packages/types/src/interfaces/payment/types.ts#L28){target=\_blank} source code. + For more information on the underlying types and fields of `RuntimeDispatchInfoV1`, check the [`RuntimeDispatchInfoV1`](https://github.com/polkadot-js/api/blob/{{ dependencies.polkadot_js_api.version}}/packages/types/src/interfaces/payment/types.ts#L28){target=\_blank} source code. ??? interface "Example" diff --git a/infrastructure/running-a-validator/onboarding-and-offboarding/set-up-validator.md b/infrastructure/running-a-validator/onboarding-and-offboarding/set-up-validator.md index 52ff3e559..cb6a642c4 100644 --- a/infrastructure/running-a-validator/onboarding-and-offboarding/set-up-validator.md +++ b/infrastructure/running-a-validator/onboarding-and-offboarding/set-up-validator.md @@ -155,7 +155,7 @@ docker.io/parity/polkadot:INSERT_VERSION_NUMBER ### Build from Sources -You may build the binaries from source by following the instructions on the [Polkadot SDK repository](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot#building){target=\_blank}. +You may build the binaries from source by following the instructions on the [Polkadot SDK repository](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/polkadot#building){target=\_blank}. ### Verify Installation diff --git a/polkadot-protocol/architecture/polkadot-chain/pos-consensus.md b/polkadot-protocol/architecture/polkadot-chain/pos-consensus.md index 0c79fa7ad..ad228ae03 100644 --- a/polkadot-protocol/architecture/polkadot-chain/pos-consensus.md +++ b/polkadot-protocol/architecture/polkadot-chain/pos-consensus.md @@ -118,6 +118,6 @@ Key features of BEEFY include: ## Resources - [GRANDPA Rust implementation](https://github.com/paritytech/finality-grandpa){target=\_blank} -- [GRANDPA Pallet](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/grandpa/src/lib.rs){target=\_blank} +- [GRANDPA Pallet](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/grandpa/src/lib.rs){target=\_blank} - [Block Production and Finalization in Polkadot](https://www.crowdcast.io/e/polkadot-block-production){target=\_blank} - Bill Laboon explains how BABE and GRANDPA work together to produce and finalize blocks on Kusama - [Block Production and Finalization in Polkadot: Understanding the BABE and GRANDPA Protocols](https://www.youtube.com/watch?v=1CuTSluL7v4&t=4s){target=\_blank} - Bill Laboon's MIT Cryptoeconomic Systems 2020 academic talk describing Polkadot's hybrid consensus model in-depth \ No newline at end of file diff --git a/polkadot-protocol/architecture/system-chains/asset-hub.md b/polkadot-protocol/architecture/system-chains/asset-hub.md index c3eb1578f..c5b3f815e 100644 --- a/polkadot-protocol/architecture/system-chains/asset-hub.md +++ b/polkadot-protocol/architecture/system-chains/asset-hub.md @@ -161,7 +161,7 @@ The API supports various asset operations, such as paying transaction fees with ### Parachain Node -To fully leverage the Asset Hub's functionality, developers will need to run a system parachain node. Setting up an Asset Hub node allows users to interact with the parachain in real time, syncing data and participating in the broader Polkadot ecosystem. Guidelines for setting up an [Asset Hub node](https://github.com/paritytech/polkadot-sdk/tree/master/cumulus#asset-hub-){target=\_blank} are available in the Parity documentation. +To fully leverage the Asset Hub's functionality, developers will need to run a system parachain node. Setting up an Asset Hub node allows users to interact with the parachain in real time, syncing data and participating in the broader Polkadot ecosystem. Guidelines for setting up an [Asset Hub node](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/cumulus#asset-hub-){target=\_blank} are available in the Parity documentation. Using these integration tools, developers can manage assets seamlessly and integrate Asset Hub functionality into their applications, leveraging Polkadot's powerful infrastructure. diff --git a/polkadot-protocol/architecture/system-chains/bridge-hub.md b/polkadot-protocol/architecture/system-chains/bridge-hub.md index eab4ff190..91bd8eaf6 100644 --- a/polkadot-protocol/architecture/system-chains/bridge-hub.md +++ b/polkadot-protocol/architecture/system-chains/bridge-hub.md @@ -37,7 +37,7 @@ In any given Bridge Hub implementation (Kusama, Polkadot, or other relay chains) Bridge Hub also has a set of components and pallets that support a bridge between Polkadot and Ethereum through [Snowbridge](https://github.com/Snowfork/snowbridge){target=\_blank}. -To view the complete list of which pallets are included in Bridge Hub, visit the Subscan [Runtime Modules](https://bridgehub-polkadot.subscan.io/runtime){target=\_blank} page. Alternatively, the source code for those pallets can be found in the Polkadot SDK [Snowbridge Pallets](https://github.com/paritytech/polkadot-sdk/tree/aff3a0796176ff3c0ee1b89c2f1d811a858f17a8/bridges/snowbridge/pallets){target=\_blank} repository. +To view the complete list of which pallets are included in Bridge Hub, visit the Subscan [Runtime Modules](https://bridgehub-polkadot.subscan.io/runtime){target=\_blank} page. Alternatively, the source code for those pallets can be found in the Polkadot SDK [Snowbridge Pallets](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/bridges/snowbridge/pallets){target=\_blank} repository. ## Deployed Bridges @@ -47,6 +47,6 @@ To view the complete list of which pallets are included in Bridge Hub, visit the ## Where to Go Next -- Go over the Bridge Hub README in the Polkadot SDK [Bridge-hub Parachains](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/runtimes/bridge-hubs/README.md){target=\_blank} repository -- Take a deeper dive into bridging architecture in the Polkadot SDK [High-Level Bridge](https://github.com/paritytech/polkadot-sdk/blob/master/bridges/docs/high-level-overview.md){target=\_blank} documentation +- Go over the Bridge Hub README in the Polkadot SDK [Bridge-hub Parachains](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/cumulus/parachains/runtimes/bridge-hubs/README.md){target=\_blank} repository +- Take a deeper dive into bridging architecture in the Polkadot SDK [High-Level Bridge](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/bridges/docs/high-level-overview.md){target=\_blank} documentation - Read more about BEEFY and Bridging in the Polkadot Wiki: [Bridging: BEEFY](https://wiki.polkadot.network/docs/learn-consensus#bridging-beefy){target=\_blank} diff --git a/polkadot-protocol/architecture/system-chains/overview.md b/polkadot-protocol/architecture/system-chains/overview.md index a7259e7ad..b858198ce 100644 --- a/polkadot-protocol/architecture/system-chains/overview.md +++ b/polkadot-protocol/architecture/system-chains/overview.md @@ -53,7 +53,7 @@ All system parachains are on both Polkadot and Kusama with the following excepti ### Asset Hub -The [Asset Hub](https://github.com/paritytech/polkadot-sdk/tree/master/cumulus#asset-hub-){target=\_blank} is an asset portal for the entire network. It helps asset creators, such as reserve-backed stablecoin issuers, track the total issuance of an asset in the network, including amounts transferred to other parachains. It also serves as the hub where asset creators can perform on-chain operations, such as minting and burning, to manage their assets effectively. +The [Asset Hub](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/cumulus#asset-hub-){target=\_blank} is an asset portal for the entire network. It helps asset creators, such as reserve-backed stablecoin issuers, track the total issuance of an asset in the network, including amounts transferred to other parachains. It also serves as the hub where asset creators can perform on-chain operations, such as minting and burning, to manage their assets effectively. This asset management logic is encoded directly in the runtime of the chain rather than in smart contracts. The efficiency of executing logic in a parachain allows for fees and deposits that are about 1/10th of what is required on the relay chain. These low fees mean that the Asset Hub is well suited for handling the frequent transactions required when managing balances, transfers, and on-chain assets. diff --git a/polkadot-protocol/basics/accounts.md b/polkadot-protocol/basics/accounts.md index f5e14d811..7a5f12e29 100644 --- a/polkadot-protocol/basics/accounts.md +++ b/polkadot-protocol/basics/accounts.md @@ -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`). @@ -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: diff --git a/polkadot-protocol/basics/blocks-transactions-fees/fees.md b/polkadot-protocol/basics/blocks-transactions-fees/fees.md index 79ef884d4..9220c4ee0 100644 --- a/polkadot-protocol/basics/blocks-transactions-fees/fees.md +++ b/polkadot-protocol/basics/blocks-transactions-fees/fees.md @@ -42,7 +42,7 @@ Transaction fees are withdrawn before the transaction is executed. After the tra ## Using the Transaction Payment Pallet -The [Transaction Payment pallet](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/transaction-payment){target=\_blank} provides the basic logic for calculating the inclusion fee. You can also use the Transaction Payment pallet to: +The [Transaction Payment pallet](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/transaction-payment){target=\_blank} provides the basic logic for calculating the inclusion fee. You can also use the Transaction Payment pallet to: - Convert a weight value into a deductible fee based on a currency type using [`Config::WeightToFee`](https://docs.rs/pallet-transaction-payment/latest/pallet_transaction_payment/pallet/trait.Config.html#associatedtype.WeightToFee){target=\_blank} - Update the fee for the next block by defining a multiplier based on the chain’s final state at the end of the previous block using [`Config::FeeMultiplierUpdate`](https://docs.rs/pallet-transaction-payment/latest/pallet_transaction_payment/pallet/trait.Config.html#associatedtype.FeeMultiplierUpdate){target=\_blank} @@ -96,7 +96,7 @@ Inclusion fees must be computable before execution and can only represent fixed - Bonds are a type of fee that might be returned or slashed after some on-chain event. For example, you might want to require users to place a bond to participate in a vote. The bond might then be returned at the end of the referendum or slashed if the voter attempted malicious behavior - Deposits are fees that might be returned later. For example, you might require users to pay a deposit to execute an operation that uses storage. The user’s deposit could be returned if a subsequent operation frees up storage - Burn operations are used to pay for a transaction based on its internal logic. For example, a transaction might burn funds from the sender if the transaction creates new storage items to pay for the increased state size -- Limits enable you to enforce constant or configurable limits on specific operations. For example, the default [Staking pallet](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/staking){target=\_blank} only allows nominators to nominate 16 validators to limit the complexity of the validator election process +- Limits enable you to enforce constant or configurable limits on specific operations. For example, the default [Staking pallet](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/staking){target=\_blank} only allows nominators to nominate 16 validators to limit the complexity of the validator election process It is important to note that if you query the chain for a transaction fee, it only returns the inclusion fee. @@ -220,5 +220,5 @@ You now know the weight system, how it affects transaction fee computation, and - [Benchmark](/develop/parachains/testing/benchmarking/) - [`SignedExtension`](https://paritytech.github.io/polkadot-sdk/master/sp_runtime/traits/trait.SignedExtension.html){target=\_blank} -- [Custom weights for the Example pallet](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/examples/basic/src/weights.rs){target=\_blank} +- [Custom weights for the Example pallet](https://github.com/paritytech/polkadot-sdk/blob/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/examples/basic/src/weights.rs){target=\_blank} - [Web3 Foundation Research](https://research.web3.foundation/Polkadot/overview/token-economics#relay-chain-transaction-fees-and-per-block-transaction-limits){target=\_blank} \ No newline at end of file diff --git a/polkadot-protocol/glossary.md b/polkadot-protocol/glossary.md index b8c32f194..d387d7e79 100644 --- a/polkadot-protocol/glossary.md +++ b/polkadot-protocol/glossary.md @@ -116,7 +116,7 @@ Well-known development accounts, such as Alice, Bob, Charlie, Dave, Eve, and Fer bottom drive obey lake curtain smoke basket hold race lonely fit walk ``` -Many tools in the Polkadot SDK ecosystem, such as [`subkey`](https://github.com/paritytech/polkadot-sdk/tree/HEAD/substrate/bin/utils/subkey){target=\_blank}, allow you to implicitly specify an account using a derivation path such as `//Alice`. +Many tools in the Polkadot SDK ecosystem, such as [`subkey`](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/bin/utils/subkey){target=\_blank}, allow you to implicitly specify an account using a derivation path such as `//Alice`. ## Digest diff --git a/polkadot-protocol/onchain-governance/overview.md b/polkadot-protocol/onchain-governance/overview.md index 4548197ce..d30d5d6b9 100644 --- a/polkadot-protocol/onchain-governance/overview.md +++ b/polkadot-protocol/onchain-governance/overview.md @@ -82,7 +82,7 @@ See [Cancelling, Killing, and Blacklisting](https://wiki.polkadot.network/docs/l ## Additional Resources -- [**Democracy pallet**](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/democracy/src){target=\_blank} - handles administration of general stakeholder voting +- [**Democracy pallet**](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/democracy/src){target=\_blank} - handles administration of general stakeholder voting - [**Gov2: Polkadot’s Next Generation of Decentralised Governance**](https://medium.com/polkadot-network/gov2-polkadots-next-generation-of-decentralised-governance-4d9ef657d11b){target=\_blank} - Medium article by Gavin Wood - [**Polkadot Direction**](https://matrix.to/#/#Polkadot-Direction:parity.io){target=\_blank} - Matrix Element client - [**Polkassembly**](https://polkadot.polkassembly.io/){target=\_blank} - OpenGov dashboard and UI diff --git a/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion.md b/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion.md index 8c32ca269..e90c3915c 100644 --- a/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion.md +++ b/tutorials/polkadot-sdk/system-chains/asset-hub/asset-conversion.md @@ -9,7 +9,7 @@ description: A guide detailing the step-by-step process of converting assets on Asset Conversion is an Automated Market Maker (AMM) utilizing [Uniswap V2](https://github.com/Uniswap/v2-core){target=\_blank} logic and implemented as a pallet on Polkadot's Asset Hub. For more details about this feature, please visit the [Asset Conversion on Asset Hub](https://wiki.polkadot.network/docs/learn-asset-conversion-assethub){target=\_blank} wiki page. -This guide will provide detailed information about the key functionalities offered by the [Asset Conversion](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/asset-conversion){target=\_blank} pallet on Asset Hub, including: +This guide will provide detailed information about the key functionalities offered by the [Asset Conversion](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.polkadot_sdk.stable_version}}/substrate/frame/asset-conversion){target=\_blank} pallet on Asset Hub, including: - Creating a liquidity pool - Adding liquidity to a pool diff --git a/variables.yml b/variables.yml index 2c54027a9..3c7218619 100644 --- a/variables.yml +++ b/variables.yml @@ -16,9 +16,12 @@ dependencies: polkadot_sdk_solochain_template: repository_url: https://github.com/paritytech/polkadot-sdk-solochain-template version: v0.0.2 - polkadot_sdk_parachain_template: - repository_url: https://github.com/paritytech/polkadot-sdk-parachain-template - version: v0.0.2 + polkadot_sdk: + repository_url: https://github.com/paritytech/polkadot-sdk + # version: v1.16.2-rc1 + stable_version: polkadot-stable2412 + polkadot_js_api: + version: v15.0.2 srtool: repository_url: https://github.com/paritytech/srtool version: v0.16.0