bitbadgesjs-sdk 0.3.14 → 0.3.16
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/dist/address-converter/converter.d.ts +1 -1
- package/dist/api-indexer/BitBadgesAddressList.d.ts +18 -18
- package/dist/api-indexer/BitBadgesAddressList.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesAddressList.js +13 -13
- package/dist/api-indexer/BitBadgesAddressList.js.map +1 -1
- package/dist/api-indexer/BitBadgesApi.d.ts +61 -56
- package/dist/api-indexer/BitBadgesApi.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesApi.js +179 -133
- package/dist/api-indexer/BitBadgesApi.js.map +1 -1
- package/dist/api-indexer/BitBadgesCollection.d.ts +20 -20
- package/dist/api-indexer/BitBadgesCollection.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesCollection.js +21 -21
- package/dist/api-indexer/BitBadgesCollection.js.map +1 -1
- package/dist/api-indexer/BitBadgesUserInfo.d.ts +14 -14
- package/dist/api-indexer/BitBadgesUserInfo.d.ts.map +1 -1
- package/dist/api-indexer/BitBadgesUserInfo.js +12 -12
- package/dist/api-indexer/BitBadgesUserInfo.js.map +1 -1
- package/dist/api-indexer/docs/docs.d.ts +64 -8
- package/dist/api-indexer/docs/docs.d.ts.map +1 -1
- package/dist/api-indexer/docs/docs.js +76 -11
- package/dist/api-indexer/docs/docs.js.map +1 -1
- package/dist/api-indexer/docs/interfaces.d.ts +73 -31
- package/dist/api-indexer/docs/interfaces.d.ts.map +1 -1
- package/dist/api-indexer/docs/interfaces.js +9 -0
- package/dist/api-indexer/docs/interfaces.js.map +1 -1
- package/dist/api-indexer/requests/collections.d.ts +35 -35
- package/dist/api-indexer/requests/collections.d.ts.map +1 -1
- package/dist/api-indexer/requests/collections.js +20 -20
- package/dist/api-indexer/requests/collections.js.map +1 -1
- package/dist/api-indexer/requests/maps.d.ts +5 -5
- package/dist/api-indexer/requests/maps.d.ts.map +1 -1
- package/dist/api-indexer/requests/maps.js +3 -3
- package/dist/api-indexer/requests/maps.js.map +1 -1
- package/dist/api-indexer/requests/requests.d.ts +242 -151
- package/dist/api-indexer/requests/requests.d.ts.map +1 -1
- package/dist/api-indexer/requests/requests.js +112 -75
- package/dist/api-indexer/requests/requests.js.map +1 -1
- package/dist/api-indexer/requests/routes.d.ts +11 -3
- package/dist/api-indexer/requests/routes.d.ts.map +1 -1
- package/dist/api-indexer/requests/routes.js +10 -3
- package/dist/api-indexer/requests/routes.js.map +1 -1
- package/dist/core/approvals.d.ts +1 -0
- package/dist/core/approvals.d.ts.map +1 -1
- package/dist/core/approvals.js.map +1 -1
- package/dist/core/blockin.d.ts +7 -7
- package/dist/core/blockin.d.ts.map +1 -1
- package/dist/core/blockin.js +11 -11
- package/dist/core/blockin.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -19,149 +19,147 @@ class BitBadgesAPI extends base_1.BaseBitBadgesApi {
|
|
|
19
19
|
async getStatus() {
|
|
20
20
|
try {
|
|
21
21
|
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetStatusRoute()}`);
|
|
22
|
-
return new requests_1.
|
|
22
|
+
return new requests_1.GetStatusSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
23
23
|
}
|
|
24
24
|
catch (error) {
|
|
25
25
|
await this.handleApiError(error);
|
|
26
26
|
return Promise.reject(error);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
async getSearchResults(searchValue,
|
|
29
|
+
async getSearchResults(searchValue, body) {
|
|
30
30
|
try {
|
|
31
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetSearchRoute(searchValue)}`,
|
|
32
|
-
return new requests_1.
|
|
31
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetSearchRoute(searchValue)}`, body);
|
|
32
|
+
return new requests_1.GetSearchSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
35
|
await this.handleApiError(error);
|
|
36
36
|
return Promise.reject(error);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async getCollections(
|
|
40
|
-
return await BitBadgesCollection_1.BitBadgesCollection.GetCollections(this,
|
|
39
|
+
async getCollections(body) {
|
|
40
|
+
return await BitBadgesCollection_1.BitBadgesCollection.GetCollections(this, body);
|
|
41
41
|
}
|
|
42
|
-
async getOwnersForBadge(collectionId, badgeId,
|
|
43
|
-
return await BitBadgesCollection_1.BitBadgesCollection.GetOwnersForBadge(this, collectionId, badgeId,
|
|
42
|
+
async getOwnersForBadge(collectionId, badgeId, body) {
|
|
43
|
+
return await BitBadgesCollection_1.BitBadgesCollection.GetOwnersForBadge(this, collectionId, badgeId, body);
|
|
44
44
|
}
|
|
45
|
-
async getBadgeBalanceByAddress(collectionId, address,
|
|
46
|
-
return await BitBadgesCollection_1.BitBadgesCollection.GetBadgeBalanceByAddress(this, collectionId, address,
|
|
45
|
+
async getBadgeBalanceByAddress(collectionId, address, body) {
|
|
46
|
+
return await BitBadgesCollection_1.BitBadgesCollection.GetBadgeBalanceByAddress(this, collectionId, address, body);
|
|
47
47
|
}
|
|
48
|
-
async getBadgeActivity(collectionId, badgeId,
|
|
49
|
-
return await BitBadgesCollection_1.BitBadgesCollection.GetBadgeActivity(this, collectionId, badgeId,
|
|
48
|
+
async getBadgeActivity(collectionId, badgeId, body) {
|
|
49
|
+
return await BitBadgesCollection_1.BitBadgesCollection.GetBadgeActivity(this, collectionId, badgeId, body);
|
|
50
50
|
}
|
|
51
|
-
async refreshMetadata(collectionId,
|
|
52
|
-
return await BitBadgesCollection_1.BitBadgesCollection.RefreshMetadata(this, collectionId,
|
|
51
|
+
async refreshMetadata(collectionId, body) {
|
|
52
|
+
return await BitBadgesCollection_1.BitBadgesCollection.RefreshMetadata(this, collectionId, body);
|
|
53
53
|
}
|
|
54
|
-
async
|
|
54
|
+
async completeClaim(claimId, cosmosAddress, body) {
|
|
55
55
|
try {
|
|
56
56
|
if (!claimId) {
|
|
57
57
|
throw new Error('claimId is required');
|
|
58
58
|
}
|
|
59
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
60
|
-
return new requests_1.
|
|
59
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CompleteClaimRoute(claimId, cosmosAddress)}`, body);
|
|
60
|
+
return new requests_1.CompleteClaimSuccessResponse(response.data);
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
63
63
|
await this.handleApiError(error);
|
|
64
64
|
return Promise.reject(error);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
async deleteReview(reviewId,
|
|
67
|
+
async deleteReview(reviewId, body) {
|
|
68
68
|
try {
|
|
69
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.DeleteReviewRoute(reviewId)}`,
|
|
70
|
-
return new requests_1.
|
|
69
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.DeleteReviewRoute(reviewId)}`, body);
|
|
70
|
+
return new requests_1.DeleteReviewSuccessResponse(response.data);
|
|
71
71
|
}
|
|
72
72
|
catch (error) {
|
|
73
73
|
await this.handleApiError(error);
|
|
74
74
|
return Promise.reject(error);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
async addReview(
|
|
77
|
+
async addReview(body) {
|
|
78
78
|
try {
|
|
79
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddReviewRoute()}`,
|
|
80
|
-
return new requests_1.
|
|
79
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddReviewRoute()}`, body);
|
|
80
|
+
return new requests_1.AddReviewSuccessResponse(response.data);
|
|
81
81
|
}
|
|
82
82
|
catch (error) {
|
|
83
83
|
await this.handleApiError(error);
|
|
84
84
|
return Promise.reject(error);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
async getAccounts(
|
|
88
|
-
return await BitBadgesUserInfo_1.BitBadgesUserInfo.GetAccounts(this,
|
|
87
|
+
async getAccounts(body) {
|
|
88
|
+
return await BitBadgesUserInfo_1.BitBadgesUserInfo.GetAccounts(this, body);
|
|
89
89
|
}
|
|
90
|
-
async updateAccountInfo(
|
|
90
|
+
async updateAccountInfo(body) {
|
|
91
91
|
try {
|
|
92
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.UpdateAccountInfoRoute()}`,
|
|
93
|
-
return new requests_1.
|
|
92
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.UpdateAccountInfoRoute()}`, body);
|
|
93
|
+
return new requests_1.UpdateAccountInfoSuccessResponse(response.data);
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
96
96
|
await this.handleApiError(error);
|
|
97
97
|
return Promise.reject(error);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
async addBalancesToOffChainStorage(
|
|
100
|
+
async addBalancesToOffChainStorage(body) {
|
|
101
101
|
try {
|
|
102
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddBalancesToOffChainStorageRoute()}`,
|
|
103
|
-
return new requests_1.
|
|
102
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddBalancesToOffChainStorageRoute()}`, body);
|
|
103
|
+
return new requests_1.AddBalancesToOffChainStorageSuccessResponse(response.data);
|
|
104
104
|
}
|
|
105
105
|
catch (error) {
|
|
106
106
|
await this.handleApiError(error);
|
|
107
107
|
return Promise.reject(error);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
async
|
|
110
|
+
async addToIpfs(body) {
|
|
111
111
|
try {
|
|
112
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
113
|
-
return new requests_1.
|
|
112
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddToIpfsRoute()}`, body);
|
|
113
|
+
return new requests_1.AddToIpfsSuccessResponse(response.data);
|
|
114
114
|
}
|
|
115
115
|
catch (error) {
|
|
116
116
|
await this.handleApiError(error);
|
|
117
117
|
return Promise.reject(error);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
async addApprovalDetailsToOffChainStorage(
|
|
120
|
+
async addApprovalDetailsToOffChainStorage(body) {
|
|
121
121
|
try {
|
|
122
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddApprovalDetailsToOffChainStorageRoute()}`,
|
|
123
|
-
return new requests_1.
|
|
122
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.AddApprovalDetailsToOffChainStorageRoute()}`, body);
|
|
123
|
+
return new requests_1.AddApprovalDetailsToOffChainStorageSuccessResponse(response.data);
|
|
124
124
|
}
|
|
125
125
|
catch (error) {
|
|
126
126
|
await this.handleApiError(error);
|
|
127
127
|
return Promise.reject(error);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
async getSignInChallenge(
|
|
130
|
+
async getSignInChallenge(body) {
|
|
131
131
|
try {
|
|
132
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetSignInChallengeRoute()}`,
|
|
133
|
-
return new requests_1.
|
|
132
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetSignInChallengeRoute()}`, body);
|
|
133
|
+
return new requests_1.GetSignInChallengeSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
134
134
|
}
|
|
135
135
|
catch (error) {
|
|
136
136
|
await this.handleApiError(error);
|
|
137
137
|
return Promise.reject(error);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
async verifySignIn(
|
|
140
|
+
async verifySignIn(body) {
|
|
141
141
|
try {
|
|
142
|
-
const body = requestBody;
|
|
143
142
|
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.VerifySignInRoute()}`, body);
|
|
144
|
-
return new requests_1.
|
|
143
|
+
return new requests_1.VerifySignInSuccessResponse(response.data);
|
|
145
144
|
}
|
|
146
145
|
catch (error) {
|
|
147
146
|
await this.handleApiError(error);
|
|
148
147
|
return Promise.reject(error);
|
|
149
148
|
}
|
|
150
149
|
}
|
|
151
|
-
async checkIfSignedIn(
|
|
150
|
+
async checkIfSignedIn(body) {
|
|
152
151
|
try {
|
|
153
|
-
const body = requestBody;
|
|
154
152
|
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CheckIfSignedInRoute()}`, body);
|
|
155
|
-
return new requests_1.
|
|
153
|
+
return new requests_1.CheckSignInStatusSuccessResponse(response.data);
|
|
156
154
|
}
|
|
157
155
|
catch (error) {
|
|
158
156
|
await this.handleApiError(error);
|
|
159
157
|
return Promise.reject(error);
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
|
-
async signOut(
|
|
160
|
+
async signOut(body) {
|
|
163
161
|
try {
|
|
164
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.SignOutRoute()}`,
|
|
162
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.SignOutRoute()}`, body);
|
|
165
163
|
return new requests_1.SignOutSuccessResponse(response.data);
|
|
166
164
|
}
|
|
167
165
|
catch (error) {
|
|
@@ -169,141 +167,149 @@ class BitBadgesAPI extends base_1.BaseBitBadgesApi {
|
|
|
169
167
|
return Promise.reject(error);
|
|
170
168
|
}
|
|
171
169
|
}
|
|
172
|
-
async getBrowseCollections(
|
|
170
|
+
async getBrowseCollections(body) {
|
|
173
171
|
try {
|
|
174
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetBrowseCollectionsRoute()}`,
|
|
175
|
-
return new requests_1.
|
|
172
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetBrowseCollectionsRoute()}`, body);
|
|
173
|
+
return new requests_1.GetBrowseCollectionsSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
176
174
|
}
|
|
177
175
|
catch (error) {
|
|
178
176
|
await this.handleApiError(error);
|
|
179
177
|
return Promise.reject(error);
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
|
-
async broadcastTx(
|
|
180
|
+
async broadcastTx(body) {
|
|
183
181
|
try {
|
|
184
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.BroadcastTxRoute()}`,
|
|
185
|
-
return new requests_1.
|
|
182
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.BroadcastTxRoute()}`, body);
|
|
183
|
+
return new requests_1.BroadcastTxSuccessResponse(response.data);
|
|
186
184
|
}
|
|
187
185
|
catch (error) {
|
|
188
186
|
await this.handleApiError(error);
|
|
189
187
|
return Promise.reject(error);
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
|
-
async simulateTx(
|
|
190
|
+
async simulateTx(body) {
|
|
193
191
|
try {
|
|
194
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.SimulateTxRoute()}`,
|
|
195
|
-
return new requests_1.
|
|
192
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.SimulateTxRoute()}`, body);
|
|
193
|
+
return new requests_1.SimulateTxSuccessResponse(response.data);
|
|
196
194
|
}
|
|
197
195
|
catch (error) {
|
|
198
196
|
await this.handleApiError(error);
|
|
199
197
|
return Promise.reject(error);
|
|
200
198
|
}
|
|
201
199
|
}
|
|
202
|
-
async fetchMetadataDirectly(
|
|
200
|
+
async fetchMetadataDirectly(body) {
|
|
203
201
|
try {
|
|
204
|
-
const error =
|
|
202
|
+
const error = body.uris.find((uri) => joi_1.default.string().uri().required().validate(uri).error);
|
|
205
203
|
if (error) {
|
|
206
204
|
throw `Invalid URIs`;
|
|
207
205
|
}
|
|
208
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.FetchMetadataDirectlyRoute()}`,
|
|
209
|
-
return new requests_1.
|
|
206
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.FetchMetadataDirectlyRoute()}`, body);
|
|
207
|
+
return new requests_1.FetchMetadataDirectlySuccessResponse(response.data).convert(this.ConvertFunction);
|
|
210
208
|
}
|
|
211
209
|
catch (error) {
|
|
212
210
|
await this.handleApiError(error);
|
|
213
211
|
return Promise.reject(error);
|
|
214
212
|
}
|
|
215
213
|
}
|
|
216
|
-
async getTokensFromFaucet(
|
|
214
|
+
async getTokensFromFaucet(body) {
|
|
217
215
|
try {
|
|
218
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetTokensFromFaucetRoute()}`,
|
|
219
|
-
return new requests_1.
|
|
216
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetTokensFromFaucetRoute()}`, body);
|
|
217
|
+
return new requests_1.GetTokensFromFaucetSuccessResponse(response.data);
|
|
220
218
|
}
|
|
221
219
|
catch (error) {
|
|
222
220
|
await this.handleApiError(error);
|
|
223
221
|
return Promise.reject(error);
|
|
224
222
|
}
|
|
225
223
|
}
|
|
226
|
-
async createAddressLists(
|
|
227
|
-
return await BitBadgesAddressList_1.BitBadgesAddressList.CreateAddressList(this,
|
|
224
|
+
async createAddressLists(body) {
|
|
225
|
+
return await BitBadgesAddressList_1.BitBadgesAddressList.CreateAddressList(this, body);
|
|
228
226
|
}
|
|
229
|
-
async updateAddressLists(
|
|
230
|
-
return await BitBadgesAddressList_1.BitBadgesAddressList.UpdateAddressList(this,
|
|
227
|
+
async updateAddressLists(body) {
|
|
228
|
+
return await BitBadgesAddressList_1.BitBadgesAddressList.UpdateAddressList(this, body);
|
|
231
229
|
}
|
|
232
|
-
async getAddressLists(
|
|
233
|
-
return await BitBadgesAddressList_1.BitBadgesAddressList.GetAddressLists(this,
|
|
230
|
+
async getAddressLists(body) {
|
|
231
|
+
return await BitBadgesAddressList_1.BitBadgesAddressList.GetAddressLists(this, body);
|
|
234
232
|
}
|
|
235
|
-
async deleteAddressLists(
|
|
236
|
-
return await BitBadgesAddressList_1.BitBadgesAddressList.DeleteAddressList(this,
|
|
233
|
+
async deleteAddressLists(body) {
|
|
234
|
+
return await BitBadgesAddressList_1.BitBadgesAddressList.DeleteAddressList(this, body);
|
|
237
235
|
}
|
|
238
|
-
async getAuthCode(
|
|
236
|
+
async getAuthCode(body) {
|
|
239
237
|
try {
|
|
240
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetAuthCodeRoute()}`,
|
|
241
|
-
return new requests_1.
|
|
238
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetAuthCodeRoute()}`, body);
|
|
239
|
+
return new requests_1.GetBlockinAuthCodeSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
242
240
|
}
|
|
243
241
|
catch (error) {
|
|
244
242
|
await this.handleApiError(error);
|
|
245
243
|
return Promise.reject(error);
|
|
246
244
|
}
|
|
247
245
|
}
|
|
248
|
-
async
|
|
246
|
+
async getAuthCodesForAuthApp(body) {
|
|
249
247
|
try {
|
|
250
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
251
|
-
return new requests_1.
|
|
248
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetAuthCodesForAuthAppRoute()}`, body);
|
|
249
|
+
return new requests_1.GetBlockinAuthCodesForAuthAppSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
252
250
|
}
|
|
253
251
|
catch (error) {
|
|
254
252
|
await this.handleApiError(error);
|
|
255
253
|
return Promise.reject(error);
|
|
256
254
|
}
|
|
257
255
|
}
|
|
258
|
-
async
|
|
256
|
+
async createAuthCode(body) {
|
|
259
257
|
try {
|
|
260
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
261
|
-
return new requests_1.
|
|
258
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CreateAuthCodeRoute()}`, body);
|
|
259
|
+
return new requests_1.CreateBlockinAuthCodeSuccessResponse(response.data);
|
|
262
260
|
}
|
|
263
261
|
catch (error) {
|
|
264
262
|
await this.handleApiError(error);
|
|
265
263
|
return Promise.reject(error);
|
|
266
264
|
}
|
|
267
265
|
}
|
|
268
|
-
async
|
|
266
|
+
async deleteAuthCode(body) {
|
|
267
|
+
try {
|
|
268
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.DeleteAuthCodeRoute()}`, body);
|
|
269
|
+
return new requests_1.DeleteBlockinAuthCodeSuccessResponse(response.data);
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
await this.handleApiError(error);
|
|
273
|
+
return Promise.reject(error);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
async verifySignInGeneric(body) {
|
|
269
277
|
try {
|
|
270
|
-
const body = requestBody;
|
|
271
278
|
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GenericVerifyRoute()}`, body);
|
|
272
|
-
return new requests_1.
|
|
279
|
+
return new requests_1.GenericBlockinVerifySuccessResponse(response.data);
|
|
273
280
|
}
|
|
274
281
|
catch (error) {
|
|
275
282
|
await this.handleApiError(error);
|
|
276
283
|
return Promise.reject(error);
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
|
-
async verifyAssetsGeneric(
|
|
286
|
+
async verifyAssetsGeneric(body) {
|
|
280
287
|
try {
|
|
281
|
-
const body = requestBody;
|
|
282
288
|
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GenericVerifyAssetsRoute()}`, body);
|
|
283
|
-
return new requests_1.
|
|
289
|
+
return new requests_1.GenericVerifyAssetsSuccessResponse(response.data);
|
|
284
290
|
}
|
|
285
291
|
catch (error) {
|
|
286
292
|
await this.handleApiError(error);
|
|
287
293
|
return Promise.reject(error);
|
|
288
294
|
}
|
|
289
295
|
}
|
|
290
|
-
async sendClaimAlert(
|
|
296
|
+
async sendClaimAlert(body) {
|
|
291
297
|
try {
|
|
292
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.SendClaimAlertRoute()}`,
|
|
293
|
-
return new requests_1.
|
|
298
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.SendClaimAlertRoute()}`, body);
|
|
299
|
+
return new requests_1.SendClaimAlertsSuccessResponse(response.data);
|
|
294
300
|
}
|
|
295
301
|
catch (error) {
|
|
296
302
|
await this.handleApiError(error);
|
|
297
303
|
return Promise.reject(error);
|
|
298
304
|
}
|
|
299
305
|
}
|
|
300
|
-
async getFollowDetails(
|
|
301
|
-
return await BitBadgesUserInfo_1.BitBadgesUserInfo.GetFollowDetails(this,
|
|
306
|
+
async getFollowDetails(body) {
|
|
307
|
+
return await BitBadgesUserInfo_1.BitBadgesUserInfo.GetFollowDetails(this, body);
|
|
302
308
|
}
|
|
303
|
-
async getClaimAlerts(
|
|
309
|
+
async getClaimAlerts(body) {
|
|
304
310
|
try {
|
|
305
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetClaimAlertsRoute()}`,
|
|
306
|
-
return new requests_1.
|
|
311
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetClaimAlertsRoute()}`, body);
|
|
312
|
+
return new requests_1.GetClaimAlertsForCollectionSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
307
313
|
}
|
|
308
314
|
catch (error) {
|
|
309
315
|
await this.handleApiError(error);
|
|
@@ -313,123 +319,163 @@ class BitBadgesAPI extends base_1.BaseBitBadgesApi {
|
|
|
313
319
|
async getRefreshStatus(collectionId) {
|
|
314
320
|
return await BitBadgesCollection_1.BitBadgesCollection.GetRefreshStatus(this, collectionId);
|
|
315
321
|
}
|
|
316
|
-
async getMaps(
|
|
322
|
+
async getMaps(body) {
|
|
323
|
+
try {
|
|
324
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetMapsRoute()}`, body);
|
|
325
|
+
return new maps_1.GetMapsSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
await this.handleApiError(error);
|
|
329
|
+
return Promise.reject(error);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
async filterBadgesInCollection(body) {
|
|
333
|
+
return await BitBadgesCollection_1.BitBadgesCollection.FilterBadgesInCollection(this, body);
|
|
334
|
+
}
|
|
335
|
+
async generateAppleWalletPass(body) {
|
|
317
336
|
try {
|
|
318
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
319
|
-
return new
|
|
337
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GenerateAppleWalletPassRoute()}`, body);
|
|
338
|
+
return new requests_1.GenerateAppleWalletPassSuccessResponse(response.data);
|
|
320
339
|
}
|
|
321
340
|
catch (error) {
|
|
322
341
|
await this.handleApiError(error);
|
|
323
342
|
return Promise.reject(error);
|
|
324
343
|
}
|
|
325
344
|
}
|
|
326
|
-
async
|
|
327
|
-
|
|
345
|
+
async getClaims(body) {
|
|
346
|
+
try {
|
|
347
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetClaimsRoute()}`, body);
|
|
348
|
+
return new requests_1.GetClaimsSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
await this.handleApiError(error);
|
|
352
|
+
return Promise.reject(error);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
async getSecret(body) {
|
|
356
|
+
try {
|
|
357
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetSecretRoute()}`, body);
|
|
358
|
+
return new requests_1.GetSecretSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
await this.handleApiError(error);
|
|
362
|
+
return Promise.reject(error);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
async createSecret(body) {
|
|
366
|
+
try {
|
|
367
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CreateSecretRoute()}`, body);
|
|
368
|
+
return new requests_1.CreateSecretSuccessResponse(response.data);
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
await this.handleApiError(error);
|
|
372
|
+
return Promise.reject(error);
|
|
373
|
+
}
|
|
328
374
|
}
|
|
329
|
-
async
|
|
375
|
+
async deleteSecret(body) {
|
|
330
376
|
try {
|
|
331
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
332
|
-
return new requests_1.
|
|
377
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.DeleteSecretRoute()}`, body);
|
|
378
|
+
return new requests_1.DeleteSecretSuccessResponse(response.data);
|
|
333
379
|
}
|
|
334
380
|
catch (error) {
|
|
335
381
|
await this.handleApiError(error);
|
|
336
382
|
return Promise.reject(error);
|
|
337
383
|
}
|
|
338
384
|
}
|
|
339
|
-
async
|
|
385
|
+
async updateSecret(body) {
|
|
340
386
|
try {
|
|
341
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
342
|
-
return new requests_1.
|
|
387
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.UpdateSecretRoute()}`, body);
|
|
388
|
+
return new requests_1.UpdateSecretSuccessResponse(response.data);
|
|
343
389
|
}
|
|
344
390
|
catch (error) {
|
|
345
391
|
await this.handleApiError(error);
|
|
346
392
|
return Promise.reject(error);
|
|
347
393
|
}
|
|
348
394
|
}
|
|
349
|
-
async
|
|
395
|
+
async getAuthApps(body) {
|
|
350
396
|
try {
|
|
351
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
352
|
-
return new requests_1.
|
|
397
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetAuthAppRoute()}`, body);
|
|
398
|
+
return new requests_1.GetAuthAppSuccessResponse(response.data);
|
|
353
399
|
}
|
|
354
400
|
catch (error) {
|
|
355
401
|
await this.handleApiError(error);
|
|
356
402
|
return Promise.reject(error);
|
|
357
403
|
}
|
|
358
404
|
}
|
|
359
|
-
async
|
|
405
|
+
async createAuthApp(body) {
|
|
360
406
|
try {
|
|
361
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
362
|
-
return new requests_1.
|
|
407
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CreateAuthAppRoute()}`, body);
|
|
408
|
+
return new requests_1.CreateAuthAppSuccessResponse(response.data);
|
|
363
409
|
}
|
|
364
410
|
catch (error) {
|
|
365
411
|
await this.handleApiError(error);
|
|
366
412
|
return Promise.reject(error);
|
|
367
413
|
}
|
|
368
414
|
}
|
|
369
|
-
async
|
|
415
|
+
async deleteAuthApp(body) {
|
|
370
416
|
try {
|
|
371
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
372
|
-
return new requests_1.
|
|
417
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.DeleteAuthAppRoute()}`, body);
|
|
418
|
+
return new requests_1.DeleteAuthAppSuccessResponse(response.data);
|
|
373
419
|
}
|
|
374
420
|
catch (error) {
|
|
375
421
|
await this.handleApiError(error);
|
|
376
422
|
return Promise.reject(error);
|
|
377
423
|
}
|
|
378
424
|
}
|
|
379
|
-
async
|
|
425
|
+
async updateAuthApp(body) {
|
|
380
426
|
try {
|
|
381
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
382
|
-
return new requests_1.
|
|
427
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.UpdateAuthAppRoute()}`, body);
|
|
428
|
+
return new requests_1.UpdateAuthAppSuccessResponse(response.data);
|
|
383
429
|
}
|
|
384
430
|
catch (error) {
|
|
385
431
|
await this.handleApiError(error);
|
|
386
432
|
return Promise.reject(error);
|
|
387
433
|
}
|
|
388
434
|
}
|
|
389
|
-
async
|
|
435
|
+
async getPlugins(body) {
|
|
390
436
|
try {
|
|
391
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
392
|
-
return new requests_1.
|
|
437
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.GetPluginRoute()}`, body);
|
|
438
|
+
return new requests_1.GetPluginSuccessResponse(response.data);
|
|
393
439
|
}
|
|
394
440
|
catch (error) {
|
|
395
441
|
await this.handleApiError(error);
|
|
396
442
|
return Promise.reject(error);
|
|
397
443
|
}
|
|
398
444
|
}
|
|
399
|
-
async
|
|
445
|
+
async createPlugin(body) {
|
|
400
446
|
try {
|
|
401
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
402
|
-
return new requests_1.
|
|
447
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CreatePluginRoute()}`, body);
|
|
448
|
+
return new requests_1.CreatePluginSuccessResponse(response.data);
|
|
403
449
|
}
|
|
404
450
|
catch (error) {
|
|
405
451
|
await this.handleApiError(error);
|
|
406
452
|
return Promise.reject(error);
|
|
407
453
|
}
|
|
408
454
|
}
|
|
409
|
-
async
|
|
455
|
+
async createClaim(body) {
|
|
410
456
|
try {
|
|
411
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
412
|
-
return new requests_1.
|
|
457
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.CreateClaimRoute()}`, body);
|
|
458
|
+
return new requests_1.CreateClaimSuccessResponse(response.data);
|
|
413
459
|
}
|
|
414
460
|
catch (error) {
|
|
415
461
|
await this.handleApiError(error);
|
|
416
462
|
return Promise.reject(error);
|
|
417
463
|
}
|
|
418
464
|
}
|
|
419
|
-
async
|
|
465
|
+
async deleteClaim(body) {
|
|
420
466
|
try {
|
|
421
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
422
|
-
return new requests_1.
|
|
467
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.DeleteClaimRoute()}`, body);
|
|
468
|
+
return new requests_1.DeleteClaimSuccessResponse(response.data);
|
|
423
469
|
}
|
|
424
470
|
catch (error) {
|
|
425
471
|
await this.handleApiError(error);
|
|
426
472
|
return Promise.reject(error);
|
|
427
473
|
}
|
|
428
474
|
}
|
|
429
|
-
async
|
|
475
|
+
async updateClaim(body) {
|
|
430
476
|
try {
|
|
431
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.
|
|
432
|
-
return new requests_1.
|
|
477
|
+
const response = await this.axios.post(`${this.BACKEND_URL}${routes_1.BitBadgesApiRoutes.UpdateClaimRoute()}`, body);
|
|
478
|
+
return new requests_1.UpdateClaimSuccessResponse(response.data);
|
|
433
479
|
}
|
|
434
480
|
catch (error) {
|
|
435
481
|
await this.handleApiError(error);
|