@moonbeam-network/xcm-sdk 1.0.0-dev.2 → 1.0.0-dev.200

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2022 PureStake
1
+ Copyright 2024 Moonbeam Foundation
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/README.md CHANGED
@@ -1,18 +1,10 @@
1
- ![Moonbeam](https://docs.moonbeam.network/images/builders/interoperability/xcm/sdk/xcm-sdk-banner.png)
1
+ The Moonbeam XCM SDK enables developers to easily transfer assets between chains, either between parachains or between a parachain and the relay chain, within the Polkadot/Kusama ecosystem. With the SDK, you don't need to worry about determining the multilocation of the origin or destination assets or which extrinsics are used on which networks to send XCM transfers.
2
2
 
3
- The Moonbeam XCM SDK enables developers to easily deposit and withdraw assets to Moonbeam/Moonriver from the relay chain and other parachains in the Polkadot/Kusama ecosystem. With the SDK, you don't need to worry about determining the multilocation of the origin or destination assets or which extrinsics are used on which networks to send XCM transfers. To deposit or withdraw assets, you simply define the asset and origin chain you want to deposit from or withdraw back to, along with the sending account's signer, and the amount to send.
3
+ The XCM SDK offers helper functions that provide a very simple interface to execute XCM transfers between chains in the Polkadot/Kusama ecosystem. In addition, the XCM config package allows any parachain project to add their information in a standard way, so they can be immediately supported by the XCM SDK.
4
4
 
5
5
  # Documentation
6
6
 
7
- ## v1 (current)
8
-
9
- - TODO: (coming soon)
10
-
11
- ## v0 (previous)
12
-
13
- - [readme](https://github.com/PureStake/xcm-sdk/tree/v0)
14
- - [usage](https://docs.moonbeam.network/builders/xcm/xcm-sdk/xcm-sdk/)
15
- - [references](https://docs.moonbeam.network/builders/xcm/xcm-sdk/reference/)
7
+ You can find the documentation at [https://moonbeam-foundation.github.io/xcm-sdk/latest/](https://moonbeam-foundation.github.io/xcm-sdk/latest/).
16
8
 
17
9
  # Installation
18
10
 
@@ -23,34 +15,68 @@ npm i @moonbeam-network/xcm-sdk
23
15
  :warning: You need to have peer dependencies of SDK installed as well.
24
16
 
25
17
  ```bash
26
- npm i @polkadot/api @polkadot/api-augment @polkadot/types @polkadot/util @polkadot/util-crypto @polkadot/apps-config ethers
18
+ npm i @polkadot/api @polkadot/util-crypto
27
19
  ```
28
20
 
29
21
  # Usage
30
22
 
31
- - TODO: (coming soon) - in the meantime, see examples below
23
+ The following sections contain basic examples of how to work with the XCM SDK to build transfer data to transfer an asset from one chain to another and how to submit the transfer. For a detailed overview on how to use it, please refer to the [XCM SDK docs](https://moonbeam-foundation.github.io/xcm-sdk/latest/example-usage/xcm).
24
+
25
+ ## Build XCM Transfer Data
26
+
27
+ ```js
28
+ import { Sdk } from '@moonbeam-network/xcm-sdk';
29
+
30
+ const transferData = async () => {
31
+ const transferData = await Sdk()
32
+ .setAsset(INSERT_ASSET)
33
+ .setSource(INSERT_SOURCE_CHAIN)
34
+ .setDestination(INSERT_DESTINATION_CHAIN)
35
+ .setAddresses({
36
+ sourceAddress: INSERT_SOURCE_ADDRESS,
37
+ destinationAddress: INSERT_DESTINATION_ADDRESS,
38
+ });
39
+ };
40
+
41
+ fromPolkadot();
42
+ ```
43
+
44
+ ## Transfer
45
+
46
+ ```js
47
+ ...
48
+
49
+ const hash = await transferData.transfer(INSERT_TRANSFER_AMOUNT, { INSERT_SIGNERS });
50
+ ```
32
51
 
33
52
  # Examples
34
53
 
35
- - [sdk](https://github.com/PureStake/xcm-sdk/blob/main/examples/sdk-simple)
54
+ - [sdk](https://github.com/moonbeam-foundation/xcm-sdk/blob/main/examples/sdk-simple)
36
55
 
37
56
  ```bash
38
- git clone git@github.com:PureStake/xcm-sdk.git
57
+ git clone git@github.com:moonbeam-foundation/xcm-sdk.git
39
58
  cd xcm-sdk
40
- npm i
59
+ pnpm install
41
60
  cd examples/sdk-simple
42
61
 
43
62
  # edit index.ts by adding your accounts
44
63
 
45
- npm start
64
+ pnpm run start
46
65
  ```
47
66
 
48
67
  # Contributing
49
68
 
69
+ First fork the repository and clone it.
70
+
71
+ ```bash
72
+ git clone git@github.com:YOUR_GITHUB_USERNAME/xcm-sdk.git
73
+ pnpm install
74
+ ```
75
+
76
+ Optionally, you can install the `pre-commit` hook to run the linter and tests before committing:
77
+
50
78
  ```bash
51
- git clone git@github.com:PureStake/xcm-sdk.git
52
- npm i
53
- npm run dev
79
+ pnpm lefthook install
54
80
  ```
55
81
 
56
82
  # Tests
@@ -58,14 +84,49 @@ npm run dev
58
84
  ## Unit tests
59
85
 
60
86
  ```bash
61
- npm run test
87
+ pnpm run test
62
88
  ```
63
89
 
64
90
  ## Acceptance tests
65
91
 
66
92
  ```bash
67
- cp .env.example .env
68
- # add private key and suri to .env file
93
+ pnpm run test:acc
94
+ ```
95
+
96
+ # Release
97
+
98
+ To create a dev version go to GitHub actions and run `publish dev versions` workflow.
99
+
100
+ To create a release version run:
101
+
102
+ ```bash
103
+ pnpm run changeset
104
+ ```
105
+
106
+ # Testing the change in the SDK locally
107
+
108
+ Build the project:
109
+
110
+ ```bash
111
+ pnpm run build
112
+ ```
113
+
114
+ Link the SDK:
115
+
116
+ ```bash
117
+ pnpm run clean && pnpm run build && pnpm run link
118
+ ```
119
+
120
+ In your project where you would like to test the changes:
121
+
122
+ ```bash
123
+ pnpm link @moonbeam-network/xcm-types @moonbeam-network/xcm-utils @moonbeam-network/xcm-builder @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk
124
+ ```
125
+
126
+ If you need you can link other packages too.
69
127
 
70
- npm run test:acc
128
+ After testing is done, unlink the SDK:
129
+
130
+ ```bash
131
+ pnpm unlink @moonbeam-network/xcm-types @moonbeam-network/xcm-utils @moonbeam-network/xcm-builder @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk
71
132
  ```
package/build/index.d.ts CHANGED
@@ -1,200 +1,196 @@
1
- import {
2
- SubstrateQueryConfig,
3
- ExtrinsicConfig,
4
- ContractConfig,
5
- } from '@moonbeam-network/xcm-builder';
6
- import { TransferConfig, AssetConfig } from '@moonbeam-network/xcm-config';
7
- import {
8
- AnyParachain,
9
- Asset,
10
- AssetAmount,
11
- ChainAssetId,
12
- AnyChain,
13
- Ecosystem,
14
- } from '@moonbeam-network/xcm-types';
15
- import { Signer as Signer$1 } from 'ethers';
1
+ import { ContractConfig, ExtrinsicConfig, BalanceConfigBuilder, AssetMinConfigBuilder, FeeConfigBuilder, SubstrateQueryConfig, EvmQueryConfig } from '@moonbeam-network/xcm-builder';
2
+ import { AssetRoute, FeeConfig, ConfigService } from '@moonbeam-network/xcm-config';
3
+ import * as _moonbeam_network_xcm_types from '@moonbeam-network/xcm-types';
4
+ import { AssetAmount, AnyChain, AnyParachain, ChainAsset, Asset, EvmChain, EvmParachain, Ecosystem, AnyAsset } from '@moonbeam-network/xcm-types';
5
+ import { Signer, SubmittableExtrinsic } from '@polkadot/api/types';
6
+ import { IKeyringPair, ISubmittableResult } from '@polkadot/types/types';
7
+ import { WalletClient, PublicClient, HttpTransport, Hash } from 'viem';
16
8
  import { ApiPromise } from '@polkadot/api';
17
- import { Signer } from '@polkadot/api/types';
18
- import { IKeyringPair } from '@polkadot/types/types';
19
-
20
- declare class PolkadotService {
21
- #private;
22
- readonly api: ApiPromise;
23
- readonly chain: AnyParachain;
24
- constructor(api: ApiPromise, chain: AnyParachain);
25
- static create(chain: AnyParachain): Promise<PolkadotService>;
26
- static createMulti(chains: AnyParachain[]): Promise<PolkadotService[]>;
27
- get decimals(): number;
28
- get asset(): Asset;
29
- get existentialDeposit(): AssetAmount;
30
- getAssetMeta(asset: ChainAssetId): Promise<
31
- | {
32
- symbol: string;
33
- decimals: number;
34
- }
35
- | undefined
36
- >;
37
- getAssetDecimals(asset: Asset): Promise<number>;
38
- query(config: SubstrateQueryConfig): Promise<bigint>;
39
- getFee(account: string, config: ExtrinsicConfig): Promise<bigint>;
40
- transfer(
41
- account: string,
42
- config: ExtrinsicConfig,
43
- signer: Signer | IKeyringPair,
44
- ): Promise<string>;
45
- }
9
+ import { RuntimeDispatchInfo } from '@polkadot/types/interfaces';
10
+ import { HexString } from '@polkadot/util/types';
46
11
 
12
+ type EvmSigner = WalletClient;
47
13
  interface Signers {
48
- ethersSigner: Signer$1;
49
- polkadotSigner: Signer | IKeyringPair;
14
+ evmSigner?: EvmSigner;
15
+ polkadotSigner?: Signer | IKeyringPair;
50
16
  }
51
17
  interface TransferData {
52
- destination: DestinationChainTransferData;
53
- getEstimate(amount: number | string): AssetAmount;
54
- isSwapPossible: boolean;
55
- max: AssetAmount;
56
- min: AssetAmount;
57
- source: SourceChainTransferData;
58
- swap(): Promise<TransferData | undefined>;
59
- transfer(amount: bigint | number | string): Promise<string>;
18
+ destination: DestinationChainTransferData;
19
+ getEstimate(amount: number | string): AssetAmount;
20
+ max: AssetAmount;
21
+ min: AssetAmount;
22
+ source: SourceChainTransferData;
23
+ transfer(amount: bigint | number | string, signers: Signers): Promise<string>;
60
24
  }
61
25
  interface SourceChainTransferData extends ChainTransferData {
62
- feeBalance: AssetAmount;
63
- max: AssetAmount;
26
+ destinationFee: AssetAmount;
27
+ destinationFeeBalance: AssetAmount;
28
+ feeBalance: AssetAmount;
29
+ max: AssetAmount;
30
+ }
31
+ interface SovereignAccountBalance {
32
+ feeAssetBalance: bigint | undefined;
33
+ transferAssetBalance: bigint;
34
+ }
35
+ interface DestinationChainTransferData extends ChainTransferData {
36
+ sovereignAccountBalances?: SovereignAccountBalance;
64
37
  }
65
- interface DestinationChainTransferData extends ChainTransferData {}
66
38
  interface ChainTransferData {
67
- balance: AssetAmount;
68
- chain: AnyChain;
69
- existentialDeposit: AssetAmount;
70
- fee: AssetAmount;
71
- min: AssetAmount;
39
+ balance: AssetAmount;
40
+ chain: AnyChain;
41
+ existentialDeposit?: AssetAmount;
42
+ fee: AssetAmount;
43
+ min: AssetAmount;
72
44
  }
73
45
 
74
46
  interface GetSourceDataParams {
75
- transferConfig: TransferConfig;
76
- destinationAddress: string;
77
- destinationFee: AssetAmount;
78
- ethersSigner: Signer$1;
79
- polkadot: PolkadotService;
80
- sourceAddress: string;
81
- }
82
- declare function getSourceData({
83
- transferConfig,
84
- destinationAddress,
85
- destinationFee,
86
- ethersSigner,
87
- polkadot,
88
- sourceAddress,
89
- }: GetSourceDataParams): Promise<SourceChainTransferData>;
90
- interface GetBalancesParams {
91
- address: string;
92
- balance: bigint;
93
- config: AssetConfig;
94
- polkadot: PolkadotService;
95
- }
96
- declare function getFeeBalances({
97
- address,
98
- balance,
99
- config,
100
- polkadot,
101
- }: GetBalancesParams): Promise<bigint>;
47
+ route: AssetRoute;
48
+ destinationAddress: string;
49
+ destinationFee: AssetAmount;
50
+ sourceAddress: string;
51
+ }
52
+ declare function getSourceData({ route, destinationAddress, destinationFee, sourceAddress, }: GetSourceDataParams): Promise<SourceChainTransferData>;
102
53
  interface GetFeeParams {
103
- balance: bigint;
104
- contract?: ContractConfig;
105
- decimals: number;
106
- ethersSigner?: Signer$1;
107
- extrinsic?: ExtrinsicConfig;
108
- polkadot: PolkadotService;
109
- sourceAddress: string;
110
- }
111
- declare function getFee({
112
- balance,
113
- contract,
114
- decimals,
115
- ethersSigner,
116
- extrinsic,
117
- polkadot,
118
- sourceAddress,
119
- }: GetFeeParams): Promise<bigint>;
120
- declare function getContractFee(
121
- balance: bigint,
122
- config: ContractConfig,
123
- decimals: number,
124
- ethersSigner: Signer$1,
125
- ): Promise<bigint>;
126
- declare function getExtrinsicFee(
127
- balance: bigint,
128
- extrinsic: ExtrinsicConfig,
129
- polkadot: PolkadotService,
130
- sourceAddress: string,
131
- ): Promise<bigint>;
54
+ balance: AssetAmount;
55
+ feeBalance: AssetAmount;
56
+ contract?: ContractConfig;
57
+ chain: AnyParachain;
58
+ destinationFee: AssetAmount;
59
+ extrinsic?: ExtrinsicConfig;
60
+ feeConfig?: FeeConfig;
61
+ sourceAddress: string;
62
+ }
63
+ declare function getFee({ balance, feeBalance, chain, contract, destinationFee, extrinsic, feeConfig, sourceAddress, }: GetFeeParams): Promise<AssetAmount>;
64
+ interface GetAssetsBalancesParams {
65
+ address: string;
66
+ chain: AnyParachain;
67
+ routes: AssetRoute[];
68
+ evmSigner?: EvmSigner;
69
+ }
70
+ declare function getAssetsBalances({ address, chain, routes, }: GetAssetsBalancesParams): Promise<AssetAmount[]>;
71
+
72
+ interface GetDestinationDataParams {
73
+ route: AssetRoute;
74
+ destinationAddress: string;
75
+ }
76
+ declare function getDestinationData({ route, destinationAddress, }: GetDestinationDataParams): Promise<DestinationChainTransferData>;
77
+
78
+ interface GetBalancesParams {
79
+ address: string;
80
+ asset: ChainAsset;
81
+ builder: BalanceConfigBuilder;
82
+ chain: AnyChain;
83
+ }
84
+ declare function getBalance({ address, asset, builder, chain, }: GetBalancesParams): Promise<AssetAmount>;
85
+ interface GetMinParams {
86
+ asset: Asset;
87
+ builder?: AssetMinConfigBuilder;
88
+ chain: AnyChain;
89
+ }
90
+ declare function getAssetMin({ asset, builder, chain, }: GetMinParams): Promise<AssetAmount>;
91
+ declare function getMin({ balance, existentialDeposit, fee, min, }: DestinationChainTransferData): AssetAmount;
132
92
  interface GetMaxParams {
133
- balanceAmount: AssetAmount;
134
- existentialDeposit: AssetAmount;
135
- feeAmount: AssetAmount;
136
- minAmount: AssetAmount;
137
- }
138
- declare function getMax({
139
- balanceAmount,
140
- existentialDeposit,
141
- feeAmount,
142
- minAmount,
143
- }: GetMaxParams): AssetAmount;
93
+ balance: AssetAmount;
94
+ existentialDeposit?: AssetAmount;
95
+ fee: AssetAmount;
96
+ min: AssetAmount;
97
+ }
98
+ declare function getMax({ balance, existentialDeposit, fee, min, }: GetMaxParams): AssetAmount;
99
+ interface GetDestinationFeeParams {
100
+ address: string;
101
+ asset: Asset;
102
+ feeAsset: Asset;
103
+ destination: AnyChain;
104
+ fee: number | FeeConfigBuilder;
105
+ source: AnyChain;
106
+ }
107
+ declare function getDestinationFee({ address, asset, destination, fee, feeAsset, source, }: GetDestinationFeeParams): Promise<AssetAmount>;
108
+ interface ConvertToChainDecimalsParams {
109
+ asset: AssetAmount;
110
+ target: ChainAsset;
111
+ }
112
+ declare function convertToChainDecimals({ asset, target, }: ConvertToChainDecimalsParams): AssetAmount;
113
+ declare function getExistentialDeposit(chain: AnyChain): Promise<AssetAmount | undefined>;
114
+ interface GetDestinationFeeBalanceParams {
115
+ balance: AssetAmount;
116
+ feeBalance: AssetAmount;
117
+ route: AssetRoute;
118
+ sourceAddress: string;
119
+ }
120
+ declare function getDestinationFeeBalance({ balance, feeBalance, route, sourceAddress, }: GetDestinationFeeBalanceParams): Promise<AssetAmount>;
121
+ interface GetExtrinsicFeeParams {
122
+ address: string;
123
+ balance: AssetAmount;
124
+ chain: AnyParachain;
125
+ extrinsic: ExtrinsicConfig;
126
+ feeBalance: AssetAmount;
127
+ feeConfig?: FeeConfig;
128
+ }
129
+ declare function getExtrinsicFee({ address, balance, chain, extrinsic, feeBalance, feeConfig, }: GetExtrinsicFeeParams): Promise<AssetAmount>;
130
+ interface GetContractFeeParams {
131
+ address: string;
132
+ balance: AssetAmount;
133
+ chain: EvmChain | EvmParachain;
134
+ contract: ContractConfig;
135
+ destinationFee: AssetAmount;
136
+ feeBalance: AssetAmount;
137
+ feeConfig?: FeeConfig;
138
+ }
139
+ declare function getContractFee({ address, balance, chain, contract, destinationFee, feeBalance, feeConfig, }: GetContractFeeParams): Promise<AssetAmount>;
140
+ interface ValidateSovereignAccountBalancesProps {
141
+ amount: bigint;
142
+ destinationData: DestinationChainTransferData;
143
+ sourceData: SourceChainTransferData;
144
+ }
145
+ declare function validateSovereignAccountBalances({ amount, sourceData, destinationData, }: ValidateSovereignAccountBalancesProps): void;
144
146
 
145
- interface SdkOptions extends Partial<Signers> {}
146
- declare function Sdk(options?: SdkOptions): {
147
- assets(ecosystem?: Ecosystem): {
148
- assets: Asset[];
149
- asset(keyOrAsset: string | Asset): {
150
- sourceChains: AnyChain[];
151
- source(keyOrChain: string | AnyChain): {
152
- destinationChains: AnyChain[];
153
- destination(destKeyOrChain: string | AnyChain): {
154
- accounts(
155
- sourceAddress: string,
156
- destinationAddress: string,
157
- signers?: Partial<Signers>,
158
- ): Promise<TransferData>;
147
+ interface SdkOptions {
148
+ configService?: ConfigService;
149
+ ecosystem?: Ecosystem;
150
+ }
151
+ declare function Sdk({ configService, ecosystem }?: SdkOptions): {
152
+ assets: _moonbeam_network_xcm_types.Asset[];
153
+ setAsset(asset: string | AnyAsset): {
154
+ sources: AnyChain[];
155
+ setSource(source: string | AnyChain): {
156
+ destinations: AnyChain[];
157
+ setDestination(destination: string | AnyChain): {
158
+ setAddresses({ sourceAddress, destinationAddress, }: {
159
+ sourceAddress: string;
160
+ destinationAddress: string;
161
+ }): Promise<TransferData>;
162
+ };
159
163
  };
160
- };
161
164
  };
162
- };
163
- getTransferData({
164
- destinationAddress,
165
- destinationKeyOrChain,
166
- ethersSigner,
167
- keyOrAsset,
168
- polkadotSigner,
169
- sourceAddress,
170
- sourceKeyOrChain,
171
- }: SdkTransferParams): Promise<TransferData>;
172
165
  };
173
- interface SdkTransferParams extends Partial<Signers> {
174
- destinationAddress: string;
175
- destinationKeyOrChain: string | AnyChain;
176
- keyOrAsset: string | Asset;
177
- sourceAddress: string;
178
- sourceKeyOrChain: string | AnyChain;
166
+ declare function getParachainBalances(chain: AnyParachain, address: string, service?: ConfigService): Promise<AssetAmount[]>;
167
+
168
+ declare class PolkadotService {
169
+ #private;
170
+ readonly api: ApiPromise;
171
+ readonly chain: AnyParachain;
172
+ constructor(api: ApiPromise, chain: AnyParachain);
173
+ static create(chain: AnyParachain): Promise<PolkadotService>;
174
+ static createMulti(chains: AnyParachain[]): Promise<PolkadotService[]>;
175
+ get decimals(): number;
176
+ get existentialDeposit(): AssetAmount;
177
+ query(config: SubstrateQueryConfig): Promise<bigint>;
178
+ getExtrinsic(config: ExtrinsicConfig): SubmittableExtrinsic<'promise', ISubmittableResult>;
179
+ getExtrinsicCallHash(config: ExtrinsicConfig): HexString;
180
+ getPaymentInfo(account: string, config: ExtrinsicConfig): Promise<RuntimeDispatchInfo>;
181
+ getFee(account: string, config: ExtrinsicConfig): Promise<bigint>;
182
+ transfer(account: string, config: ExtrinsicConfig, signer: Signer | IKeyringPair, statusCallback?: (params: ISubmittableResult) => void): Promise<string>;
179
183
  }
180
184
 
181
- export {
182
- ChainTransferData,
183
- DestinationChainTransferData,
184
- GetBalancesParams,
185
- GetFeeParams,
186
- GetMaxParams,
187
- GetSourceDataParams,
188
- Sdk,
189
- SdkOptions,
190
- SdkTransferParams,
191
- Signers,
192
- SourceChainTransferData,
193
- TransferData,
194
- getContractFee,
195
- getExtrinsicFee,
196
- getFee,
197
- getFeeBalances,
198
- getMax,
199
- getSourceData,
200
- };
185
+ declare class EvmService {
186
+ readonly chain: EvmChain | EvmParachain;
187
+ readonly client: PublicClient<HttpTransport>;
188
+ static create(chain: EvmChain | EvmParachain): EvmService;
189
+ constructor(chain: EvmChain | EvmParachain);
190
+ query(query: EvmQueryConfig): Promise<bigint>;
191
+ getFee(address: string, contract: ContractConfig): Promise<bigint>;
192
+ getBalance(address: string, contract: ContractConfig): Promise<bigint>;
193
+ transfer(signer: EvmSigner, contract: ContractConfig): Promise<Hash>;
194
+ }
195
+
196
+ export { type ChainTransferData, type ConvertToChainDecimalsParams, type DestinationChainTransferData, EvmService, type EvmSigner, type GetAssetsBalancesParams, type GetBalancesParams, type GetContractFeeParams, type GetDestinationDataParams, type GetDestinationFeeBalanceParams, type GetDestinationFeeParams, type GetExtrinsicFeeParams, type GetFeeParams, type GetMaxParams, type GetMinParams, type GetSourceDataParams, PolkadotService, Sdk, type SdkOptions, type Signers, type SourceChainTransferData, type SovereignAccountBalance, type TransferData, convertToChainDecimals, getAssetMin, getAssetsBalances, getBalance, getContractFee, getDestinationData, getDestinationFee, getDestinationFeeBalance, getExistentialDeposit, getExtrinsicFee, getFee, getMax, getMin, getParachainBalances, getSourceData, validateSovereignAccountBalances };