You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
Everything you need to interact with the [Monerium API](https://monerium.dev/api-docs) - an electronic money issuer.
3
+
Monerium connects your web3 wallet to any euro bank account with your personal IBAN.
4
+
All incoming euro payments are automatically minted as EURe tokens to your wallet.
5
+
Sending EURe to traditional bank accounts is just as easy.
6
+
With a single signature from your wallet, your EURe is burned and sent as Euros to any bank account.
4
7
5
-
_This package is in development. Please make sure to check if any future updates contain commits
6
-
that may change the behavior of your application before you upgrade. If you find any issues please report them [here](https://github.com/monerium/sdk/issues)._
| production |https://monerium.app|https://api.monerium.app|
35
38
36
-
networks: `goerli`, `mumbai`, `chiado`.
39
+
### Environments - Networks
37
40
38
-
#### Production:
41
+
| Environment | Chain | Network |
42
+
| ----------- | -------- | ------- |
43
+
| sandbox | ethereum | goerli |
44
+
|| polygon | mumbai |
45
+
|| gnosis | chiado |
46
+
| production | ethereum | mainnet |
47
+
|| polygon | mainnet |
48
+
|| gnosis | mainnet |
39
49
40
-
chains: `ethereum`, `polygon`, `gnosis`.
41
-
42
-
networks: `mainnet`, `mainnet`, `mainnet`.
43
-
44
-
## Getting started
50
+
## Usage Examples
45
51
46
52
We recommend starting in the [Developer Portal](https://monerium.dev/docs/welcome). There you will learn more about `client_id`'s and ways of authenticating.
47
53
48
-
### Import the SDK and initialize a client
54
+
####Import the SDK and initialize a client
49
55
50
56
```ts
51
57
import { MoneriumClient } from'@monerium/sdk';
52
58
53
-
//By default, the client will use the sandbox environment.
54
-
//To change to production, pass "production" as the first argument.
59
+
//Initialize the client. By default, it uses the sandbox environment.
60
+
//For using the production environment, replace 'sandbox' with 'production'.
55
61
const client =newMoneriumClient('sandbox');
56
62
```
57
63
58
-
### Authenticate using client credentials
64
+
####Authenticate using client credentials
59
65
60
66
```ts
61
67
awaitclient.auth({
62
-
client_id: "your_client_credentials_uuid"
63
-
client_secret: "your_client_secret"
64
-
})
68
+
client_id: 'your_client_credentials_uuid', // replace with your client ID
69
+
client_secret: 'your_client_secret', // replace with your client secret
70
+
});
65
71
66
-
//User is now authenticated, get authentication data
67
-
awaitclient.getAuthContext()
72
+
//Retrieve authentication data after successful authentication.
73
+
awaitclient.getAuthContext();
68
74
69
-
//You can now find your access and refresh token here:
First you have to navigate the user to the Monerium authentication flow. This can be done by generating a URL and redirecting the user to it. After the user has authenticated, Monerium will redirect back to your specified URI with a code. You can then finalize the authentication process by exchanging the code for access and refresh tokens.
74
82
75
83
```ts
76
-
//Construct the authFlowUrl for your application and redirect your customer.
84
+
//Generate the URL where users will be redirected to authenticate.
// Redirecting to the Monerium onboarding / Authentication flow.
90
-
window.location.replace(authFlowUrl)
86
+
client_id: 'your_client_authflow_uuid', // replace with your auth flow client ID
87
+
redirect_uri: 'http://your-webpage.com/monerium-integration', // specify your redirect URI
88
+
// Optional parameters for automatic wallet selection (if applicable)
89
+
network: 'mumbai', // specify the network
90
+
chain: 'polygon', // specify the chain
91
+
address: '0xValidAddress72413Fa92980B889A1eCE84dD', // user wallet address
92
+
signature:
93
+
'0xValidSignature0df2b6c9e0fc067ab29bdbf322bec30aad7c46dcd97f62498a91ef7795957397e0f49426e000b0f500c347219ddd98dc5080982563055e918031c', // user wallet signature
94
+
});
95
+
96
+
// Store the code verifier securely between requests.
We are using [commitlint](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional) to enforce that developers format the commit messages according to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines.
114
135
115
136
We are using Yarn as a package manager.
116
137
117
-
```
138
+
```sh
139
+
# Install dependencies
118
140
yarn
141
+
142
+
# Run Vite to build a production release distributable
119
143
yarn build
144
+
145
+
# Run Vite in watch mode to detect changes to files during development
146
+
yarn watch
120
147
```
121
148
122
149
Smart IDEs (such as VSCode) require [special configuration](https://yarnpkg.com/getting-started/editor-sdks) for TypeScript to work when using Yarn Plug'n'Play installs.
@@ -138,6 +165,30 @@ cd ../your-project
138
165
yarn link "@monerium/sdk"
139
166
```
140
167
141
-
## Publishing
168
+
####Publishing
142
169
143
170
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.
171
+
172
+
## FAQs
173
+
174
+
Common questions developers have regarding the SDK.
This template is a comprehensive starting point. Each section should contain detailed information relevant to your SDK to guide your users from installation to effective usage and troubleshooting. Be sure to adjust the headers and content to suit your SDK's unique needs and features.
0 commit comments