@paraspell/assets 10.11.10 → 11.0.0
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 +10 -10
- package/dist/index.cjs +1425 -997
- package/dist/index.d.ts +112 -116
- package/dist/index.mjs +1414 -986
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ pnpm | npm install || yarn add @paraspell/assets
|
|
|
38
38
|
|
|
39
39
|
To use this functionality you first have to import it in the following way.
|
|
40
40
|
```ts
|
|
41
|
-
import { getAssetsObject, getAssetId, getRelayChainSymbol, getNativeAssets, getNativeAssets, getOtherAssets, getAllAssetsSymbols, hasSupportForAsset, getAssetDecimals, getParaId,
|
|
41
|
+
import { getAssetsObject, getAssetId, getRelayChainSymbol, getNativeAssets, getNativeAssets, getOtherAssets, getAllAssetsSymbols, hasSupportForAsset, getAssetDecimals, getParaId, getTChain, getAssetLocation, CHAINS } from '@paraspell/assets'
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
|
|
@@ -76,7 +76,7 @@ getAllAssetsSymbols('Acala')
|
|
|
76
76
|
### Query asset support
|
|
77
77
|
The function checks if Parachain supports a particular asset. (Both native and foreign assets are searched). Returns boolean
|
|
78
78
|
```ts
|
|
79
|
-
hasSupportForAsset(
|
|
79
|
+
hasSupportForAsset(chain: TChain, symbol: string)
|
|
80
80
|
```
|
|
81
81
|
### Query asset decimals
|
|
82
82
|
The function returns decimals for a specific asset
|
|
@@ -90,21 +90,21 @@ getParaId('Basilisk')
|
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
### Query Parachain name
|
|
93
|
-
Function to get specific
|
|
93
|
+
Function to get specific TChain from Parachain id
|
|
94
94
|
```ts
|
|
95
|
-
|
|
95
|
+
getTChain(chainID: number, ecosystem: 'Polkadot' | 'Kusama' | 'Ethereum' | 'Paseo' | 'Westend') //When Ethereum ecosystem is selected please fill chainID as 1 to select Ethereum.
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
### Import
|
|
99
|
-
Import all compatible
|
|
98
|
+
### Import chains as constant
|
|
99
|
+
Import all compatible chains as constant
|
|
100
100
|
```ts
|
|
101
|
-
console.log(
|
|
101
|
+
console.log(CHAINS)
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
### Convert id or symbol to
|
|
105
|
-
Get
|
|
104
|
+
### Convert id or symbol to location
|
|
105
|
+
Get location for asset id or symbol.
|
|
106
106
|
```ts
|
|
107
|
-
|
|
107
|
+
getAssetLocation(chainFrom, { symbol: symbol } | { id: assetId })
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
## 💻 Tests
|