@paraspell/sdk 8.5.0 → 8.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/dist/index.cjs +5 -6
- package/dist/index.mjs +5 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<img alt="downloads" src="https://img.shields.io/npm/dm/@paraspell/sdk?style=flat-square" />
|
|
12
12
|
</a>
|
|
13
13
|
<a href="https://github.com/paraspell/xcm-sdk/actions">
|
|
14
|
-
<img alt="build" src="https://github.com/paraspell/xcm-
|
|
14
|
+
<img alt="build" src="https://github.com/paraspell/xcm-tools/actions/workflows/ci.yml/badge.svg" />
|
|
15
15
|
</a>
|
|
16
16
|
<a href="https://snyk.io/test/github/paraspell/sdk">
|
|
17
17
|
<img alt="snyk" src="https://snyk.io/test/github/paraspell/sdk/badge.svg" />
|
|
@@ -225,7 +225,7 @@ const result = await Builder(API /*optional*/)
|
|
|
225
225
|
.dryRun(SENDER_ADDRESS)
|
|
226
226
|
|
|
227
227
|
//Function pattern
|
|
228
|
-
getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
|
|
228
|
+
await getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
### Asset claim:
|
|
@@ -334,9 +334,8 @@ await getTransferableAmount({address, node, currency /*- {id: currencyID} | {sym
|
|
|
334
334
|
//Get all the information about XCM transfer
|
|
335
335
|
await getTransferInfo({from, to, address, destinationAddress, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: AssetMultilocationString | AssetMultilocationJson}*/, amount, api /* api/ws_url_string optional */})
|
|
336
336
|
|
|
337
|
-
//Get bridge and execution fee for transfer from Parachain to Ethereum. Returns as an object of 2 values
|
|
338
|
-
await getParaEthTransferFees(/*api - optional (Can also be WS port string or array o WS ports. Must be AssetHubPolkadot WS!)*/)
|
|
339
|
-
|
|
337
|
+
//Get bridge and execution fee for transfer from Parachain to Ethereum. Returns as an object of 2 values - [bridgeFee, executionFee]
|
|
338
|
+
await getParaEthTransferFees(/*api - optional (Can also be WS port string or array o WS ports. Must be AssetHubPolkadot WS!)*/)
|
|
340
339
|
```
|
|
341
340
|
|
|
342
341
|
## 💻 Tests
|
package/dist/index.cjs
CHANGED
|
@@ -749,16 +749,15 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
749
749
|
}
|
|
750
750
|
return createApiInstance;
|
|
751
751
|
}()
|
|
752
|
-
}, {
|
|
753
|
-
key: "createAccountId",
|
|
754
|
-
value: function createAccountId(address) {
|
|
755
|
-
return polkadotApi.FixedSizeBinary.fromAccountId32(address).asHex();
|
|
756
|
-
}
|
|
757
752
|
}, {
|
|
758
753
|
key: "accountToHex",
|
|
759
754
|
value: function accountToHex(address) {
|
|
760
755
|
var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
761
|
-
var
|
|
756
|
+
var isHex = function isHex(str) {
|
|
757
|
+
return typeof str === 'string' && /^0x[0-9a-fA-F]+$/.test(str);
|
|
758
|
+
};
|
|
759
|
+
if (isHex(address)) return address;
|
|
760
|
+
var hex = polkadotApi.FixedSizeBinary.fromAccountId32(address).asHex();
|
|
762
761
|
return isPrefixed ? hex : hex.slice(2);
|
|
763
762
|
}
|
|
764
763
|
}, {
|
package/dist/index.mjs
CHANGED
|
@@ -748,16 +748,15 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
748
748
|
}
|
|
749
749
|
return createApiInstance;
|
|
750
750
|
}()
|
|
751
|
-
}, {
|
|
752
|
-
key: "createAccountId",
|
|
753
|
-
value: function createAccountId(address) {
|
|
754
|
-
return FixedSizeBinary.fromAccountId32(address).asHex();
|
|
755
|
-
}
|
|
756
751
|
}, {
|
|
757
752
|
key: "accountToHex",
|
|
758
753
|
value: function accountToHex(address) {
|
|
759
754
|
var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
760
|
-
var
|
|
755
|
+
var isHex = function isHex(str) {
|
|
756
|
+
return typeof str === 'string' && /^0x[0-9a-fA-F]+$/.test(str);
|
|
757
|
+
};
|
|
758
|
+
if (isHex(address)) return address;
|
|
759
|
+
var hex = FixedSizeBinary.fromAccountId32(address).asHex();
|
|
761
760
|
return isPrefixed ? hex : hex.slice(2);
|
|
762
761
|
}
|
|
763
762
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.2",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"ethers": "^6.13.5",
|
|
27
27
|
"viem": "^2.22.22",
|
|
28
|
-
"@paraspell/sdk-core": "8.5.
|
|
28
|
+
"@paraspell/sdk-core": "8.5.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.8.4 < 2"
|