@galacticcouncil/sdk 7.0.1 → 7.0.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.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type CallDryRunEffects } from '@polkadot/types/interfaces';
|
|
2
2
|
import { type SubmittableExtrinsic } from '@polkadot/api/promise/types';
|
|
3
|
-
export interface Transaction {
|
|
3
|
+
export interface Transaction<T, R> {
|
|
4
4
|
hex: string;
|
|
5
5
|
name?: string;
|
|
6
|
-
get():
|
|
7
|
-
dryRun(account: string): Promise<
|
|
6
|
+
get(): T;
|
|
7
|
+
dryRun(account: string): Promise<R>;
|
|
8
8
|
}
|
|
9
|
+
export type SubstrateTransaction = Transaction<SubmittableExtrinsic, CallDryRunEffects>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ApiPromise } from '@polkadot/api';
|
|
2
|
-
import { PolkadotApiClient,
|
|
2
|
+
import { PolkadotApiClient, SubstrateTransaction } from '../api';
|
|
3
3
|
import { PoolType } from '../pool';
|
|
4
4
|
import { Swap, Trade } from './types';
|
|
5
5
|
export declare class TradeUtils extends PolkadotApiClient {
|
|
6
6
|
private balanceClient;
|
|
7
7
|
private evmClient;
|
|
8
8
|
constructor(api: ApiPromise);
|
|
9
|
-
buildBuyTx(trade: Trade, slippagePct?: number):
|
|
10
|
-
buildSellTx(trade: Trade, slippagePct?: number):
|
|
11
|
-
buildSellAllTx(trade: Trade, slippagePct?: number):
|
|
12
|
-
buildWithdrawAndSellReserveTx(beneficiary: string, trade: Trade, slippagePct?: number): Promise<
|
|
9
|
+
buildBuyTx(trade: Trade, slippagePct?: number): SubstrateTransaction;
|
|
10
|
+
buildSellTx(trade: Trade, slippagePct?: number): SubstrateTransaction;
|
|
11
|
+
buildSellAllTx(trade: Trade, slippagePct?: number): SubstrateTransaction;
|
|
12
|
+
buildWithdrawAndSellReserveTx(beneficiary: string, trade: Trade, slippagePct?: number): Promise<SubstrateTransaction>;
|
|
13
13
|
buildRoute(swaps: Swap[]): ({
|
|
14
14
|
pool: {
|
|
15
15
|
Stableswap: string | undefined;
|