@novastera-oss/nitro-metamask 0.4.1 → 0.4.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/README.md +28 -11
- package/package.json +16 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @novastera-oss/nitro-metamask
|
|
2
2
|
|
|
3
|
-
Novastera authentication with native mobile libraries
|
|
3
|
+
Novastera authentication with native mobile metamask libraries. Those aims at providing native mobile support for the metamask wallet.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@novastera-oss/nitro-metamask)
|
|
6
6
|
[](https://www.npmjs.com/package/@novastera-oss/nitro-metamask)
|
|
@@ -102,10 +102,10 @@ func application(
|
|
|
102
102
|
```typescript
|
|
103
103
|
import { NitroMetamask } from '@novastera-oss/nitro-metamask';
|
|
104
104
|
|
|
105
|
-
// Optional: Configure dapp URL
|
|
106
|
-
// If not called, defaults to "https://novastera.com"
|
|
105
|
+
// Optional: Configure dapp URL and deep link scheme
|
|
106
|
+
// If not called, defaults to "https://novastera.com" and auto-detects deep link scheme
|
|
107
107
|
// This URL is ONLY used for SDK validation - the deep link return is handled automatically
|
|
108
|
-
NitroMetamask.configure('https://yourdomain.com'); // Optional
|
|
108
|
+
NitroMetamask.configure('https://yourdomain.com', 'nitrometamask'); // Optional
|
|
109
109
|
|
|
110
110
|
// Connect to MetaMask
|
|
111
111
|
const connectResult = await NitroMetamask.connect();
|
|
@@ -115,10 +115,18 @@ console.log('Connected:', connectResult.address, 'Chain:', connectResult.chainId
|
|
|
115
115
|
const signature = await NitroMetamask.signMessage('Hello from my app!');
|
|
116
116
|
|
|
117
117
|
// Connect and sign in one call (convenience method)
|
|
118
|
-
// This constructs a JSON message with
|
|
118
|
+
// This constructs a JSON message with nonce and exp, then signs it
|
|
119
|
+
// Returns signature, address, and chainId together
|
|
119
120
|
const nonce = 'random-nonce-123';
|
|
120
121
|
const exp = BigInt(Date.now() + 42000); // 42 seconds from now (use BigInt for timestamp)
|
|
121
|
-
const
|
|
122
|
+
const result = await NitroMetamask.connectSign(nonce, exp);
|
|
123
|
+
console.log('Signature:', result.signature);
|
|
124
|
+
console.log('Address:', result.address);
|
|
125
|
+
console.log('Chain ID:', result.chainId);
|
|
126
|
+
|
|
127
|
+
// Get current address and chainId (useful if you need to check after other operations)
|
|
128
|
+
const address = await NitroMetamask.getAddress();
|
|
129
|
+
const chainId = await NitroMetamask.getChainId();
|
|
122
130
|
```
|
|
123
131
|
|
|
124
132
|
### How Deep Linking Works
|
|
@@ -133,20 +141,29 @@ const signature = await NitroMetamask.connectSign(nonce, exp);
|
|
|
133
141
|
- If you don't have a website, the default works fine - it's just for validation
|
|
134
142
|
- [Reference](https://raw.githubusercontent.com/MetaMask/metamask-android-sdk/a448378fbedc3afbf70759ba71294f7819af2f37/metamask-android-sdk/src/main/java/io/metamask/androidsdk/DappMetadata.kt)
|
|
135
143
|
|
|
136
|
-
2. **Deep Link Return** (automatic):
|
|
144
|
+
2. **Deep Link Return** (automatic or configurable):
|
|
137
145
|
- Automatically detected from your `AndroidManifest.xml` intent filter
|
|
138
146
|
- The SDK reads `<data android:scheme="..." android:host="mmsdk" />` and uses it to return to your app
|
|
147
|
+
- You can also explicitly provide the scheme via `configure()`: `NitroMetamask.configure('https://yourdomain.com', 'nitrometamask')`
|
|
139
148
|
- This is what actually makes MetaMask return to your app after operations
|
|
140
|
-
-
|
|
149
|
+
- If not explicitly configured, the library will attempt to auto-detect it from your manifest
|
|
141
150
|
|
|
142
151
|
**Summary:**
|
|
143
152
|
- The `configure()` URL is just for SDK validation (you can use the default if you don't have a website)
|
|
144
|
-
- The deep link
|
|
153
|
+
- The deep link scheme can be auto-detected or explicitly provided via `configure()`
|
|
145
154
|
- Your app will return correctly as long as the manifest is configured properly
|
|
146
155
|
|
|
147
|
-
##
|
|
156
|
+
## About Novastera
|
|
148
157
|
|
|
149
|
-
|
|
158
|
+
[Novastera](https://novastera.com) is a modern CRM and ERP platform designed to streamline business operations and customer relationship management. This library is part of Novastera's open-source ecosystem, providing native mobile MetaMask wallet integration for React Native applications.
|
|
159
|
+
|
|
160
|
+
**Key Features:**
|
|
161
|
+
- Native mobile MetaMask wallet support for iOS and Android
|
|
162
|
+
- Seamless deep linking integration
|
|
163
|
+
- Secure authentication and message signing
|
|
164
|
+
- Built with [Nitro Modules](https://nitro.margelo.com) for optimal performance
|
|
165
|
+
|
|
166
|
+
Learn more at [novastera.com](https://novastera.com)
|
|
150
167
|
|
|
151
168
|
## Contributing
|
|
152
169
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novastera-oss/nitro-metamask",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "Novastera
|
|
3
|
+
"version": "0.4.2",
|
|
4
|
+
"description": "Native mobile MetaMask wallet integration for React Native. Part of Novastera CRM/ERP platform ecosystem. Provides secure authentication and message signing for Web3 mobile applications.",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
7
7
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -18,7 +18,20 @@
|
|
|
18
18
|
"react-native",
|
|
19
19
|
"@novastera-oss/nitro-metamask",
|
|
20
20
|
"metamask",
|
|
21
|
-
"novastera"
|
|
21
|
+
"novastera",
|
|
22
|
+
"crm",
|
|
23
|
+
"erp",
|
|
24
|
+
"web3",
|
|
25
|
+
"blockchain",
|
|
26
|
+
"ethereum",
|
|
27
|
+
"wallet",
|
|
28
|
+
"mobile",
|
|
29
|
+
"ios",
|
|
30
|
+
"android",
|
|
31
|
+
"nitro-modules",
|
|
32
|
+
"authentication",
|
|
33
|
+
"crypto",
|
|
34
|
+
"defi"
|
|
22
35
|
],
|
|
23
36
|
"files": [
|
|
24
37
|
"src",
|