@poolstream/client 1.0.1 → 1.0.2-snapshot
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/dist/balance.d.ts +8 -0
- package/dist/currency-network-module.d.ts +9 -0
- package/dist/index.d.ts +8 -0
- package/dist/info.d.ts +5 -0
- package/dist/network/ripple/ripple.d.ts +13 -0
- package/dist/network/solana/solana.d.ts +15 -0
- package/dist/network/stellar/stellar.d.ts +31 -0
- package/dist/network/tron/tron.d.ts +21 -0
- package/dist/network.d.ts +4 -0
- package/dist/poolstream.d.ts +51 -0
- package/dist/transaction.d.ts +22 -0
- package/dist/walletaddress.d.ts +7 -0
- package/package.json +2 -1
- package/tsconfig.json +5 -4
@@ -0,0 +1,9 @@
|
|
1
|
+
import { SignebleTransaction } from "./transaction";
|
2
|
+
import { WalletAddress } from "./walletaddress";
|
3
|
+
export interface CurrencyNetworkModule {
|
4
|
+
signTransaction(transaction: SignebleTransaction): Promise<string>;
|
5
|
+
generateWalletAddress(): Promise<WalletAddress>;
|
6
|
+
readonly network: string;
|
7
|
+
}
|
8
|
+
export declare function getCoinNetworkModule(network: string, test?: boolean, contractAddress?: string): CurrencyNetworkModule;
|
9
|
+
export declare const networks: any;
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
export { Transaction, SignebleTransaction, SubmittedTransaction, TransactionItem, } from "./transaction";
|
2
|
+
export { Network } from "./network";
|
3
|
+
export { CurrencyNetworkModule } from "./currency-network-module";
|
4
|
+
export { PoolStream, PoolStreamOptions } from "./poolstream";
|
5
|
+
export { WalletAddress } from "./walletaddress";
|
6
|
+
export { Balance } from "./balance";
|
7
|
+
export { Info } from "./info";
|
8
|
+
export { Ripple } from "./network/ripple/ripple";
|
package/dist/info.d.ts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
import { SignebleTransaction } from "../../transaction";
|
2
|
+
import { CurrencyNetworkModule } from "../../currency-network-module";
|
3
|
+
import { WalletAddress } from "../../walletaddress";
|
4
|
+
export declare abstract class Ripple implements CurrencyNetworkModule {
|
5
|
+
readonly network = "ripple";
|
6
|
+
constructor();
|
7
|
+
abstract signTransaction(transaction: SignebleTransaction): Promise<string>;
|
8
|
+
generateWalletAddress(): Promise<WalletAddress>;
|
9
|
+
}
|
10
|
+
export declare class XrpRipple extends Ripple {
|
11
|
+
constructor();
|
12
|
+
signTransaction(signebleTransaction: SignebleTransaction): Promise<string>;
|
13
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { SignebleTransaction } from "../../transaction";
|
2
|
+
import { CurrencyNetworkModule } from "../../currency-network-module";
|
3
|
+
import { WalletAddress } from "../../walletaddress";
|
4
|
+
import { Connection } from "@solana/web3.js";
|
5
|
+
export declare abstract class Solana implements CurrencyNetworkModule {
|
6
|
+
readonly connection: Connection;
|
7
|
+
readonly network = "solana";
|
8
|
+
constructor(test?: boolean);
|
9
|
+
abstract signTransaction(transaction: SignebleTransaction): Promise<string>;
|
10
|
+
generateWalletAddress(): Promise<WalletAddress>;
|
11
|
+
}
|
12
|
+
export declare class SolSolana extends Solana {
|
13
|
+
constructor(test?: boolean);
|
14
|
+
signTransaction(signebleTransaction: SignebleTransaction): Promise<string>;
|
15
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { Horizon } from "@stellar/stellar-sdk";
|
2
|
+
import { SignebleTransaction } from "../../transaction";
|
3
|
+
import { CurrencyNetworkModule } from "../../currency-network-module";
|
4
|
+
import { WalletAddress } from "../../walletaddress";
|
5
|
+
export declare abstract class Stellar implements CurrencyNetworkModule {
|
6
|
+
readonly server: Horizon.Server;
|
7
|
+
readonly network = "stellar";
|
8
|
+
constructor(test: boolean);
|
9
|
+
abstract signTransaction(transaction: SignebleTransaction): Promise<string>;
|
10
|
+
generateWalletAddress(): Promise<WalletAddress>;
|
11
|
+
}
|
12
|
+
export declare class GenericStellar extends Stellar {
|
13
|
+
protected readonly assetAddress: string;
|
14
|
+
constructor(assetAddress: string, test?: boolean);
|
15
|
+
test: {
|
16
|
+
signebleTransaction: {
|
17
|
+
fee: number;
|
18
|
+
items: {
|
19
|
+
from: string;
|
20
|
+
privateKey: string;
|
21
|
+
to: string;
|
22
|
+
amount: string;
|
23
|
+
}[];
|
24
|
+
};
|
25
|
+
};
|
26
|
+
signTransaction(transaction: SignebleTransaction): Promise<string>;
|
27
|
+
}
|
28
|
+
export declare class XlmStellar extends Stellar {
|
29
|
+
constructor(test?: boolean);
|
30
|
+
signTransaction(signebleTransaction: SignebleTransaction): Promise<string>;
|
31
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { TronWeb, Contract } from "tronweb";
|
2
|
+
import { SignebleTransaction } from "../../transaction";
|
3
|
+
import { CurrencyNetworkModule } from "../../currency-network-module";
|
4
|
+
import { WalletAddress } from "../../walletaddress";
|
5
|
+
export declare abstract class Tron implements CurrencyNetworkModule {
|
6
|
+
readonly tronWeb: TronWeb;
|
7
|
+
constructor(test: boolean);
|
8
|
+
readonly network = "tron";
|
9
|
+
generateWalletAddress(): Promise<WalletAddress>;
|
10
|
+
abstract signTransaction(transaction: SignebleTransaction): Promise<string>;
|
11
|
+
}
|
12
|
+
export declare class GenericTron extends Tron {
|
13
|
+
readonly contractAddress: string;
|
14
|
+
usdtContract: Contract | null;
|
15
|
+
constructor(contractAddress: string, test?: boolean);
|
16
|
+
signTransaction(transaction: SignebleTransaction): Promise<string>;
|
17
|
+
}
|
18
|
+
export declare class TrxTron extends Tron {
|
19
|
+
constructor(test?: boolean);
|
20
|
+
signTransaction(signebleTransaction: SignebleTransaction): Promise<string>;
|
21
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { Balance } from "./balance";
|
2
|
+
import { Network } from "./network";
|
3
|
+
import { SignebleTransaction, SubmittedTransaction } from "./transaction";
|
4
|
+
import { WalletAddress } from "./walletaddress";
|
5
|
+
export interface PoolStreamOptions {
|
6
|
+
apiKey?: string;
|
7
|
+
}
|
8
|
+
export interface TransactionFilter {
|
9
|
+
start?: number;
|
10
|
+
end?: number;
|
11
|
+
from?: string;
|
12
|
+
to?: string;
|
13
|
+
limit?: number;
|
14
|
+
}
|
15
|
+
export declare class PoolStream {
|
16
|
+
private url;
|
17
|
+
private options;
|
18
|
+
constructor(url: string, options?: PoolStreamOptions);
|
19
|
+
transaction(coin: string, network: string, txid: string): Promise<SubmittedTransaction>;
|
20
|
+
info(params: {
|
21
|
+
network: string;
|
22
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
23
|
+
transactions(params: {
|
24
|
+
network: string;
|
25
|
+
filter?: TransactionFilter;
|
26
|
+
contractAddress?: string;
|
27
|
+
}): Promise<Array<SubmittedTransaction>>;
|
28
|
+
balances(params: {
|
29
|
+
network: string;
|
30
|
+
addresses: string | Array<string>;
|
31
|
+
contractAddress?: string;
|
32
|
+
}): Promise<Balance>;
|
33
|
+
networks(): Promise<Array<Network>>;
|
34
|
+
submitTransaction(params: {
|
35
|
+
network: string;
|
36
|
+
signedTransaction: string;
|
37
|
+
contractAddress?: string;
|
38
|
+
}): Promise<Array<string>>;
|
39
|
+
signedAndSubmitTransaction(params: {
|
40
|
+
network: string;
|
41
|
+
transaction: SignebleTransaction;
|
42
|
+
contractAddress?: string;
|
43
|
+
}): Promise<Array<string>>;
|
44
|
+
signTransaction(params: {
|
45
|
+
network: string;
|
46
|
+
transaction: SignebleTransaction;
|
47
|
+
contractAddress?: string;
|
48
|
+
}): Promise<string>;
|
49
|
+
generateWalletAddress(network: string): Promise<WalletAddress>;
|
50
|
+
private apiKeyHeader;
|
51
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export interface Transaction {
|
2
|
+
items: Array<TransactionItem>;
|
3
|
+
fee?: number;
|
4
|
+
extra?: any;
|
5
|
+
}
|
6
|
+
export interface SignebleTransaction extends Transaction {
|
7
|
+
items: Array<TransactionItem & {
|
8
|
+
secret: string;
|
9
|
+
}>;
|
10
|
+
}
|
11
|
+
export interface TransactionItem {
|
12
|
+
from: string;
|
13
|
+
to: string;
|
14
|
+
amount: string;
|
15
|
+
extra?: any;
|
16
|
+
}
|
17
|
+
export interface SubmittedTransaction extends Transaction {
|
18
|
+
txID: string;
|
19
|
+
confirmations: number;
|
20
|
+
decimals: number;
|
21
|
+
timestamp: number;
|
22
|
+
}
|
package/package.json
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "@poolstream/client",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.2-snapshot",
|
4
4
|
"description": "To work with a collection of cryptocurrencies.",
|
5
5
|
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
6
7
|
"private": false,
|
7
8
|
"scripts": {
|
8
9
|
"test": "npx jest",
|
package/tsconfig.json
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"compilerOptions": {
|
3
|
-
"outDir": "
|
4
|
-
"rootDir": "./src",
|
3
|
+
"outDir": "dist",
|
5
4
|
"strict": true,
|
5
|
+
"allowJs": true,
|
6
|
+
"declaration": true,
|
6
7
|
"noImplicitOverride": true,
|
7
8
|
"noPropertyAccessFromIndexSignature": true,
|
9
|
+
"emitDeclarationOnly": false,
|
8
10
|
"noImplicitReturns": true,
|
9
11
|
"noFallthroughCasesInSwitch": false,
|
10
12
|
"skipLibCheck": true,
|
11
13
|
"esModuleInterop": true,
|
12
14
|
"sourceMap": true,
|
13
|
-
"declaration": false,
|
14
15
|
"experimentalDecorators": true,
|
15
16
|
"importHelpers": true,
|
16
17
|
"useDefineForClassFields": false,
|
@@ -19,6 +20,6 @@
|
|
19
20
|
"module": "ES2022",
|
20
21
|
"target": "ES2022"
|
21
22
|
},
|
22
|
-
"include": ["src
|
23
|
+
"include": ["src"],
|
23
24
|
"exclude": ["node_modules", "**/__tests__/*"]
|
24
25
|
}
|