@rarible/api-client
Advanced tools
Comparing version 0.0.13-beta8 to 0.0.13-beta9
@@ -13,6 +13,9 @@ /** | ||
import * as runtime from '../runtime'; | ||
import { Ownership, Ownerships, UnionApiErrorBadRequest, UnionApiErrorEntityNotFound, UnionApiErrorServerError } from '../models'; | ||
import { Ownership, OwnershipIds, Ownerships, UnionApiErrorBadRequest, UnionApiErrorEntityNotFound, UnionApiErrorServerError } from '../models'; | ||
export interface GetOwnershipByIdRequest { | ||
ownershipId: string; | ||
} | ||
export interface GetOwnershipsByIdsRequest { | ||
ownershipIds: OwnershipIds; | ||
} | ||
export interface GetOwnershipsByItemRequest { | ||
@@ -36,2 +39,10 @@ itemId: string; | ||
/** | ||
* Returns Ownerships by Ids | ||
*/ | ||
getOwnershipsByIdsRaw(requestParameters: GetOwnershipsByIdsRequest): Promise<GetOwnershipsByIdsResponse>; | ||
/** | ||
* Returns Ownerships by Ids | ||
*/ | ||
getOwnershipsByIds(requestParameters: GetOwnershipsByIdsRequest): Promise<Ownerships>; | ||
/** | ||
* Returns ownerships by item | ||
@@ -62,2 +73,15 @@ */ | ||
export declare type GetOwnershipByIdResponse = GetOwnershipById200 | GetOwnershipById404 | GetOwnershipById400 | GetOwnershipById500; | ||
export declare type GetOwnershipsByIds200 = { | ||
status: 200; | ||
value: Ownerships; | ||
}; | ||
export declare type GetOwnershipsByIds400 = { | ||
status: 400; | ||
value: UnionApiErrorBadRequest; | ||
}; | ||
export declare type GetOwnershipsByIds500 = { | ||
status: 500; | ||
value: UnionApiErrorServerError; | ||
}; | ||
export declare type GetOwnershipsByIdsResponse = GetOwnershipsByIds200 | GetOwnershipsByIds400 | GetOwnershipsByIds500; | ||
export declare type GetOwnershipsByItem200 = { | ||
@@ -64,0 +88,0 @@ status: 200; |
@@ -175,2 +175,74 @@ "use strict"; | ||
/** | ||
* Returns Ownerships by Ids | ||
*/ | ||
OwnershipControllerApi.prototype.getOwnershipsByIdsRaw = function (requestParameters) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var queryParameters, headerParameters, response; | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: | ||
if (requestParameters.ownershipIds === null || requestParameters.ownershipIds === undefined) { | ||
throw new runtime.RequiredError('ownershipIds', 'Required parameter requestParameters.ownershipIds was null or undefined when calling getOwnershipsByIds.'); | ||
} | ||
queryParameters = {}; | ||
headerParameters = {}; | ||
headerParameters['Content-Type'] = 'application/json'; | ||
return [4 /*yield*/, this.request({ | ||
path: "/v0.1/ownerships/byIds", | ||
method: 'POST', | ||
headers: headerParameters, | ||
query: queryParameters, | ||
body: requestParameters.ownershipIds, | ||
})]; | ||
case 1: | ||
response = _d.sent(); | ||
if (!(response.status === 200)) return [3 /*break*/, 3]; | ||
_a = { | ||
status: 200 | ||
}; | ||
return [4 /*yield*/, response.json()]; | ||
case 2: return [2 /*return*/, (_a.value = _d.sent(), | ||
_a)]; | ||
case 3: | ||
if (!(response.status === 400)) return [3 /*break*/, 5]; | ||
_b = { | ||
status: 400 | ||
}; | ||
return [4 /*yield*/, response.json()]; | ||
case 4: return [2 /*return*/, (_b.value = _d.sent(), | ||
_b)]; | ||
case 5: | ||
if (!(response.status === 500)) return [3 /*break*/, 7]; | ||
_c = { | ||
status: 500 | ||
}; | ||
return [4 /*yield*/, response.json()]; | ||
case 6: return [2 /*return*/, (_c.value = _d.sent(), | ||
_c)]; | ||
case 7: throw response; | ||
} | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Returns Ownerships by Ids | ||
*/ | ||
OwnershipControllerApi.prototype.getOwnershipsByIds = function (requestParameters) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var response; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.getOwnershipsByIdsRaw(requestParameters)]; | ||
case 1: | ||
response = _a.sent(); | ||
if (response.status === 200) { | ||
return [2 /*return*/, response.value]; | ||
} | ||
throw response; | ||
} | ||
}); | ||
}); | ||
}; | ||
/** | ||
* Returns ownerships by item | ||
@@ -177,0 +249,0 @@ */ |
@@ -61,2 +61,3 @@ export * from "./ItemLastSale"; | ||
export * from "./PendingOrder"; | ||
export * from "./OwnershipIds"; | ||
export * from "./UnionApiErrorServerError"; | ||
@@ -63,0 +64,0 @@ export * from "./ItemOwnership"; |
@@ -73,2 +73,3 @@ "use strict"; | ||
__exportStar(require("./PendingOrder"), exports); | ||
__exportStar(require("./OwnershipIds"), exports); | ||
__exportStar(require("./UnionApiErrorServerError"), exports); | ||
@@ -75,0 +76,0 @@ __exportStar(require("./ItemOwnership"), exports); |
@@ -8,3 +8,3 @@ import { BigNumber } from "@rarible/types"; | ||
import { UnionAddress } from "@rarible/types"; | ||
export declare type OrderData = EthOrderDataLegacy | EthOrderDataRaribleV2DataV1 | EthOrderOpenSeaV1DataV1 | EthOrderSeaportDataV1 | EthOrderCryptoPunksData | TezosOrderDataRaribleV2DataV1 | TezosOrderDataRaribleV2DataV2 | FlowOrderDataV1 | SolanaAuctionHouseDataV1 | ImmutablexOrderDataV1; | ||
export declare type OrderData = EthOrderDataLegacy | EthOrderDataRaribleV2DataV1 | EthOrderOpenSeaV1DataV1 | EthOrderSeaportDataV1 | EthOrderCryptoPunksData | TezosOrderDataRaribleV2DataV1 | FlowOrderDataV1 | SolanaAuctionHouseDataV1 | ImmutablexOrderDataV1; | ||
export declare type EthOrderDataLegacy = { | ||
@@ -76,9 +76,2 @@ "@type": "ETH_RARIBLE_V1"; | ||
}; | ||
export declare type TezosOrderDataRaribleV2DataV2 = { | ||
"@type": "TEZOS_RARIBLE_V3"; | ||
payouts: Array<Payout>; | ||
originFees: Array<Payout>; | ||
makerEdpk?: string; | ||
takerEdpk?: string; | ||
}; | ||
export declare type FlowOrderDataV1 = { | ||
@@ -85,0 +78,0 @@ "@type": "FLOW_RARIBLE_V1"; |
@@ -79,3 +79,3 @@ "use strict"; | ||
exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.canConsumeForm = exports.mapValues = exports.querystring = exports.exists = exports.Configuration = exports.COLLECTION_FORMATS = exports.RequiredError = exports.BaseAPI = exports.BASE_PATH = void 0; | ||
exports.BASE_PATH = "https://dev-api.rarible.org".replace(/\/+$/, ""); | ||
exports.BASE_PATH = "https://api.rarible.org".replace(/\/+$/, ""); | ||
var isBlob = function (value) { return typeof Blob !== 'undefined' && value instanceof Blob; }; | ||
@@ -82,0 +82,0 @@ /** |
{ | ||
"name": "@rarible/api-client", | ||
"version": "0.0.13-beta8", | ||
"version": "0.0.13-beta9", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "axios", |
327699
182
7842