@monerium/sdk 2.2.0 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,26 +1,43 @@
1
1
  # Changelog
2
2
 
3
- ## [2.2.0](https://github.com/monerium/sdk/compare/v2.1.23...v2.2.0) (2023-04-25)
3
+ ## [2.2.2](https://github.com/monerium/sdk/compare/v2.2.1...v2.2.2) (2023-04-26)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * coverage output path ([675b7cd](https://github.com/monerium/sdk/commit/675b7cd3536a320dcbe915bfeb077609bfa834b1))
9
+
10
+
11
+ ### Miscellaneous
12
+
13
+ * archive build and reuse for deploying static files. ([#80](https://github.com/monerium/sdk/issues/80)) ([cfc34d8](https://github.com/monerium/sdk/commit/cfc34d80f2db547505c34b55ab3b2a7d0a37aae5))
14
+ * move .prettierignore into configs folder and add some rules ([171b0b3](https://github.com/monerium/sdk/commit/171b0b3c5dc807f0bec0cc9220b390302fdd98e9))
4
15
 
16
+ ## [2.2.1](https://github.com/monerium/sdk/compare/v2.2.0...v2.2.1) (2023-04-26)
17
+
18
+ ### Miscellaneous
19
+
20
+ - backward support for node 16.15 ([a80379b](https://github.com/monerium/sdk/commit/a80379b8849f78e541d9f4455cd12cd676e7751f))
21
+ - ignore release please branches for build ([4b68cfa](https://github.com/monerium/sdk/commit/4b68cfa17380432136620acb67e856619333e3aa))
22
+ - move configs to reduce clutter in root folder ([#78](https://github.com/monerium/sdk/issues/78)) ([f2dcb21](https://github.com/monerium/sdk/commit/f2dcb2190811c9521e029eb15caef3b4ee557c4a))
23
+
24
+ ## [2.2.0](https://github.com/monerium/sdk/compare/v2.1.23...v2.2.0) (2023-04-25)
5
25
 
6
26
  ### Features
7
27
 
8
- * use Yarn PnP ([#73](https://github.com/monerium/sdk/issues/73)) ([4295154](https://github.com/monerium/sdk/commit/4295154487c3eb255b23816b5cf32aac52cae710))
28
+ - use Yarn PnP ([#73](https://github.com/monerium/sdk/issues/73)) ([4295154](https://github.com/monerium/sdk/commit/4295154487c3eb255b23816b5cf32aac52cae710))
9
29
 
10
30
  ## [2.1.23](https://github.com/monerium/sdk/compare/v2.1.22...v2.1.23) (2023-04-25)
11
31
 
12
-
13
32
  ### Bug Fixes
14
33
 
15
- * now it should publish succesfully to npm registry ([#71](https://github.com/monerium/sdk/issues/71)) ([5b5e37b](https://github.com/monerium/sdk/commit/5b5e37b2cde1d1e0411e3e023cfcd5f7eca376d6))
34
+ - now it should publish succesfully to npm registry ([#71](https://github.com/monerium/sdk/issues/71)) ([5b5e37b](https://github.com/monerium/sdk/commit/5b5e37b2cde1d1e0411e3e023cfcd5f7eca376d6))
16
35
 
17
36
  ## [2.1.22](https://github.com/monerium/sdk/compare/v2.1.21...v2.1.22) (2023-04-24)
18
37
 
19
-
20
38
  ### Bug Fixes
21
39
 
22
- * deploy static pipeline ([#69](https://github.com/monerium/sdk/issues/69)) ([38067e7](https://github.com/monerium/sdk/commit/38067e75e3334b6eb20dcc182f1d6aaca5af0caa))
23
-
40
+ - deploy static pipeline ([#69](https://github.com/monerium/sdk/issues/69)) ([38067e7](https://github.com/monerium/sdk/commit/38067e75e3334b6eb20dcc182f1d6aaca5af0caa))
24
41
 
25
42
  ## [2.1.21](https://github.com/monerium/sdk/compare/v2.1.20...v2.1.21) (2023-04-24)
26
43
 
package/dist/index.d.ts CHANGED
@@ -1,328 +1,322 @@
1
1
  // Generated by dts-bundle-generator v7.2.0
2
2
 
3
3
  export type Environment = {
4
- api: string;
5
- web: string;
4
+ api: string;
5
+ web: string;
6
6
  };
7
7
  export type Config = {
8
- environments: {
9
- production: Environment;
10
- sandbox: Environment;
11
- };
8
+ environments: {
9
+ production: Environment;
10
+ sandbox: Environment;
11
+ };
12
12
  };
13
13
  export interface BearerProfile {
14
- access_token: string;
15
- token_type: string;
16
- expires_in: number;
17
- refresh_token: string;
18
- profile: string;
19
- userId: string;
14
+ access_token: string;
15
+ token_type: string;
16
+ expires_in: number;
17
+ refresh_token: string;
18
+ profile: string;
19
+ userId: string;
20
20
  }
21
21
  export declare enum Currency {
22
- eur = 'eur',
23
- usd = 'usd',
24
- gbp = 'gbp',
25
- isk = 'isk',
26
- }
27
- export type AuthArgs =
28
- | Omit<AuthCode, 'grant_type'>
29
- | Omit<RefreshToken, 'grant_type'>
30
- | Omit<ClientCredentials, 'grant_type'>;
22
+ eur = "eur",
23
+ usd = "usd",
24
+ gbp = "gbp",
25
+ isk = "isk"
26
+ }
27
+ export type AuthArgs = Omit<AuthCode, "grant_type"> | Omit<RefreshToken, "grant_type"> | Omit<ClientCredentials, "grant_type">;
31
28
  export interface AuthCode {
32
- grant_type: 'authorization_code';
33
- client_id: string;
34
- code: string;
35
- code_verifier: string;
36
- redirect_uri: string;
37
- scope?: string;
29
+ grant_type: "authorization_code";
30
+ client_id: string;
31
+ code: string;
32
+ code_verifier: string;
33
+ redirect_uri: string;
34
+ scope?: string;
38
35
  }
39
36
  export interface RefreshToken {
40
- grant_type: 'refresh_token';
41
- client_id: string;
42
- refresh_token: string;
43
- scope?: string;
37
+ grant_type: "refresh_token";
38
+ client_id: string;
39
+ refresh_token: string;
40
+ scope?: string;
44
41
  }
45
42
  export interface ClientCredentials {
46
- grant_type: 'client_credentials';
47
- client_id: string;
48
- client_secret: string;
49
- scope?: string;
43
+ grant_type: "client_credentials";
44
+ client_id: string;
45
+ client_secret: string;
46
+ scope?: string;
50
47
  }
51
48
  /**
52
49
  * @returns A {@link PKCERequest} object with properties omitted that are automatically computed in by the SDK.
53
50
  */
54
- export type PKCERequestArgs = Omit<
55
- PKCERequest,
56
- 'code_challenge' | 'code_challenge_method' | 'response_type'
57
- >;
51
+ export type PKCERequestArgs = Omit<PKCERequest, "code_challenge" | "code_challenge_method" | "response_type">;
58
52
  export type PKCERequest = {
59
- /** the authentication flow client id of the application */
60
- client_id: string;
61
- /** the code challenge automatically generated by the SDK */
62
- code_challenge: string;
63
- /** the code challenge method for the authentication flow , handled by the SDK */
64
- code_challenge_method: 'S256';
65
- /** the response type of the authentication flow, handled by the SDK */
66
- response_type: 'code';
67
- /** the state of the application */
68
- state?: string;
69
- /** the redirect uri of the application */
70
- redirect_uri?: string;
71
- /** the scope of the application */
72
- scope?: string;
73
- /** the address of the wallet to automatically link */
74
- address?: string;
75
- /** the signature of the wallet to automatically link */
76
- signature?: string;
77
- /** the network of the wallet to automatically link */
78
- network?: Network;
79
- /** the chain of the wallet to automatically link */
80
- chain?: Chain;
53
+ /** the authentication flow client id of the application */
54
+ client_id: string;
55
+ /** the code challenge automatically generated by the SDK */
56
+ code_challenge: string;
57
+ /** the code challenge method for the authentication flow , handled by the SDK */
58
+ code_challenge_method: "S256";
59
+ /** the response type of the authentication flow, handled by the SDK */
60
+ response_type: "code";
61
+ /** the state of the application */
62
+ state?: string;
63
+ /** the redirect uri of the application */
64
+ redirect_uri?: string;
65
+ /** the scope of the application */
66
+ scope?: string;
67
+ /** the address of the wallet to automatically link */
68
+ address?: string;
69
+ /** the signature of the wallet to automatically link */
70
+ signature?: string;
71
+ /** the network of the wallet to automatically link */
72
+ network?: Network;
73
+ /** the chain of the wallet to automatically link */
74
+ chain?: Chain;
81
75
  };
82
76
  declare enum Method {
83
- password = 'password',
84
- resource = 'resource',
85
- jwt = 'jwt',
86
- apiKey = 'apiKey',
77
+ password = "password",
78
+ resource = "resource",
79
+ jwt = "jwt",
80
+ apiKey = "apiKey"
87
81
  }
88
82
  export declare enum ProfileType {
89
- corporate = 'corporate',
90
- personal = 'personal',
83
+ corporate = "corporate",
84
+ personal = "personal"
91
85
  }
92
86
  export declare enum Permission {
93
- read = 'read',
94
- write = 'write',
87
+ read = "read",
88
+ write = "write"
95
89
  }
96
90
  export interface AuthProfile {
97
- id: string;
98
- type: ProfileType;
99
- name: string;
100
- perms: Permission[];
91
+ id: string;
92
+ type: ProfileType;
93
+ name: string;
94
+ perms: Permission[];
101
95
  }
102
96
  export interface AuthContext {
103
- userId: string;
104
- email: string;
105
- name: string;
106
- roles: 'admin'[];
107
- auth: {
108
- method: Method;
109
- subject: string;
110
- verified: boolean;
111
- };
112
- defaultProfile: string;
113
- profiles: AuthProfile[];
97
+ userId: string;
98
+ email: string;
99
+ name: string;
100
+ roles: "admin"[];
101
+ auth: {
102
+ method: Method;
103
+ subject: string;
104
+ verified: boolean;
105
+ };
106
+ defaultProfile: string;
107
+ profiles: AuthProfile[];
114
108
  }
115
109
  export declare enum KYCState {
116
- absent = 'absent',
117
- submitted = 'submitted',
118
- pending = 'pending',
119
- confirmed = 'confirmed',
110
+ absent = "absent",
111
+ submitted = "submitted",
112
+ pending = "pending",
113
+ confirmed = "confirmed"
120
114
  }
121
115
  export declare enum KYCOutcome {
122
- approved = 'approved',
123
- rejected = 'rejected',
124
- unknown = 'unknown',
116
+ approved = "approved",
117
+ rejected = "rejected",
118
+ unknown = "unknown"
125
119
  }
126
120
  export interface KYC {
127
- state: KYCState;
128
- outcome: KYCOutcome;
121
+ state: KYCState;
122
+ outcome: KYCOutcome;
129
123
  }
130
124
  export declare enum PaymentStandard {
131
- iban = 'iban',
132
- scan = 'scan',
125
+ iban = "iban",
126
+ scan = "scan"
133
127
  }
134
128
  export interface Account {
135
- address: string;
136
- currency: Currency;
137
- standard: PaymentStandard;
138
- iban?: string;
139
- sortCode?: string;
140
- accountNumber?: string;
141
- network: Network;
142
- chain: Chain;
143
- id?: string;
129
+ address: string;
130
+ currency: Currency;
131
+ standard: PaymentStandard;
132
+ iban?: string;
133
+ sortCode?: string;
134
+ accountNumber?: string;
135
+ network: Network;
136
+ chain: Chain;
137
+ id?: string;
144
138
  }
145
139
  export interface Profile {
146
- id: string;
147
- name: string;
148
- kyc: KYC;
149
- accounts: Account[];
140
+ id: string;
141
+ name: string;
142
+ kyc: KYC;
143
+ accounts: Account[];
150
144
  }
151
145
  export declare enum Chain {
152
- polygon = 'polygon',
153
- ethereum = 'ethereum',
154
- gnosis = 'gnosis',
146
+ polygon = "polygon",
147
+ ethereum = "ethereum",
148
+ gnosis = "gnosis"
155
149
  }
156
150
  export declare enum Network {
157
- mainnet = 'mainnet',
158
- chiado = 'chiado',
159
- goerli = 'goerli',
160
- mumbai = 'mumbai',
151
+ mainnet = "mainnet",
152
+ chiado = "chiado",
153
+ goerli = "goerli",
154
+ mumbai = "mumbai"
161
155
  }
162
156
  export interface Balance {
163
- currency: Currency;
164
- amount: string;
157
+ currency: Currency;
158
+ amount: string;
165
159
  }
166
160
  export interface Balances {
167
- id: string;
168
- address: string;
169
- chain: Chain;
170
- network: Network;
171
- balances: Balance[];
161
+ id: string;
162
+ address: string;
163
+ chain: Chain;
164
+ network: Network;
165
+ balances: Balance[];
172
166
  }
173
167
  export declare enum OrderKind {
174
- redeem = 'redeem',
175
- issue = 'issue',
168
+ redeem = "redeem",
169
+ issue = "issue"
176
170
  }
177
171
  export declare enum OrderState {
178
- placed = 'placed',
179
- pending = 'pending',
180
- processed = 'processed',
181
- rejected = 'rejected',
172
+ placed = "placed",
173
+ pending = "pending",
174
+ processed = "processed",
175
+ rejected = "rejected"
182
176
  }
183
177
  export interface Fee {
184
- provider: 'satchel';
185
- currency: Currency;
186
- amount: string;
178
+ provider: "satchel";
179
+ currency: Currency;
180
+ amount: string;
187
181
  }
188
182
  export interface IBAN {
189
- standard: PaymentStandard.iban;
190
- iban: string;
183
+ standard: PaymentStandard.iban;
184
+ iban: string;
191
185
  }
192
186
  export interface SCAN {
193
- standard: PaymentStandard.scan;
194
- sortCode: string;
195
- accountNumber: string;
187
+ standard: PaymentStandard.scan;
188
+ sortCode: string;
189
+ accountNumber: string;
196
190
  }
197
191
  export interface Individual {
198
- firstName: string;
199
- lastName: string;
200
- country?: string;
192
+ firstName: string;
193
+ lastName: string;
194
+ country?: string;
201
195
  }
202
196
  export interface Corporation {
203
- companyName: string;
204
- country: string;
197
+ companyName: string;
198
+ country: string;
205
199
  }
206
200
  export interface Counterpart {
207
- identifier: IBAN | SCAN;
208
- details: Individual | Corporation;
201
+ identifier: IBAN | SCAN;
202
+ details: Individual | Corporation;
209
203
  }
210
204
  export interface OrderMetadata {
211
- approvedAt: string;
212
- processedAt: string;
213
- rejectedAt: string;
214
- state: OrderState;
215
- placedBy: string;
216
- placedAt: string;
217
- receivedAmount: string;
218
- sentAmount: string;
205
+ approvedAt: string;
206
+ processedAt: string;
207
+ rejectedAt: string;
208
+ state: OrderState;
209
+ placedBy: string;
210
+ placedAt: string;
211
+ receivedAmount: string;
212
+ sentAmount: string;
219
213
  }
220
214
  export interface OrderFilter {
221
- address?: string;
222
- txHash?: string;
223
- profile?: string;
224
- memo?: string;
225
- accountId?: string;
226
- state?: OrderState;
215
+ address?: string;
216
+ txHash?: string;
217
+ profile?: string;
218
+ memo?: string;
219
+ accountId?: string;
220
+ state?: OrderState;
227
221
  }
228
222
  export interface Order {
229
- id: string;
230
- profile: string;
231
- accountId: string;
232
- address: string;
233
- kind: OrderKind;
234
- amount: string;
235
- currency: Currency;
236
- totalFee: string;
237
- fees: Fee[];
238
- counterpart: Counterpart;
239
- memo: string;
240
- rejectedReason: string;
241
- supportingDocumentId: string;
242
- meta: OrderMetadata;
223
+ id: string;
224
+ profile: string;
225
+ accountId: string;
226
+ address: string;
227
+ kind: OrderKind;
228
+ amount: string;
229
+ currency: Currency;
230
+ totalFee: string;
231
+ fees: Fee[];
232
+ counterpart: Counterpart;
233
+ memo: string;
234
+ rejectedReason: string;
235
+ supportingDocumentId: string;
236
+ meta: OrderMetadata;
243
237
  }
244
238
  export interface Token {
245
- currency: Currency;
246
- ticker: string;
247
- symbol: string;
248
- chain: Chain;
249
- network: Network;
250
- address: string;
251
- decimals: number;
239
+ currency: Currency;
240
+ ticker: string;
241
+ symbol: string;
242
+ chain: Chain;
243
+ network: Network;
244
+ address: string;
245
+ decimals: number;
252
246
  }
253
247
  export interface NewOrder {
254
- kind: OrderKind;
255
- amount: string;
256
- signature: string;
257
- accountId?: string;
258
- address: string;
259
- currency: Currency;
260
- counterpart: Counterpart;
261
- message: string;
262
- memo: string;
263
- supportingDocumentId?: string;
264
- chain: Chain;
265
- network: Network;
248
+ kind: OrderKind;
249
+ amount: string;
250
+ signature: string;
251
+ accountId?: string;
252
+ address: string;
253
+ currency: Currency;
254
+ counterpart: Counterpart;
255
+ message: string;
256
+ memo: string;
257
+ supportingDocumentId?: string;
258
+ chain: Chain;
259
+ network: Network;
266
260
  }
267
261
  export interface SupportingDocMetadata {
268
- uploadedBy: string;
269
- createdAt: string;
270
- updatedAt: string;
262
+ uploadedBy: string;
263
+ createdAt: string;
264
+ updatedAt: string;
271
265
  }
272
266
  export interface SupportingDoc {
273
- id: string;
274
- name: string;
275
- type: string;
276
- size: number;
277
- hash: string;
278
- meta: SupportingDocMetadata;
267
+ id: string;
268
+ name: string;
269
+ type: string;
270
+ size: number;
271
+ hash: string;
272
+ meta: SupportingDocMetadata;
279
273
  }
280
274
  export interface CurrencyAccounts {
281
- network: Network;
282
- chain: Chain;
283
- currency: Currency;
275
+ network: Network;
276
+ chain: Chain;
277
+ currency: Currency;
284
278
  }
285
279
  export interface LinkAddress {
286
- address: string;
287
- message: string;
288
- signature: string;
289
- accounts: CurrencyAccounts[];
290
- network?: Network;
291
- chain?: Chain;
280
+ address: string;
281
+ message: string;
282
+ signature: string;
283
+ accounts: CurrencyAccounts[];
284
+ network?: Network;
285
+ chain?: Chain;
292
286
  }
293
287
  export declare class MoneriumClient {
294
- #private;
295
- /** The PKCE code verifier */
296
- codeVerifier?: string;
297
- bearerProfile?: BearerProfile;
298
- constructor(env?: 'production' | 'sandbox');
299
- auth(args: AuthArgs): Promise<BearerProfile>;
300
- /**
301
- * Construct the url to the authorization code flow,
302
- * the code verifier is needed afterwards to obtain an access token and is therefore stored in `this.codeVerifier`
303
- * For automatic wallet link, add the following properties: `address`, `signature`, `chain` & `network`
304
- * @returns string
305
- */
306
- getAuthFlowURI(args: PKCERequestArgs): string;
307
- /**
308
- * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.
309
- */
310
- pkceRequest: (args: PKCERequestArgs) => string;
311
- getAuthContext(): Promise<AuthContext>;
312
- /**
313
- * @param {string} profileId - the id of the profile to fetch.
314
- */
315
- getProfile(profileId: string): Promise<Profile>;
316
- /**
317
- * @param {string=} profileId - the id of the profile to fetch balances.
318
- */
319
- getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]>;
320
- getOrders(filter?: OrderFilter): Promise<Order[]>;
321
- getOrder(orderId: string): Promise<Order>;
322
- getTokens(): Promise<Token[]>;
323
- linkAddress(profileId: string, body: LinkAddress): Promise<any>;
324
- placeOrder(order: NewOrder, profileId?: string): Promise<Order>;
325
- uploadSupportingDocument(document: File): Promise<SupportingDoc>;
288
+ #private;
289
+ /** The PKCE code verifier */
290
+ codeVerifier?: string;
291
+ bearerProfile?: BearerProfile;
292
+ constructor(env?: "production" | "sandbox");
293
+ auth(args: AuthArgs): Promise<BearerProfile>;
294
+ /**
295
+ * Construct the url to the authorization code flow,
296
+ * the code verifier is needed afterwards to obtain an access token and is therefore stored in `this.codeVerifier`
297
+ * For automatic wallet link, add the following properties: `address`, `signature`, `chain` & `network`
298
+ * @returns string
299
+ */
300
+ getAuthFlowURI(args: PKCERequestArgs): string;
301
+ /**
302
+ * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.
303
+ */
304
+ pkceRequest: (args: PKCERequestArgs) => string;
305
+ getAuthContext(): Promise<AuthContext>;
306
+ /**
307
+ * @param {string} profileId - the id of the profile to fetch.
308
+ */
309
+ getProfile(profileId: string): Promise<Profile>;
310
+ /**
311
+ * @param {string=} profileId - the id of the profile to fetch balances.
312
+ */
313
+ getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]>;
314
+ getOrders(filter?: OrderFilter): Promise<Order[]>;
315
+ getOrder(orderId: string): Promise<Order>;
316
+ getTokens(): Promise<Token[]>;
317
+ linkAddress(profileId: string, body: LinkAddress): Promise<any>;
318
+ placeOrder(order: NewOrder, profileId?: string): Promise<Order>;
319
+ uploadSupportingDocument(document: File): Promise<SupportingDoc>;
326
320
  }
327
321
 
328
322
  export {};