@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 ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## [2.0.2](https://github.com/monerium/sdk/compare/v2.0.1...v2.0.2) (2023-01-05)
4
+
5
+ ### Bug Fixes
6
+
7
+ - Update TypeDocs and set workflow to run only on release ([#7](https://github.com/monerium/sdk/issues/7)) ([79c9ec9](https://github.com/monerium/sdk/commit/79c9ec9e7a68ccfb4d9debaacbc9b7b90be0fcde))
8
+
9
+ ## [2.0.1](https://github.com/monerium/sdk/compare/v2.0.0...v2.0.1) (2023-01-05)
10
+
11
+ ### Bug Fixes
12
+
13
+ - Update TypeDocs and set workflow to run only on release ([#7](https://github.com/monerium/sdk/issues/7)) ([553d765](https://github.com/monerium/sdk/commit/553d765a4a40c807de6628b31b59ddf3064f89a4))
14
+
15
+ ### Miscellaneous
16
+
17
+ - cleanup ([5aeebbc](https://github.com/monerium/sdk/commit/5aeebbca9a53592e7229168ad66849113638d070))
package/README.md CHANGED
@@ -5,24 +5,25 @@ Everything you need to interact with the Monerium API - an electronic money issu
5
5
  _This package is in development. Please make sure to check if any future updates contain commits
6
6
  that may change the behavior of your application before you upgrade._
7
7
 
8
+ [Documentation](https://monerium.github.io/sdk/)
9
+
10
+ [Code coverage](https://monerium.github.io/sdk/coverage)
11
+
8
12
  ## Installing
9
13
 
10
14
  ```sh
11
- # Node
15
+ # Node
12
16
  yarn add @monerium/sdk
13
17
  ```
14
18
 
15
19
  ## Developing
16
20
 
17
- If you want to make any code contributions, make sure to run the following commands before you pr
18
- them:
21
+ ## Usage
19
22
 
20
- ```sh
21
- deno fmt
22
- deno lint
23
- deno test --allow-net=api.monerium.dev
24
- ```
23
+ - `start`: Run Vite in host mode for a local development environment (not included in production build)
24
+ - `watch`: Run Vite in watch mode to detect changes to files during development
25
+ - `build`: Run Vite to build a production release distributable
25
26
 
26
27
  ## Publishing
27
28
 
28
- Tagging a release on GitHub will publish the package to NPM and Deno Land.
29
+ When changes are merged to the `main` branch that follows the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard, [release-please](https://github.com/googleapis/release-please) workflow creates a pull request, preparing for the next release. If kept open, the following commits will also be added to the PR. Merging that PR will create a new release, a workflow will publish it on NPM and tag it on Github.
package/package.json CHANGED
@@ -1,9 +1,6 @@
1
1
  {
2
- "module": "./esm/mod.js",
3
- "main": "./script/mod.js",
4
- "types": "./types/mod.d.ts",
5
2
  "name": "@monerium/sdk",
6
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.2",
7
4
  "description": "Everything you need to interact with the Monerium API - an electronic money issuer.",
8
5
  "license": "MIT",
9
6
  "repository": {
@@ -13,28 +10,48 @@
13
10
  "bugs": {
14
11
  "url": "https://github.com/monerium/sdk/issues"
15
12
  },
16
- "exports": {
17
- ".": {
18
- "import": {
19
- "types": "./types/mod.d.ts",
20
- "default": "./esm/mod.js"
21
- },
22
- "require": {
23
- "types": "./types/mod.d.ts",
24
- "default": "./script/mod.js"
25
- }
26
- }
13
+ "main": "dist/index.cjs.js",
14
+ "module": "dist/index.es.js",
15
+ "types": "dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "engines": {
20
+ "node": "18.x"
27
21
  },
28
22
  "scripts": {
29
- "test": "node test_runner.js"
30
- },
31
- "dependencies": {
32
- "@deno/shim-deno": "~0.11.0",
33
- "@deno/shim-crypto": "~0.3.1",
34
- "undici": "^5.12.0"
23
+ "build": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
24
+ "clean": "rm -rf dist",
25
+ "docs": "typedoc --options configs/typedoc.json",
26
+ "format": "prettier . --write",
27
+ "lint": "eslint . --ext .ts",
28
+ "prepare": "husky install",
29
+ "prepublish": "yarn lint && yarn format && yarn test",
30
+ "start": "vite --host --open",
31
+ "test": "jest",
32
+ "test:coverage": "jest --coverage",
33
+ "watch": "tsc && vite build --watch"
35
34
  },
36
35
  "devDependencies": {
37
- "@types/node": "^18.11.9",
38
- "chalk": "^4.1.2"
36
+ "@types/crypto-js": "^4.1.1",
37
+ "@types/jest": "^29.2.4",
38
+ "@types/node": "^18.11.18",
39
+ "@typescript-eslint/eslint-plugin": "^5.46.0",
40
+ "@typescript-eslint/parser": "^5.46.0",
41
+ "crypto-js": "^4.1.1",
42
+ "dts-bundle-generator": "^7.1.0",
43
+ "eslint": "^8.29.0",
44
+ "eslint-config-prettier": "^8.5.0",
45
+ "eslint-plugin-jest": "^27.1.7",
46
+ "eslint-plugin-prettier": "^4.2.1",
47
+ "husky": "^8.0.2",
48
+ "jest": "^29.3.1",
49
+ "prettier": "^2.8.1",
50
+ "ts-jest": "^29.0.3",
51
+ "ts-node": "^10.9.1",
52
+ "tslib": "^2.4.1",
53
+ "typedoc": "^0.23.23",
54
+ "typescript": "^4.9.4",
55
+ "vite": "^4.0.0"
39
56
  }
40
- }
57
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 monerium
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/esm/_dnt.shims.js DELETED
@@ -1,76 +0,0 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- import { crypto } from "@deno/shim-crypto";
4
- export { crypto } from "@deno/shim-crypto";
5
- import { fetch, File, FormData, Headers, Request, Response } from "undici";
6
- export { fetch, File, FormData, Headers, Request, Response } from "undici";
7
- import { TextEncoder } from "util";
8
- export { TextEncoder } from "util";
9
- const dntGlobals = {
10
- Deno,
11
- crypto,
12
- fetch,
13
- File,
14
- FormData,
15
- Headers,
16
- Request,
17
- Response,
18
- TextEncoder,
19
- };
20
- export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
21
- // deno-lint-ignore ban-types
22
- function createMergeProxy(baseObj, extObj) {
23
- return new Proxy(baseObj, {
24
- get(_target, prop, _receiver) {
25
- if (prop in extObj) {
26
- return extObj[prop];
27
- }
28
- else {
29
- return baseObj[prop];
30
- }
31
- },
32
- set(_target, prop, value) {
33
- if (prop in extObj) {
34
- delete extObj[prop];
35
- }
36
- baseObj[prop] = value;
37
- return true;
38
- },
39
- deleteProperty(_target, prop) {
40
- let success = false;
41
- if (prop in extObj) {
42
- delete extObj[prop];
43
- success = true;
44
- }
45
- if (prop in baseObj) {
46
- delete baseObj[prop];
47
- success = true;
48
- }
49
- return success;
50
- },
51
- ownKeys(_target) {
52
- const baseKeys = Reflect.ownKeys(baseObj);
53
- const extKeys = Reflect.ownKeys(extObj);
54
- const extKeysSet = new Set(extKeys);
55
- return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
56
- },
57
- defineProperty(_target, prop, desc) {
58
- if (prop in extObj) {
59
- delete extObj[prop];
60
- }
61
- Reflect.defineProperty(baseObj, prop, desc);
62
- return true;
63
- },
64
- getOwnPropertyDescriptor(_target, prop) {
65
- if (prop in extObj) {
66
- return Reflect.getOwnPropertyDescriptor(extObj, prop);
67
- }
68
- else {
69
- return Reflect.getOwnPropertyDescriptor(baseObj, prop);
70
- }
71
- },
72
- has(_target, prop) {
73
- return prop in extObj || prop in baseObj;
74
- },
75
- });
76
- }
@@ -1,140 +0,0 @@
1
- // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
2
- /**
3
- * {@linkcode encode} and {@linkcode decode} for
4
- * [base64](https://en.wikipedia.org/wiki/Base64) encoding.
5
- *
6
- * This module is browser compatible.
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
- *
25
- * @module
26
- */
27
- import * as dntShim from "../../../../_dnt.shims.js";
28
- const base64abc = [
29
- "A",
30
- "B",
31
- "C",
32
- "D",
33
- "E",
34
- "F",
35
- "G",
36
- "H",
37
- "I",
38
- "J",
39
- "K",
40
- "L",
41
- "M",
42
- "N",
43
- "O",
44
- "P",
45
- "Q",
46
- "R",
47
- "S",
48
- "T",
49
- "U",
50
- "V",
51
- "W",
52
- "X",
53
- "Y",
54
- "Z",
55
- "a",
56
- "b",
57
- "c",
58
- "d",
59
- "e",
60
- "f",
61
- "g",
62
- "h",
63
- "i",
64
- "j",
65
- "k",
66
- "l",
67
- "m",
68
- "n",
69
- "o",
70
- "p",
71
- "q",
72
- "r",
73
- "s",
74
- "t",
75
- "u",
76
- "v",
77
- "w",
78
- "x",
79
- "y",
80
- "z",
81
- "0",
82
- "1",
83
- "2",
84
- "3",
85
- "4",
86
- "5",
87
- "6",
88
- "7",
89
- "8",
90
- "9",
91
- "+",
92
- "/",
93
- ];
94
- /**
95
- * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
96
- * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
97
- * @param data
98
- */
99
- export function encode(data) {
100
- const uint8 = typeof data === "string"
101
- ? new dntShim.TextEncoder().encode(data)
102
- : data instanceof Uint8Array
103
- ? data
104
- : new Uint8Array(data);
105
- let result = "", i;
106
- const l = uint8.length;
107
- for (i = 2; i < l; i += 3) {
108
- result += base64abc[uint8[i - 2] >> 2];
109
- result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)];
110
- result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)];
111
- result += base64abc[uint8[i] & 0x3f];
112
- }
113
- if (i === l + 1) {
114
- // 1 octet yet to write
115
- result += base64abc[uint8[i - 2] >> 2];
116
- result += base64abc[(uint8[i - 2] & 0x03) << 4];
117
- result += "==";
118
- }
119
- if (i === l) {
120
- // 2 octets yet to write
121
- result += base64abc[uint8[i - 2] >> 2];
122
- result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)];
123
- result += base64abc[(uint8[i - 1] & 0x0f) << 2];
124
- result += "=";
125
- }
126
- return result;
127
- }
128
- /**
129
- * Decodes a given RFC4648 base64 encoded string
130
- * @param b64
131
- */
132
- export function decode(b64) {
133
- const binString = atob(b64);
134
- const size = binString.length;
135
- const bytes = new Uint8Array(size);
136
- for (let i = 0; i < size; i++) {
137
- bytes[i] = binString.charCodeAt(i);
138
- }
139
- return bytes;
140
- }
@@ -1,65 +0,0 @@
1
- // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
2
- /**
3
- * {@linkcode encode} and {@linkcode decode} for
4
- * [base64 URL safe](https://en.wikipedia.org/wiki/Base64#URL_applications) encoding.
5
- *
6
- * This module is browser compatible.
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
- *
24
- * @module
25
- */
26
- import * as base64 from "./base64.js";
27
- /*
28
- * Some variants allow or require omitting the padding '=' signs:
29
- * https://en.wikipedia.org/wiki/Base64#The_URL_applications
30
- * @param base64url
31
- */
32
- function addPaddingToBase64url(base64url) {
33
- if (base64url.length % 4 === 2)
34
- return base64url + "==";
35
- if (base64url.length % 4 === 3)
36
- return base64url + "=";
37
- if (base64url.length % 4 === 1) {
38
- throw new TypeError("Illegal base64url string!");
39
- }
40
- return base64url;
41
- }
42
- function convertBase64urlToBase64(b64url) {
43
- if (!/^[-_A-Z0-9]*?={0,2}$/i.test(b64url)) {
44
- // Contains characters not part of base64url spec.
45
- throw new TypeError("Failed to decode base64url: invalid character");
46
- }
47
- return addPaddingToBase64url(b64url).replace(/\-/g, "+").replace(/_/g, "/");
48
- }
49
- function convertBase64ToBase64url(b64) {
50
- return b64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
51
- }
52
- /**
53
- * Encodes a given ArrayBuffer or string into a base64url representation
54
- * @param data
55
- */
56
- export function encode(data) {
57
- return convertBase64ToBase64url(base64.encode(data));
58
- }
59
- /**
60
- * Converts given base64url encoded data back to original
61
- * @param b64url
62
- */
63
- export function decode(b64url) {
64
- return base64.decode(convertBase64urlToBase64(b64url));
65
- }
package/esm/mod.js DELETED
@@ -1 +0,0 @@
1
- export { MoneriumClient } from "./src/client.js";
package/esm/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
package/esm/src/client.js DELETED
@@ -1,139 +0,0 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _MoneriumClient_instances, _MoneriumClient_env, _MoneriumClient_authPayload, _MoneriumClient_api, _MoneriumClient_isAuthCode, _MoneriumClient_isRefreshToken, _MoneriumClient_isClientCredentials;
13
- import * as dntShim from "../_dnt.shims.js";
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
- import { MONERIUM_CONFIG } from "./config.js";
17
- export class MoneriumClient {
18
- constructor(env = "sandbox") {
19
- _MoneriumClient_instances.add(this);
20
- _MoneriumClient_env.set(this, void 0);
21
- _MoneriumClient_authPayload.set(this, void 0);
22
- Object.defineProperty(this, "codeVerifier", {
23
- enumerable: true,
24
- configurable: true,
25
- writable: true,
26
- value: void 0
27
- });
28
- Object.defineProperty(this, "bearerProfile", {
29
- enumerable: true,
30
- configurable: true,
31
- writable: true,
32
- value: void 0
33
- });
34
- __classPrivateFieldSet(this, _MoneriumClient_env, MONERIUM_CONFIG.environments[env], "f");
35
- }
36
- // -- Authentication
37
- async auth(args) {
38
- let params;
39
- if (__classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_isAuthCode).call(this, args)) {
40
- params = { ...args, grant_type: "authorization_code" };
41
- }
42
- else if (__classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_isRefreshToken).call(this, args)) {
43
- params = { ...args, grant_type: "refresh_token" };
44
- }
45
- else if (__classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_isClientCredentials).call(this, args)) {
46
- params = { ...args, grant_type: "client_credentials" };
47
- }
48
- else {
49
- throw new Error("Authentication method could not be detected.");
50
- }
51
- this.bearerProfile = (await __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "post", `auth/token`, new URLSearchParams(params), true));
52
- __classPrivateFieldSet(this, _MoneriumClient_authPayload, `Bearer ${this.bearerProfile.access_token}`, "f");
53
- }
54
- async pkceRequest(args) {
55
- const buffer = dntShim.crypto.getRandomValues(new Uint8Array(128 / 2));
56
- let randomString = "";
57
- for (let i = 0; i < buffer.length; ++i) {
58
- randomString += ("0" + buffer[i].toString(16)).slice(-2);
59
- }
60
- this.codeVerifier = randomString;
61
- const data = new dntShim.TextEncoder().encode(this.codeVerifier);
62
- const digest = await dntShim.crypto.subtle.digest("SHA-256", data);
63
- const base64Digest = encodeBase64(digest);
64
- const challenge = encodeBase64URL(base64Digest);
65
- const params = {
66
- ...args,
67
- code_challenge: challenge,
68
- code_challenge_method: "S256",
69
- response_type: "code",
70
- };
71
- return `${__classPrivateFieldGet(this, _MoneriumClient_env, "f").api}/auth?${new URLSearchParams(params)}`;
72
- }
73
- // -- Read Methods
74
- getAuthContext() {
75
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", `auth/context`);
76
- }
77
- getProfile(profileId) {
78
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", `profiles/${profileId}`);
79
- }
80
- getBalances(profileId) {
81
- if (profileId) {
82
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", `profiles/${profileId}/balances`);
83
- }
84
- else {
85
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", `balances`);
86
- }
87
- }
88
- getOrders(filter) {
89
- const searchParams = new URLSearchParams(filter);
90
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", `orders?${searchParams}`);
91
- }
92
- getOrder(orderId) {
93
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", `orders/${orderId}`);
94
- }
95
- getTokens() {
96
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "get", "tokens");
97
- }
98
- // -- Write Methods
99
- linkAddress(profileId, body) {
100
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "post", `profiles/${profileId}/addresses`, JSON.stringify(body));
101
- }
102
- placeOrder(order, profileId) {
103
- if (profileId) {
104
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "post", `profiles/${profileId}/orders`, JSON.stringify(order));
105
- }
106
- else {
107
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "post", `orders`, JSON.stringify(order));
108
- }
109
- }
110
- uploadSupportingDocument(document) {
111
- const searchParams = new URLSearchParams(document);
112
- return __classPrivateFieldGet(this, _MoneriumClient_instances, "m", _MoneriumClient_api).call(this, "post", "files/supporting-document", searchParams, true);
113
- }
114
- }
115
- _MoneriumClient_env = new WeakMap(), _MoneriumClient_authPayload = new WeakMap(), _MoneriumClient_instances = new WeakSet(), _MoneriumClient_api =
116
- // -- Helper Methods
117
- async function _MoneriumClient_api(method, resource, body, isFormEncoded) {
118
- const res = await dntShim.fetch(`${__classPrivateFieldGet(this, _MoneriumClient_env, "f").api}/${resource}`, {
119
- method,
120
- headers: {
121
- "Content-Type": `application/${isFormEncoded ? "x-www-form-urlencoded" : "json"}`,
122
- Authorization: __classPrivateFieldGet(this, _MoneriumClient_authPayload, "f") || "",
123
- },
124
- body,
125
- });
126
- const response = await res.json();
127
- if (res.ok) {
128
- return response;
129
- }
130
- else {
131
- throw response;
132
- }
133
- }, _MoneriumClient_isAuthCode = function _MoneriumClient_isAuthCode(args) {
134
- return args.code != undefined;
135
- }, _MoneriumClient_isRefreshToken = function _MoneriumClient_isRefreshToken(args) {
136
- return args.refresh_token != undefined;
137
- }, _MoneriumClient_isClientCredentials = function _MoneriumClient_isClientCredentials(args) {
138
- return args.client_secret != undefined;
139
- };
package/esm/src/config.js DELETED
@@ -1,13 +0,0 @@
1
- const MONERIUM_CONFIG = {
2
- environments: {
3
- production: {
4
- api: "https://api.monerium.app",
5
- web: "https://monerium.app",
6
- },
7
- sandbox: {
8
- api: "https://api.monerium.dev",
9
- web: "https://sandbox.monerium.dev",
10
- },
11
- },
12
- };
13
- export { MONERIUM_CONFIG };
package/esm/src/types.js DELETED
@@ -1,73 +0,0 @@
1
- // --- Config --- //
2
- // --- Client Methods --- //
3
- export var Currency;
4
- (function (Currency) {
5
- Currency["eur"] = "eur";
6
- Currency["usd"] = "usd";
7
- Currency["gbp"] = "gbp";
8
- Currency["isk"] = "isk";
9
- })(Currency || (Currency = {}));
10
- // -- authContext
11
- var Method;
12
- (function (Method) {
13
- Method["password"] = "password";
14
- Method["resource"] = "resource";
15
- Method["jwt"] = "jwt";
16
- Method["apiKey"] = "apiKey";
17
- })(Method || (Method = {}));
18
- var Type;
19
- (function (Type) {
20
- Type["corporate"] = "corporate";
21
- Type["personal"] = "personal";
22
- })(Type || (Type = {}));
23
- var Permission;
24
- (function (Permission) {
25
- Permission["read"] = "read";
26
- Permission["write"] = "write";
27
- })(Permission || (Permission = {}));
28
- // -- getProfile
29
- var KYCState;
30
- (function (KYCState) {
31
- KYCState["absent"] = "absent";
32
- KYCState["submitted"] = "submitted";
33
- KYCState["pending"] = "pending";
34
- KYCState["confirmed"] = "confirmed";
35
- })(KYCState || (KYCState = {}));
36
- var KYCOutcome;
37
- (function (KYCOutcome) {
38
- KYCOutcome["approved"] = "approved";
39
- KYCOutcome["rejected"] = "rejected";
40
- KYCOutcome["unknown"] = "unknown";
41
- })(KYCOutcome || (KYCOutcome = {}));
42
- export var PaymentStandard;
43
- (function (PaymentStandard) {
44
- PaymentStandard["iban"] = "iban";
45
- PaymentStandard["scan"] = "scan";
46
- })(PaymentStandard || (PaymentStandard = {}));
47
- // -- getBalances
48
- export var Chain;
49
- (function (Chain) {
50
- Chain["polygon"] = "polygon";
51
- Chain["ethereum"] = "ethereum";
52
- Chain["gnosis"] = "gnosis";
53
- })(Chain || (Chain = {}));
54
- export var Network;
55
- (function (Network) {
56
- Network["mainnet"] = "mainnet";
57
- Network["chiado"] = "chiado";
58
- Network["goerli"] = "goerli";
59
- Network["mumbai"] = "mumbai";
60
- })(Network || (Network = {}));
61
- // --getOrders
62
- export var OrderKind;
63
- (function (OrderKind) {
64
- OrderKind["redeem"] = "redeem";
65
- OrderKind["issue"] = "issue";
66
- })(OrderKind || (OrderKind = {}));
67
- var OrderState;
68
- (function (OrderState) {
69
- OrderState["placed"] = "placed";
70
- OrderState["pending"] = "pending";
71
- OrderState["processed"] = "processed";
72
- OrderState["rejected"] = "rejected";
73
- })(OrderState || (OrderState = {}));