@monerium/sdk 2.0.0-alpha → 2.0.0-alpha.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/esm/deps/deno.land/{std@0.159.0 → std@0.168.0}/encoding/base64.js +17 -0
- package/esm/deps/deno.land/{std@0.159.0 → std@0.168.0}/encoding/base64url.js +16 -0
- package/esm/src/client.js +2 -2
- package/package.json +9 -9
- package/script/deps/deno.land/{std@0.159.0 → std@0.168.0}/encoding/base64.js +17 -0
- package/script/deps/deno.land/{std@0.159.0 → std@0.168.0}/encoding/base64url.js +16 -0
- package/script/src/client.js +2 -2
- package/types/_dnt.shims.d.ts +1 -1
- package/types/deps/deno.land/{std@0.159.0 → std@0.168.0}/encoding/base64.d.ts +0 -0
- package/types/deps/deno.land/{std@0.159.0 → std@0.168.0}/encoding/base64url.d.ts +0 -0
- package/types/src/types.d.ts +17 -17
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
*
|
|
6
6
|
* This module is browser compatible.
|
|
7
7
|
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import {
|
|
11
|
+
* decode,
|
|
12
|
+
* encode,
|
|
13
|
+
* } from "https://deno.land/std@$STD_VERSION/encoding/base64.ts";
|
|
14
|
+
*
|
|
15
|
+
* const b64Repr = "Zm9vYg==";
|
|
16
|
+
*
|
|
17
|
+
* const binaryData = decode(b64Repr);
|
|
18
|
+
* console.log(binaryData);
|
|
19
|
+
* // => Uint8Array [ 102, 111, 111, 98 ]
|
|
20
|
+
*
|
|
21
|
+
* console.log(encode(binaryData));
|
|
22
|
+
* // => Zm9vYg==
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
8
25
|
* @module
|
|
9
26
|
*/
|
|
10
27
|
import * as dntShim from "../../../../_dnt.shims.js";
|
|
@@ -5,6 +5,22 @@
|
|
|
5
5
|
*
|
|
6
6
|
* This module is browser compatible.
|
|
7
7
|
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import {
|
|
11
|
+
* decode,
|
|
12
|
+
* encode,
|
|
13
|
+
* } from "https://deno.land/std@$STD_VERSION/encoding/base64url.ts";
|
|
14
|
+
*
|
|
15
|
+
* const binary = new TextEncoder().encode("foobar");
|
|
16
|
+
* const encoded = encode(binary);
|
|
17
|
+
* console.log(encoded);
|
|
18
|
+
* // => "Zm9vYmFy"
|
|
19
|
+
*
|
|
20
|
+
* console.log(decode(encoded));
|
|
21
|
+
* // => Uint8Array(6) [ 102, 111, 111, 98, 97, 114 ]
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
8
24
|
* @module
|
|
9
25
|
*/
|
|
10
26
|
import * as base64 from "./base64.js";
|
package/esm/src/client.js
CHANGED
|
@@ -11,8 +11,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
11
11
|
};
|
|
12
12
|
var _MoneriumClient_instances, _MoneriumClient_env, _MoneriumClient_authPayload, _MoneriumClient_api, _MoneriumClient_isAuthCode, _MoneriumClient_isRefreshToken, _MoneriumClient_isClientCredentials;
|
|
13
13
|
import * as dntShim from "../_dnt.shims.js";
|
|
14
|
-
import { encode as encodeBase64 } from "../deps/deno.land/std@0.
|
|
15
|
-
import { encode as encodeBase64URL } from "../deps/deno.land/std@0.
|
|
14
|
+
import { encode as encodeBase64 } from "../deps/deno.land/std@0.168.0/encoding/base64.js";
|
|
15
|
+
import { encode as encodeBase64URL } from "../deps/deno.land/std@0.168.0/encoding/base64url.js";
|
|
16
16
|
import { MONERIUM_CONFIG } from "./config.js";
|
|
17
17
|
export class MoneriumClient {
|
|
18
18
|
constructor(env = "sandbox") {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "./script/mod.js",
|
|
4
4
|
"types": "./types/mod.d.ts",
|
|
5
5
|
"name": "@monerium/sdk",
|
|
6
|
-
"version": "2.0.0-alpha",
|
|
6
|
+
"version": "2.0.0-alpha.2",
|
|
7
7
|
"description": "Everything you need to interact with the Monerium API - an electronic money issuer.",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"repository": {
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
18
|
"import": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"types": "./types/mod.d.ts",
|
|
20
|
+
"default": "./esm/mod.js"
|
|
21
21
|
},
|
|
22
22
|
"require": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"types": "./types/mod.d.ts",
|
|
24
|
+
"default": "./script/mod.js"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"test": "node test_runner.js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@deno/shim-deno": "~0.
|
|
32
|
+
"@deno/shim-deno": "~0.11.0",
|
|
33
33
|
"@deno/shim-crypto": "~0.3.1",
|
|
34
|
-
"undici": "^5.
|
|
34
|
+
"undici": "^5.12.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "
|
|
38
|
-
"chalk": "4.1.2"
|
|
37
|
+
"@types/node": "^18.11.9",
|
|
38
|
+
"chalk": "^4.1.2"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -31,6 +31,23 @@ exports.decode = exports.encode = void 0;
|
|
|
31
31
|
*
|
|
32
32
|
* This module is browser compatible.
|
|
33
33
|
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import {
|
|
37
|
+
* decode,
|
|
38
|
+
* encode,
|
|
39
|
+
* } from "https://deno.land/std@$STD_VERSION/encoding/base64.ts";
|
|
40
|
+
*
|
|
41
|
+
* const b64Repr = "Zm9vYg==";
|
|
42
|
+
*
|
|
43
|
+
* const binaryData = decode(b64Repr);
|
|
44
|
+
* console.log(binaryData);
|
|
45
|
+
* // => Uint8Array [ 102, 111, 111, 98 ]
|
|
46
|
+
*
|
|
47
|
+
* console.log(encode(binaryData));
|
|
48
|
+
* // => Zm9vYg==
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
34
51
|
* @module
|
|
35
52
|
*/
|
|
36
53
|
const dntShim = __importStar(require("../../../../_dnt.shims.js"));
|
|
@@ -31,6 +31,22 @@ exports.decode = exports.encode = void 0;
|
|
|
31
31
|
*
|
|
32
32
|
* This module is browser compatible.
|
|
33
33
|
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import {
|
|
37
|
+
* decode,
|
|
38
|
+
* encode,
|
|
39
|
+
* } from "https://deno.land/std@$STD_VERSION/encoding/base64url.ts";
|
|
40
|
+
*
|
|
41
|
+
* const binary = new TextEncoder().encode("foobar");
|
|
42
|
+
* const encoded = encode(binary);
|
|
43
|
+
* console.log(encoded);
|
|
44
|
+
* // => "Zm9vYmFy"
|
|
45
|
+
*
|
|
46
|
+
* console.log(decode(encoded));
|
|
47
|
+
* // => Uint8Array(6) [ 102, 111, 111, 98, 97, 114 ]
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
34
50
|
* @module
|
|
35
51
|
*/
|
|
36
52
|
const base64 = __importStar(require("./base64.js"));
|
package/script/src/client.js
CHANGED
|
@@ -37,8 +37,8 @@ var _MoneriumClient_instances, _MoneriumClient_env, _MoneriumClient_authPayload,
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.MoneriumClient = void 0;
|
|
39
39
|
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
40
|
-
const base64_js_1 = require("../deps/deno.land/std@0.
|
|
41
|
-
const base64url_js_1 = require("../deps/deno.land/std@0.
|
|
40
|
+
const base64_js_1 = require("../deps/deno.land/std@0.168.0/encoding/base64.js");
|
|
41
|
+
const base64url_js_1 = require("../deps/deno.land/std@0.168.0/encoding/base64url.js");
|
|
42
42
|
const config_js_1 = require("./config.js");
|
|
43
43
|
class MoneriumClient {
|
|
44
44
|
constructor(env = "sandbox") {
|
package/types/_dnt.shims.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { fetch, File, FormData, Headers, Request, Response } from "undici";
|
|
|
5
5
|
export { fetch, File, FormData, Headers, Request, Response, type BodyInit, type HeadersInit, type RequestInit, type ResponseInit } from "undici";
|
|
6
6
|
import { TextEncoder } from "util";
|
|
7
7
|
export { TextEncoder } from "util";
|
|
8
|
-
export declare const dntGlobalThis: Omit<typeof globalThis, "Deno" | "crypto" | "fetch" | "File" | "FormData" | "Headers" | "Request" | "Response"
|
|
8
|
+
export declare const dntGlobalThis: Omit<typeof globalThis, "TextEncoder" | "Deno" | "crypto" | "fetch" | "File" | "FormData" | "Headers" | "Request" | "Response"> & {
|
|
9
9
|
Deno: typeof Deno;
|
|
10
10
|
crypto: import("@deno/shim-crypto").Crypto;
|
|
11
11
|
fetch: typeof fetch;
|
|
File without changes
|
|
File without changes
|
package/types/src/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Environment = {
|
|
2
2
|
api: string;
|
|
3
3
|
web: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type Config = {
|
|
6
6
|
environments: {
|
|
7
7
|
production: Environment;
|
|
8
8
|
sandbox: Environment;
|
|
@@ -22,7 +22,7 @@ export declare enum Currency {
|
|
|
22
22
|
gbp = "gbp",
|
|
23
23
|
isk = "isk"
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type AuthArgs = Omit<AuthCode, "grant_type"> | Omit<RefreshToken, "grant_type"> | Omit<ClientCredentials, "grant_type">;
|
|
26
26
|
export interface AuthCode {
|
|
27
27
|
grant_type: "authorization_code";
|
|
28
28
|
client_id: string;
|
|
@@ -43,8 +43,8 @@ export interface ClientCredentials {
|
|
|
43
43
|
client_secret: string;
|
|
44
44
|
scope?: string;
|
|
45
45
|
}
|
|
46
|
-
export
|
|
47
|
-
export
|
|
46
|
+
export type PKCERequestArgs = Omit<PKCERequest, "code_challenge" | "code_challenge_method" | "response_type">;
|
|
47
|
+
export type PKCERequest = {
|
|
48
48
|
client_id: string;
|
|
49
49
|
code_challenge: string;
|
|
50
50
|
code_challenge_method: string;
|
|
@@ -68,7 +68,7 @@ declare enum Permission {
|
|
|
68
68
|
read = "read",
|
|
69
69
|
write = "write"
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
type AuthProfile = {
|
|
72
72
|
id: string;
|
|
73
73
|
type: Type;
|
|
74
74
|
name: string;
|
|
@@ -98,7 +98,7 @@ declare enum KYCOutcome {
|
|
|
98
98
|
rejected = "rejected",
|
|
99
99
|
unknown = "unknown"
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
type KYC = {
|
|
102
102
|
state: KYCState;
|
|
103
103
|
outcome: KYCOutcome;
|
|
104
104
|
};
|
|
@@ -106,7 +106,7 @@ export declare enum PaymentStandard {
|
|
|
106
106
|
iban = "iban",
|
|
107
107
|
scan = "scan"
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
type Account = {
|
|
110
110
|
address: string;
|
|
111
111
|
currency: Currency;
|
|
112
112
|
standard: PaymentStandard;
|
|
@@ -134,7 +134,7 @@ export declare enum Network {
|
|
|
134
134
|
goerli = "goerli",
|
|
135
135
|
mumbai = "mumbai"
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
type Balance = {
|
|
138
138
|
currency: Currency;
|
|
139
139
|
amount: string;
|
|
140
140
|
};
|
|
@@ -155,34 +155,34 @@ declare enum OrderState {
|
|
|
155
155
|
processed = "processed",
|
|
156
156
|
rejected = "rejected"
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
type Fee = {
|
|
159
159
|
provider: "satchel";
|
|
160
160
|
currency: Currency;
|
|
161
161
|
amount: string;
|
|
162
162
|
};
|
|
163
|
-
|
|
163
|
+
type IBAN = {
|
|
164
164
|
standard: PaymentStandard.iban;
|
|
165
165
|
iban: string;
|
|
166
166
|
};
|
|
167
|
-
|
|
167
|
+
type SCAN = {
|
|
168
168
|
standard: PaymentStandard.scan;
|
|
169
169
|
sortCode: string;
|
|
170
170
|
accountNumber: string;
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
type Individual = {
|
|
173
173
|
firstName: string;
|
|
174
174
|
lastName: string;
|
|
175
175
|
country?: string;
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
type Corporation = {
|
|
178
178
|
companyName: string;
|
|
179
179
|
country: string;
|
|
180
180
|
};
|
|
181
|
-
|
|
181
|
+
type Counterpart = {
|
|
182
182
|
identifier: IBAN | SCAN;
|
|
183
183
|
details: Individual | Corporation;
|
|
184
184
|
};
|
|
185
|
-
|
|
185
|
+
type OrderMetadata = {
|
|
186
186
|
approvedAt: string;
|
|
187
187
|
processedAt: string;
|
|
188
188
|
rejectedAt: string;
|
|
@@ -239,7 +239,7 @@ export interface NewOrder {
|
|
|
239
239
|
chain: Chain;
|
|
240
240
|
network: Network;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
type SupportingDocMetadata = {
|
|
243
243
|
uploadedBy: string;
|
|
244
244
|
createdAt: string;
|
|
245
245
|
updatedAt: string;
|