@chainflip/sdk 0.1.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 +3 -0
- package/dist/chunk-BSY2FXE7.mjs +2128 -0
- package/dist/enums-d5fa72fa.d.ts +32 -0
- package/dist/funding.d.ts +20 -0
- package/dist/funding.js +998 -0
- package/dist/funding.mjs +102 -0
- package/dist/swap.d.ts +430 -0
- package/dist/swap.js +2229 -0
- package/dist/swap.mjs +754 -0
- package/package.json +60 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
type ArrayToMap<T extends readonly string[]> = {
|
|
2
|
+
[K in T[number]]: K;
|
|
3
|
+
};
|
|
4
|
+
declare const Chains: ArrayToMap<readonly ["Bitcoin", "Ethereum", "Polkadot"]>;
|
|
5
|
+
type Chain = (typeof Chains)[keyof typeof Chains];
|
|
6
|
+
declare const Assets: ArrayToMap<readonly ["FLIP", "USDC", "DOT", "ETH", "BTC"]>;
|
|
7
|
+
type Asset = (typeof Assets)[keyof typeof Assets];
|
|
8
|
+
declare const ChainflipNetworks: ArrayToMap<readonly ["sisyphos", "perseverance", "mainnet", "partnernet"]>;
|
|
9
|
+
type ChainflipNetwork = (typeof ChainflipNetworks)[keyof typeof ChainflipNetworks];
|
|
10
|
+
declare const assetChains: {
|
|
11
|
+
ETH: "Ethereum";
|
|
12
|
+
FLIP: "Ethereum";
|
|
13
|
+
USDC: "Ethereum";
|
|
14
|
+
BTC: "Bitcoin";
|
|
15
|
+
DOT: "Polkadot";
|
|
16
|
+
};
|
|
17
|
+
declare const assetDecimals: {
|
|
18
|
+
DOT: number;
|
|
19
|
+
ETH: number;
|
|
20
|
+
FLIP: number;
|
|
21
|
+
USDC: number;
|
|
22
|
+
BTC: number;
|
|
23
|
+
};
|
|
24
|
+
declare const assetContractIds: Record<Asset, number>;
|
|
25
|
+
declare const chainAssets: {
|
|
26
|
+
Ethereum: ("FLIP" | "USDC" | "ETH")[];
|
|
27
|
+
Bitcoin: "BTC"[];
|
|
28
|
+
Polkadot: "DOT"[];
|
|
29
|
+
};
|
|
30
|
+
declare const chainContractIds: Record<Chain, number>;
|
|
31
|
+
|
|
32
|
+
export { Asset as A, Chain as C, ChainflipNetwork as a, Chains as b, chainAssets as c, Assets as d, ChainflipNetworks as e, assetChains as f, assetDecimals as g, assetContractIds as h, chainContractIds as i };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Signer } from 'ethers';
|
|
2
|
+
import { a as ChainflipNetwork } from './enums-d5fa72fa.js';
|
|
3
|
+
|
|
4
|
+
type SDKOptions = {
|
|
5
|
+
network?: Exclude<ChainflipNetwork, 'mainnet'>;
|
|
6
|
+
signer: Signer;
|
|
7
|
+
};
|
|
8
|
+
type TransactionHash = string;
|
|
9
|
+
declare class FundingSDK {
|
|
10
|
+
private readonly options;
|
|
11
|
+
constructor(options: SDKOptions);
|
|
12
|
+
fundStateChainAccount(accountId: `0x${string}`, amount: string): Promise<TransactionHash>;
|
|
13
|
+
executeRedemption(accountId: `0x${string}`): Promise<TransactionHash>;
|
|
14
|
+
getMinimumFunding(): Promise<bigint>;
|
|
15
|
+
getRedemptionDelay(): Promise<number>;
|
|
16
|
+
getFlipBalance(): Promise<bigint>;
|
|
17
|
+
approveStateChainGateway(amount: bigint | string | number, nonce?: bigint | string | number): Promise<TransactionHash | null>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { FundingSDK };
|