@stellar/typescript-wallet-sdk 1.1.0-alpha.2 → 1.1.1

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 (90) hide show
  1. package/.husky/pre-commit +4 -0
  2. package/docs/WalletGuide.md +5 -0
  3. package/lib/bundle.js +15519 -18948
  4. package/lib/bundle.js.map +1 -1
  5. package/lib/bundle_browser.js +89069 -0
  6. package/lib/bundle_browser.js.map +1 -0
  7. package/lib/index.d.ts +26 -7
  8. package/lib/walletSdk/Anchor/Sep24.d.ts +48 -0
  9. package/lib/walletSdk/Anchor/index.d.ts +24 -0
  10. package/lib/walletSdk/Asset/index.d.ts +27 -0
  11. package/lib/walletSdk/Auth/WalletSigner.d.ts +7 -0
  12. package/lib/walletSdk/Auth/index.d.ts +21 -0
  13. package/lib/walletSdk/Exceptions/index.d.ts +56 -0
  14. package/lib/walletSdk/{horizon → Horizon}/Account.d.ts +3 -6
  15. package/lib/walletSdk/Horizon/AccountService.d.ts +53 -0
  16. package/lib/walletSdk/Horizon/Stellar.d.ts +16 -0
  17. package/lib/walletSdk/Horizon/Transaction/TransactionBuilder.d.ts +20 -0
  18. package/lib/walletSdk/Horizon/index.d.ts +4 -0
  19. package/lib/walletSdk/Recovery/index.d.ts +18 -0
  20. package/lib/walletSdk/{Watcher/Types.d.ts → Types/anchor.d.ts} +89 -6
  21. package/lib/walletSdk/Types/auth.d.ts +35 -0
  22. package/lib/walletSdk/Types/horizon.d.ts +34 -0
  23. package/lib/walletSdk/Types/index.d.ts +30 -0
  24. package/lib/walletSdk/Types/sep24.d.ts +30 -0
  25. package/lib/walletSdk/{toml/index.d.ts → Types/utils.d.ts} +4 -5
  26. package/lib/walletSdk/Types/watcher.d.ts +30 -0
  27. package/lib/walletSdk/{util → Utils}/camelToSnakeCase.d.ts +1 -1
  28. package/lib/walletSdk/Utils/getResultCode.d.ts +1 -0
  29. package/lib/walletSdk/Utils/index.d.ts +3 -0
  30. package/lib/walletSdk/Utils/toml.d.ts +3 -0
  31. package/lib/walletSdk/Utils/url.d.ts +1 -0
  32. package/lib/walletSdk/Watcher/index.d.ts +21 -42
  33. package/lib/walletSdk/index.d.ts +17 -15
  34. package/package.json +12 -2
  35. package/prettier.config.js +1 -0
  36. package/src/index.ts +39 -17
  37. package/src/walletSdk/Anchor/Sep24.ts +267 -0
  38. package/src/walletSdk/Anchor/index.ts +32 -201
  39. package/src/walletSdk/Asset/index.ts +58 -0
  40. package/src/walletSdk/Auth/WalletSigner.ts +23 -12
  41. package/src/walletSdk/Auth/index.ts +96 -49
  42. package/src/walletSdk/Exceptions/index.ts +148 -0
  43. package/src/walletSdk/{horizon → Horizon}/Account.ts +7 -9
  44. package/src/walletSdk/Horizon/AccountService.ts +96 -0
  45. package/src/walletSdk/Horizon/Stellar.ts +164 -0
  46. package/src/walletSdk/Horizon/Transaction/TransactionBuilder.ts +140 -0
  47. package/src/walletSdk/Horizon/index.ts +4 -0
  48. package/src/walletSdk/Recovery/index.ts +32 -0
  49. package/src/walletSdk/{Watcher/Types.ts → Types/anchor.ts} +114 -21
  50. package/src/walletSdk/Types/auth.ts +43 -0
  51. package/src/walletSdk/Types/horizon.ts +40 -0
  52. package/src/walletSdk/Types/index.ts +39 -0
  53. package/src/walletSdk/Types/sep24.ts +41 -0
  54. package/src/walletSdk/Types/utils.ts +77 -0
  55. package/src/walletSdk/Types/watcher.ts +34 -0
  56. package/src/walletSdk/Utils/camelToSnakeCase.ts +16 -0
  57. package/src/walletSdk/Utils/getResultCode.ts +5 -0
  58. package/src/walletSdk/Utils/index.ts +3 -0
  59. package/src/walletSdk/Utils/toml.ts +103 -0
  60. package/src/walletSdk/{util → Utils}/url.ts +1 -1
  61. package/src/walletSdk/Watcher/index.ts +137 -128
  62. package/src/walletSdk/index.ts +72 -55
  63. package/test/account.test.ts +19 -15
  64. package/test/accountService.test.ts +109 -0
  65. package/test/fixtures/TransactionsResponse.ts +144 -127
  66. package/test/stellar.test.ts +247 -0
  67. package/test/wallet.test.ts +196 -214
  68. package/tsconfig.json +3 -7
  69. package/webpack.config.js +7 -4
  70. package/lib/walletSdk/anchor/Types.d.ts +0 -75
  71. package/lib/walletSdk/anchor/index.d.ts +0 -87
  72. package/lib/walletSdk/auth/WalletSigner.d.ts +0 -6
  73. package/lib/walletSdk/auth/index.d.ts +0 -12
  74. package/lib/walletSdk/exception/index.d.ts +0 -21
  75. package/lib/walletSdk/horizon/AccountService.d.ts +0 -8
  76. package/lib/walletSdk/horizon/Stellar.d.ts +0 -7
  77. package/lib/walletSdk/horizon/constants.d.ts +0 -4
  78. package/lib/walletSdk/interactive/index.d.ts +0 -38
  79. package/lib/walletSdk/recovery/Recovery.d.ts +0 -3
  80. package/lib/walletSdk/util/sleep.d.ts +0 -1
  81. package/lib/walletSdk/util/url.d.ts +0 -1
  82. package/src/walletSdk/Anchor/Types.ts +0 -83
  83. package/src/walletSdk/exception/index.ts +0 -48
  84. package/src/walletSdk/horizon/AccountService.ts +0 -19
  85. package/src/walletSdk/horizon/Stellar.ts +0 -14
  86. package/src/walletSdk/horizon/constants.ts +0 -4
  87. package/src/walletSdk/interactive/index.ts +0 -105
  88. package/src/walletSdk/recovery/Recovery.ts +0 -6
  89. package/src/walletSdk/toml/index.ts +0 -179
  90. package/src/walletSdk/util/camelToSnakeCase.ts +0 -13
@@ -0,0 +1,109 @@
1
+ import axios from "axios";
2
+ import { Horizon } from "stellar-sdk";
3
+
4
+ import { AccountService, SigningKeypair, Wallet } from "../src";
5
+ import { HORIZON_ORDER } from "../src/walletSdk/Types";
6
+ import { IssuedAssetId } from "../src/walletSdk/Asset";
7
+
8
+ let accountService: AccountService;
9
+ let accountAddress: string;
10
+
11
+ describe("Horizon", () => {
12
+ // Creates testing stellar account with USDC trustline
13
+ // in case it doesn't exist just yet
14
+ beforeAll(async () => {
15
+ const wallet = Wallet.TestNet();
16
+ const stellar = wallet.stellar();
17
+ accountService = stellar.account();
18
+
19
+ const fundingAccountKp = SigningKeypair.fromSecret(
20
+ "SDJTZXPFPWRK4GHECLQBDFRDCNEZFA4PIZA475WQEGKTL4Y2QLS77DGD",
21
+ );
22
+
23
+ // make sure funding account exists
24
+ try {
25
+ await stellar.server.loadAccount(fundingAccountKp.publicKey);
26
+ } catch (e) {
27
+ await axios.get(
28
+ "https://friendbot.stellar.org/?addr=" + fundingAccountKp.publicKey,
29
+ );
30
+ }
31
+
32
+ const testingAccountKp = SigningKeypair.fromSecret(
33
+ "SAXW2HC7JH5IJSIRFQ22JTMT6T3VONKGMYSIBLHNEJCV7AXLIGAXNESD",
34
+ );
35
+
36
+ // make sure testing account exists
37
+ accountAddress = testingAccountKp.publicKey;
38
+ try {
39
+ await stellar.server.loadAccount(accountAddress);
40
+ } catch (e) {
41
+ const txBuilder1 = await stellar.transaction({
42
+ sourceAddress: fundingAccountKp,
43
+ baseFee: 100,
44
+ });
45
+ const createAccTx = txBuilder1.createAccount(testingAccountKp, 2).build();
46
+ createAccTx.sign(fundingAccountKp.keypair);
47
+
48
+ let failed = false;
49
+ try {
50
+ await stellar.submitTransaction(createAccTx);
51
+ await stellar.server.loadAccount(accountAddress);
52
+ } catch (e) {
53
+ failed = true;
54
+ }
55
+
56
+ const txBuilder2 = await stellar.transaction({
57
+ sourceAddress: testingAccountKp,
58
+ baseFee: 100,
59
+ });
60
+ const asset = new IssuedAssetId(
61
+ "USDC",
62
+ "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
63
+ );
64
+ const addUsdcTx = txBuilder2.addAssetSupport(asset).build();
65
+ addUsdcTx.sign(testingAccountKp.keypair);
66
+
67
+ // make sure testing account has USDC trustline
68
+ try {
69
+ await stellar.submitTransaction(addUsdcTx);
70
+ } catch (e) {
71
+ failed = true;
72
+ }
73
+
74
+ expect(failed).toBeFalsy();
75
+ }
76
+ }, 30000);
77
+
78
+ it("should return stellar account details", async () => {
79
+ const response = await accountService.getInfo({ accountAddress });
80
+
81
+ expect(response.account_id).toBe(accountAddress);
82
+ expect(response.balances).toBeInstanceOf(Array);
83
+ expect(
84
+ response.balances.some(
85
+ (balance) =>
86
+ (balance as Horizon.BalanceLineAsset).asset_code === "USDC",
87
+ ),
88
+ ).toBeTruthy();
89
+ });
90
+
91
+ it("should return stellar account operations", async () => {
92
+ const response = await accountService.getHistory({
93
+ accountAddress,
94
+ order: HORIZON_ORDER.ASC,
95
+ });
96
+
97
+ expect(response.records).toBeInstanceOf(Array);
98
+ expect(response.records[0]).toBeInstanceOf(Object);
99
+ expect(response.records[0]).toHaveProperty("id");
100
+ expect(response.records[0]).toHaveProperty("type");
101
+ expect(response.records[0]).toHaveProperty("created_at");
102
+ expect(
103
+ response.records.some(({ type }) => type === "create_account"),
104
+ ).toBeTruthy();
105
+ expect(
106
+ response.records.some(({ type }) => type === "change_trust"),
107
+ ).toBeTruthy();
108
+ });
109
+ });
@@ -1,150 +1,161 @@
1
- export const TransactionsResponse = [
1
+ import {
2
+ AnchorTransaction,
3
+ TransactionStatus,
4
+ } from "../../src/walletSdk/Types";
5
+
6
+ export const TransactionsResponse: AnchorTransaction[] = [
2
7
  {
3
- id: 'db15d166-5a5e-4d5c-ba5d-271c32cd8cf0',
4
- kind: 'withdrawal',
5
- status: 'pending_user_transfer_start',
8
+ id: "db15d166-5a5e-4d5c-ba5d-271c32cd8cf0",
9
+ kind: "withdrawal",
10
+ status: TransactionStatus.pending_user_transfer_start,
6
11
  status_eta: null,
7
- amount_in: '50.55',
8
- amount_in_asset: 'stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B',
9
- amount_out: '75.08',
10
- amount_out_asset: 'iso4217:USD',
11
- amount_fee: '1.00',
12
- amount_fee_asset: 'stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B',
13
- started_at: '2023-05-26T14:12:35.128156Z',
12
+ amount_in: "50.55",
13
+ amount_in_asset:
14
+ "stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
15
+ amount_out: "75.08",
16
+ amount_out_asset: "iso4217:USD",
17
+ amount_fee: "1.00",
18
+ amount_fee_asset:
19
+ "stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
20
+ started_at: "2023-05-26T14:12:35.128156Z",
14
21
  completed_at: null,
15
22
  stellar_transaction_id: null,
16
23
  external_transaction_id: null,
17
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=db15d166-5a5e-4d5c-ba5d-271c32cd8cf0',
18
- refunded: false,
19
- message: 'waiting on the user to transfer funds',
24
+ more_info_url:
25
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=db15d166-5a5e-4d5c-ba5d-271c32cd8cf0",
26
+ message: "waiting on the user to transfer funds",
20
27
  to: null,
21
- from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
22
- withdraw_memo_type: 'hash',
23
- withdraw_memo: 'AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=',
24
- withdraw_anchor_account: 'GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE'
28
+ from: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
29
+ withdraw_memo_type: "hash",
30
+ withdraw_memo: "AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=",
31
+ withdraw_anchor_account:
32
+ "GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE",
25
33
  },
26
34
  {
27
- id: 'hgt1576b-ac28-4c02-a521-ddbfd9ae7poi',
28
- kind: 'deposit',
29
- status: 'pending_anchor',
35
+ id: "hgt1576b-ac28-4c02-a521-ddbfd9ae7poi",
36
+ kind: "deposit",
37
+ status: TransactionStatus.pending_anchor,
30
38
  status_eta: null,
31
- amount_in: '120.45',
32
- amount_out: '119.45',
33
- amount_fee: '1.00',
34
- started_at: '2023-05-26T10:11:27.227597Z',
39
+ amount_in: "120.45",
40
+ amount_out: "119.45",
41
+ amount_fee: "1.00",
42
+ started_at: "2023-05-26T10:11:27.227597Z",
35
43
  completed_at: null,
36
44
  stellar_transaction_id: null,
37
45
  external_transaction_id: null,
38
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=hgt1576b-ac28-4c02-a521-ddbfd9ae7poi',
39
- refunded: false,
40
- message: 'waiting for anchor to process the transaction',
46
+ more_info_url:
47
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=hgt1576b-ac28-4c02-a521-ddbfd9ae7poi",
48
+ message: "waiting for anchor to process the transaction",
41
49
  claimable_balance_id: null,
42
- to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
50
+ to: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
43
51
  from: null,
44
- deposit_memo_type: 'hash',
45
- deposit_memo: null
52
+ deposit_memo_type: "hash",
53
+ deposit_memo: null,
46
54
  },
47
55
  {
48
- id: 'ac71576b-ac28-4c02-a521-ddbfd9ae73cc',
49
- kind: 'deposit',
50
- status: 'pending_trust',
56
+ id: "ac71576b-ac28-4c02-a521-ddbfd9ae73cc",
57
+ kind: "deposit",
58
+ status: TransactionStatus.pending_trust,
51
59
  status_eta: null,
52
- amount_in: '123.45',
53
- amount_out: '122.45',
54
- amount_fee: '1.00',
55
- started_at: '2023-05-26T14:11:27.227597Z',
60
+ amount_in: "123.45",
61
+ amount_out: "122.45",
62
+ amount_fee: "1.00",
63
+ started_at: "2023-05-26T14:11:27.227597Z",
56
64
  completed_at: null,
57
65
  stellar_transaction_id: null,
58
66
  external_transaction_id: null,
59
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=ac71576b-ac28-4c02-a521-ddbfd9ae73cc',
60
- refunded: false,
61
- message: 'waiting for a trustline to be established',
67
+ more_info_url:
68
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=ac71576b-ac28-4c02-a521-ddbfd9ae73cc",
69
+ message: "waiting for a trustline to be established",
62
70
  claimable_balance_id: null,
63
- to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
71
+ to: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
64
72
  from: null,
65
- deposit_memo_type: 'hash',
66
- deposit_memo: null
73
+ deposit_memo_type: "hash",
74
+ deposit_memo: null,
67
75
  },
68
76
  {
69
- id: 'a20f35fc-f1b0-4657-b0b2-28f77d489df4',
70
- kind: 'deposit',
71
- status: 'incomplete',
77
+ id: "a20f35fc-f1b0-4657-b0b2-28f77d489df4",
78
+ kind: "deposit",
79
+ status: TransactionStatus.incomplete,
72
80
  status_eta: null,
73
81
  amount_in: null,
74
82
  amount_out: null,
75
83
  amount_fee: null,
76
- started_at: '2023-05-25T18:56:31.727086Z',
84
+ started_at: "2023-05-25T18:56:31.727086Z",
77
85
  completed_at: null,
78
86
  stellar_transaction_id: null,
79
87
  external_transaction_id: null,
80
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=a20f35fc-f1b0-4657-b0b2-28f77d489df4',
81
- refunded: false,
82
- message: 'incomplete',
88
+ more_info_url:
89
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=a20f35fc-f1b0-4657-b0b2-28f77d489df4",
90
+ message: "incomplete",
83
91
  claimable_balance_id: null,
84
- to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
92
+ to: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
85
93
  from: null,
86
- deposit_memo_type: 'hash',
87
- deposit_memo: null
94
+ deposit_memo_type: "hash",
95
+ deposit_memo: null,
88
96
  },
89
97
  {
90
- id: '325cf7c4-927d-4b7a-8a1f-d7188ebdde0f',
91
- kind: 'withdrawal',
92
- status: 'incomplete',
98
+ id: "325cf7c4-927d-4b7a-8a1f-d7188ebdde0f",
99
+ kind: "withdrawal",
100
+ status: TransactionStatus.incomplete,
93
101
  status_eta: null,
94
102
  amount_in: null,
95
103
  amount_out: null,
96
104
  amount_fee: null,
97
- started_at: '2023-05-25T18:56:29.615274Z',
105
+ started_at: "2023-05-25T18:56:29.615274Z",
98
106
  completed_at: null,
99
107
  stellar_transaction_id: null,
100
108
  external_transaction_id: null,
101
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=325cf7c4-927d-4b7a-8a1f-d7188ebdde0f',
102
- refunded: false,
103
- message: 'incomplete',
109
+ more_info_url:
110
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=325cf7c4-927d-4b7a-8a1f-d7188ebdde0f",
111
+ message: "incomplete",
104
112
  to: null,
105
- from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
106
- withdraw_memo_type: 'hash',
113
+ from: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
114
+ withdraw_memo_type: "hash",
107
115
  withdraw_memo: null,
108
- withdraw_anchor_account: null
116
+ withdraw_anchor_account: null,
109
117
  },
110
118
  {
111
- id: 'hytcf7c4-927d-4b7a-8a1f-d7188ebddu8i',
112
- kind: 'withdrawal',
113
- status: 'expired',
119
+ id: "hytcf7c4-927d-4b7a-8a1f-d7188ebddu8i",
120
+ kind: "withdrawal",
121
+ status: TransactionStatus.expired,
114
122
  status_eta: null,
115
123
  amount_in: null,
116
124
  amount_out: null,
117
125
  amount_fee: null,
118
- started_at: '2023-05-25T18:56:29.615274Z',
126
+ started_at: "2023-05-25T18:56:29.615274Z",
119
127
  completed_at: null,
120
128
  stellar_transaction_id: null,
121
129
  external_transaction_id: null,
122
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=hytcf7c4-927d-4b7a-8a1f-d7188ebddu8i',
123
- refunded: false,
124
- message: 'transaction has expired',
130
+ more_info_url:
131
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=hytcf7c4-927d-4b7a-8a1f-d7188ebddu8i",
132
+ message: "transaction has expired",
125
133
  to: null,
126
- from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
127
- withdraw_memo_type: 'hash',
134
+ from: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
135
+ withdraw_memo_type: "hash",
128
136
  withdraw_memo: null,
129
- withdraw_anchor_account: null
137
+ withdraw_anchor_account: null,
130
138
  },
131
139
  {
132
- id: 'def5d166-5a5e-4d5c-ba5d-271c32cd8abc',
133
- kind: 'withdrawal',
134
- status: 'refunded',
140
+ id: "def5d166-5a5e-4d5c-ba5d-271c32cd8abc",
141
+ kind: "withdrawal",
142
+ status: TransactionStatus.refunded,
135
143
  status_eta: null,
136
- amount_in: '95.35',
137
- amount_in_asset: 'stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B',
138
- amount_out: '144.48',
139
- amount_out_asset: 'iso4217:USD',
140
- amount_fee: '1.00',
141
- amount_fee_asset: 'stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B',
142
- started_at: '2023-05-25T13:12:35.128156Z',
143
- completed_at: '2023-05-26T15:12:35.128156Z',
144
- stellar_transaction_id: "abu0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cdega",
144
+ amount_in: "95.35",
145
+ amount_in_asset:
146
+ "stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
147
+ amount_out: "144.48",
148
+ amount_out_asset: "iso4217:USD",
149
+ amount_fee: "1.00",
150
+ amount_fee_asset:
151
+ "stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
152
+ started_at: "2023-05-25T13:12:35.128156Z",
153
+ completed_at: "2023-05-26T15:12:35.128156Z",
154
+ stellar_transaction_id:
155
+ "abu0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cdega",
145
156
  external_transaction_id: null,
146
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=def5d166-5a5e-4d5c-ba5d-271c32cd8abc',
147
- refunded: true,
157
+ more_info_url:
158
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=def5d166-5a5e-4d5c-ba5d-271c32cd8abc",
148
159
  refunds: {
149
160
  amount_refunded: "95.35",
150
161
  amount_fee: "5",
@@ -156,7 +167,7 @@ export const TransactionsResponse = [
156
167
  fee: "5",
157
168
  },
158
169
  {
159
- id:"b9d0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9c9020",
170
+ id: "b9d0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9c9020",
160
171
  id_type: "stellar",
161
172
  amount: "55.35",
162
173
  fee: "0",
@@ -165,34 +176,38 @@ export const TransactionsResponse = [
165
176
  },
166
177
  message: null,
167
178
  to: null,
168
- from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
169
- withdraw_memo_type: 'hash',
170
- withdraw_memo: 'AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=',
171
- withdraw_anchor_account: 'GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE',
179
+ from: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
180
+ withdraw_memo_type: "hash",
181
+ withdraw_memo: "AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=",
182
+ withdraw_anchor_account:
183
+ "GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE",
172
184
  },
173
185
  {
174
- id: 'duh5d166-5a5e-4d5c-ba5d-271c32cd8pok',
175
- kind: 'withdrawal',
176
- status: 'completed',
186
+ id: "duh5d166-5a5e-4d5c-ba5d-271c32cd8pok",
187
+ kind: "withdrawal",
188
+ status: TransactionStatus.completed,
177
189
  status_eta: null,
178
- amount_in: '95.35',
179
- amount_in_asset: 'stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B',
180
- amount_out: '144.48',
181
- amount_out_asset: 'iso4217:USD',
182
- amount_fee: '1.00',
183
- amount_fee_asset: 'stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B',
184
- started_at: '2023-05-27T13:12:35.128156Z',
185
- completed_at: '2023-05-28T15:12:35.128156Z',
186
- stellar_transaction_id: "hut0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cdjiu",
190
+ amount_in: "95.35",
191
+ amount_in_asset:
192
+ "stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
193
+ amount_out: "144.48",
194
+ amount_out_asset: "iso4217:USD",
195
+ amount_fee: "1.00",
196
+ amount_fee_asset:
197
+ "stellar:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
198
+ started_at: "2023-05-27T13:12:35.128156Z",
199
+ completed_at: "2023-05-28T15:12:35.128156Z",
200
+ stellar_transaction_id:
201
+ "hut0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cdjiu",
187
202
  external_transaction_id: null,
188
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=duh5d166-5a5e-4d5c-ba5d-271c32cd8pok',
189
- refunded: false,
203
+ more_info_url:
204
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=duh5d166-5a5e-4d5c-ba5d-271c32cd8pok",
190
205
  refunds: {
191
206
  amount_refunded: "35.35",
192
207
  amount_fee: "0",
193
208
  payments: [
194
209
  {
195
- id:"urh0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cuhrt",
210
+ id: "urh0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cuhrt",
196
211
  id_type: "stellar",
197
212
  amount: "35.35",
198
213
  fee: "0",
@@ -201,30 +216,32 @@ export const TransactionsResponse = [
201
216
  },
202
217
  message: null,
203
218
  to: null,
204
- from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
205
- withdraw_memo_type: 'hash',
206
- withdraw_memo: 'AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=',
207
- withdraw_anchor_account: 'GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE',
219
+ from: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
220
+ withdraw_memo_type: "hash",
221
+ withdraw_memo: "AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=",
222
+ withdraw_anchor_account:
223
+ "GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE",
208
224
  },
209
225
  {
210
- id: 'uyt1576b-ac28-4c02-a521-ddbfd9ae7oiu',
211
- kind: 'deposit',
212
- status: 'completed',
226
+ id: "uyt1576b-ac28-4c02-a521-ddbfd9ae7oiu",
227
+ kind: "deposit",
228
+ status: TransactionStatus.completed,
213
229
  status_eta: null,
214
- amount_in: '150.45',
215
- amount_out: '149.45',
216
- amount_fee: '1.00',
217
- started_at: '2023-05-22T12:11:27.227597Z',
218
- completed_at: '2023-05-22T18:11:27.227597Z',
219
- stellar_transaction_id: "pokib2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cbngt",
230
+ amount_in: "150.45",
231
+ amount_out: "149.45",
232
+ amount_fee: "1.00",
233
+ started_at: "2023-05-22T12:11:27.227597Z",
234
+ completed_at: "2023-05-22T18:11:27.227597Z",
235
+ stellar_transaction_id:
236
+ "pokib2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cbngt",
220
237
  external_transaction_id: null,
221
- more_info_url: 'https://testanchor.stellar.org/sep24/transaction/more_info?id=uyt1576b-ac28-4c02-a521-ddbfd9ae7oiu',
222
- refunded: false,
223
- message: 'deposit completed!',
238
+ more_info_url:
239
+ "https://testanchor.stellar.org/sep24/transaction/more_info?id=uyt1576b-ac28-4c02-a521-ddbfd9ae7oiu",
240
+ message: "deposit completed!",
224
241
  claimable_balance_id: null,
225
- to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
242
+ to: "GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5",
226
243
  from: null,
227
- deposit_memo_type: 'hash',
228
- deposit_memo: null
244
+ deposit_memo_type: "hash",
245
+ deposit_memo: null,
229
246
  },
230
247
  ];