@stellar/typescript-wallet-sdk 1.1.0-alpha.1 → 1.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/.husky/pre-commit +4 -0
- package/docs/WalletGuide.md +5 -0
- package/lib/bundle.js +30087 -4736
- package/lib/bundle.js.map +1 -1
- package/lib/index.d.ts +26 -0
- package/lib/walletSdk/Asset/index.d.ts +27 -0
- package/lib/walletSdk/Exceptions/index.d.ts +56 -0
- package/lib/walletSdk/Types/anchor.d.ts +148 -0
- package/lib/walletSdk/Types/auth.d.ts +35 -0
- package/lib/walletSdk/Types/horizon.d.ts +34 -0
- package/lib/walletSdk/Types/index.d.ts +30 -0
- package/lib/walletSdk/Types/sep24.d.ts +30 -0
- package/lib/walletSdk/Types/utils.d.ts +77 -0
- package/lib/walletSdk/Types/watcher.d.ts +30 -0
- package/lib/walletSdk/Utils/camelToSnakeCase.d.ts +2 -0
- package/lib/walletSdk/Utils/getResultCode.d.ts +1 -0
- package/lib/walletSdk/Utils/index.d.ts +3 -0
- package/lib/walletSdk/Utils/toml.d.ts +3 -0
- package/lib/walletSdk/Utils/url.d.ts +1 -0
- package/lib/walletSdk/Watcher/index.d.ts +21 -42
- package/lib/walletSdk/anchor/Sep24.d.ts +48 -0
- package/lib/walletSdk/anchor/index.d.ts +12 -75
- package/lib/walletSdk/auth/WalletSigner.d.ts +4 -3
- package/lib/walletSdk/auth/index.d.ts +14 -5
- package/lib/walletSdk/horizon/Account.d.ts +3 -6
- package/lib/walletSdk/horizon/AccountService.d.ts +46 -1
- package/lib/walletSdk/horizon/Stellar.d.ts +10 -1
- package/lib/walletSdk/horizon/index.d.ts +4 -0
- package/lib/walletSdk/horizon/transaction/TransactionBuilder.d.ts +20 -0
- package/lib/walletSdk/index.d.ts +17 -15
- package/lib/walletSdk/recovery/index.d.ts +18 -0
- package/package.json +7 -1
- package/prettier.config.js +1 -0
- package/src/index.ts +41 -1
- package/src/walletSdk/Anchor/Sep24.ts +267 -0
- package/src/walletSdk/Anchor/index.ts +32 -201
- package/src/walletSdk/Asset/index.ts +58 -0
- package/src/walletSdk/Auth/WalletSigner.ts +23 -12
- package/src/walletSdk/Auth/index.ts +96 -49
- package/src/walletSdk/Exceptions/index.ts +148 -0
- package/src/walletSdk/{horizon → Horizon}/Account.ts +7 -9
- package/src/walletSdk/Horizon/AccountService.ts +96 -0
- package/src/walletSdk/Horizon/Stellar.ts +164 -0
- package/src/walletSdk/Horizon/Transaction/TransactionBuilder.ts +140 -0
- package/src/walletSdk/Horizon/index.ts +4 -0
- package/src/walletSdk/Recovery/index.ts +32 -0
- package/src/walletSdk/{Watcher/Types.ts → Types/anchor.ts} +114 -21
- package/src/walletSdk/Types/auth.ts +43 -0
- package/src/walletSdk/Types/horizon.ts +40 -0
- package/src/walletSdk/Types/index.ts +39 -0
- package/src/walletSdk/Types/sep24.ts +41 -0
- package/src/walletSdk/Types/utils.ts +77 -0
- package/src/walletSdk/Types/watcher.ts +34 -0
- package/src/walletSdk/Utils/camelToSnakeCase.ts +16 -0
- package/src/walletSdk/Utils/getResultCode.ts +5 -0
- package/src/walletSdk/Utils/index.ts +3 -0
- package/src/walletSdk/Utils/toml.ts +103 -0
- package/src/walletSdk/{util → Utils}/url.ts +1 -1
- package/src/walletSdk/Watcher/index.ts +137 -128
- package/src/walletSdk/index.ts +72 -55
- package/test/account.test.ts +19 -15
- package/test/accountService.test.ts +109 -0
- package/test/fixtures/TransactionsResponse.ts +144 -127
- package/test/stellar.test.ts +247 -0
- package/test/wallet.test.ts +196 -214
- package/tsconfig.json +3 -7
- package/webpack.config.js +2 -0
- package/lib/walletSdk/anchor/Types.d.ts +0 -76
- package/lib/walletSdk/util/sleep.d.ts +0 -1
- package/src/walletSdk/Anchor/Types.ts +0 -79
- package/src/walletSdk/exception/index.ts +0 -48
- package/src/walletSdk/horizon/AccountService.ts +0 -19
- package/src/walletSdk/horizon/Stellar.ts +0 -14
- package/src/walletSdk/horizon/constants.ts +0 -4
- package/src/walletSdk/interactive/index.ts +0 -92
- package/src/walletSdk/recovery/Recovery.ts +0 -6
- package/src/walletSdk/toml/index.ts +0 -179
- package/src/walletSdk/util/camelToSnakeCase.ts +0 -13
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import { Auth } from "../Auth";
|
|
3
|
-
import { Interactive } from "../interactive";
|
|
4
|
-
import { TomlInfo } from "../toml";
|
|
5
|
-
import { Watcher } from "../Watcher";
|
|
6
2
|
import { Config } from "walletSdk";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
lang?: string;
|
|
3
|
+
import { Sep10 } from "../Auth";
|
|
4
|
+
import { Sep24 } from "./Sep24";
|
|
5
|
+
import { AnchorServiceInfo, TomlInfo } from "../Types";
|
|
6
|
+
type AnchorParams = {
|
|
7
|
+
cfg: Config;
|
|
8
|
+
homeDomain: string;
|
|
9
|
+
httpClient: AxiosInstance;
|
|
10
|
+
language: string;
|
|
16
11
|
};
|
|
17
12
|
export declare class Anchor {
|
|
18
13
|
language: string;
|
|
@@ -20,68 +15,10 @@ export declare class Anchor {
|
|
|
20
15
|
private homeDomain;
|
|
21
16
|
private httpClient;
|
|
22
17
|
private toml;
|
|
23
|
-
constructor(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
language: string;
|
|
28
|
-
});
|
|
29
|
-
getInfo(shouldRefresh?: boolean): Promise<TomlInfo>;
|
|
30
|
-
auth(): Promise<Auth>;
|
|
31
|
-
interactive(): Interactive;
|
|
32
|
-
watcher(): Watcher;
|
|
18
|
+
constructor(params: AnchorParams);
|
|
19
|
+
sep1(shouldRefresh?: boolean): Promise<TomlInfo>;
|
|
20
|
+
sep10(): Promise<Sep10>;
|
|
21
|
+
sep24(): Sep24;
|
|
33
22
|
getServicesInfo(lang?: string): Promise<AnchorServiceInfo>;
|
|
34
|
-
/**
|
|
35
|
-
* Get single transaction's current status and details. One of the [id], [stellarTransactionId],
|
|
36
|
-
* [externalTransactionId] must be provided.
|
|
37
|
-
*
|
|
38
|
-
* @param authToken auth token of the account authenticated with the anchor
|
|
39
|
-
* @param id transaction ID
|
|
40
|
-
* @param stellarTransactionId stellar transaction ID
|
|
41
|
-
* @param externalTransactionId external transaction ID
|
|
42
|
-
* @return transaction object
|
|
43
|
-
* @throws [MissingTransactionIdError] if none of the id params is provided
|
|
44
|
-
* @throws [InvalidTransactionResponseError] if Anchor returns an invalid transaction
|
|
45
|
-
* @throws [ServerRequestFailedError] if server request fails
|
|
46
|
-
*/
|
|
47
|
-
getTransactionBy({ authToken, id, stellarTransactionId, externalTransactionId, lang, }: {
|
|
48
|
-
authToken: string;
|
|
49
|
-
id?: string;
|
|
50
|
-
stellarTransactionId?: string;
|
|
51
|
-
externalTransactionId?: string;
|
|
52
|
-
lang?: string;
|
|
53
|
-
}): Promise<AnchorTransaction>;
|
|
54
|
-
/**
|
|
55
|
-
* Get account's transactions specified by asset and other params.
|
|
56
|
-
*
|
|
57
|
-
* @param authToken auth token of the account authenticated with the anchor
|
|
58
|
-
* @param assetCode target asset to query for
|
|
59
|
-
* @param noOlderThan response should contain transactions starting on or after this date & time
|
|
60
|
-
* @param limit response should contain at most 'limit' transactions
|
|
61
|
-
* @param kind kind of transaction that is desired. E.g.: 'deposit', 'withdrawal'
|
|
62
|
-
* @param pagingId response should contain transactions starting prior to this ID (exclusive)
|
|
63
|
-
* @param lang desired language (localization), it can also accept locale in the format 'en-US'
|
|
64
|
-
* @return list of transactions as requested by the client, sorted in time-descending order
|
|
65
|
-
* @throws [InvalidTransactionsResponseError] if Anchor returns an invalid response
|
|
66
|
-
* @throws [ServerRequestFailedError] if server request fails
|
|
67
|
-
*/
|
|
68
|
-
getTransactionsForAsset(params: GetTransactionsParams): Promise<AnchorTransaction[]>;
|
|
69
|
-
/**
|
|
70
|
-
* Get all successfully finished (either completed or refunded) account transactions for specified
|
|
71
|
-
* asset. Optional field implementation depends on anchor.
|
|
72
|
-
*
|
|
73
|
-
* @param authToken auth token of the account authenticated with the anchor
|
|
74
|
-
* @param assetCode target asset to query for
|
|
75
|
-
* @param noOlderThan response should contain transactions starting on or after this date & time
|
|
76
|
-
* @param limit response should contain at most 'limit' transactions
|
|
77
|
-
* @param kind kind of transaction that is desired. E.g.: 'deposit', 'withdrawal'
|
|
78
|
-
* @param pagingId response should contain transactions starting prior to this ID (exclusive)
|
|
79
|
-
* @param lang desired language (localization), it can also accept locale in the format 'en-US'
|
|
80
|
-
* @return list of filtered transactions that achieved a final state (completed or refunded)
|
|
81
|
-
* @throws [AssetNotSupportedError] if asset is not supported by the anchor
|
|
82
|
-
* @throws [InvalidTransactionsResponseError] if Anchor returns an invalid response
|
|
83
|
-
* @throws [ServerRequestFailedError] if server request fails
|
|
84
|
-
*/
|
|
85
|
-
getHistory(params: GetTransactionsParams): Promise<AnchorTransaction[]>;
|
|
86
23
|
}
|
|
87
24
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Transaction } from "stellar-sdk";
|
|
2
|
+
import { SignWithClientAccountParams, SignWithDomainAccountParams } from "../Types";
|
|
2
3
|
export interface WalletSigner {
|
|
3
|
-
signWithClientAccount(
|
|
4
|
-
signWithDomainAccount(transactionXDR
|
|
4
|
+
signWithClientAccount({ transaction, accountKp, }: SignWithClientAccountParams): Transaction;
|
|
5
|
+
signWithDomainAccount({ transactionXDR, networkPassphrase, accountKp, }: SignWithDomainAccountParams): Promise<Transaction>;
|
|
5
6
|
}
|
|
6
7
|
export declare const DefaultSigner: WalletSigner;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { Config } from "walletSdk";
|
|
3
|
+
import { AuthenticateParams, AuthToken } from "../Types";
|
|
4
|
+
export { WalletSigner, DefaultSigner } from "./WalletSigner";
|
|
5
|
+
type Sep10Params = {
|
|
6
|
+
cfg: Config;
|
|
7
|
+
webAuthEndpoint: string;
|
|
8
|
+
homeDomain: string;
|
|
9
|
+
httpClient: AxiosInstance;
|
|
10
|
+
};
|
|
11
|
+
export declare class Sep10 {
|
|
4
12
|
private cfg;
|
|
5
13
|
private webAuthEndpoint;
|
|
14
|
+
private homeDomain;
|
|
6
15
|
private httpClient;
|
|
7
|
-
constructor(
|
|
8
|
-
authenticate(accountKp
|
|
16
|
+
constructor(params: Sep10Params);
|
|
17
|
+
authenticate({ accountKp, walletSigner, memoId, clientDomain, }: AuthenticateParams): Promise<AuthToken>;
|
|
9
18
|
private challenge;
|
|
10
19
|
private sign;
|
|
11
20
|
private getToken;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { Keypair, Transaction, FeeBumpTransaction } from "stellar-sdk";
|
|
2
|
-
declare class AccountKeypair {
|
|
2
|
+
export declare class AccountKeypair {
|
|
3
3
|
keypair: Keypair;
|
|
4
4
|
constructor(keypair: Keypair);
|
|
5
5
|
get publicKey(): string;
|
|
6
6
|
toString(): string;
|
|
7
7
|
}
|
|
8
8
|
export declare class PublicKeypair extends AccountKeypair {
|
|
9
|
-
keypair: Keypair;
|
|
10
9
|
constructor(keypair: Keypair);
|
|
11
|
-
static fromPublicKey: (
|
|
10
|
+
static fromPublicKey: (publicKey: string) => PublicKeypair;
|
|
12
11
|
}
|
|
13
12
|
export declare class SigningKeypair extends AccountKeypair {
|
|
14
|
-
keypair: Keypair;
|
|
15
13
|
constructor(keypair: Keypair);
|
|
16
|
-
static fromSecret: (
|
|
14
|
+
static fromSecret: (secretKey: string) => SigningKeypair;
|
|
17
15
|
get secretKey(): string;
|
|
18
16
|
sign(transaction: Transaction | FeeBumpTransaction): Transaction | FeeBumpTransaction;
|
|
19
17
|
}
|
|
20
|
-
export {};
|
|
@@ -1,8 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Server, ServerApi } from "stellar-sdk";
|
|
2
3
|
import { Config } from "walletSdk";
|
|
4
|
+
import { SigningKeypair } from "./Account";
|
|
5
|
+
import { HORIZON_ORDER } from "../Types";
|
|
3
6
|
export declare class AccountService {
|
|
4
7
|
private server;
|
|
5
8
|
private network;
|
|
6
9
|
constructor(cfg: Config);
|
|
10
|
+
/**
|
|
11
|
+
* Generate new account keypair (public and secret key). This key pair can be
|
|
12
|
+
* used to create a Stellar account.
|
|
13
|
+
*
|
|
14
|
+
* @return public key and secret key
|
|
15
|
+
*/
|
|
7
16
|
createKeypair(): SigningKeypair;
|
|
17
|
+
/**
|
|
18
|
+
* Generate new account keypair (public and secret key) from random bytes. This key pair can be
|
|
19
|
+
* used to create a Stellar account.
|
|
20
|
+
*
|
|
21
|
+
* @return public key and secret key
|
|
22
|
+
*/
|
|
23
|
+
createKeypairFromRandom(randomBytes: Buffer): SigningKeypair;
|
|
24
|
+
/**
|
|
25
|
+
* Get account information from the Stellar network.
|
|
26
|
+
*
|
|
27
|
+
* @param accountAddress Stellar address of the account
|
|
28
|
+
* @param serverInstance optional Horizon server instance when default doesn't work
|
|
29
|
+
* @return account information
|
|
30
|
+
*/
|
|
31
|
+
getInfo({ accountAddress, serverInstance, }: {
|
|
32
|
+
accountAddress: string;
|
|
33
|
+
serverInstance?: Server;
|
|
34
|
+
}): Promise<ServerApi.AccountRecord>;
|
|
35
|
+
/**
|
|
36
|
+
* Get account operations for the specified Stellar address.
|
|
37
|
+
*
|
|
38
|
+
* @param accountAddress Stellar address of the account
|
|
39
|
+
* @param limit optional how many operations to fetch, maximum is 200, default is 10
|
|
40
|
+
* @param order optional data order, ascending or descending, defaults to descending
|
|
41
|
+
* @param cursor optional cursor to specify a starting point
|
|
42
|
+
* @param includeFailed optional flag to include failed operations, defaults to false
|
|
43
|
+
* @return a list of operations
|
|
44
|
+
* @throws [OperationsLimitExceededException] when maximum limit of 200 is exceeded
|
|
45
|
+
*/
|
|
46
|
+
getHistory({ accountAddress, limit, order, cursor, includeFailed, }: {
|
|
47
|
+
accountAddress: string;
|
|
48
|
+
limit?: number;
|
|
49
|
+
order?: HORIZON_ORDER;
|
|
50
|
+
cursor?: string;
|
|
51
|
+
includeFailed?: boolean;
|
|
52
|
+
}): Promise<ServerApi.CollectionPage<ServerApi.OperationRecord>>;
|
|
8
53
|
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Server, Transaction, FeeBumpTransaction } from "stellar-sdk";
|
|
2
2
|
import { Config } from "walletSdk";
|
|
3
|
+
import { AccountService } from "./AccountService";
|
|
4
|
+
import { TransactionBuilder } from "./Transaction/TransactionBuilder";
|
|
5
|
+
import { TransactionParams, SubmitWithFeeIncreaseParams, FeeBumpTransactionParams } from "../Types";
|
|
3
6
|
export declare class Stellar {
|
|
4
7
|
private cfg;
|
|
8
|
+
server: Server;
|
|
5
9
|
constructor(cfg: Config);
|
|
6
10
|
account(): AccountService;
|
|
11
|
+
transaction({ sourceAddress, baseFee, memo, timebounds, }: TransactionParams): Promise<TransactionBuilder>;
|
|
12
|
+
makeFeeBump({ feeAddress, transaction, baseFee, }: FeeBumpTransactionParams): FeeBumpTransaction;
|
|
13
|
+
submitTransaction(signedTransaction: Transaction | FeeBumpTransaction): Promise<boolean>;
|
|
14
|
+
submitWithFeeIncrease({ sourceAddress, timeout, baseFeeIncrease, buildingFunction, signerFunction, baseFee, memo, maxFee, }: SubmitWithFeeIncreaseParams): Promise<Transaction>;
|
|
15
|
+
decodeTransaction(xdr: string): Transaction | FeeBumpTransaction;
|
|
7
16
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Account as StellarAccount, Transaction, Server, Memo, xdr } from "stellar-sdk";
|
|
2
|
+
import { Config } from "walletSdk";
|
|
3
|
+
import { AccountKeypair } from "../Account";
|
|
4
|
+
import { IssuedAssetId, StellarAssetId } from "../../Asset";
|
|
5
|
+
import { WithdrawTransaction } from "../../Types";
|
|
6
|
+
export declare class TransactionBuilder {
|
|
7
|
+
private network;
|
|
8
|
+
private operations;
|
|
9
|
+
private builder;
|
|
10
|
+
sourceAccount: string;
|
|
11
|
+
constructor(cfg: Config, sourceAccount: StellarAccount, baseFee?: number, memo?: Memo, timebounds?: Server.Timebounds);
|
|
12
|
+
createAccount(newAccount: AccountKeypair, startingBalance?: number): TransactionBuilder;
|
|
13
|
+
transfer(destinationAddress: string, assetId: StellarAssetId, amount: string): TransactionBuilder;
|
|
14
|
+
addOperation(op: xdr.Operation): TransactionBuilder;
|
|
15
|
+
setMemo(memo: Memo): TransactionBuilder;
|
|
16
|
+
addAssetSupport(asset: IssuedAssetId, trustLimit?: string): TransactionBuilder;
|
|
17
|
+
removeAssetSupport(asset: IssuedAssetId): TransactionBuilder;
|
|
18
|
+
build(): Transaction;
|
|
19
|
+
transferWithdrawalTransaction(transaction: WithdrawTransaction, assetId: StellarAssetId): TransactionBuilder;
|
|
20
|
+
}
|
package/lib/walletSdk/index.d.ts
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
1
2
|
import { Networks, Server } from "stellar-sdk";
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
3
3
|
import { Anchor } from "./Anchor";
|
|
4
|
-
import { WalletSigner } from "./Auth
|
|
5
|
-
import { Stellar } from "./
|
|
6
|
-
import { Recovery } from "./
|
|
7
|
-
|
|
8
|
-
app: ApplicationConfiguration;
|
|
9
|
-
stellar: StellarConfiguration;
|
|
10
|
-
constructor(stellarCfg: any, appCfg: any);
|
|
11
|
-
}
|
|
4
|
+
import { WalletSigner } from "./Auth";
|
|
5
|
+
import { Stellar } from "./Horizon";
|
|
6
|
+
import { Recovery } from "./Recovery";
|
|
7
|
+
import { ConfigParams, StellarConfigurationParams, WalletAnchor, WalletParams, WalletRecovery } from "./Types";
|
|
12
8
|
export declare class Wallet {
|
|
13
9
|
private cfg;
|
|
14
10
|
private language;
|
|
15
11
|
static TestNet: () => Wallet;
|
|
16
12
|
static MainNet: () => Wallet;
|
|
17
|
-
constructor(stellarConfiguration
|
|
18
|
-
anchor(homeDomain
|
|
13
|
+
constructor({ stellarConfiguration, applicationConfiguration, language, }: WalletParams);
|
|
14
|
+
anchor({ homeDomain, language }: WalletAnchor): Anchor;
|
|
19
15
|
stellar(): Stellar;
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
recovery({ servers }: WalletRecovery): Recovery;
|
|
17
|
+
}
|
|
18
|
+
export declare class Config {
|
|
19
|
+
stellar: StellarConfiguration;
|
|
20
|
+
app: ApplicationConfiguration;
|
|
21
|
+
constructor({ stellarConfiguration, applicationConfiguration, }: ConfigParams);
|
|
22
22
|
}
|
|
23
23
|
export declare class StellarConfiguration {
|
|
24
24
|
server: Server;
|
|
25
25
|
network: Networks;
|
|
26
26
|
horizonUrl: string;
|
|
27
27
|
baseFee: number;
|
|
28
|
+
defaultTimeout: number;
|
|
28
29
|
static TestNet: () => StellarConfiguration;
|
|
29
30
|
static MainNet: () => StellarConfiguration;
|
|
30
|
-
constructor(network
|
|
31
|
+
constructor({ network, horizonUrl, baseFee, defaultTimeout, }: StellarConfigurationParams);
|
|
31
32
|
}
|
|
33
|
+
export declare const DefaultClient: AxiosInstance;
|
|
32
34
|
export declare class ApplicationConfiguration {
|
|
33
35
|
defaultSigner: WalletSigner;
|
|
34
36
|
defaultClient: AxiosInstance;
|
|
35
|
-
constructor(defaultSigner?: WalletSigner);
|
|
37
|
+
constructor(defaultSigner?: WalletSigner, defaultClient?: AxiosInstance);
|
|
36
38
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { Server } from "stellar-sdk";
|
|
3
|
+
import { Config } from "walletSdk";
|
|
4
|
+
import { Stellar } from "../Horizon";
|
|
5
|
+
type RecoveryParams = {
|
|
6
|
+
cfg: Config;
|
|
7
|
+
stellar: Stellar;
|
|
8
|
+
httpClient: AxiosInstance;
|
|
9
|
+
servers: Server[];
|
|
10
|
+
};
|
|
11
|
+
export declare class Recovery {
|
|
12
|
+
private cfg;
|
|
13
|
+
private stellar;
|
|
14
|
+
private httpClient;
|
|
15
|
+
private servers;
|
|
16
|
+
constructor(params: RecoveryParams);
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stellar/typescript-wallet-sdk",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=18"
|
|
6
6
|
},
|
|
@@ -17,9 +17,14 @@
|
|
|
17
17
|
"@types/lodash": "^4.14.194",
|
|
18
18
|
"@types/sinon": "^10.0.15",
|
|
19
19
|
"babel-jest": "^29.4.1",
|
|
20
|
+
"crypto-browserify": "^3.12.0",
|
|
20
21
|
"eslint": "^8.33.0",
|
|
22
|
+
"husky": "^8.0.0",
|
|
21
23
|
"jest": "^29.4.1",
|
|
24
|
+
"prettier": "^2.0.5",
|
|
25
|
+
"pretty-quick": "^2.0.1",
|
|
22
26
|
"sinon": "^15.1.0",
|
|
27
|
+
"stream-browserify": "^3.0.0",
|
|
23
28
|
"ts-jest": "^29.0.5",
|
|
24
29
|
"ts-loader": "^9.4.2",
|
|
25
30
|
"tslib": "^2.5.0",
|
|
@@ -30,6 +35,7 @@
|
|
|
30
35
|
"dependencies": {
|
|
31
36
|
"axios": "^1.4.0",
|
|
32
37
|
"https-browserify": "^1.0.0",
|
|
38
|
+
"jws": "^4.0.0",
|
|
33
39
|
"lodash": "^4.17.21",
|
|
34
40
|
"query-string": "^7.1.3",
|
|
35
41
|
"stellar-sdk": "^10.4.1",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@stellar/prettier-config");
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types
|
|
3
|
+
*/
|
|
4
|
+
import * as Types from "./walletSdk/Types";
|
|
5
|
+
export { Types };
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Classes
|
|
9
|
+
*/
|
|
10
|
+
export {
|
|
11
|
+
Wallet,
|
|
12
|
+
Config,
|
|
13
|
+
StellarConfiguration,
|
|
14
|
+
ApplicationConfiguration,
|
|
15
|
+
} from "./walletSdk";
|
|
16
|
+
export { Anchor } from "./walletSdk/Anchor";
|
|
17
|
+
export { Sep24 } from "./walletSdk/Anchor/Sep24";
|
|
18
|
+
export { IssuedAssetId, NativeAssetId, FiatAssetId } from "./walletSdk/Asset";
|
|
19
|
+
export { Sep10, WalletSigner, DefaultSigner } from "./walletSdk/Auth";
|
|
20
|
+
export {
|
|
21
|
+
PublicKeypair,
|
|
22
|
+
SigningKeypair,
|
|
23
|
+
AccountService,
|
|
24
|
+
Stellar,
|
|
25
|
+
TransactionBuilder,
|
|
26
|
+
} from "./walletSdk/Horizon";
|
|
27
|
+
export { Recovery } from "./walletSdk/Recovery";
|
|
28
|
+
export { Watcher } from "./walletSdk/Watcher";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Utils
|
|
32
|
+
*/
|
|
33
|
+
import * as Utils from "./walletSdk/Utils";
|
|
34
|
+
export { Utils };
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Exceptions
|
|
38
|
+
*/
|
|
39
|
+
import * as Exceptions from "./walletSdk/Exceptions";
|
|
40
|
+
export { Exceptions };
|
|
41
|
+
|
|
1
42
|
import * as walletSdk from "./walletSdk";
|
|
2
43
|
import { Keypair } from "stellar-sdk";
|
|
3
|
-
|
|
4
44
|
// TODO - figure out why Keypair used in parent codebase throws error
|
|
5
45
|
export { walletSdk, Keypair };
|
|
6
46
|
export default { walletSdk };
|