@monerium/sdk 2.3.0 → 2.4.0

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,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.4.0](https://github.com/monerium/sdk/compare/v2.3.0...v2.4.0) (2023-05-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * kind always redeem from place order [#87](https://github.com/monerium/sdk/issues/87) ([#88](https://github.com/monerium/sdk/issues/88)) ([850921e](https://github.com/monerium/sdk/commit/850921ed0aa8d36e180ee7c1df439e04f5d7085b))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * custom urlEncoder for x-www-forms so the package works for Metamask snapa ([#91](https://github.com/monerium/sdk/issues/91)) ([8375164](https://github.com/monerium/sdk/commit/83751645565c4b7054f8aabffaa8f91eea8d5caf))
14
+ * lint ([82f8f7c](https://github.com/monerium/sdk/commit/82f8f7c0192b235c4e0e584a25d52490e1575aa3))
15
+ * vscode cant detect the configs in nested folder ([#89](https://github.com/monerium/sdk/issues/89)) ([398dcf1](https://github.com/monerium/sdk/commit/398dcf1513de86a7c3949493e3728aac746349fa))
16
+ * we only support EUR for now + adjust placeOrder request type ([1c54932](https://github.com/monerium/sdk/commit/1c549321192c115947f1ce574c97cf618353a6ef))
17
+ * we only support EUR for now + adjust placeOrder request type ([07f801a](https://github.com/monerium/sdk/commit/07f801a1088bf2df014af549214199bb17ee8f51))
18
+
19
+
20
+ ### Miscellaneous
21
+
22
+ * add a comment to explain how to use the Network type ([c913224](https://github.com/monerium/sdk/commit/c9132242d2f977524ba6467210344b1c8dc51e85))
23
+ * add info about sdks to Readme ([ad10488](https://github.com/monerium/sdk/commit/ad10488ce634787bee3b1eab8be6b8d78f56f834))
24
+
3
25
  ## [2.3.0](https://github.com/monerium/sdk/compare/v2.2.3...v2.3.0) (2023-04-30)
4
26
 
5
27
 
package/README.md CHANGED
@@ -16,9 +16,14 @@ that may change the behavior of your application before you upgrade._
16
16
  yarn add @monerium/sdk
17
17
  ```
18
18
 
19
+ Smart IDEs (such as VSCode) require [special configuration](https://yarnpkg.com/getting-started/editor-sdks) for TypeScript to work when using Plug'n'Play installs.
20
+
21
+ ```sh
22
+ yarn dlx @yarnpkg/sdks vscode
23
+ ```
24
+
19
25
  ## Usage
20
26
 
21
- - `start`: Run Vite in host mode for a local development environment (not included in production build)
22
27
  - `watch`: Run Vite in watch mode to detect changes to files during development
23
28
  - `build`: Run Vite to build a production release distributable
24
29
 
@@ -43,7 +48,7 @@ If you are new here, we recommend starting in the [Developer Portal](https://mon
43
48
  ### Import the SDK and initialize a client
44
49
 
45
50
  ```ts
46
- import { MoneriumClient } from "@monerium/sdk";
51
+ import { MoneriumClient } from '@monerium/sdk';
47
52
 
48
53
  const client = new MoneriumClient();
49
54
  ```
@@ -84,10 +89,10 @@ window.location.replace(authFlowUrl)
84
89
  // i.e. http://your-webpage.com/monerium-integration?code=1234abcd
85
90
 
86
91
  await client.auth({
87
- client_id: "your_client_authflow_uuid",
88
- code: new URLSearchParams(window.location.search).get("code"),
89
- code_verifier: window.localStorage.getItem("myCodeVerifier"),
90
- redirect_url: "http://your-webpage.com/monerium-integration",
92
+ client_id: 'your_client_authflow_uuid',
93
+ code: new URLSearchParams(window.location.search).get('code'),
94
+ code_verifier: window.localStorage.getItem('myCodeVerifier'),
95
+ redirect_url: 'http://your-webpage.com/monerium-integration',
91
96
  });
92
97
 
93
98
  // User is now authenticated, get authentication data
package/dist/index.d.ts CHANGED
@@ -20,10 +20,7 @@ export type NetworkSemiStrict<C extends Chain> = C extends "ethereum" ? Ethereum
20
20
  export type NetworkStrict<C extends Chain, E extends ENV> = E extends "production" ? "mainnet" : E extends "sandbox" ? C extends "ethereum" ? EthereumTestnet : C extends "gnosis" ? GnosisTestnet : C extends "polygon" ? PolygonTestnet : never : never;
21
21
  export type Network<C extends Chain = Chain, E extends ENV = ENV> = C extends Chain ? E extends ENV ? NetworkStrict<C, E> & NetworkSemiStrict<C> : never : never;
22
22
  export declare enum Currency {
23
- eur = "eur",
24
- usd = "usd",
25
- gbp = "gbp",
26
- isk = "isk"
23
+ eur = "eur"
27
24
  }
28
25
  export type AuthArgs = Omit<AuthCode, "grant_type"> | Omit<RefreshToken, "grant_type"> | Omit<ClientCredentials, "grant_type">;
29
26
  export interface AuthCode {
@@ -139,8 +136,6 @@ export interface Account {
139
136
  currency: Currency;
140
137
  standard: PaymentStandard;
141
138
  iban?: string;
142
- sortCode?: string;
143
- accountNumber?: string;
144
139
  network: Network;
145
140
  chain: Chain;
146
141
  id?: string;
@@ -242,20 +237,23 @@ export interface Token {
242
237
  address: string;
243
238
  decimals: number;
244
239
  }
245
- export interface NewOrder {
246
- kind: OrderKind;
240
+ export type NewOrder = NewOrderByAddress | NewOrderByAccountId;
241
+ export interface NewOrderCommon {
247
242
  amount: string;
248
243
  signature: string;
249
- accountId?: string;
250
- address: string;
251
- currency: Currency;
252
244
  counterpart: Counterpart;
253
245
  message: string;
254
- memo: string;
246
+ memo?: string;
255
247
  supportingDocumentId?: string;
248
+ }
249
+ export interface NewOrderByAddress extends NewOrderCommon {
250
+ address: string;
256
251
  chain: Chain;
257
252
  network: Network;
258
253
  }
254
+ export interface NewOrderByAccountId extends NewOrderCommon {
255
+ accountId: string;
256
+ }
259
257
  export interface SupportingDocMetadata {
260
258
  uploadedBy: string;
261
259
  createdAt: string;
@@ -321,8 +319,7 @@ export declare class MoneriumClient {
321
319
  *
322
320
  * @returns string
323
321
  */
324
- export declare const placeOrderMessage: ({ currency, amount, iban, }: {
325
- currency: Currency | Uppercase<Currency> | string;
322
+ export declare const placeOrderMessage: ({ amount, iban, }: {
326
323
  amount: string | number;
327
324
  iban: string;
328
325
  }) => string;