@paraspell/sdk-pjs 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 -6
- package/dist/index.cjs +1 -5
- package/dist/index.mjs +2 -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-pjs?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" />
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
</p>
|
|
20
20
|
<p>Supporting every XCM Active Parachain <a href = "https://paraspell.github.io/docs/supported.html"\>[list]</p>
|
|
21
21
|
<p>SDK documentation <a href = "https://paraspell.github.io/docs/" \>[here]</p>
|
|
22
|
-
<p>SDK starter template project <a href = "https://github.com/paraspell/xcm-sdk-template" \>[here]</p>
|
|
23
22
|
</div>
|
|
24
23
|
|
|
25
24
|
<br /><br />
|
|
@@ -223,7 +222,7 @@ const result = await Builder(API /*optional*/)
|
|
|
223
222
|
.dryRun(SENDER_ADDRESS)
|
|
224
223
|
|
|
225
224
|
//Function pattern
|
|
226
|
-
getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
|
|
225
|
+
await getDryRun({api /*optional*/, node, address /*sender address*/, tx /* Extrinsic object */})
|
|
227
226
|
```
|
|
228
227
|
|
|
229
228
|
### Asset claim:
|
|
@@ -332,9 +331,8 @@ await getTransferableAmount({address, node, currency /*- {id: currencyID} | {sym
|
|
|
332
331
|
//Get all the information about XCM transfer
|
|
333
332
|
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 */})
|
|
334
333
|
|
|
335
|
-
//Get bridge and execution fee for transfer from Parachain to Ethereum. Returns as an object of 2 values
|
|
336
|
-
await getParaEthTransferFees(/*api - optional (Can also be WS port string or array o WS ports. Must be AssetHubPolkadot WS!)*/)
|
|
337
|
-
|
|
334
|
+
//Get bridge and execution fee for transfer from Parachain to Ethereum. Returns as an object of 2 values - [bridgeFee, executionFee]
|
|
335
|
+
await getParaEthTransferFees(/*api - optional (Can also be WS port string or array o WS ports. Must be AssetHubPolkadot WS!)*/)
|
|
338
336
|
```
|
|
339
337
|
|
|
340
338
|
## 💻 Tests
|
package/dist/index.cjs
CHANGED
|
@@ -896,15 +896,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
896
896
|
}
|
|
897
897
|
return createApiInstance;
|
|
898
898
|
}()
|
|
899
|
-
}, {
|
|
900
|
-
key: "createAccountId",
|
|
901
|
-
value: function createAccountId(address) {
|
|
902
|
-
return this.api.createType('AccountId32', address).toHex();
|
|
903
|
-
}
|
|
904
899
|
}, {
|
|
905
900
|
key: "accountToHex",
|
|
906
901
|
value: function accountToHex(address) {
|
|
907
902
|
var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
903
|
+
if (util.isHex(address)) return address;
|
|
908
904
|
var uint8Array = utilCrypto.decodeAddress(address);
|
|
909
905
|
return util.u8aToHex(uint8Array, -1, isPrefixed);
|
|
910
906
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { WETH9__factory } from '@snowbridge/contract-types';
|
|
|
5
5
|
import { WsProvider, ApiPromise } from '@polkadot/api';
|
|
6
6
|
import { u32 } from '@polkadot/types';
|
|
7
7
|
import { decodeAddress, blake2AsHex } from '@polkadot/util-crypto';
|
|
8
|
-
import { u8aToHex, numberToHex } from '@polkadot/util';
|
|
8
|
+
import { isHex, u8aToHex, numberToHex } from '@polkadot/util';
|
|
9
9
|
import { Contract } from 'ethers';
|
|
10
10
|
import { getContract, createPublicClient, http } from 'viem';
|
|
11
11
|
|
|
@@ -895,15 +895,11 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
895
895
|
}
|
|
896
896
|
return createApiInstance;
|
|
897
897
|
}()
|
|
898
|
-
}, {
|
|
899
|
-
key: "createAccountId",
|
|
900
|
-
value: function createAccountId(address) {
|
|
901
|
-
return this.api.createType('AccountId32', address).toHex();
|
|
902
|
-
}
|
|
903
898
|
}, {
|
|
904
899
|
key: "accountToHex",
|
|
905
900
|
value: function accountToHex(address) {
|
|
906
901
|
var isPrefixed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
902
|
+
if (isHex(address)) return address;
|
|
907
903
|
var uint8Array = decodeAddress(address);
|
|
908
904
|
return u8aToHex(uint8Array, -1, isPrefixed);
|
|
909
905
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-pjs",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.2",
|
|
4
4
|
"description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@snowbridge/contract-types": "^0.1.32",
|
|
28
28
|
"ethers": "^6.13.5",
|
|
29
29
|
"viem": "^2.22.22",
|
|
30
|
-
"@paraspell/sdk-core": "8.5.
|
|
30
|
+
"@paraspell/sdk-core": "8.5.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@polkadot/api": ">= 15.0 < 16",
|