Skip to content

Commit

Permalink
feat: deprecating redirectUrl for redirectUri for consistency w Oauth2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
einaralex committed Aug 7, 2024
1 parent 4f2ccbb commit 90e8639
Show file tree
Hide file tree
Showing 83 changed files with 372 additions and 295 deletions.
2 changes: 1 addition & 1 deletion apps/customer/components/App/Providers/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Providers({ children }: { children: React.ReactNode }) {
<RainbowKitProvider>
<MoneriumProvider
clientId="f99e629b-6dca-11ee-8aa6-5273f65ed05b"
redirectUrl={`${baseUrl}/dashboard`}
redirectUri={`${baseUrl}/dashboard`}
environment="sandbox"
>
<StyleProviders>{children}</StyleProviders>
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-react-provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pnpm add @monerium/sdk-react-provider @tanstack/react-query

Wrap your app in the `QueryClientProvider` React Context Provider and pass a new `QueryClient` instance to the `client` property

Inside the `QueryClientProvider`, wrap your app in the `MoneriumProvider` React Context Provider and pass the auth flow's `clientId`, `redirectUrl`, and `environment` configuration.
Inside the `QueryClientProvider`, wrap your app in the `MoneriumProvider` React Context Provider and pass the auth flow's `clientId`, `redirectUri`, and `environment` configuration.

```tsx
import { StrictMode } from 'react';
Expand All @@ -61,7 +61,7 @@ root.render(
<QueryClientProvider client={queryClient}>
<MoneriumProvider
clientId="f99e629b-6dca-11ee-8aa6-5273f65ed05b"
redirectUrl="https://pntvgs.csb.app/"
redirectUri="https://pntvgs.csb.app/"
environment="sandbox"
>
<App />
Expand Down
4 changes: 3 additions & 1 deletion packages/sdk-react-provider/src/lib/hooks.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ const Providers = ({ children }: { children: ReactNode }) => {
});
return (
<QueryClientProvider client={queryClient}>
<MoneriumProvider>{children}</MoneriumProvider>
<MoneriumProvider clientId="testClient" redirectUri="testRedirectUri">
{children}
</MoneriumProvider>
</QueryClientProvider>
);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-react-provider/src/lib/provider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('MoneriumProvider', () => {
const queryClient = new QueryClient();
render(
<QueryClientProvider client={queryClient}>
<MoneriumProvider>
<MoneriumProvider clientId="testClient" redirectUri="testRedirectUri">
<TestConsumerComponent />
</MoneriumProvider>
</QueryClientProvider>
Expand Down
11 changes: 7 additions & 4 deletions packages/sdk-react-provider/src/lib/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ import { AuthorizeParams } from './types';
*/
export const MoneriumProvider = ({
children,
clientId = 'f99e629b-6dca-11ee-8aa6-5273f65ed05b',
redirectUrl = 'http://localhost:5173',
clientId,
redirectUrl,
redirectUri,
environment = 'sandbox',
}: {
children: ReactNode;
clientId?: string;
clientId: string;
redirectUri: string;
/** @deprecated use redirectUri */
redirectUrl?: string;
environment?: 'sandbox' | 'production';
}) => {
Expand All @@ -39,7 +42,7 @@ export const MoneriumProvider = ({
const sdkInstance = new MoneriumClient({
environment: environment,
clientId,
redirectUrl,
redirectUri: redirectUri || redirectUrl,
});
setSdk(sdkInstance);
}, []);
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function App() {
const sdk = new MoneriumClient({
environment: 'sandbox',
clientId: 'f99e629b-6dca-11ee-8aa6-5273f65ed05b',
redirectUrl: 'http://localhost:4200',
redirectUri: 'http://localhost:4200',
});
setMonerium(sdk);
}, []);
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/docs/generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Renames and re-exports [MoneriumClient](classes/MoneriumClient.md)
- [Counterpart](interfaces/Counterpart.md)
- [CrossChain](interfaces/CrossChain.md)
- [CurrencyAccounts](interfaces/CurrencyAccounts.md)
- [DeprecatedAuthorizationCodeCredentials](interfaces/DeprecatedAuthorizationCodeCredentials.md)
- [Fee](interfaces/Fee.md)
- [IBAN](interfaces/IBAN.md)
- [Identifier](interfaces/Identifier.md)
Expand Down
48 changes: 24 additions & 24 deletions packages/sdk/docs/generated/classes/MoneriumClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ new MoneriumClient('production')
new MoneriumClient({
environment: 'sandbox',
clientId: 'your-client-id',
redirectUrl: 'your-redirect-url'
redirectUri: 'your-redirect-url'
})
```

#### Defined in

[client.ts:89](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L89)
[client.ts:90](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L90)

## Properties

Expand All @@ -52,7 +52,7 @@ The bearer profile will be available after authentication, it includes the `acce

#### Defined in

[client.ts:60](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L60)
[client.ts:61](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L61)

***

Expand All @@ -62,7 +62,7 @@ The bearer profile will be available after authentication, it includes the `acce
#### Defined in

[client.ts:68](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L68)
[client.ts:69](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L69)

***

Expand All @@ -74,7 +74,7 @@ The state parameter is used to maintain state between the request and the callba

#### Defined in

[client.ts:74](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L74)
[client.ts:75](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L75)

## Methods

Expand All @@ -101,7 +101,7 @@ string

##### Defined in

[client.ts:127](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L127)
[client.ts:130](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L130)

***

Expand All @@ -117,7 +117,7 @@ Cleanups the socket and the subscriptions

##### Defined in

[client.ts:502](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L502)
[client.ts:515](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L515)

***

Expand All @@ -129,7 +129,7 @@ Get access to the API

##### Parameters

**client?**: [`ClientCredentials`](../interfaces/ClientCredentials.md) \| [`AuthorizationCodeCredentials`](../interfaces/AuthorizationCodeCredentials.md)
**client?**: [`ClientCredentials`](../interfaces/ClientCredentials.md) \| [`AuthorizationCodeCredentials`](../interfaces/AuthorizationCodeCredentials.md) \| [`DeprecatedAuthorizationCodeCredentials`](../interfaces/DeprecatedAuthorizationCodeCredentials.md)

the client credentials

Expand All @@ -141,7 +141,7 @@ boolean to indicate if access has been granted

##### Defined in

[client.ts:162](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L162)
[client.ts:166](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L166)

***

Expand All @@ -157,7 +157,7 @@ boolean to indicate if access has been granted

##### Defined in

[client.ts:275](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L275)
[client.ts:288](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L288)

***

Expand All @@ -173,7 +173,7 @@ Revokes access

##### Defined in

[client.ts:515](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L515)
[client.ts:528](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L528)

### Accounts

Expand All @@ -195,7 +195,7 @@ the id of the profile to fetch balances.

##### Defined in

[client.ts:299](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L299)
[client.ts:312](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L312)

***

Expand All @@ -217,7 +217,7 @@ the id of the profile to fetch balances.

##### Defined in

[client.ts:338](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L338)
[client.ts:351](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L351)

### Profiles

Expand All @@ -239,7 +239,7 @@ the id of the profile to fetch.

##### Defined in

[client.ts:284](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L284)
[client.ts:297](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L297)

***

Expand All @@ -255,7 +255,7 @@ the id of the profile to fetch.

##### Defined in

[client.ts:291](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L291)
[client.ts:304](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L304)

### Orders

Expand All @@ -271,7 +271,7 @@ Connects to the order notifications socket

##### Defined in

[client.ts:459](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L459)
[client.ts:472](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L472)

***

Expand All @@ -291,7 +291,7 @@ Connects to the order notifications socket

##### Defined in

[client.ts:320](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L320)
[client.ts:333](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L333)

***

Expand All @@ -311,7 +311,7 @@ Connects to the order notifications socket

##### Defined in

[client.ts:311](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L311)
[client.ts:324](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L324)

***

Expand All @@ -331,7 +331,7 @@ Connects to the order notifications socket

##### Defined in

[client.ts:353](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L353)
[client.ts:366](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L366)

***

Expand Down Expand Up @@ -359,7 +359,7 @@ The handler to be called when the event is triggered

##### Defined in

[client.ts:531](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L531)
[client.ts:544](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L544)

***

Expand All @@ -375,7 +375,7 @@ Subscribes to the order notifications socket

##### Defined in

[client.ts:470](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L470)
[client.ts:483](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L483)

***

Expand All @@ -397,7 +397,7 @@ The event to unsubscribe from

##### Defined in

[client.ts:540](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L540)
[client.ts:553](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L553)

***

Expand All @@ -417,7 +417,7 @@ The event to unsubscribe from

##### Defined in

[client.ts:370](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L370)
[client.ts:383](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L383)

### Tokens

Expand All @@ -433,4 +433,4 @@ The event to unsubscribe from

##### Defined in

[client.ts:328](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/client.ts#L328)
[client.ts:341](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/client.ts#L341)
6 changes: 3 additions & 3 deletions packages/sdk/docs/generated/enumerations/AccountState.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#### Defined in

[types.ts:221](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L221)
[types.ts:221](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L221)

***

Expand All @@ -24,7 +24,7 @@
#### Defined in

[types.ts:222](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L222)
[types.ts:222](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L222)

***

Expand All @@ -34,4 +34,4 @@
#### Defined in

[types.ts:220](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L220)
[types.ts:220](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L220)
8 changes: 4 additions & 4 deletions packages/sdk/docs/generated/enumerations/Currency.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#### Defined in

[types.ts:69](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L69)
[types.ts:69](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L69)

***

Expand All @@ -24,7 +24,7 @@
#### Defined in

[types.ts:71](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L71)
[types.ts:71](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L71)

***

Expand All @@ -34,7 +34,7 @@
#### Defined in

[types.ts:72](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L72)
[types.ts:72](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L72)

***

Expand All @@ -44,4 +44,4 @@
#### Defined in

[types.ts:70](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L70)
[types.ts:70](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L70)
6 changes: 3 additions & 3 deletions packages/sdk/docs/generated/enumerations/KYCOutcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#### Defined in

[types.ts:214](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L214)
[types.ts:214](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L214)

***

Expand All @@ -24,7 +24,7 @@
#### Defined in

[types.ts:215](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L215)
[types.ts:215](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L215)

***

Expand All @@ -34,4 +34,4 @@
#### Defined in

[types.ts:216](https://github.com/monerium/js-monorepo/blob/294e3704bc2735fba770b1d2fbba8f31f3bfa306/packages/sdk/src/types.ts#L216)
[types.ts:216](https://github.com/monerium/js-monorepo/blob/4f2ccbbab3654810f24287d973126d95378140bb/packages/sdk/src/types.ts#L216)
Loading

0 comments on commit 90e8639

Please sign in to comment.