@stellar/typescript-wallet-sdk 1.4.1 → 1.6.0-beta.1719865729038

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.
Files changed (66) hide show
  1. package/CHANGELOG.MD +98 -0
  2. package/examples/sep24/sep24.ts +4 -9
  3. package/jest.e2e.config.js +9 -0
  4. package/lib/bundle.js +47445 -43024
  5. package/lib/bundle.js.map +1 -1
  6. package/lib/bundle_browser.js +45409 -41445
  7. package/lib/bundle_browser.js.map +1 -1
  8. package/lib/index.d.ts +2 -0
  9. package/lib/walletSdk/Anchor/index.d.ts +1 -1
  10. package/lib/walletSdk/Auth/AuthHeaderSigner.d.ts +61 -0
  11. package/lib/walletSdk/Auth/index.d.ts +2 -2
  12. package/lib/walletSdk/Exceptions/index.d.ts +21 -0
  13. package/lib/walletSdk/Horizon/AccountService.d.ts +1 -1
  14. package/lib/walletSdk/Horizon/Stellar.d.ts +1 -1
  15. package/lib/walletSdk/Horizon/Transaction/TransactionBuilder.d.ts +1 -1
  16. package/lib/walletSdk/Recovery/AccountRecover.d.ts +1 -1
  17. package/lib/walletSdk/Recovery/index.d.ts +2 -2
  18. package/lib/walletSdk/Types/anchor.d.ts +5 -1
  19. package/lib/walletSdk/Types/auth.d.ts +17 -0
  20. package/lib/walletSdk/Types/horizon.d.ts +1 -1
  21. package/lib/walletSdk/Types/index.d.ts +2 -1
  22. package/lib/walletSdk/Types/recovery.d.ts +2 -2
  23. package/lib/walletSdk/Types/sep7.d.ts +15 -0
  24. package/lib/walletSdk/Uri/Sep7Base.d.ts +187 -0
  25. package/lib/walletSdk/Uri/Sep7Pay.d.ts +121 -0
  26. package/lib/walletSdk/Uri/Sep7Tx.d.ts +133 -0
  27. package/lib/walletSdk/Uri/index.d.ts +4 -0
  28. package/lib/walletSdk/Uri/sep7Parser.d.ts +60 -0
  29. package/lib/walletSdk/Utils/index.d.ts +2 -1
  30. package/package.json +8 -3
  31. package/src/index.ts +14 -0
  32. package/src/walletSdk/Anchor/index.ts +1 -1
  33. package/src/walletSdk/Auth/AuthHeaderSigner.ts +162 -0
  34. package/src/walletSdk/Auth/WalletSigner.ts +3 -3
  35. package/src/walletSdk/Auth/index.ts +48 -2
  36. package/src/walletSdk/Customer/index.ts +7 -7
  37. package/src/walletSdk/Exceptions/index.ts +56 -0
  38. package/src/walletSdk/Horizon/Account.ts +2 -1
  39. package/src/walletSdk/Horizon/AccountService.ts +1 -1
  40. package/src/walletSdk/Horizon/Stellar.ts +1 -1
  41. package/src/walletSdk/Horizon/Transaction/TransactionBuilder.ts +1 -1
  42. package/src/walletSdk/Recovery/AccountRecover.ts +1 -1
  43. package/src/walletSdk/Recovery/index.ts +2 -2
  44. package/src/walletSdk/Types/anchor.ts +4 -0
  45. package/src/walletSdk/Types/auth.ts +19 -0
  46. package/src/walletSdk/Types/horizon.ts +1 -1
  47. package/src/walletSdk/Types/index.ts +2 -1
  48. package/src/walletSdk/Types/recovery.ts +2 -2
  49. package/src/walletSdk/Types/sep7.ts +19 -0
  50. package/src/walletSdk/Uri/Sep7Base.ts +311 -0
  51. package/src/walletSdk/Uri/Sep7Pay.ts +169 -0
  52. package/src/walletSdk/Uri/Sep7Tx.ts +193 -0
  53. package/src/walletSdk/Uri/index.ts +9 -0
  54. package/src/walletSdk/Uri/sep7Parser.ts +220 -0
  55. package/src/walletSdk/Utils/index.ts +2 -1
  56. package/src/walletSdk/Watcher/index.ts +3 -1
  57. package/test/customer.test.ts +7 -7
  58. package/test/e2e/README.md +11 -0
  59. package/test/e2e/browser.test.ts +52 -0
  60. package/test/integration/README.md +38 -0
  61. package/test/integration/anchorplatform.test.ts +11 -2
  62. package/test/sep7.test.ts +825 -0
  63. package/test/server.test.ts +13 -0
  64. package/test/wallet.test.ts +85 -0
  65. package/webpack.config.js +4 -0
  66. package/test/README.md +0 -18
package/CHANGELOG.MD ADDED
@@ -0,0 +1,98 @@
1
+ # Release notes - Typescript Wallet SDK - 1.6.0
2
+
3
+ ### Added
4
+ * Support for Sep-7 (#141)(#144)
5
+ * Upgrade @stellar/stellar-sdk to 12.1.0 (#143)
6
+ * New on_hold status (#140)
7
+
8
+ ### Fixed
9
+ * [BREAKING CHANGE] Fix response objects returned on Customer functions (#142)
10
+
11
+ # Release notes - Typescript Wallet SDK - 1.5.0
12
+
13
+ ### Added
14
+ * AuthHeaderSigner to Authentication Flow
15
+ * End to end tests for testing browser build
16
+ * Beta builds on merges to develop branch
17
+
18
+ # Release notes - Typescript Wallet SDK - 1.4.0
19
+
20
+ ### Added
21
+ * SEP-10 sign challenge transaction helper
22
+ * Anchor platform integration tests
23
+ * Change project structure to monorepo
24
+ * Helper for parsing AnchorTransaction
25
+
26
+ ### Fixed
27
+ * Fix stellar-sdk imports
28
+
29
+ # Release notes - Typescript Wallet SDK - 1.3.1
30
+
31
+ ### Added
32
+ * Upgraded stellar-sdk to 11.1.0
33
+
34
+ # Release notes - Typescript Wallet SDK - 1.3.0
35
+
36
+ ### Added
37
+ * Type aliases
38
+ * Account setup and recovery using SEP-30
39
+ * Customer / SEP-12 code
40
+ * SEP-6 deposit and withdrawal
41
+ * Exchange endpoints
42
+ * Recovery integration tests
43
+ * Watcher and polling for SEP-6
44
+ * AuthToken class
45
+ * Account merge and premade assets
46
+ * SEP-38 info, price, and prices
47
+ * SEP-38 Quote
48
+
49
+ ### Fixed
50
+ * Some small fixes to recovery code
51
+
52
+ # Release notes - Typescript Wallet SDK - 1.2.1
53
+
54
+ ### Fixed
55
+ * Better handle axios errors
56
+
57
+ # Release notes - Typescript Wallet SDK - 1.2.0
58
+
59
+ ### Added
60
+ * Sponosring transactions
61
+ * Account modification functions
62
+ * Default domain signer and default client_domain
63
+ * Path payment and swap
64
+ * Sep24 example code
65
+
66
+ ### Fixed
67
+ * Add build for both node and browser
68
+
69
+ # Release notes - Typescript Wallet SDK - 1.1.3
70
+
71
+ ### Fixed
72
+ * Check if withdraw memo is hash type
73
+
74
+ ### Added
75
+ * Upgrading stellar-sdk veresion for protocol 20
76
+
77
+
78
+ # Release notes - Typescript Wallet SDK - 1.1.2
79
+
80
+ ### Fixed
81
+ * Fix watcher stopping
82
+ * Only emit txn if status changed
83
+
84
+
85
+ # Release notes - Typescript Wallet SDK - 1.1.0
86
+
87
+ ### Added
88
+ * Submitting a transaction
89
+ * Manage non-XLM trustlines
90
+ * Importing and signing arbitrary transactions given an XDR
91
+ * Horizon getInfo and gitHistory functions
92
+ * Helper method for creating a keypair from random bytes
93
+ * Exporting classes
94
+ * Transfer withdrawal method
95
+ * Fee bump transaction
96
+ * Building function to submitWithFeeIncrease
97
+
98
+
@@ -9,6 +9,7 @@ import {
9
9
  Types,
10
10
  IssuedAssetId,
11
11
  DefaultSigner,
12
+ Wallet,
12
13
  } from "../../src";
13
14
  import {
14
15
  Memo,
@@ -34,7 +35,7 @@ const clientSecret = process.env.CLIENT_SECRET;
34
35
 
35
36
  // Running example
36
37
 
37
- let wallet;
38
+ let wallet: Wallet;
38
39
  if (runMainnet === "true") {
39
40
  console.log("Warning: you are running this script on the public network.");
40
41
  wallet = walletSdk.Wallet.MainNet();
@@ -123,7 +124,6 @@ export let depositDone = false;
123
124
  export const runDepositWatcher = (anchor: Anchor) => {
124
125
  console.log("\nstarting watcher ...");
125
126
 
126
- const stop: Types.WatcherStopFunction;
127
127
  const onMessage = (m: Types.AnchorTransaction) => {
128
128
  console.log({ m });
129
129
  if (m.status === Types.TransactionStatus.completed) {
@@ -138,7 +138,7 @@ export const runDepositWatcher = (anchor: Anchor) => {
138
138
  };
139
139
 
140
140
  const watcher = anchor.sep24().watcher();
141
- const resp = watcher.watchAllTransactions({
141
+ const { stop } = watcher.watchAllTransactions({
142
142
  authToken: authToken,
143
143
  assetCode: asset.code,
144
144
  onMessage,
@@ -146,8 +146,6 @@ export const runDepositWatcher = (anchor: Anchor) => {
146
146
  timeout: 5000,
147
147
  lang: "en-US",
148
148
  });
149
-
150
- stop = resp.stop;
151
149
  };
152
150
 
153
151
  // Create Withdrawal
@@ -188,7 +186,6 @@ const sendWithdrawalTransaction = async (withdrawalTxn, kp) => {
188
186
  export const runWithdrawWatcher = (anchor, kp) => {
189
187
  console.log("\nstarting watcher ...");
190
188
 
191
- const stop;
192
189
  const onMessage = (m) => {
193
190
  console.log({ m });
194
191
 
@@ -208,7 +205,7 @@ export const runWithdrawWatcher = (anchor, kp) => {
208
205
  };
209
206
 
210
207
  const watcher = anchor.sep24().watcher();
211
- const resp = watcher.watchAllTransactions({
208
+ const { stop } = watcher.watchAllTransactions({
212
209
  authToken: authToken,
213
210
  assetCode: asset.code,
214
211
  onMessage,
@@ -216,8 +213,6 @@ export const runWithdrawWatcher = (anchor, kp) => {
216
213
  timeout: 5000,
217
214
  lang: "en-US",
218
215
  });
219
-
220
- stop = resp.stop;
221
216
  };
222
217
 
223
218
  const walletSigner = DefaultSigner;
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ rootDir: "./",
3
+ preset: "ts-jest",
4
+ transform: {
5
+ "^.+\\.(ts|tsx)?$": "ts-jest",
6
+ "^.+\\.(js|jsx)$": "babel-jest",
7
+ },
8
+ testMatch: ["**/e2e/*.test.ts"],
9
+ };