@stellar/typescript-wallet-sdk 1.0.0-alpha.1 → 1.0.0-beta.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/lib/bundle.js +63977 -0
- package/lib/bundle.js.map +1 -0
- package/lib/index.d.ts +32 -0
- package/lib/walletSdk/Exceptions/index.d.ts +22 -0
- package/lib/walletSdk/Types/anchor.d.ts +148 -0
- package/lib/walletSdk/Types/auth.d.ts +34 -0
- package/lib/walletSdk/Types/horizon.d.ts +4 -0
- package/lib/walletSdk/Types/index.d.ts +32 -0
- package/lib/walletSdk/Types/interactive.d.ts +27 -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/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/Types.d.ts +65 -0
- package/lib/walletSdk/Watcher/index.d.ts +33 -0
- package/lib/walletSdk/anchor/Types.d.ts +75 -0
- package/lib/walletSdk/anchor/index.d.ts +72 -0
- package/lib/walletSdk/auth/WalletSigner.d.ts +7 -0
- package/lib/walletSdk/auth/index.d.ts +21 -0
- package/lib/walletSdk/exception/index.d.ts +21 -0
- package/lib/walletSdk/horizon/Account.d.ts +18 -0
- package/lib/walletSdk/horizon/AccountService.d.ts +8 -0
- package/lib/walletSdk/horizon/Stellar.d.ts +7 -0
- package/lib/walletSdk/horizon/constants.d.ts +4 -0
- package/lib/walletSdk/horizon/index.d.ts +3 -0
- package/lib/walletSdk/index.d.ts +37 -0
- package/lib/walletSdk/interactive/index.d.ts +16 -0
- package/lib/walletSdk/recovery/Recovery.d.ts +3 -0
- package/lib/walletSdk/recovery/index.d.ts +18 -0
- package/lib/walletSdk/toml/index.d.ts +78 -0
- package/lib/walletSdk/util/camelToSnakeCase.d.ts +2 -0
- package/lib/walletSdk/util/sleep.d.ts +1 -0
- package/lib/walletSdk/util/url.d.ts +1 -0
- package/package.json +12 -6
- package/src/index.ts +39 -1
- package/src/walletSdk/Anchor/index.ts +252 -27
- package/src/walletSdk/Auth/WalletSigner.ts +27 -3
- package/src/walletSdk/Auth/index.ts +87 -32
- package/src/walletSdk/Exceptions/index.ts +51 -0
- package/src/walletSdk/Horizon/Account.ts +50 -0
- package/src/walletSdk/Horizon/AccountService.ts +19 -0
- package/src/walletSdk/Horizon/Stellar.ts +15 -0
- package/src/walletSdk/Horizon/index.ts +3 -0
- package/src/walletSdk/Interactive/index.ts +126 -0
- package/src/walletSdk/Recovery/index.ts +37 -0
- package/src/walletSdk/Types/anchor.ts +174 -0
- package/src/walletSdk/Types/auth.ts +42 -0
- package/src/walletSdk/{horizon/constants.ts → Types/horizon.ts} +1 -1
- package/src/walletSdk/Types/index.ts +40 -0
- package/src/walletSdk/Types/interactive.ts +36 -0
- package/src/walletSdk/Types/utils.ts +77 -0
- package/src/walletSdk/Types/watcher.ts +34 -0
- package/src/walletSdk/Utils/camelToSnakeCase.ts +13 -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 +367 -0
- package/src/walletSdk/index.ts +103 -58
- package/test/account.test.ts +30 -0
- package/test/fixtures/TransactionsResponse.ts +230 -0
- package/test/wallet.test.ts +1719 -0
- package/src/walletSdk/exception/index.ts +0 -27
- package/src/walletSdk/horizon/Account.ts +0 -0
- package/src/walletSdk/horizon/AccountService.ts +0 -0
- package/src/walletSdk/horizon/Stellar.ts +0 -6
- package/src/walletSdk/interactive/index.ts +0 -103
- package/src/walletSdk/recovery/Recovery.ts +0 -6
- package/src/walletSdk/toml/index.ts +0 -179
- package/test/index.test.ts +0 -73
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
export const TransactionsResponse = [
|
|
2
|
+
{
|
|
3
|
+
id: 'db15d166-5a5e-4d5c-ba5d-271c32cd8cf0',
|
|
4
|
+
kind: 'withdrawal',
|
|
5
|
+
status: 'pending_user_transfer_start',
|
|
6
|
+
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',
|
|
14
|
+
completed_at: null,
|
|
15
|
+
stellar_transaction_id: null,
|
|
16
|
+
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',
|
|
20
|
+
to: null,
|
|
21
|
+
from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
22
|
+
withdraw_memo_type: 'hash',
|
|
23
|
+
withdraw_memo: 'AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=',
|
|
24
|
+
withdraw_anchor_account: 'GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'hgt1576b-ac28-4c02-a521-ddbfd9ae7poi',
|
|
28
|
+
kind: 'deposit',
|
|
29
|
+
status: 'pending_anchor',
|
|
30
|
+
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',
|
|
35
|
+
completed_at: null,
|
|
36
|
+
stellar_transaction_id: null,
|
|
37
|
+
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',
|
|
41
|
+
claimable_balance_id: null,
|
|
42
|
+
to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
43
|
+
from: null,
|
|
44
|
+
deposit_memo_type: 'hash',
|
|
45
|
+
deposit_memo: null
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'ac71576b-ac28-4c02-a521-ddbfd9ae73cc',
|
|
49
|
+
kind: 'deposit',
|
|
50
|
+
status: 'pending_trust',
|
|
51
|
+
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',
|
|
56
|
+
completed_at: null,
|
|
57
|
+
stellar_transaction_id: null,
|
|
58
|
+
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',
|
|
62
|
+
claimable_balance_id: null,
|
|
63
|
+
to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
64
|
+
from: null,
|
|
65
|
+
deposit_memo_type: 'hash',
|
|
66
|
+
deposit_memo: null
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'a20f35fc-f1b0-4657-b0b2-28f77d489df4',
|
|
70
|
+
kind: 'deposit',
|
|
71
|
+
status: 'incomplete',
|
|
72
|
+
status_eta: null,
|
|
73
|
+
amount_in: null,
|
|
74
|
+
amount_out: null,
|
|
75
|
+
amount_fee: null,
|
|
76
|
+
started_at: '2023-05-25T18:56:31.727086Z',
|
|
77
|
+
completed_at: null,
|
|
78
|
+
stellar_transaction_id: null,
|
|
79
|
+
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',
|
|
83
|
+
claimable_balance_id: null,
|
|
84
|
+
to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
85
|
+
from: null,
|
|
86
|
+
deposit_memo_type: 'hash',
|
|
87
|
+
deposit_memo: null
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: '325cf7c4-927d-4b7a-8a1f-d7188ebdde0f',
|
|
91
|
+
kind: 'withdrawal',
|
|
92
|
+
status: 'incomplete',
|
|
93
|
+
status_eta: null,
|
|
94
|
+
amount_in: null,
|
|
95
|
+
amount_out: null,
|
|
96
|
+
amount_fee: null,
|
|
97
|
+
started_at: '2023-05-25T18:56:29.615274Z',
|
|
98
|
+
completed_at: null,
|
|
99
|
+
stellar_transaction_id: null,
|
|
100
|
+
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',
|
|
104
|
+
to: null,
|
|
105
|
+
from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
106
|
+
withdraw_memo_type: 'hash',
|
|
107
|
+
withdraw_memo: null,
|
|
108
|
+
withdraw_anchor_account: null
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'hytcf7c4-927d-4b7a-8a1f-d7188ebddu8i',
|
|
112
|
+
kind: 'withdrawal',
|
|
113
|
+
status: 'expired',
|
|
114
|
+
status_eta: null,
|
|
115
|
+
amount_in: null,
|
|
116
|
+
amount_out: null,
|
|
117
|
+
amount_fee: null,
|
|
118
|
+
started_at: '2023-05-25T18:56:29.615274Z',
|
|
119
|
+
completed_at: null,
|
|
120
|
+
stellar_transaction_id: null,
|
|
121
|
+
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',
|
|
125
|
+
to: null,
|
|
126
|
+
from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
127
|
+
withdraw_memo_type: 'hash',
|
|
128
|
+
withdraw_memo: null,
|
|
129
|
+
withdraw_anchor_account: null
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: 'def5d166-5a5e-4d5c-ba5d-271c32cd8abc',
|
|
133
|
+
kind: 'withdrawal',
|
|
134
|
+
status: 'refunded',
|
|
135
|
+
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",
|
|
145
|
+
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,
|
|
148
|
+
refunds: {
|
|
149
|
+
amount_refunded: "95.35",
|
|
150
|
+
amount_fee: "5",
|
|
151
|
+
payments: [
|
|
152
|
+
{
|
|
153
|
+
id: "1937103",
|
|
154
|
+
id_type: "external",
|
|
155
|
+
amount: "40.0",
|
|
156
|
+
fee: "5",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id:"b9d0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9c9020",
|
|
160
|
+
id_type: "stellar",
|
|
161
|
+
amount: "55.35",
|
|
162
|
+
fee: "0",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
message: null,
|
|
167
|
+
to: null,
|
|
168
|
+
from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
169
|
+
withdraw_memo_type: 'hash',
|
|
170
|
+
withdraw_memo: 'AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=',
|
|
171
|
+
withdraw_anchor_account: 'GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: 'duh5d166-5a5e-4d5c-ba5d-271c32cd8pok',
|
|
175
|
+
kind: 'withdrawal',
|
|
176
|
+
status: 'completed',
|
|
177
|
+
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",
|
|
187
|
+
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,
|
|
190
|
+
refunds: {
|
|
191
|
+
amount_refunded: "35.35",
|
|
192
|
+
amount_fee: "0",
|
|
193
|
+
payments: [
|
|
194
|
+
{
|
|
195
|
+
id:"urh0b2292c4e09e8eb22d036171491e87b8d2086bf8b265874c8d182cb9cuhrt",
|
|
196
|
+
id_type: "stellar",
|
|
197
|
+
amount: "35.35",
|
|
198
|
+
fee: "0",
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
message: null,
|
|
203
|
+
to: null,
|
|
204
|
+
from: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
205
|
+
withdraw_memo_type: 'hash',
|
|
206
|
+
withdraw_memo: 'AAAAAAAAAAAAAAAAAAAAANsV0WZaXk1cul0nHDLNjPA=',
|
|
207
|
+
withdraw_anchor_account: 'GCSGSR6KQQ5BP2FXVPWRL6SWPUSFWLVONLIBJZUKTVQB5FYJFVL6XOXE',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: 'uyt1576b-ac28-4c02-a521-ddbfd9ae7oiu',
|
|
211
|
+
kind: 'deposit',
|
|
212
|
+
status: 'completed',
|
|
213
|
+
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",
|
|
220
|
+
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!',
|
|
224
|
+
claimable_balance_id: null,
|
|
225
|
+
to: 'GCZSYKPDWAKPGR7GYFBOIQB3TH352X7ELZL27WSJET5PDVFORDMGYTB5',
|
|
226
|
+
from: null,
|
|
227
|
+
deposit_memo_type: 'hash',
|
|
228
|
+
deposit_memo: null
|
|
229
|
+
},
|
|
230
|
+
];
|