@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,594 @@
|
|
|
1
|
+
# Competition — `oasis.competition`
|
|
2
|
+
|
|
3
|
+
Source controller: [`CompetitionController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/CompetitionController.cs)
|
|
4
|
+
Route prefix: `api/competition`
|
|
5
|
+
9 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
|
+
### `getActiveTournaments`
|
|
22
|
+
|
|
23
|
+
Get active tournaments
|
|
24
|
+
|
|
25
|
+
**GET** `api/competition/tournaments`
|
|
26
|
+
|
|
27
|
+
**Request**
|
|
28
|
+
|
|
29
|
+
Query parameters:
|
|
30
|
+
|
|
31
|
+
| Field | Type |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `competitionType` | `CompetitionType (optional)` |
|
|
34
|
+
|
|
35
|
+
**Response**
|
|
36
|
+
|
|
37
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
38
|
+
|
|
39
|
+
`result` type: `Tournament` (array)
|
|
40
|
+
|
|
41
|
+
| Field | Type |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `Id` | `Guid` |
|
|
44
|
+
| `Name` | `string` |
|
|
45
|
+
| `Description` | `string` |
|
|
46
|
+
| `TournamentType` | `TournamentType` |
|
|
47
|
+
| `CompetitionType` | `CompetitionType` |
|
|
48
|
+
| `Status` | `TournamentStatus` |
|
|
49
|
+
| `StartDate` | `DateTime` |
|
|
50
|
+
| `EndDate` | `DateTime` |
|
|
51
|
+
| `RegistrationStart` | `DateTime` |
|
|
52
|
+
| `RegistrationEnd` | `DateTime` |
|
|
53
|
+
| `MaxParticipants` | `int` |
|
|
54
|
+
| `CurrentParticipants` | `int` |
|
|
55
|
+
| `MinLevel` | `int` |
|
|
56
|
+
| `MaxLevel` | `int` |
|
|
57
|
+
| `Prerequisites` | `List<string>` |
|
|
58
|
+
| `Rewards` | `List<TournamentReward>` |
|
|
59
|
+
| `Participants` | `List<TournamentParticipant>` |
|
|
60
|
+
| `Matches` | `List<TournamentMatch>` |
|
|
61
|
+
| `Rules` | `Dictionary<string, object>` |
|
|
62
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
63
|
+
| `CreatedBy` | `Guid` |
|
|
64
|
+
| `CreatedAt` | `DateTime` |
|
|
65
|
+
|
|
66
|
+
**Example**
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
const { isError, message, result } = await oasis.competition.getActiveTournaments({
|
|
70
|
+
competitionType: '<competitionType>'
|
|
71
|
+
});
|
|
72
|
+
if (isError) throw new Error(message);
|
|
73
|
+
console.log(result);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Example response:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"isError": false,
|
|
81
|
+
"message": "",
|
|
82
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Description": "example string", "TournamentType": { }, "CompetitionType": { }, "Status": { }, "StartDate": "2026-01-01T00:00:00Z", "EndDate": "2026-01-01T00:00:00Z", "RegistrationStart": "2026-01-01T00:00:00Z", "RegistrationEnd": "2026-01-01T00:00:00Z", "MaxParticipants": 1, "CurrentParticipants": 1, "MinLevel": 1, "MaxLevel": 1, "Prerequisites": ["example string"], "Rewards": [{ "Type": "example string", "Name": "example string", "Description": "example string", "Value": 1, "Position": 1, "ItemId": "example string", "Properties": { "<string>": {} } }], "Participants": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarName": "example string", "AvatarUsername": "example string", "Score": 1, "Rank": 1, "IsEliminated": true, "JoinedAt": "2026-01-01T00:00:00Z", "Stats": { "<string>": {} } }], "Matches": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Participant1Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Participant2Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Round": 1, "Status": { }, "Participant1Score": 1, "Participant2Score": 1, "WinnerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "StartTime": "2026-01-01T00:00:00Z", "EndTime": "2026-01-01T00:00:00Z", "MatchData": { "<string>": {} } }], "Rules": { "<string>": {} }, "Metadata": { "<string>": {} }, "CreatedBy": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "CreatedAt": "2026-01-01T00:00:00Z" }]
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### `getAvailableLeagues`
|
|
89
|
+
|
|
90
|
+
Get available leagues for a competition type and season
|
|
91
|
+
|
|
92
|
+
**GET** `api/competition/leagues/{competitionType}/{seasonType}`
|
|
93
|
+
|
|
94
|
+
Route parameters:
|
|
95
|
+
|
|
96
|
+
| Field | Type |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| `competitionType` | `CompetitionType` |
|
|
99
|
+
| `seasonType` | `SeasonType` |
|
|
100
|
+
|
|
101
|
+
**Request**
|
|
102
|
+
|
|
103
|
+
No request body.
|
|
104
|
+
|
|
105
|
+
**Response**
|
|
106
|
+
|
|
107
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
108
|
+
|
|
109
|
+
`result` type: `League` (array)
|
|
110
|
+
|
|
111
|
+
| Field | Type |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `Id` | `Guid` |
|
|
114
|
+
| `Name` | `string` |
|
|
115
|
+
| `Description` | `string` |
|
|
116
|
+
| `LeagueType` | `LeagueType` |
|
|
117
|
+
| `CompetitionType` | `CompetitionType` |
|
|
118
|
+
| `MinScore` | `long` |
|
|
119
|
+
| `MaxScore` | `long` |
|
|
120
|
+
| `MaxPlayers` | `int` |
|
|
121
|
+
| `CurrentPlayers` | `int` |
|
|
122
|
+
| `IsActive` | `bool` |
|
|
123
|
+
| `CreatedAt` | `DateTime` |
|
|
124
|
+
| `SeasonStart` | `DateTime?` |
|
|
125
|
+
| `SeasonEnd` | `DateTime?` |
|
|
126
|
+
| `SeasonType` | `SeasonType` |
|
|
127
|
+
| `Rewards` | `List<LeagueReward>` |
|
|
128
|
+
| `Requirements` | `Dictionary<string, object>` |
|
|
129
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
130
|
+
|
|
131
|
+
**Example**
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
const { isError, message, result } = await oasis.competition.getAvailableLeagues({
|
|
135
|
+
competitionType: '<competitionType>',
|
|
136
|
+
seasonType: '<seasonType>'
|
|
137
|
+
});
|
|
138
|
+
if (isError) throw new Error(message);
|
|
139
|
+
console.log(result);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Example response:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"isError": false,
|
|
147
|
+
"message": "",
|
|
148
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Description": "example string", "LeagueType": { }, "CompetitionType": { }, "MinScore": 1, "MaxScore": 1, "MaxPlayers": 1, "CurrentPlayers": 1, "IsActive": true, "CreatedAt": "2026-01-01T00:00:00Z", "SeasonStart": "2026-01-01T00:00:00Z", "SeasonEnd": "2026-01-01T00:00:00Z", "SeasonType": { }, "Rewards": [{ "Type": "example string", "Name": "example string", "Description": "example string", "Value": 1, "ItemId": "example string", "Properties": { "<string>": {} } }], "Requirements": { "<string>": {} }, "Metadata": { "<string>": {} } }]
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### `getAvatarLeague`
|
|
155
|
+
|
|
156
|
+
Get avatar's league by ID
|
|
157
|
+
|
|
158
|
+
**GET** `api/competition/league/{avatarId}/{competitionType}/{seasonType}`
|
|
159
|
+
|
|
160
|
+
Route parameters:
|
|
161
|
+
|
|
162
|
+
| Field | Type |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| `avatarId` | `Guid` |
|
|
165
|
+
| `competitionType` | `CompetitionType` |
|
|
166
|
+
| `seasonType` | `SeasonType` |
|
|
167
|
+
|
|
168
|
+
**Request**
|
|
169
|
+
|
|
170
|
+
No request body.
|
|
171
|
+
|
|
172
|
+
**Response**
|
|
173
|
+
|
|
174
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
175
|
+
|
|
176
|
+
`result` type: `League`
|
|
177
|
+
|
|
178
|
+
| Field | Type |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| `Id` | `Guid` |
|
|
181
|
+
| `Name` | `string` |
|
|
182
|
+
| `Description` | `string` |
|
|
183
|
+
| `LeagueType` | `LeagueType` |
|
|
184
|
+
| `CompetitionType` | `CompetitionType` |
|
|
185
|
+
| `MinScore` | `long` |
|
|
186
|
+
| `MaxScore` | `long` |
|
|
187
|
+
| `MaxPlayers` | `int` |
|
|
188
|
+
| `CurrentPlayers` | `int` |
|
|
189
|
+
| `IsActive` | `bool` |
|
|
190
|
+
| `CreatedAt` | `DateTime` |
|
|
191
|
+
| `SeasonStart` | `DateTime?` |
|
|
192
|
+
| `SeasonEnd` | `DateTime?` |
|
|
193
|
+
| `SeasonType` | `SeasonType` |
|
|
194
|
+
| `Rewards` | `List<LeagueReward>` |
|
|
195
|
+
| `Requirements` | `Dictionary<string, object>` |
|
|
196
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
197
|
+
|
|
198
|
+
**Example**
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
const { isError, message, result } = await oasis.competition.getAvatarLeague({
|
|
202
|
+
avatarId: '<avatarId>',
|
|
203
|
+
competitionType: '<competitionType>',
|
|
204
|
+
seasonType: '<seasonType>'
|
|
205
|
+
});
|
|
206
|
+
if (isError) throw new Error(message);
|
|
207
|
+
console.log(result);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Example response:
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"isError": false,
|
|
215
|
+
"message": "",
|
|
216
|
+
"result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Description": "example string", "LeagueType": { }, "CompetitionType": { }, "MinScore": 1, "MaxScore": 1, "MaxPlayers": 1, "CurrentPlayers": 1, "IsActive": true, "CreatedAt": "2026-01-01T00:00:00Z", "SeasonStart": "2026-01-01T00:00:00Z", "SeasonEnd": "2026-01-01T00:00:00Z", "SeasonType": { }, "Rewards": [{ "Type": "example string", "Name": "example string", "Description": "example string", "Value": 1, "ItemId": "example string", "Properties": { "<string>": {} } }], "Requirements": { "<string>": {} }, "Metadata": { "<string>": {} } }
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### `getAvatarRank`
|
|
223
|
+
|
|
224
|
+
Get avatar's rank by ID in a specific competition
|
|
225
|
+
|
|
226
|
+
**GET** `api/competition/rank/{avatarId}/{competitionType}/{seasonType}`
|
|
227
|
+
|
|
228
|
+
Route parameters:
|
|
229
|
+
|
|
230
|
+
| Field | Type |
|
|
231
|
+
| --- | --- |
|
|
232
|
+
| `avatarId` | `Guid` |
|
|
233
|
+
| `competitionType` | `CompetitionType` |
|
|
234
|
+
| `seasonType` | `SeasonType` |
|
|
235
|
+
|
|
236
|
+
**Request**
|
|
237
|
+
|
|
238
|
+
No request body.
|
|
239
|
+
|
|
240
|
+
**Response**
|
|
241
|
+
|
|
242
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
243
|
+
|
|
244
|
+
`result` type: `LeaderboardEntry`
|
|
245
|
+
|
|
246
|
+
| Field | Type |
|
|
247
|
+
| --- | --- |
|
|
248
|
+
| `Id` | `Guid` |
|
|
249
|
+
| `AvatarId` | `Guid` |
|
|
250
|
+
| `AvatarName` | `string` |
|
|
251
|
+
| `AvatarUsername` | `string` |
|
|
252
|
+
| `CompetitionType` | `CompetitionType` |
|
|
253
|
+
| `Score` | `long` |
|
|
254
|
+
| `Rank` | `int` |
|
|
255
|
+
| `PreviousRank` | `int` |
|
|
256
|
+
| `RankChange` | `int` |
|
|
257
|
+
| `LastUpdated` | `DateTime` |
|
|
258
|
+
| `SeasonStart` | `DateTime` |
|
|
259
|
+
| `SeasonEnd` | `DateTime` |
|
|
260
|
+
| `SeasonType` | `SeasonType` |
|
|
261
|
+
| `CurrentLeague` | `LeagueType` |
|
|
262
|
+
| `PreviousLeague` | `LeagueType` |
|
|
263
|
+
| `LeaguePromoted` | `bool` |
|
|
264
|
+
| `LeagueDemoted` | `bool` |
|
|
265
|
+
| `Stats` | `Dictionary<string, object>` |
|
|
266
|
+
| `Achievements` | `Dictionary<string, object>` |
|
|
267
|
+
| `Badges` | `List<string>` |
|
|
268
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
269
|
+
|
|
270
|
+
**Example**
|
|
271
|
+
|
|
272
|
+
```js
|
|
273
|
+
const { isError, message, result } = await oasis.competition.getAvatarRank({
|
|
274
|
+
avatarId: '<avatarId>',
|
|
275
|
+
competitionType: '<competitionType>',
|
|
276
|
+
seasonType: '<seasonType>'
|
|
277
|
+
});
|
|
278
|
+
if (isError) throw new Error(message);
|
|
279
|
+
console.log(result);
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Example response:
|
|
283
|
+
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"isError": false,
|
|
287
|
+
"message": "",
|
|
288
|
+
"result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarName": "example string", "AvatarUsername": "example string", "CompetitionType": { }, "Score": 1, "Rank": 1, "PreviousRank": 1, "RankChange": 1, "LastUpdated": "2026-01-01T00:00:00Z", "SeasonStart": "2026-01-01T00:00:00Z", "SeasonEnd": "2026-01-01T00:00:00Z", "SeasonType": { }, "CurrentLeague": { }, "PreviousLeague": {}, "LeaguePromoted": true, "LeagueDemoted": true, "Stats": { "<string>": {} }, "Achievements": { "<string>": {} }, "Badges": ["example string"], "Metadata": { "<string>": {} } }
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
### `getLeaderboard`
|
|
295
|
+
|
|
296
|
+
Get leaderboard for a specific competition type and season
|
|
297
|
+
|
|
298
|
+
**GET** `api/competition/leaderboard/{competitionType}/{seasonType}`
|
|
299
|
+
|
|
300
|
+
Route parameters:
|
|
301
|
+
|
|
302
|
+
| Field | Type |
|
|
303
|
+
| --- | --- |
|
|
304
|
+
| `competitionType` | `CompetitionType` |
|
|
305
|
+
| `seasonType` | `SeasonType` |
|
|
306
|
+
|
|
307
|
+
**Request**
|
|
308
|
+
|
|
309
|
+
Query parameters:
|
|
310
|
+
|
|
311
|
+
| Field | Type |
|
|
312
|
+
| --- | --- |
|
|
313
|
+
| `limit` | `int (optional)` |
|
|
314
|
+
| `offset` | `int (optional)` |
|
|
315
|
+
|
|
316
|
+
**Response**
|
|
317
|
+
|
|
318
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
319
|
+
|
|
320
|
+
`result` type: `LeaderboardEntry` (array)
|
|
321
|
+
|
|
322
|
+
| Field | Type |
|
|
323
|
+
| --- | --- |
|
|
324
|
+
| `Id` | `Guid` |
|
|
325
|
+
| `AvatarId` | `Guid` |
|
|
326
|
+
| `AvatarName` | `string` |
|
|
327
|
+
| `AvatarUsername` | `string` |
|
|
328
|
+
| `CompetitionType` | `CompetitionType` |
|
|
329
|
+
| `Score` | `long` |
|
|
330
|
+
| `Rank` | `int` |
|
|
331
|
+
| `PreviousRank` | `int` |
|
|
332
|
+
| `RankChange` | `int` |
|
|
333
|
+
| `LastUpdated` | `DateTime` |
|
|
334
|
+
| `SeasonStart` | `DateTime` |
|
|
335
|
+
| `SeasonEnd` | `DateTime` |
|
|
336
|
+
| `SeasonType` | `SeasonType` |
|
|
337
|
+
| `CurrentLeague` | `LeagueType` |
|
|
338
|
+
| `PreviousLeague` | `LeagueType` |
|
|
339
|
+
| `LeaguePromoted` | `bool` |
|
|
340
|
+
| `LeagueDemoted` | `bool` |
|
|
341
|
+
| `Stats` | `Dictionary<string, object>` |
|
|
342
|
+
| `Achievements` | `Dictionary<string, object>` |
|
|
343
|
+
| `Badges` | `List<string>` |
|
|
344
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
345
|
+
|
|
346
|
+
**Example**
|
|
347
|
+
|
|
348
|
+
```js
|
|
349
|
+
const { isError, message, result } = await oasis.competition.getLeaderboard({
|
|
350
|
+
competitionType: '<competitionType>',
|
|
351
|
+
seasonType: '<seasonType>',
|
|
352
|
+
limit: 1,
|
|
353
|
+
offset: 1
|
|
354
|
+
});
|
|
355
|
+
if (isError) throw new Error(message);
|
|
356
|
+
console.log(result);
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Example response:
|
|
360
|
+
|
|
361
|
+
```json
|
|
362
|
+
{
|
|
363
|
+
"isError": false,
|
|
364
|
+
"message": "",
|
|
365
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarName": "example string", "AvatarUsername": "example string", "CompetitionType": { }, "Score": 1, "Rank": 1, "PreviousRank": 1, "RankChange": 1, "LastUpdated": "2026-01-01T00:00:00Z", "SeasonStart": "2026-01-01T00:00:00Z", "SeasonEnd": "2026-01-01T00:00:00Z", "SeasonType": { }, "CurrentLeague": { }, "PreviousLeague": {}, "LeaguePromoted": true, "LeagueDemoted": true, "Stats": { "<string>": {} }, "Achievements": { "<string>": {} }, "Badges": ["example string"], "Metadata": { "<string>": {} } }]
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
### `getMyLeague`
|
|
372
|
+
|
|
373
|
+
Get current avatar's league
|
|
374
|
+
|
|
375
|
+
**GET** `api/competition/my-league/{competitionType}/{seasonType}`
|
|
376
|
+
|
|
377
|
+
Route parameters:
|
|
378
|
+
|
|
379
|
+
| Field | Type |
|
|
380
|
+
| --- | --- |
|
|
381
|
+
| `competitionType` | `CompetitionType` |
|
|
382
|
+
| `seasonType` | `SeasonType` |
|
|
383
|
+
|
|
384
|
+
**Request**
|
|
385
|
+
|
|
386
|
+
No request body.
|
|
387
|
+
|
|
388
|
+
**Response**
|
|
389
|
+
|
|
390
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
391
|
+
|
|
392
|
+
`result` type: `League`
|
|
393
|
+
|
|
394
|
+
| Field | Type |
|
|
395
|
+
| --- | --- |
|
|
396
|
+
| `Id` | `Guid` |
|
|
397
|
+
| `Name` | `string` |
|
|
398
|
+
| `Description` | `string` |
|
|
399
|
+
| `LeagueType` | `LeagueType` |
|
|
400
|
+
| `CompetitionType` | `CompetitionType` |
|
|
401
|
+
| `MinScore` | `long` |
|
|
402
|
+
| `MaxScore` | `long` |
|
|
403
|
+
| `MaxPlayers` | `int` |
|
|
404
|
+
| `CurrentPlayers` | `int` |
|
|
405
|
+
| `IsActive` | `bool` |
|
|
406
|
+
| `CreatedAt` | `DateTime` |
|
|
407
|
+
| `SeasonStart` | `DateTime?` |
|
|
408
|
+
| `SeasonEnd` | `DateTime?` |
|
|
409
|
+
| `SeasonType` | `SeasonType` |
|
|
410
|
+
| `Rewards` | `List<LeagueReward>` |
|
|
411
|
+
| `Requirements` | `Dictionary<string, object>` |
|
|
412
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
413
|
+
|
|
414
|
+
**Example**
|
|
415
|
+
|
|
416
|
+
```js
|
|
417
|
+
const { isError, message, result } = await oasis.competition.getMyLeague({
|
|
418
|
+
competitionType: '<competitionType>',
|
|
419
|
+
seasonType: '<seasonType>'
|
|
420
|
+
});
|
|
421
|
+
if (isError) throw new Error(message);
|
|
422
|
+
console.log(result);
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Example response:
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"isError": false,
|
|
430
|
+
"message": "",
|
|
431
|
+
"result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Description": "example string", "LeagueType": { }, "CompetitionType": { }, "MinScore": 1, "MaxScore": 1, "MaxPlayers": 1, "CurrentPlayers": 1, "IsActive": true, "CreatedAt": "2026-01-01T00:00:00Z", "SeasonStart": "2026-01-01T00:00:00Z", "SeasonEnd": "2026-01-01T00:00:00Z", "SeasonType": { }, "Rewards": [{ "Type": "example string", "Name": "example string", "Description": "example string", "Value": 1, "ItemId": "example string", "Properties": { "<string>": {} } }], "Requirements": { "<string>": {} }, "Metadata": { "<string>": {} } }
|
|
432
|
+
}
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
### `getMyRank`
|
|
438
|
+
|
|
439
|
+
Get current avatar's rank in a specific competition
|
|
440
|
+
|
|
441
|
+
**GET** `api/competition/my-rank/{competitionType}/{seasonType}`
|
|
442
|
+
|
|
443
|
+
Route parameters:
|
|
444
|
+
|
|
445
|
+
| Field | Type |
|
|
446
|
+
| --- | --- |
|
|
447
|
+
| `competitionType` | `CompetitionType` |
|
|
448
|
+
| `seasonType` | `SeasonType` |
|
|
449
|
+
|
|
450
|
+
**Request**
|
|
451
|
+
|
|
452
|
+
No request body.
|
|
453
|
+
|
|
454
|
+
**Response**
|
|
455
|
+
|
|
456
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
457
|
+
|
|
458
|
+
`result` type: `LeaderboardEntry`
|
|
459
|
+
|
|
460
|
+
| Field | Type |
|
|
461
|
+
| --- | --- |
|
|
462
|
+
| `Id` | `Guid` |
|
|
463
|
+
| `AvatarId` | `Guid` |
|
|
464
|
+
| `AvatarName` | `string` |
|
|
465
|
+
| `AvatarUsername` | `string` |
|
|
466
|
+
| `CompetitionType` | `CompetitionType` |
|
|
467
|
+
| `Score` | `long` |
|
|
468
|
+
| `Rank` | `int` |
|
|
469
|
+
| `PreviousRank` | `int` |
|
|
470
|
+
| `RankChange` | `int` |
|
|
471
|
+
| `LastUpdated` | `DateTime` |
|
|
472
|
+
| `SeasonStart` | `DateTime` |
|
|
473
|
+
| `SeasonEnd` | `DateTime` |
|
|
474
|
+
| `SeasonType` | `SeasonType` |
|
|
475
|
+
| `CurrentLeague` | `LeagueType` |
|
|
476
|
+
| `PreviousLeague` | `LeagueType` |
|
|
477
|
+
| `LeaguePromoted` | `bool` |
|
|
478
|
+
| `LeagueDemoted` | `bool` |
|
|
479
|
+
| `Stats` | `Dictionary<string, object>` |
|
|
480
|
+
| `Achievements` | `Dictionary<string, object>` |
|
|
481
|
+
| `Badges` | `List<string>` |
|
|
482
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
483
|
+
|
|
484
|
+
**Example**
|
|
485
|
+
|
|
486
|
+
```js
|
|
487
|
+
const { isError, message, result } = await oasis.competition.getMyRank({
|
|
488
|
+
competitionType: '<competitionType>',
|
|
489
|
+
seasonType: '<seasonType>'
|
|
490
|
+
});
|
|
491
|
+
if (isError) throw new Error(message);
|
|
492
|
+
console.log(result);
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
Example response:
|
|
496
|
+
|
|
497
|
+
```json
|
|
498
|
+
{
|
|
499
|
+
"isError": false,
|
|
500
|
+
"message": "",
|
|
501
|
+
"result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarName": "example string", "AvatarUsername": "example string", "CompetitionType": { }, "Score": 1, "Rank": 1, "PreviousRank": 1, "RankChange": 1, "LastUpdated": "2026-01-01T00:00:00Z", "SeasonStart": "2026-01-01T00:00:00Z", "SeasonEnd": "2026-01-01T00:00:00Z", "SeasonType": { }, "CurrentLeague": { }, "PreviousLeague": {}, "LeaguePromoted": true, "LeagueDemoted": true, "Stats": { "<string>": {} }, "Achievements": { "<string>": {} }, "Badges": ["example string"], "Metadata": { "<string>": {} } }
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
### `getMyStats`
|
|
508
|
+
|
|
509
|
+
Get competition statistics for the current avatar
|
|
510
|
+
|
|
511
|
+
**GET** `api/competition/stats/{competitionType}/{seasonType}`
|
|
512
|
+
|
|
513
|
+
Route parameters:
|
|
514
|
+
|
|
515
|
+
| Field | Type |
|
|
516
|
+
| --- | --- |
|
|
517
|
+
| `competitionType` | `CompetitionType` |
|
|
518
|
+
| `seasonType` | `SeasonType` |
|
|
519
|
+
|
|
520
|
+
**Request**
|
|
521
|
+
|
|
522
|
+
No request body.
|
|
523
|
+
|
|
524
|
+
**Response**
|
|
525
|
+
|
|
526
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
527
|
+
|
|
528
|
+
`result` type: `Dictionary<string, object>` - a key/value map keyed by `string`, each value a `object`.
|
|
529
|
+
|
|
530
|
+
**Example**
|
|
531
|
+
|
|
532
|
+
```js
|
|
533
|
+
const { isError, message, result } = await oasis.competition.getMyStats({
|
|
534
|
+
competitionType: '<competitionType>',
|
|
535
|
+
seasonType: '<seasonType>'
|
|
536
|
+
});
|
|
537
|
+
if (isError) throw new Error(message);
|
|
538
|
+
console.log(result);
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
Example response:
|
|
542
|
+
|
|
543
|
+
```json
|
|
544
|
+
{
|
|
545
|
+
"isError": false,
|
|
546
|
+
"message": "",
|
|
547
|
+
"result": { "<string>": {} }
|
|
548
|
+
}
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
### `joinTournament`
|
|
554
|
+
|
|
555
|
+
Join a tournament
|
|
556
|
+
|
|
557
|
+
**POST** `api/competition/tournaments/{tournamentId}/join`
|
|
558
|
+
|
|
559
|
+
Route parameters:
|
|
560
|
+
|
|
561
|
+
| Field | Type |
|
|
562
|
+
| --- | --- |
|
|
563
|
+
| `tournamentId` | `Guid` |
|
|
564
|
+
|
|
565
|
+
**Request**
|
|
566
|
+
|
|
567
|
+
No request body.
|
|
568
|
+
|
|
569
|
+
**Response**
|
|
570
|
+
|
|
571
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
572
|
+
|
|
573
|
+
`result` type: `bool`
|
|
574
|
+
|
|
575
|
+
**Example**
|
|
576
|
+
|
|
577
|
+
```js
|
|
578
|
+
const { isError, message, result } = await oasis.competition.joinTournament({
|
|
579
|
+
tournamentId: '<tournamentId>'
|
|
580
|
+
});
|
|
581
|
+
if (isError) throw new Error(message);
|
|
582
|
+
console.log(result);
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
Example response:
|
|
586
|
+
|
|
587
|
+
```json
|
|
588
|
+
{
|
|
589
|
+
"isError": false,
|
|
590
|
+
"message": "",
|
|
591
|
+
"result": true
|
|
592
|
+
}
|
|
593
|
+
```
|
|
594
|
+
|