@monerium/sdk 2.0.2 → 2.0.4

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,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.4](https://github.com/monerium/sdk/compare/v2.0.3...v2.0.4) (2023-01-05)
4
+
5
+ ### Bug Fixes
6
+
7
+ - variable is a string ([831bcca](https://github.com/monerium/sdk/commit/831bcca6b1b646dc4a537790fe07d1195903a070))
8
+ - workflow not triggering static page deploy ([#12](https://github.com/monerium/sdk/issues/12)) ([d481570](https://github.com/monerium/sdk/commit/d48157046a65b46a31e75d1212158a9178f509e1))
9
+
10
+ ## [2.0.3](https://github.com/monerium/sdk/compare/v2.0.2...v2.0.3) (2023-01-05)
11
+
12
+ ### Bug Fixes
13
+
14
+ - build missing and static page deploy not being triggered([#7](https://github.com/monerium/sdk/issues/7)) ([#9](https://github.com/monerium/sdk/issues/9)) ([0c5e955](https://github.com/monerium/sdk/commit/0c5e955a9823c9d2c79cac5d21120fa49ce79741))
15
+ - workflow ([cb27cb4](https://github.com/monerium/sdk/commit/cb27cb484e6f46beb379d9e46d1874c436eb7208))
16
+ - workflow broken ([09623f0](https://github.com/monerium/sdk/commit/09623f0eee78535ee5e3712e6009e44c6082bbd7))
17
+
3
18
  ## [2.0.2](https://github.com/monerium/sdk/compare/v2.0.1...v2.0.2) (2023-01-05)
4
19
 
5
20
  ### Bug Fixes
@@ -0,0 +1,314 @@
1
+ // Generated by dts-bundle-generator v7.1.0
2
+
3
+ export type Environment = {
4
+ api: string;
5
+ web: string;
6
+ };
7
+ export type Config = {
8
+ environments: {
9
+ production: Environment;
10
+ sandbox: Environment;
11
+ };
12
+ };
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;
20
+ }
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">;
31
+ 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;
38
+ }
39
+ export interface RefreshToken {
40
+ grant_type: "refresh_token";
41
+ client_id: string;
42
+ refresh_token: string;
43
+ scope?: string;
44
+ }
45
+ export interface ClientCredentials {
46
+ grant_type: "client_credentials";
47
+ client_id: string;
48
+ client_secret: string;
49
+ scope?: string;
50
+ }
51
+ export type PKCERequestArgs = Omit<
52
+ PKCERequest,
53
+ "code_challenge" | "code_challenge_method" | "response_type"
54
+ >;
55
+ export type PKCERequest = {
56
+ client_id: string;
57
+ code_challenge: string;
58
+ code_challenge_method: string;
59
+ response_type: string;
60
+ state: string;
61
+ redirect_uri?: string;
62
+ scope?: string;
63
+ address?: string;
64
+ };
65
+ declare enum Method {
66
+ password = "password",
67
+ resource = "resource",
68
+ jwt = "jwt",
69
+ apiKey = "apiKey",
70
+ }
71
+ export declare enum ProfileType {
72
+ corporate = "corporate",
73
+ personal = "personal",
74
+ }
75
+ export declare enum Permission {
76
+ read = "read",
77
+ write = "write",
78
+ }
79
+ export interface AuthProfile {
80
+ id: string;
81
+ type: ProfileType;
82
+ name: string;
83
+ perms: Permission[];
84
+ }
85
+ export interface AuthContext {
86
+ userId: string;
87
+ email: string;
88
+ name: string;
89
+ roles: "admin"[];
90
+ auth: {
91
+ method: Method;
92
+ subject: string;
93
+ verified: boolean;
94
+ };
95
+ defaultProfile: string;
96
+ profiles: AuthProfile[];
97
+ }
98
+ export declare enum KYCState {
99
+ absent = "absent",
100
+ submitted = "submitted",
101
+ pending = "pending",
102
+ confirmed = "confirmed",
103
+ }
104
+ export declare enum KYCOutcome {
105
+ approved = "approved",
106
+ rejected = "rejected",
107
+ unknown = "unknown",
108
+ }
109
+ export interface KYC {
110
+ state: KYCState;
111
+ outcome: KYCOutcome;
112
+ }
113
+ export declare enum PaymentStandard {
114
+ iban = "iban",
115
+ scan = "scan",
116
+ }
117
+ export interface Account {
118
+ address: string;
119
+ currency: Currency;
120
+ standard: PaymentStandard;
121
+ iban?: string;
122
+ sortCode?: string;
123
+ accountNumber?: string;
124
+ network: Network;
125
+ chain: Chain;
126
+ id?: string;
127
+ }
128
+ export interface Profile {
129
+ id: string;
130
+ name: string;
131
+ kyc: KYC;
132
+ accounts: Account[];
133
+ }
134
+ export declare enum Chain {
135
+ polygon = "polygon",
136
+ ethereum = "ethereum",
137
+ gnosis = "gnosis",
138
+ }
139
+ export declare enum Network {
140
+ mainnet = "mainnet",
141
+ chiado = "chiado",
142
+ goerli = "goerli",
143
+ mumbai = "mumbai",
144
+ }
145
+ export interface Balance {
146
+ currency: Currency;
147
+ amount: string;
148
+ }
149
+ export interface Balances {
150
+ id: string;
151
+ address: string;
152
+ chain: Chain;
153
+ network: Network;
154
+ balances: Balance[];
155
+ }
156
+ export declare enum OrderKind {
157
+ redeem = "redeem",
158
+ issue = "issue",
159
+ }
160
+ export declare enum OrderState {
161
+ placed = "placed",
162
+ pending = "pending",
163
+ processed = "processed",
164
+ rejected = "rejected",
165
+ }
166
+ export interface Fee {
167
+ provider: "satchel";
168
+ currency: Currency;
169
+ amount: string;
170
+ }
171
+ export interface IBAN {
172
+ standard: PaymentStandard.iban;
173
+ iban: string;
174
+ }
175
+ export interface SCAN {
176
+ standard: PaymentStandard.scan;
177
+ sortCode: string;
178
+ accountNumber: string;
179
+ }
180
+ export interface Individual {
181
+ firstName: string;
182
+ lastName: string;
183
+ country?: string;
184
+ }
185
+ export interface Corporation {
186
+ companyName: string;
187
+ country: string;
188
+ }
189
+ export interface Counterpart {
190
+ identifier: IBAN | SCAN;
191
+ details: Individual | Corporation;
192
+ }
193
+ export interface OrderMetadata {
194
+ approvedAt: string;
195
+ processedAt: string;
196
+ rejectedAt: string;
197
+ state: OrderState;
198
+ placedBy: string;
199
+ placedAt: string;
200
+ receivedAmount: string;
201
+ sentAmount: string;
202
+ }
203
+ export interface OrderFilter {
204
+ address?: string;
205
+ txHash?: string;
206
+ profile?: string;
207
+ memo?: string;
208
+ accountId?: string;
209
+ state?: OrderState;
210
+ }
211
+ export interface Order {
212
+ id: string;
213
+ profile: string;
214
+ accountId: string;
215
+ address: string;
216
+ kind: OrderKind;
217
+ amount: string;
218
+ currency: Currency;
219
+ totalFee: string;
220
+ fees: Fee[];
221
+ counterpart: Counterpart;
222
+ memo: string;
223
+ rejectedReason: string;
224
+ supportingDocumentId: string;
225
+ meta: OrderMetadata;
226
+ }
227
+ export interface Token {
228
+ currency: Currency;
229
+ ticker: string;
230
+ symbol: string;
231
+ chain: Chain;
232
+ network: Network;
233
+ address: string;
234
+ decimals: number;
235
+ }
236
+ export interface NewOrder {
237
+ kind: OrderKind;
238
+ amount: string;
239
+ signature: string;
240
+ accountId?: string;
241
+ address: string;
242
+ currency: Currency;
243
+ counterpart: Counterpart;
244
+ message: string;
245
+ memo: string;
246
+ supportingDocumentId?: string;
247
+ chain: Chain;
248
+ network: Network;
249
+ }
250
+ export interface SupportingDocMetadata {
251
+ uploadedBy: string;
252
+ createdAt: string;
253
+ updatedAt: string;
254
+ }
255
+ export interface SupportingDoc {
256
+ id: string;
257
+ name: string;
258
+ type: string;
259
+ size: number;
260
+ hash: string;
261
+ meta: SupportingDocMetadata;
262
+ }
263
+ export interface CurrencyAccounts {
264
+ network: Network;
265
+ chain: Chain;
266
+ currency: Currency;
267
+ }
268
+ export interface LinkAddress {
269
+ address: string;
270
+ message: string;
271
+ signature: string;
272
+ accounts: CurrencyAccounts[];
273
+ }
274
+ /**
275
+ * How to authenticate
276
+ * ```ts
277
+ *
278
+ * import { MoneriumClient } from '@monerium/sdk'
279
+ *
280
+ * const client = new MoneriumClient();
281
+ *
282
+ * // Start by authenticating
283
+ * await client.auth({
284
+ * client_id:
285
+ * client_secret:
286
+ * })
287
+ * ```
288
+ * */
289
+ export declare class MoneriumClient {
290
+ #private;
291
+ /** The PKCE code verifier */
292
+ codeVerifier?: string;
293
+ bearerProfile?: BearerProfile;
294
+ constructor(env?: "production" | "sandbox");
295
+ auth(args: AuthArgs): Promise<void>;
296
+ pkceRequest(args: PKCERequestArgs): string;
297
+ getAuthContext(): Promise<AuthContext>;
298
+ /**
299
+ * @param {string} profileId - the id of the profile to fetch.
300
+ */
301
+ getProfile(profileId: string): Promise<Profile>;
302
+ /**
303
+ * @param {string=} profileId - the id of the profile to fetch balances.
304
+ */
305
+ getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]>;
306
+ getOrders(filter?: OrderFilter): Promise<Order[]>;
307
+ getOrder(orderId: string): Promise<Order>;
308
+ getTokens(): Promise<Token[]>;
309
+ linkAddress(profileId: string, body: LinkAddress): Promise<any>;
310
+ placeOrder(order: NewOrder, profileId?: string): Promise<Order>;
311
+ uploadSupportingDocument(document: File): Promise<SupportingDoc>;
312
+ }
313
+
314
+ export {};