You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -140,6 +144,7 @@ For non-sufficient assets, make sure the destination account has enough native t
140
144
Use proper runtime APIs for accurate fee estimation rather than hardcoded values:
141
145
142
146
-[Transaction Payment API](https://paritytech.github.io/polkadot-sdk/master/pallet_transaction_payment_rpc/trait.TransactionPaymentRuntimeApi.html){target=\_blank} for local fees:
147
+
143
148
```typescript
144
149
import { dot } from"@polkadot-api/descriptors";
145
150
import { createClient } from"polkadot-api";
@@ -153,8 +158,10 @@ Use proper runtime APIs for accurate fee estimation rather than hardcoded values
153
158
call.encodedLength
154
159
);
155
160
```
161
+
This code establishes a connection to the Polkadot network and queries detailed fee information for a specific transaction call, including base fees, length fees, and tip calculations.
156
162
157
163
-[XCM Payment API](https://paritytech.github.io/polkadot-sdk/master/xcm_runtime_apis/fees/trait.XcmPaymentApi.html){target=\_blank} for cross-chain delivery fees:
164
+
158
165
```typescript
159
166
import { dot } from"@polkadot-api/descriptors";
160
167
import { createClient } from"polkadot-api";
@@ -168,14 +175,16 @@ Use proper runtime APIs for accurate fee estimation rather than hardcoded values
168
175
message
169
176
);
170
177
```
178
+
This code calculates the delivery fees required to send an XCM message to a specific destination parachain, helping estimate cross-chain transaction costs.
171
179
172
180
-[Asset Conversion API](https://paritytech.github.io/polkadot-sdk/master/pallet_asset_conversion/trait.AssetConversionApi.html){target=\_blank} (available on Asset Hub) for fee conversion:
@@ -184,6 +193,7 @@ Use proper runtime APIs for accurate fee estimation rather than hardcoded values
184
193
amountIn
185
194
);
186
195
```
196
+
This code connects to Asset Hub's `AssetConversionApi` and calculates the exchange rate between different assets, allowing users to determine how much of one token they need to pay fees in another token.
187
197
188
198
### Multi-Asset Fee Handling
189
199
@@ -195,17 +205,17 @@ For dealing with non-sufficient assets and fees, there are different fee payment
- Verify XCM barrier configuration on the destination
295
-
- Ensure origin has proper permissions
296
-
- Check asset transfer limits and restrictions
297
-
- Use supported XCM version and instructions
304
+
- Verify XCM barrier configuration on the destination
305
+
- Ensure origin has proper permissions
306
+
- Check asset transfer limits and restrictions
307
+
- Use supported XCM version and instructions
298
308
299
309
You can find a full list of XCM errors in the [Polkadot Rust Docs](https://paritytech.github.io/polkadot-sdk/master/cumulus_primitives_core/enum.XcmError.html){target=\_blank}.
0 commit comments