onairos 0.0.6 → 0.0.8
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 +13 -10
- package/dist/onairos.js +5 -3
- package/package.json +1 -1
- package/src/onairos.jsx +5 -5
package/README.md
CHANGED
|
@@ -48,13 +48,12 @@ Individual Request Information:
|
|
|
48
48
|
|
|
49
49
|
Then instantiate the Onairos object from the Onairos package - passing in your Onairos Developer ID and your Request Object
|
|
50
50
|
```jsx
|
|
51
|
-
<Onairos requestData={requestData} onairosID={onairosID}
|
|
51
|
+
<Onairos requestData={requestData} onairosID={onairosID} webpageName={webpageName} proofMode={proofMode} />
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Onairos Object fields:
|
|
55
55
|
- `requestData` - Request Object - Json
|
|
56
56
|
- `onairosID` - App Assigned Onairos ID - String
|
|
57
|
-
- `access_token` - App Assigned Access Token - String
|
|
58
57
|
- `webpageName` - App Display Name - String
|
|
59
58
|
- `proofMode` - Wish to recieve ZK proof after recieving Data , default FALSE - boolean
|
|
60
59
|
|
|
@@ -97,6 +96,8 @@ Send a POST request to the API endpoint with a JSON payload containing a set of
|
|
|
97
96
|
- `category`: The category to which the content belongs (String) - required
|
|
98
97
|
- `img_url`: The URL of an image associated with the content (String) - optional
|
|
99
98
|
|
|
99
|
+
You should also send the access token as part of this request, from your **backend**
|
|
100
|
+
- `access_token` - App Assigned Access Token - String
|
|
100
101
|
Example JSON body for the POST request:
|
|
101
102
|
|
|
102
103
|
```json
|
|
@@ -116,7 +117,8 @@ Example JSON body for the POST request:
|
|
|
116
117
|
"text": "Example text input 3",
|
|
117
118
|
"category": "Example Category 3",
|
|
118
119
|
"img_url": "http://example.com/image3.jpg"
|
|
119
|
-
}
|
|
120
|
+
},
|
|
121
|
+
"AccessToken":"access_token"
|
|
120
122
|
}
|
|
121
123
|
// Additional entries can be added here
|
|
122
124
|
|
|
@@ -195,22 +197,23 @@ function App() {
|
|
|
195
197
|
|
|
196
198
|
}}
|
|
197
199
|
|
|
198
|
-
const sendData = {
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
const sendData = {
|
|
201
|
+
Small: {
|
|
202
|
+
type:"Personality",
|
|
201
203
|
descriptions:"Insight into your Interests",
|
|
202
204
|
reward:"10% Discount"
|
|
203
205
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
Medium:{
|
|
207
|
+
type:"Personality",
|
|
206
208
|
descriptions:"Insight into your Interests",
|
|
207
209
|
reward:"2 USDC"
|
|
208
210
|
},
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
Large:{
|
|
212
|
+
type:"Personality",
|
|
211
213
|
descriptions:"Insight into your Interests",
|
|
212
214
|
reward:"2 USDC"
|
|
213
215
|
},
|
|
216
|
+
AccessToken:access_token
|
|
214
217
|
};
|
|
215
218
|
useEffect(() => {
|
|
216
219
|
window.addEventListener('message', UseAPIURL);
|
package/dist/onairos.js
CHANGED
|
@@ -41,12 +41,14 @@ function Onairos(_ref) {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("button", {
|
|
44
|
-
className: "OnairosConnect flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer",
|
|
44
|
+
className: "OnairosConnect w-20 h-20 flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer",
|
|
45
45
|
onClick: OnairosAnime
|
|
46
46
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
47
47
|
src: _OnairosBlack.default,
|
|
48
48
|
alt: "Onairos Logo",
|
|
49
|
-
className: "w-
|
|
50
|
-
}), /*#__PURE__*/_react.default.createElement("span",
|
|
49
|
+
className: "w-16 h-16 object-contain mb-2"
|
|
50
|
+
}), " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
51
|
+
className: "whitespace-nowrap"
|
|
52
|
+
}, "Connect to Onairos"), " "));
|
|
51
53
|
}
|
|
52
54
|
var _default = exports.default = Onairos;
|
package/package.json
CHANGED
package/src/onairos.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import onairosLogo from "./OnairosBlack.png";
|
|
3
3
|
|
|
4
|
-
function Onairos( {requestData, onairosID,
|
|
4
|
+
function Onairos( {requestData, onairosID, proofMode=false,webpageName}) {
|
|
5
5
|
const OnairosAnime = async () => {
|
|
6
6
|
try {
|
|
7
7
|
console.log("Clicked Onairos Connect")
|
|
@@ -21,7 +21,7 @@ function Onairos( {requestData, onairosID, access_token, proofMode=false,webpage
|
|
|
21
21
|
type: 'GET_API_URL',
|
|
22
22
|
webpageName: webpageName,
|
|
23
23
|
onairosID:onairosID,
|
|
24
|
-
access_token:access_token,
|
|
24
|
+
access_token:"access_token",
|
|
25
25
|
account:"ConnectedAccountRef.current", //No Longer needed, REMOVE
|
|
26
26
|
requestData: requestData,
|
|
27
27
|
proofMode:proofMode
|
|
@@ -31,11 +31,11 @@ function Onairos( {requestData, onairosID, access_token, proofMode=false,webpage
|
|
|
31
31
|
return (
|
|
32
32
|
<div>
|
|
33
33
|
<button
|
|
34
|
-
className="OnairosConnect flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer"
|
|
34
|
+
className="OnairosConnect w-20 h-20 flex flex-col items-center justify-center text-white font-bold py-2 px-4 rounded cursor-pointer"
|
|
35
35
|
onClick={OnairosAnime}
|
|
36
36
|
>
|
|
37
|
-
<img src={onairosLogo} alt="Onairos Logo" className="w-
|
|
38
|
-
<span>Connect to Onairos</span>
|
|
37
|
+
<img src={onairosLogo} alt="Onairos Logo" className="w-16 h-16 object-contain mb-2" /> {/* Adjust size as needed */}
|
|
38
|
+
<span className="whitespace-nowrap">Connect to Onairos</span> {/* Prevent text from wrapping */}
|
|
39
39
|
</button>
|
|
40
40
|
</div>
|
|
41
41
|
);
|