@oasisomniverse/web4-api 2.0.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/README.md +464 -0
- package/docs/README.md +52 -0
- package/docs/auth.md +89 -0
- package/docs/getting-started.md +129 -0
- package/docs/modules/Avatar.md +4160 -0
- package/docs/modules/Bridge.md +394 -0
- package/docs/modules/Chat.md +168 -0
- package/docs/modules/Clan.md +552 -0
- package/docs/modules/Competition.md +594 -0
- package/docs/modules/Data.md +796 -0
- package/docs/modules/EOSIO.md +508 -0
- package/docs/modules/Eggs.md +396 -0
- package/docs/modules/Files.md +312 -0
- package/docs/modules/Gifts.md +306 -0
- package/docs/modules/Health.md +90 -0
- package/docs/modules/Holochain.md +374 -0
- package/docs/modules/HyperDrive.md +3857 -0
- package/docs/modules/Karma.md +644 -0
- package/docs/modules/Keys.md +3303 -0
- package/docs/modules/Map.md +1026 -0
- package/docs/modules/Messaging.md +320 -0
- package/docs/modules/Nft.md +2216 -0
- package/docs/modules/OLand.md +425 -0
- package/docs/modules/ONET.md +442 -0
- package/docs/modules/ONODE.md +504 -0
- package/docs/modules/Provider.md +1396 -0
- package/docs/modules/Search.md +69 -0
- package/docs/modules/Seeds.md +167 -0
- package/docs/modules/Settings.md +533 -0
- package/docs/modules/Share.md +64 -0
- package/docs/modules/Social.md +190 -0
- package/docs/modules/Solana.md +150 -0
- package/docs/modules/Stats.md +359 -0
- package/docs/modules/Subscription.md +437 -0
- package/docs/modules/Video.md +150 -0
- package/docs/modules/Wallet.md +1993 -0
- package/index.d.ts +106 -0
- package/index.js +3 -0
- package/index.mjs +4 -0
- package/package.json +120 -0
- package/src/core/httpClient.js +110 -0
- package/src/core/routeHelper.js +50 -0
- package/src/core/tokenStore.js +52 -0
- package/src/core/types.d.ts +18 -0
- package/src/index.js +46 -0
- package/src/modules/Auth.d.ts +28 -0
- package/src/modules/Auth.js +98 -0
- package/src/modules/Avatar.d.ts +192 -0
- package/src/modules/Avatar.js +143 -0
- package/src/modules/Bridge.d.ts +24 -0
- package/src/modules/Bridge.js +35 -0
- package/src/modules/Cargo.js +35 -0
- package/src/modules/Chat.d.ts +15 -0
- package/src/modules/Chat.js +27 -0
- package/src/modules/Clan.d.ts +36 -0
- package/src/modules/Clan.js +41 -0
- package/src/modules/Competition.d.ts +33 -0
- package/src/modules/Competition.js +39 -0
- package/src/modules/Core.js +27 -0
- package/src/modules/Data.d.ts +36 -0
- package/src/modules/Data.js +41 -0
- package/src/modules/EOSIO.d.ts +33 -0
- package/src/modules/EOSIO.js +39 -0
- package/src/modules/Eggs.d.ts +24 -0
- package/src/modules/Eggs.js +33 -0
- package/src/modules/Files.d.ts +24 -0
- package/src/modules/Files.js +33 -0
- package/src/modules/Gifts.d.ts +24 -0
- package/src/modules/Gifts.js +33 -0
- package/src/modules/Health.d.ts +12 -0
- package/src/modules/Health.js +25 -0
- package/src/modules/Holochain.d.ts +27 -0
- package/src/modules/Holochain.js +35 -0
- package/src/modules/HyperDrive.d.ts +237 -0
- package/src/modules/HyperDrive.js +175 -0
- package/src/modules/Karma.d.ts +42 -0
- package/src/modules/Karma.js +45 -0
- package/src/modules/Keys.d.ts +183 -0
- package/src/modules/Keys.js +139 -0
- package/src/modules/Map.d.ts +75 -0
- package/src/modules/Map.js +65 -0
- package/src/modules/Messaging.d.ts +24 -0
- package/src/modules/Messaging.js +33 -0
- package/src/modules/Nft.d.ts +102 -0
- package/src/modules/Nft.js +85 -0
- package/src/modules/OAPP.js +31 -0
- package/src/modules/OLand.d.ts +27 -0
- package/src/modules/OLand.js +35 -0
- package/src/modules/ONET.d.ts +39 -0
- package/src/modules/ONET.js +43 -0
- package/src/modules/ONODE.d.ts +45 -0
- package/src/modules/ONODE.js +47 -0
- package/src/modules/Provider.d.ts +99 -0
- package/src/modules/Provider.js +83 -0
- package/src/modules/Search.d.ts +9 -0
- package/src/modules/Search.js +23 -0
- package/src/modules/Seeds.d.ts +15 -0
- package/src/modules/Seeds.js +27 -0
- package/src/modules/Settings.d.ts +48 -0
- package/src/modules/Settings.js +47 -0
- package/src/modules/Share.d.ts +9 -0
- package/src/modules/Share.js +23 -0
- package/src/modules/Social.d.ts +18 -0
- package/src/modules/Social.js +29 -0
- package/src/modules/Solana.d.ts +12 -0
- package/src/modules/Solana.js +25 -0
- package/src/modules/Stats.d.ts +30 -0
- package/src/modules/Stats.js +37 -0
- package/src/modules/Subscription.d.ts +36 -0
- package/src/modules/Subscription.js +41 -0
- package/src/modules/Telos.js +39 -0
- package/src/modules/Video.d.ts +15 -0
- package/src/modules/Video.js +27 -0
- package/src/modules/Wallet.d.ts +102 -0
- package/src/modules/Wallet.js +85 -0
- package/src/modules/index.js +79 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Gifts — `oasis.gifts`
|
|
2
|
+
|
|
3
|
+
Source controller: [`GiftsController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/GiftsController.cs)
|
|
4
|
+
Route prefix: `api/gifts`
|
|
5
|
+
6 operation(s).
|
|
6
|
+
|
|
7
|
+
Every method takes a single args object: any key matching a `{token}` in the route is substituted into the URL; everything else becomes the query string (GET/DELETE) or JSON body (POST/PUT). Every call resolves to the standard OASIS envelope:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
{
|
|
11
|
+
isError: boolean;
|
|
12
|
+
isWarning: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
errorCode?: string;
|
|
15
|
+
result: T; // see each endpoint's Response section below
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Operations
|
|
20
|
+
|
|
21
|
+
### `getGiftHistory`
|
|
22
|
+
|
|
23
|
+
Get gift history for the current avatar
|
|
24
|
+
|
|
25
|
+
**GET** `api/gifts/history`
|
|
26
|
+
|
|
27
|
+
**Request**
|
|
28
|
+
|
|
29
|
+
Query parameters:
|
|
30
|
+
|
|
31
|
+
| Field | Type |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `limit` | `int (optional)` |
|
|
34
|
+
| `offset` | `int (optional)` |
|
|
35
|
+
|
|
36
|
+
**Response**
|
|
37
|
+
|
|
38
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
39
|
+
|
|
40
|
+
`result` type: `GiftTransaction` (array)
|
|
41
|
+
|
|
42
|
+
| Field | Type |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `Id` | `Guid` |
|
|
45
|
+
| `GiftId` | `Guid` |
|
|
46
|
+
| `FromAvatarId` | `Guid` |
|
|
47
|
+
| `ToAvatarId` | `Guid` |
|
|
48
|
+
| `TransactionType` | `GiftTransactionType` |
|
|
49
|
+
| `Timestamp` | `DateTime` |
|
|
50
|
+
|
|
51
|
+
**Example**
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
const { isError, message, result } = await oasis.gifts.getGiftHistory({
|
|
55
|
+
limit: 1,
|
|
56
|
+
offset: 1
|
|
57
|
+
});
|
|
58
|
+
if (isError) throw new Error(message);
|
|
59
|
+
console.log(result);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Example response:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"isError": false,
|
|
67
|
+
"message": "",
|
|
68
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "GiftId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FromAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "ToAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "TransactionType": { }, "Timestamp": "2026-01-01T00:00:00Z" }]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### `getGiftStats`
|
|
75
|
+
|
|
76
|
+
Get gift statistics for the current avatar
|
|
77
|
+
|
|
78
|
+
**GET** `api/gifts/stats`
|
|
79
|
+
|
|
80
|
+
**Request**
|
|
81
|
+
|
|
82
|
+
No request body.
|
|
83
|
+
|
|
84
|
+
**Response**
|
|
85
|
+
|
|
86
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
87
|
+
|
|
88
|
+
`result` type: `Dictionary<string, object>` - a key/value map keyed by `string`, each value a `object`.
|
|
89
|
+
|
|
90
|
+
**Example**
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
const { isError, message, result } = await oasis.gifts.getGiftStats({});
|
|
94
|
+
if (isError) throw new Error(message);
|
|
95
|
+
console.log(result);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Example response:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"isError": false,
|
|
103
|
+
"message": "",
|
|
104
|
+
"result": { "<string>": {} }
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### `getMyGifts`
|
|
111
|
+
|
|
112
|
+
Get all gifts for the current avatar
|
|
113
|
+
|
|
114
|
+
**GET** `api/gifts/my-gifts`
|
|
115
|
+
|
|
116
|
+
**Request**
|
|
117
|
+
|
|
118
|
+
No request body.
|
|
119
|
+
|
|
120
|
+
**Response**
|
|
121
|
+
|
|
122
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
123
|
+
|
|
124
|
+
`result` type: `Gift` (array)
|
|
125
|
+
|
|
126
|
+
| Field | Type |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| `Id` | `Guid` |
|
|
129
|
+
| `FromAvatarId` | `Guid` |
|
|
130
|
+
| `ToAvatarId` | `Guid` |
|
|
131
|
+
| `GiftType` | `GiftType` |
|
|
132
|
+
| `Message` | `string` |
|
|
133
|
+
| `SentAt` | `DateTime` |
|
|
134
|
+
| `ReceivedAt` | `DateTime?` |
|
|
135
|
+
| `OpenedAt` | `DateTime?` |
|
|
136
|
+
| `IsReceived` | `bool` |
|
|
137
|
+
| `IsOpened` | `bool` |
|
|
138
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
139
|
+
|
|
140
|
+
**Example**
|
|
141
|
+
|
|
142
|
+
```js
|
|
143
|
+
const { isError, message, result } = await oasis.gifts.getMyGifts({});
|
|
144
|
+
if (isError) throw new Error(message);
|
|
145
|
+
console.log(result);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Example response:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"isError": false,
|
|
153
|
+
"message": "",
|
|
154
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FromAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "ToAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "GiftType": { }, "Message": "example string", "SentAt": "2026-01-01T00:00:00Z", "ReceivedAt": "2026-01-01T00:00:00Z", "OpenedAt": "2026-01-01T00:00:00Z", "IsReceived": true, "IsOpened": true, "Metadata": { "<string>": {} } }]
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### `openGift`
|
|
161
|
+
|
|
162
|
+
Open a received gift
|
|
163
|
+
|
|
164
|
+
**POST** `api/gifts/open-gift/{giftId}`
|
|
165
|
+
|
|
166
|
+
Route parameters:
|
|
167
|
+
|
|
168
|
+
| Field | Type |
|
|
169
|
+
| --- | --- |
|
|
170
|
+
| `giftId` | `Guid` |
|
|
171
|
+
|
|
172
|
+
**Request**
|
|
173
|
+
|
|
174
|
+
No request body.
|
|
175
|
+
|
|
176
|
+
**Response**
|
|
177
|
+
|
|
178
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
179
|
+
|
|
180
|
+
`result` type: `bool`
|
|
181
|
+
|
|
182
|
+
**Example**
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
const { isError, message, result } = await oasis.gifts.openGift({
|
|
186
|
+
giftId: '<giftId>'
|
|
187
|
+
});
|
|
188
|
+
if (isError) throw new Error(message);
|
|
189
|
+
console.log(result);
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Example response:
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"isError": false,
|
|
197
|
+
"message": "",
|
|
198
|
+
"result": true
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### `receiveGift`
|
|
205
|
+
|
|
206
|
+
Receive a gift
|
|
207
|
+
|
|
208
|
+
**POST** `api/gifts/receive-gift/{giftId}`
|
|
209
|
+
|
|
210
|
+
Route parameters:
|
|
211
|
+
|
|
212
|
+
| Field | Type |
|
|
213
|
+
| --- | --- |
|
|
214
|
+
| `giftId` | `Guid` |
|
|
215
|
+
|
|
216
|
+
**Request**
|
|
217
|
+
|
|
218
|
+
No request body.
|
|
219
|
+
|
|
220
|
+
**Response**
|
|
221
|
+
|
|
222
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
223
|
+
|
|
224
|
+
`result` type: `bool`
|
|
225
|
+
|
|
226
|
+
**Example**
|
|
227
|
+
|
|
228
|
+
```js
|
|
229
|
+
const { isError, message, result } = await oasis.gifts.receiveGift({
|
|
230
|
+
giftId: '<giftId>'
|
|
231
|
+
});
|
|
232
|
+
if (isError) throw new Error(message);
|
|
233
|
+
console.log(result);
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Example response:
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"isError": false,
|
|
241
|
+
"message": "",
|
|
242
|
+
"result": true
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
### `sendGift`
|
|
249
|
+
|
|
250
|
+
Send a gift to another avatar
|
|
251
|
+
|
|
252
|
+
**POST** `api/gifts/send-gift/{toAvatarId}`
|
|
253
|
+
|
|
254
|
+
Route parameters:
|
|
255
|
+
|
|
256
|
+
| Field | Type |
|
|
257
|
+
| --- | --- |
|
|
258
|
+
| `toAvatarId` | `Guid` |
|
|
259
|
+
|
|
260
|
+
**Request**
|
|
261
|
+
|
|
262
|
+
Body type: `Dictionary<string, object>` - a key/value map keyed by `string`, each value a `object`.
|
|
263
|
+
|
|
264
|
+
**Response**
|
|
265
|
+
|
|
266
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
267
|
+
|
|
268
|
+
`result` type: `Gift`
|
|
269
|
+
|
|
270
|
+
| Field | Type |
|
|
271
|
+
| --- | --- |
|
|
272
|
+
| `Id` | `Guid` |
|
|
273
|
+
| `FromAvatarId` | `Guid` |
|
|
274
|
+
| `ToAvatarId` | `Guid` |
|
|
275
|
+
| `GiftType` | `GiftType` |
|
|
276
|
+
| `Message` | `string` |
|
|
277
|
+
| `SentAt` | `DateTime` |
|
|
278
|
+
| `ReceivedAt` | `DateTime?` |
|
|
279
|
+
| `OpenedAt` | `DateTime?` |
|
|
280
|
+
| `IsReceived` | `bool` |
|
|
281
|
+
| `IsOpened` | `bool` |
|
|
282
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
283
|
+
|
|
284
|
+
**Example**
|
|
285
|
+
|
|
286
|
+
```js
|
|
287
|
+
const { isError, message, result } = await oasis.gifts.sendGift({
|
|
288
|
+
toAvatarId: '<toAvatarId>',
|
|
289
|
+
giftType: '<giftType>',
|
|
290
|
+
message: 'example string',
|
|
291
|
+
/* ...request body fields */
|
|
292
|
+
});
|
|
293
|
+
if (isError) throw new Error(message);
|
|
294
|
+
console.log(result);
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Example response:
|
|
298
|
+
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"isError": false,
|
|
302
|
+
"message": "",
|
|
303
|
+
"result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FromAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "ToAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "GiftType": { }, "Message": "example string", "SentAt": "2026-01-01T00:00:00Z", "ReceivedAt": "2026-01-01T00:00:00Z", "OpenedAt": "2026-01-01T00:00:00Z", "IsReceived": true, "IsOpened": true, "Metadata": { "<string>": {} } }
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Health — `oasis.health`
|
|
2
|
+
|
|
3
|
+
Source controller: [`HealthController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/HealthController.cs)
|
|
4
|
+
Route prefix: `api/health`
|
|
5
|
+
2 operation(s).
|
|
6
|
+
|
|
7
|
+
Every method takes a single args object: any key matching a `{token}` in the route is substituted into the URL; everything else becomes the query string (GET/DELETE) or JSON body (POST/PUT). Every call resolves to the standard OASIS envelope:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
{
|
|
11
|
+
isError: boolean;
|
|
12
|
+
isWarning: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
errorCode?: string;
|
|
15
|
+
result: T; // see each endpoint's Response section below
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Operations
|
|
20
|
+
|
|
21
|
+
### `get`
|
|
22
|
+
|
|
23
|
+
Health check endpoint for Railway deployment
|
|
24
|
+
|
|
25
|
+
**GET** `api/health`
|
|
26
|
+
|
|
27
|
+
**Request**
|
|
28
|
+
|
|
29
|
+
No request body.
|
|
30
|
+
|
|
31
|
+
**Response**
|
|
32
|
+
|
|
33
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
34
|
+
|
|
35
|
+
`result` type: `object`
|
|
36
|
+
|
|
37
|
+
**Example**
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
const { isError, message, result } = await oasis.health.get({});
|
|
41
|
+
if (isError) throw new Error(message);
|
|
42
|
+
console.log(result);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Example response:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"isError": false,
|
|
50
|
+
"message": "",
|
|
51
|
+
"result": {}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### `health`
|
|
58
|
+
|
|
59
|
+
Health check endpoint for Railway deployment
|
|
60
|
+
|
|
61
|
+
**GET** `api/health/health`
|
|
62
|
+
|
|
63
|
+
**Request**
|
|
64
|
+
|
|
65
|
+
No request body.
|
|
66
|
+
|
|
67
|
+
**Response**
|
|
68
|
+
|
|
69
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
70
|
+
|
|
71
|
+
`result` type: `object`
|
|
72
|
+
|
|
73
|
+
**Example**
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
const { isError, message, result } = await oasis.health.health({});
|
|
77
|
+
if (isError) throw new Error(message);
|
|
78
|
+
console.log(result);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Example response:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"isError": false,
|
|
86
|
+
"message": "",
|
|
87
|
+
"result": {}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|