@stellar/typescript-wallet-sdk 1.1.0 → 1.1.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.
package/README.md CHANGED
@@ -1,30 +1,44 @@
1
- # typescript-wallet-sdk
1
+ # Stellar Typescript Wallet SDK [![npm version](https://badge.fury.io/js/@stellar%2Ftypescript-wallet-sdk.svg)](https://badge.fury.io/js/@stellar%2Ftypescript-wallet-sdk)
2
2
 
3
- Typescript Wallet SDK to build Stellar wallets
3
+ Typescript Wallet SDK is a library that allows developers to build wallet applications on the Stellar network faster. It
4
+ utilizes [Javascript Stellar SDK](https://github.com/stellar/js-stellar-sdk) to communicate with a Stellar Horizon server.
5
+ It offers wide range of functionality to simplify integration with the Stellar network, and connect to the anchors easily, utilizing
6
+ various Stellar protocols (SEPs)
4
7
 
5
- ### This SDK is currently in development. Some features may not work as expected. Please use at your own risk.
8
+ ## Dependency
6
9
 
7
- ### To use locally you can use npm link:
10
+ The library is available via npm.
11
+ To import `typescript-wallet-sdk` library you need to add it as a dependency to your code:
8
12
 
9
- ```
10
- // build wallet sdk
11
- cd typescript-wallet-sdk
12
- yarn
13
- yarn run build
13
+ yarn:
14
14
 
15
- // add npm link of sdk directory
16
- npm link
15
+ ```shell
16
+ yarn add @stellar/typescript-wallet-sdk
17
+ ```
17
18
 
18
- // change to your wallet directory, and then create npm link
19
- cd my-wallet
20
- npm link @stellar/typescript-wallet-sdk
19
+ npm:
21
20
 
22
- // import in wallet code
23
- import typescript-wallet-sdk from "@stellar/typescript-wallet-sdk"
21
+ ```shell
22
+ npm install @stellar/typescript-wallet-sdk
24
23
  ```
25
24
 
26
- ### To run tests:
25
+ ## Introduction
27
26
 
27
+ Here's a small example creating main wallet class with default configuration connected to testnet network:
28
+
29
+ ```typescript
30
+ let wallet = walletSdk.Wallet.TestNet();
28
31
  ```
29
- yarn test
32
+
33
+ It should later be re-used across the code, as it has access to various useful children classes. For example, you can
34
+ authenticate with the `testanchor` as simple as:
35
+
36
+ ```typescript
37
+ const authKey = SigningKeypair.fromSecret("my secret key");
38
+ const anchor = wallet.anchor({ homeDomain: "testanchor.stellar.org" });
39
+ const sep10 = await anchor.sep10();
40
+
41
+ const authToken = await sep10.authenticate({accountKp: authKey});
30
42
  ```
43
+
44
+ Read [full wallet guide](https://developers.stellar.org/docs/category/build-a-wallet) for more info