@monerium/sdk 2.0.0-alpha.3 → 2.0.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 +17 -0
- package/README.md +10 -9
- package/package.json +41 -24
- package/LICENSE +0 -21
- package/esm/_dnt.shims.js +0 -76
- package/esm/deps/deno.land/std@0.168.0/encoding/base64.js +0 -140
- package/esm/deps/deno.land/std@0.168.0/encoding/base64url.js +0 -65
- package/esm/mod.js +0 -1
- package/esm/package.json +0 -3
- package/esm/src/client.js +0 -139
- package/esm/src/config.js +0 -13
- package/esm/src/types.js +0 -73
- package/script/_dnt.shims.js +0 -88
- package/script/deps/deno.land/std@0.168.0/encoding/base64.js +0 -168
- package/script/deps/deno.land/std@0.168.0/encoding/base64url.js +0 -93
- package/script/mod.js +0 -5
- package/script/package.json +0 -3
- package/script/src/client.js +0 -166
- package/script/src/config.js +0 -16
- package/script/src/types.js +0 -76
- package/types/_dnt.shims.d.ts +0 -18
- package/types/deps/deno.land/std@0.168.0/encoding/base64.d.ts +0 -11
- package/types/deps/deno.land/std@0.168.0/encoding/base64url.d.ts +0 -10
- package/types/mod.d.ts +0 -1
- package/types/src/client.d.ts +0 -19
- package/types/src/config.d.ts +0 -3
- package/types/src/types.d.ts +0 -266
package/types/src/client.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as dntShim from "../_dnt.shims.js";
|
|
2
|
-
import type { AuthArgs, AuthContext, Balances, BearerProfile, LinkAddress, NewOrder, Order, OrderFilter, PKCERequestArgs, Profile, SupportingDoc, Token } from "./types.js";
|
|
3
|
-
export declare class MoneriumClient {
|
|
4
|
-
#private;
|
|
5
|
-
codeVerifier?: string;
|
|
6
|
-
bearerProfile?: BearerProfile;
|
|
7
|
-
constructor(env?: "production" | "sandbox");
|
|
8
|
-
auth(args: AuthArgs): Promise<void>;
|
|
9
|
-
pkceRequest(args: PKCERequestArgs): Promise<string>;
|
|
10
|
-
getAuthContext(): Promise<AuthContext>;
|
|
11
|
-
getProfile(profileId: string): Promise<Profile>;
|
|
12
|
-
getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]>;
|
|
13
|
-
getOrders(filter?: OrderFilter): Promise<Order[]>;
|
|
14
|
-
getOrder(orderId: string): Promise<Order>;
|
|
15
|
-
getTokens(): Promise<Token[]>;
|
|
16
|
-
linkAddress(profileId: string, body: LinkAddress): Promise<unknown>;
|
|
17
|
-
placeOrder(order: NewOrder, profileId?: string): Promise<Order>;
|
|
18
|
-
uploadSupportingDocument(document: dntShim.File): Promise<SupportingDoc>;
|
|
19
|
-
}
|
package/types/src/config.d.ts
DELETED
package/types/src/types.d.ts
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
export type Environment = {
|
|
2
|
-
api: string;
|
|
3
|
-
web: string;
|
|
4
|
-
};
|
|
5
|
-
export type Config = {
|
|
6
|
-
environments: {
|
|
7
|
-
production: Environment;
|
|
8
|
-
sandbox: Environment;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export interface BearerProfile {
|
|
12
|
-
access_token: string;
|
|
13
|
-
token_type: string;
|
|
14
|
-
expires_in: number;
|
|
15
|
-
refresh_token: string;
|
|
16
|
-
profile: string;
|
|
17
|
-
userId: string;
|
|
18
|
-
}
|
|
19
|
-
export declare enum Currency {
|
|
20
|
-
eur = "eur",
|
|
21
|
-
usd = "usd",
|
|
22
|
-
gbp = "gbp",
|
|
23
|
-
isk = "isk"
|
|
24
|
-
}
|
|
25
|
-
export type AuthArgs = Omit<AuthCode, "grant_type"> | Omit<RefreshToken, "grant_type"> | Omit<ClientCredentials, "grant_type">;
|
|
26
|
-
export interface AuthCode {
|
|
27
|
-
grant_type: "authorization_code";
|
|
28
|
-
client_id: string;
|
|
29
|
-
code: string;
|
|
30
|
-
code_verifier: string;
|
|
31
|
-
redirect_uri: string;
|
|
32
|
-
scope?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface RefreshToken {
|
|
35
|
-
grant_type: "refresh_token";
|
|
36
|
-
client_id: string;
|
|
37
|
-
refresh_token: string;
|
|
38
|
-
scope?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface ClientCredentials {
|
|
41
|
-
grant_type: "client_credentials";
|
|
42
|
-
client_id: string;
|
|
43
|
-
client_secret: string;
|
|
44
|
-
scope?: string;
|
|
45
|
-
}
|
|
46
|
-
export type PKCERequestArgs = Omit<PKCERequest, "code_challenge" | "code_challenge_method" | "response_type">;
|
|
47
|
-
export type PKCERequest = {
|
|
48
|
-
client_id: string;
|
|
49
|
-
code_challenge: string;
|
|
50
|
-
code_challenge_method: string;
|
|
51
|
-
response_type: string;
|
|
52
|
-
state: string;
|
|
53
|
-
redirect_uri?: string;
|
|
54
|
-
scope?: string;
|
|
55
|
-
address?: string;
|
|
56
|
-
};
|
|
57
|
-
declare enum Method {
|
|
58
|
-
password = "password",
|
|
59
|
-
resource = "resource",
|
|
60
|
-
jwt = "jwt",
|
|
61
|
-
apiKey = "apiKey"
|
|
62
|
-
}
|
|
63
|
-
declare enum Type {
|
|
64
|
-
corporate = "corporate",
|
|
65
|
-
personal = "personal"
|
|
66
|
-
}
|
|
67
|
-
declare enum Permission {
|
|
68
|
-
read = "read",
|
|
69
|
-
write = "write"
|
|
70
|
-
}
|
|
71
|
-
type AuthProfile = {
|
|
72
|
-
id: string;
|
|
73
|
-
type: Type;
|
|
74
|
-
name: string;
|
|
75
|
-
perms: Permission[];
|
|
76
|
-
};
|
|
77
|
-
export interface AuthContext {
|
|
78
|
-
userId: string;
|
|
79
|
-
email: string;
|
|
80
|
-
name: string;
|
|
81
|
-
roles: "admin"[];
|
|
82
|
-
auth: {
|
|
83
|
-
method: Method;
|
|
84
|
-
subject: string;
|
|
85
|
-
verified: boolean;
|
|
86
|
-
};
|
|
87
|
-
defaultProfile: string;
|
|
88
|
-
profiles: AuthProfile[];
|
|
89
|
-
}
|
|
90
|
-
declare enum KYCState {
|
|
91
|
-
absent = "absent",
|
|
92
|
-
submitted = "submitted",
|
|
93
|
-
pending = "pending",
|
|
94
|
-
confirmed = "confirmed"
|
|
95
|
-
}
|
|
96
|
-
declare enum KYCOutcome {
|
|
97
|
-
approved = "approved",
|
|
98
|
-
rejected = "rejected",
|
|
99
|
-
unknown = "unknown"
|
|
100
|
-
}
|
|
101
|
-
type KYC = {
|
|
102
|
-
state: KYCState;
|
|
103
|
-
outcome: KYCOutcome;
|
|
104
|
-
};
|
|
105
|
-
export declare enum PaymentStandard {
|
|
106
|
-
iban = "iban",
|
|
107
|
-
scan = "scan"
|
|
108
|
-
}
|
|
109
|
-
type Account = {
|
|
110
|
-
address: string;
|
|
111
|
-
currency: Currency;
|
|
112
|
-
standard: PaymentStandard;
|
|
113
|
-
iban?: string;
|
|
114
|
-
sortCode?: string;
|
|
115
|
-
accountNumber?: string;
|
|
116
|
-
network: Network;
|
|
117
|
-
chain: Chain;
|
|
118
|
-
id?: string;
|
|
119
|
-
};
|
|
120
|
-
export interface Profile {
|
|
121
|
-
id: string;
|
|
122
|
-
name: string;
|
|
123
|
-
kyc: KYC;
|
|
124
|
-
accounts: Account[];
|
|
125
|
-
}
|
|
126
|
-
export declare enum Chain {
|
|
127
|
-
polygon = "polygon",
|
|
128
|
-
ethereum = "ethereum",
|
|
129
|
-
gnosis = "gnosis"
|
|
130
|
-
}
|
|
131
|
-
export declare enum Network {
|
|
132
|
-
mainnet = "mainnet",
|
|
133
|
-
chiado = "chiado",
|
|
134
|
-
goerli = "goerli",
|
|
135
|
-
mumbai = "mumbai"
|
|
136
|
-
}
|
|
137
|
-
type Balance = {
|
|
138
|
-
currency: Currency;
|
|
139
|
-
amount: string;
|
|
140
|
-
};
|
|
141
|
-
export interface Balances {
|
|
142
|
-
id: string;
|
|
143
|
-
address: string;
|
|
144
|
-
chain: Chain;
|
|
145
|
-
network: Network;
|
|
146
|
-
balances: Balance[];
|
|
147
|
-
}
|
|
148
|
-
export declare enum OrderKind {
|
|
149
|
-
redeem = "redeem",
|
|
150
|
-
issue = "issue"
|
|
151
|
-
}
|
|
152
|
-
declare enum OrderState {
|
|
153
|
-
placed = "placed",
|
|
154
|
-
pending = "pending",
|
|
155
|
-
processed = "processed",
|
|
156
|
-
rejected = "rejected"
|
|
157
|
-
}
|
|
158
|
-
type Fee = {
|
|
159
|
-
provider: "satchel";
|
|
160
|
-
currency: Currency;
|
|
161
|
-
amount: string;
|
|
162
|
-
};
|
|
163
|
-
type IBAN = {
|
|
164
|
-
standard: PaymentStandard.iban;
|
|
165
|
-
iban: string;
|
|
166
|
-
};
|
|
167
|
-
type SCAN = {
|
|
168
|
-
standard: PaymentStandard.scan;
|
|
169
|
-
sortCode: string;
|
|
170
|
-
accountNumber: string;
|
|
171
|
-
};
|
|
172
|
-
type Individual = {
|
|
173
|
-
firstName: string;
|
|
174
|
-
lastName: string;
|
|
175
|
-
country?: string;
|
|
176
|
-
};
|
|
177
|
-
type Corporation = {
|
|
178
|
-
companyName: string;
|
|
179
|
-
country: string;
|
|
180
|
-
};
|
|
181
|
-
type Counterpart = {
|
|
182
|
-
identifier: IBAN | SCAN;
|
|
183
|
-
details: Individual | Corporation;
|
|
184
|
-
};
|
|
185
|
-
type OrderMetadata = {
|
|
186
|
-
approvedAt: string;
|
|
187
|
-
processedAt: string;
|
|
188
|
-
rejectedAt: string;
|
|
189
|
-
state: OrderState;
|
|
190
|
-
placedBy: string;
|
|
191
|
-
placedAt: string;
|
|
192
|
-
receivedAmount: string;
|
|
193
|
-
sentAmount: string;
|
|
194
|
-
};
|
|
195
|
-
export interface OrderFilter {
|
|
196
|
-
address?: string;
|
|
197
|
-
txHash?: string;
|
|
198
|
-
profile?: string;
|
|
199
|
-
memo?: string;
|
|
200
|
-
accountId?: string;
|
|
201
|
-
state?: OrderState;
|
|
202
|
-
}
|
|
203
|
-
export interface Order {
|
|
204
|
-
id: string;
|
|
205
|
-
profile: string;
|
|
206
|
-
accountId: string;
|
|
207
|
-
address: string;
|
|
208
|
-
kind: OrderKind;
|
|
209
|
-
amount: string;
|
|
210
|
-
currency: Currency;
|
|
211
|
-
totalFee: string;
|
|
212
|
-
fees: Fee[];
|
|
213
|
-
counterpart: Counterpart;
|
|
214
|
-
memo: string;
|
|
215
|
-
rejectedReason: string;
|
|
216
|
-
supportingDocumentId: string;
|
|
217
|
-
meta: OrderMetadata;
|
|
218
|
-
}
|
|
219
|
-
export interface Token {
|
|
220
|
-
currency: Currency;
|
|
221
|
-
ticker: string;
|
|
222
|
-
symbol: string;
|
|
223
|
-
chain: Chain;
|
|
224
|
-
network: Network;
|
|
225
|
-
address: string;
|
|
226
|
-
decimals: number;
|
|
227
|
-
}
|
|
228
|
-
export interface NewOrder {
|
|
229
|
-
kind: OrderKind;
|
|
230
|
-
amount: string;
|
|
231
|
-
signature: string;
|
|
232
|
-
accountId?: string;
|
|
233
|
-
address: string;
|
|
234
|
-
currency: Currency;
|
|
235
|
-
counterpart: Counterpart;
|
|
236
|
-
message: string;
|
|
237
|
-
memo: string;
|
|
238
|
-
supportingDocumentId?: string;
|
|
239
|
-
chain: Chain;
|
|
240
|
-
network: Network;
|
|
241
|
-
}
|
|
242
|
-
type SupportingDocMetadata = {
|
|
243
|
-
uploadedBy: string;
|
|
244
|
-
createdAt: string;
|
|
245
|
-
updatedAt: string;
|
|
246
|
-
};
|
|
247
|
-
export interface SupportingDoc {
|
|
248
|
-
id: string;
|
|
249
|
-
name: string;
|
|
250
|
-
type: string;
|
|
251
|
-
size: number;
|
|
252
|
-
hash: string;
|
|
253
|
-
meta: SupportingDocMetadata;
|
|
254
|
-
}
|
|
255
|
-
interface CurrencyAccounts {
|
|
256
|
-
network: Network;
|
|
257
|
-
chain: Chain;
|
|
258
|
-
currency: Currency;
|
|
259
|
-
}
|
|
260
|
-
export interface LinkAddress {
|
|
261
|
-
address: string;
|
|
262
|
-
message: string;
|
|
263
|
-
signature: string;
|
|
264
|
-
accounts: CurrencyAccounts[];
|
|
265
|
-
}
|
|
266
|
-
export {};
|