@moonbeam-network/xcm-types 3.0.0 → 3.0.1
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 +14 -8
- package/package.json +20 -14
- package/build/index.d.mts +0 -171
package/README.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
The Types package contains the type definitions for the Moonbeam XCM SDK and MRL SDK.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Documentation for the Moonbeam XCM SDK
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## v3 (current)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Usage
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
- [XCM SDK](https://moonbeam-foundation.github.io/xcm-sdk/latest/example-usage/xcm)
|
|
10
|
+
- [MRL SDK](https://moonbeam-foundation.github.io/xcm-sdk/latest/example-usage/mrl)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
### References
|
|
12
13
|
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
14
|
+
- [XCM SDK](https://moonbeam-foundation.github.io/xcm-sdk/latest/reference/xcm)
|
|
15
|
+
- [MRL SDK](https://moonbeam-foundation.github.io/xcm-sdk/latest/reference/mrl)
|
|
16
|
+
|
|
17
|
+
## v2 (previous)
|
|
18
|
+
|
|
19
|
+
- [usage](https://moonbeam-foundation.github.io/xcm-sdk/v2/example-usage)
|
|
20
|
+
- [references](https://moonbeam-foundation.github.io/xcm-sdk/v2/reference/interfaces)
|
package/package.json
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbeam-network/xcm-types",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Moonbeam XCM Types",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "tsup",
|
|
7
|
-
"dev": "tsup --watch",
|
|
8
|
-
"link": "pnpm ln --global",
|
|
9
|
-
"test": "vitest --run",
|
|
10
|
-
"test:watch": "vitest",
|
|
11
|
-
"test:update": "vitest -u"
|
|
12
|
-
},
|
|
13
5
|
"repository": {
|
|
14
6
|
"directory": "packages/types",
|
|
15
7
|
"type": "git",
|
|
16
8
|
"url": "git+https://github.com/moonbeam-foundation/xcm-sdk.git"
|
|
17
9
|
},
|
|
18
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"moonbeam",
|
|
12
|
+
"moonriver",
|
|
13
|
+
"xcm"
|
|
14
|
+
],
|
|
19
15
|
"author": "moonbeam-foundation",
|
|
20
16
|
"license": "MIT",
|
|
21
17
|
"bugs": {
|
|
22
18
|
"url": "https://github.com/moonbeam-foundation/xcm-sdk/issues"
|
|
23
19
|
},
|
|
24
20
|
"homepage": "https://moonbeam-foundation.github.io/xcm-sdk/latest",
|
|
25
|
-
"files": [
|
|
21
|
+
"files": [
|
|
22
|
+
"build"
|
|
23
|
+
],
|
|
26
24
|
"type": "module",
|
|
27
25
|
"exports": {
|
|
28
26
|
"import": "./build/index.mjs",
|
|
@@ -32,8 +30,8 @@
|
|
|
32
30
|
"types": "./build/index.d.ts",
|
|
33
31
|
"main": "./build/index.mjs",
|
|
34
32
|
"dependencies": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
33
|
+
"big.js": "^6.2.1",
|
|
34
|
+
"@moonbeam-network/xcm-utils": "3.0.1"
|
|
37
35
|
},
|
|
38
36
|
"devDependencies": {
|
|
39
37
|
"@types/big.js": "^6.2.2",
|
|
@@ -41,5 +39,13 @@
|
|
|
41
39
|
},
|
|
42
40
|
"peerDependencies": {
|
|
43
41
|
"viem": "^2.21.7"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup",
|
|
45
|
+
"dev": "tsup --watch",
|
|
46
|
+
"link": "pnpm ln --global",
|
|
47
|
+
"test": "vitest --run",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"test:update": "vitest -u"
|
|
44
50
|
}
|
|
45
|
-
}
|
|
51
|
+
}
|
package/build/index.d.mts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import Big, { RoundingMode } from 'big.js';
|
|
2
|
-
import { Chain as Chain$3 } from '@wormhole-foundation/sdk-connect';
|
|
3
|
-
import { Chain as Chain$1, Address } from 'viem';
|
|
4
|
-
import { Chain as Chain$2 } from 'viem/chains';
|
|
5
|
-
|
|
6
|
-
interface AssetConstructorParams {
|
|
7
|
-
key: string;
|
|
8
|
-
originSymbol: string;
|
|
9
|
-
}
|
|
10
|
-
declare class Asset {
|
|
11
|
-
readonly key: string;
|
|
12
|
-
readonly originSymbol: string;
|
|
13
|
-
constructor({ key, originSymbol }: AssetConstructorParams);
|
|
14
|
-
copyWith(params: Partial<AssetConstructorParams>): Asset;
|
|
15
|
-
isEqual(asset: Asset): boolean;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface ChainAssetConstructorParams extends AssetConstructorParams {
|
|
19
|
-
address?: string;
|
|
20
|
-
decimals: number;
|
|
21
|
-
ids?: ChainAssetIds;
|
|
22
|
-
min?: number | bigint;
|
|
23
|
-
symbol?: string;
|
|
24
|
-
}
|
|
25
|
-
interface ChainAssetIds {
|
|
26
|
-
balanceId?: ChainAssetId;
|
|
27
|
-
id?: ChainAssetId;
|
|
28
|
-
minId?: ChainAssetId;
|
|
29
|
-
palletInstance?: number;
|
|
30
|
-
}
|
|
31
|
-
type ChainAssetId = string | number | bigint | {
|
|
32
|
-
[key: string]: ChainAssetId;
|
|
33
|
-
};
|
|
34
|
-
declare class ChainAsset extends Asset {
|
|
35
|
-
readonly address?: string;
|
|
36
|
-
readonly decimals: number;
|
|
37
|
-
readonly ids?: ChainAssetIds;
|
|
38
|
-
readonly min?: bigint;
|
|
39
|
-
readonly symbol?: string;
|
|
40
|
-
constructor({ address, decimals, ids, min, symbol, ...other }: ChainAssetConstructorParams);
|
|
41
|
-
static fromAsset(asset: Asset, params: Omit<ChainAssetConstructorParams, keyof AssetConstructorParams>): ChainAsset;
|
|
42
|
-
copyWith(params: Partial<ChainAssetConstructorParams>): ChainAsset;
|
|
43
|
-
getSymbol(): string;
|
|
44
|
-
getAssetId(): ChainAssetId;
|
|
45
|
-
getBalanceAssetId(): ChainAssetId;
|
|
46
|
-
getMinAssetId(): ChainAssetId;
|
|
47
|
-
getAssetPalletInstance(): number | undefined;
|
|
48
|
-
getAssetMin(): bigint;
|
|
49
|
-
hasOnlyAddress(): this is {
|
|
50
|
-
address: string;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface AssetAmountConstructorParams extends ChainAssetConstructorParams {
|
|
55
|
-
amount: number | bigint;
|
|
56
|
-
decimals: number;
|
|
57
|
-
symbol?: string;
|
|
58
|
-
}
|
|
59
|
-
declare class AssetAmount extends ChainAsset {
|
|
60
|
-
readonly amount: bigint;
|
|
61
|
-
constructor({ amount, ...other }: AssetAmountConstructorParams);
|
|
62
|
-
static fromChainAsset(asset: ChainAsset, params: Omit<AssetAmountConstructorParams, keyof ChainAssetConstructorParams>): AssetAmount;
|
|
63
|
-
isSame(asset: ChainAsset | AssetAmount): boolean;
|
|
64
|
-
isEqual(asset: AssetAmount): boolean;
|
|
65
|
-
copyWith(params: Partial<AssetAmountConstructorParams>): AssetAmount;
|
|
66
|
-
convertDecimals(decimals: number): AssetAmount;
|
|
67
|
-
toBig(): Big;
|
|
68
|
-
toBigDecimal(maxDecimal?: number, roundType?: RoundingMode): Big;
|
|
69
|
-
toDecimal(maxDecimal?: number, roundType?: RoundingMode): string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
type AnyAsset = Asset | ChainAsset | AssetAmount;
|
|
73
|
-
|
|
74
|
-
interface EvmChainConstructorParams extends ChainConstructorParams {
|
|
75
|
-
id: number;
|
|
76
|
-
rpc: string;
|
|
77
|
-
}
|
|
78
|
-
declare class EvmChain extends Chain {
|
|
79
|
-
readonly id: number;
|
|
80
|
-
readonly rpc: string;
|
|
81
|
-
static is(obj: unknown): obj is EvmChain;
|
|
82
|
-
constructor({ id, rpc, ...others }: EvmChainConstructorParams);
|
|
83
|
-
getViemChain(): Chain$1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
interface ParachainConstructorParams extends ChainConstructorParams {
|
|
87
|
-
checkSovereignAccountBalances?: boolean;
|
|
88
|
-
genesisHash: string;
|
|
89
|
-
isRelay?: boolean;
|
|
90
|
-
parachainId: number;
|
|
91
|
-
ss58Format: number;
|
|
92
|
-
usesChainDecimals?: boolean;
|
|
93
|
-
weight?: number;
|
|
94
|
-
ws: string[];
|
|
95
|
-
}
|
|
96
|
-
declare class Parachain extends Chain {
|
|
97
|
-
readonly checkSovereignAccountBalances: boolean;
|
|
98
|
-
readonly genesisHash: string;
|
|
99
|
-
readonly isRelay: boolean;
|
|
100
|
-
readonly parachainId: number;
|
|
101
|
-
readonly ss58Format: number;
|
|
102
|
-
readonly usesChainDecimals: boolean;
|
|
103
|
-
readonly weight: number | undefined;
|
|
104
|
-
readonly ws: string[];
|
|
105
|
-
static is(obj: unknown): obj is Parachain;
|
|
106
|
-
constructor({ checkSovereignAccountBalances, genesisHash, isRelay, parachainId, usesChainDecimals, ss58Format, weight, ws, ...others }: ParachainConstructorParams);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
interface EvmParachainConstructorParams extends ParachainConstructorParams {
|
|
110
|
-
id: number;
|
|
111
|
-
rpc: string;
|
|
112
|
-
isEvmSigner?: boolean;
|
|
113
|
-
contracts?: Contracts;
|
|
114
|
-
}
|
|
115
|
-
type Contracts = {
|
|
116
|
-
Batch?: Address;
|
|
117
|
-
XcmUtils?: Address;
|
|
118
|
-
Xtokens?: Address;
|
|
119
|
-
};
|
|
120
|
-
declare class EvmParachain extends Parachain {
|
|
121
|
-
readonly id: number;
|
|
122
|
-
readonly rpc: string;
|
|
123
|
-
readonly isEvmSigner: boolean;
|
|
124
|
-
readonly contracts?: Contracts;
|
|
125
|
-
static is(obj: unknown): obj is EvmParachain;
|
|
126
|
-
static isAnyParachain(obj: unknown): obj is EvmParachain | Parachain;
|
|
127
|
-
static isAnyEvmChain(obj: unknown): obj is EvmParachain | EvmChain;
|
|
128
|
-
constructor({ id, rpc, isEvmSigner, contracts, ...others }: EvmParachainConstructorParams);
|
|
129
|
-
getViemChain(): Chain$2;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
type AnyChain = EvmChain | Parachain | EvmParachain;
|
|
133
|
-
type AnyParachain = Parachain | EvmParachain;
|
|
134
|
-
declare enum Ecosystem {
|
|
135
|
-
Polkadot = "polkadot",
|
|
136
|
-
Kusama = "kusama",
|
|
137
|
-
AlphanetRelay = "alphanet-relay"
|
|
138
|
-
}
|
|
139
|
-
interface WormholeConfig {
|
|
140
|
-
name?: Chain$3;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
interface ChainConstructorParams {
|
|
144
|
-
assets: Map<string, ChainAsset> | ChainAsset[];
|
|
145
|
-
ecosystem?: Ecosystem;
|
|
146
|
-
explorer?: string;
|
|
147
|
-
isTestChain?: boolean;
|
|
148
|
-
key: string;
|
|
149
|
-
name: string;
|
|
150
|
-
nativeAsset: Asset;
|
|
151
|
-
wh?: WormholeConfig;
|
|
152
|
-
}
|
|
153
|
-
declare abstract class Chain {
|
|
154
|
-
#private;
|
|
155
|
-
readonly assets: Map<string, ChainAsset>;
|
|
156
|
-
readonly ecosystem?: Ecosystem;
|
|
157
|
-
readonly explorer?: string;
|
|
158
|
-
readonly isTestChain: boolean;
|
|
159
|
-
readonly key: string;
|
|
160
|
-
readonly name: string;
|
|
161
|
-
readonly wh?: WormholeConfig;
|
|
162
|
-
constructor({ assets, ecosystem, explorer, isTestChain, key, name, nativeAsset, wh, }: ChainConstructorParams);
|
|
163
|
-
get nativeAsset(): ChainAsset;
|
|
164
|
-
isEqual<T extends Chain>(chain: T): boolean;
|
|
165
|
-
getChainAsset(keyOrAsset: string | Asset | AssetAmount): ChainAsset;
|
|
166
|
-
getWormholeName(): Chain$3;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
type SetOptional<Base, Keys extends keyof Base> = Omit<Base, Keys> & Partial<Pick<Base, Keys>>;
|
|
170
|
-
|
|
171
|
-
export { type AnyAsset, type AnyChain, type AnyParachain, Asset, AssetAmount, type AssetAmountConstructorParams, type AssetConstructorParams, Chain, ChainAsset, type ChainAssetConstructorParams, type ChainAssetId, type ChainAssetIds, type ChainConstructorParams, Ecosystem, EvmChain, type EvmChainConstructorParams, EvmParachain, type EvmParachainConstructorParams, Parachain, type ParachainConstructorParams, type SetOptional, type WormholeConfig };
|