@stellar/typescript-wallet-sdk 1.1.1 → 1.1.3
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 +32 -18
- package/lib/bundle.js +42155 -45147
- package/lib/bundle.js.map +1 -1
- package/lib/bundle_browser.js +55845 -51613
- package/lib/bundle_browser.js.map +1 -1
- package/lib/walletSdk/Exceptions/index.d.ts +3 -0
- package/package.json +2 -2
- package/src/walletSdk/Exceptions/index.ts +7 -0
- package/src/walletSdk/Horizon/Transaction/TransactionBuilder.ts +16 -3
- package/src/walletSdk/Watcher/index.ts +9 -8
- package/test/stellar.test.ts +45 -24
- package/test/wallet.test.ts +131 -16
package/README.md
CHANGED
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Stellar Typescript Wallet SDK [](https://badge.fury.io/js/@stellar%2Ftypescript-wallet-sdk)
|
|
2
2
|
|
|
3
|
-
Typescript Wallet SDK to build Stellar
|
|
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
|
-
|
|
8
|
+
## Dependency
|
|
6
9
|
|
|
7
|
-
|
|
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
|
-
|
|
16
|
-
|
|
15
|
+
```shell
|
|
16
|
+
yarn add @stellar/typescript-wallet-sdk
|
|
17
|
+
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
cd my-wallet
|
|
20
|
-
npm link @stellar/typescript-wallet-sdk
|
|
19
|
+
npm:
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
```shell
|
|
22
|
+
npm install @stellar/typescript-wallet-sdk
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
|
|
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
|
-
|
|
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
|