@poap-xyz/providers
Advanced tools
Comparing version 0.0.11 to 0.0.12
export { PoapMomentsApi } from './PoapMomentsApi/PoapMomentsApi'; | ||
export { PoapRegistryApi } from './PoapRegistryApi/PoapRegistryApi'; | ||
export { PoapDropApi } from './PoapDropApi/PoapDropApi'; | ||
export { PoapCompass } from './PoapCompass/PoapCompass'; |
@@ -5,2 +5,1 @@ export { InvalidMediaFileError } from './core/PoapMomentsApi/errors/InvalidMediaFileError'; | ||
export * from './core'; | ||
export { CreateAttributeInput, CreateAttributesBulkInput, CreateAttribute, } from './ports/RegistryApiProvider/Types/input'; |
export * from './MomentsApiProvider/MomentsApiProvider'; | ||
export * from './DropApiProvider/DropApiProvider'; | ||
export * from './RegistryApiProvider/RegistryApiProvider'; | ||
export { HttpProvider } from './HttpProvider/HttpProvider'; | ||
export { CompassProvider } from './CompassProvider/CompassProvider'; |
export { PoapMomentsApi } from './PoapMomentsApi/PoapMomentsApi'; | ||
export { PoapRegistryApi } from './PoapRegistryApi/PoapRegistryApi'; | ||
export { PoapDropApi } from './PoapDropApi/PoapDropApi'; | ||
export { PoapCompass } from './PoapCompass/PoapCompass'; |
@@ -5,2 +5,1 @@ export { InvalidMediaFileError } from './core/PoapMomentsApi/errors/InvalidMediaFileError'; | ||
export * from './core'; | ||
export { CreateAttributeInput, CreateAttributesBulkInput, CreateAttribute, } from './ports/RegistryApiProvider/Types/input'; |
export * from './MomentsApiProvider/MomentsApiProvider'; | ||
export * from './DropApiProvider/DropApiProvider'; | ||
export * from './RegistryApiProvider/RegistryApiProvider'; | ||
export { HttpProvider } from './HttpProvider/HttpProvider'; | ||
export { CompassProvider } from './CompassProvider/CompassProvider'; |
export { PoapMomentsApi } from './PoapMomentsApi/PoapMomentsApi'; | ||
export { PoapRegistryApi } from './PoapRegistryApi/PoapRegistryApi'; | ||
export { PoapDropApi } from './PoapDropApi/PoapDropApi'; | ||
export { PoapCompass } from './PoapCompass/PoapCompass'; |
@@ -5,2 +5,1 @@ export { InvalidMediaFileError } from './core/PoapMomentsApi/errors/InvalidMediaFileError'; | ||
export * from './core'; | ||
export { CreateAttributeInput, CreateAttributesBulkInput, CreateAttribute, } from './ports/RegistryApiProvider/Types/input'; |
@@ -93,35 +93,2 @@ (function (global, factory) { | ||
const REGISTRY_BASE_URL = 'https://registry.poap.xyz'; | ||
class PoapRegistryApi { | ||
constructor(apiKey, baseUrl = REGISTRY_BASE_URL) { | ||
this.apiKey = apiKey; | ||
this.baseUrl = baseUrl; | ||
} | ||
async createAttribute(input) { | ||
return await this.secureFetch(`${this.baseUrl}/attributes`, { | ||
method: 'POST', | ||
body: JSON.stringify(input.attribute), | ||
headers: { 'Content-Type': 'application/json' }, | ||
}); | ||
} | ||
async createAttributesBulk(input) { | ||
return await this.secureFetch(`${this.baseUrl}/attributes/bulk`, { | ||
method: 'POST', | ||
body: JSON.stringify(input.attributes), | ||
headers: { 'Content-Type': 'application/json' }, | ||
}); | ||
} | ||
async secureFetch(url, options) { | ||
const headersWithApiKey = { | ||
...options.headers, | ||
'x-api-key': this.apiKey, | ||
}; | ||
return (await axios(url, { | ||
method: options.method, | ||
data: options.body, | ||
headers: headersWithApiKey, | ||
})).data; | ||
} | ||
} | ||
const DROP_BASE_URL = 'https://api.poap.xyz'; | ||
@@ -221,5 +188,4 @@ class PoapDropApi { | ||
exports.PoapMomentsApi = PoapMomentsApi; | ||
exports.PoapRegistryApi = PoapRegistryApi; | ||
})); | ||
//# sourceMappingURL=index.js.map |
export * from './MomentsApiProvider/MomentsApiProvider'; | ||
export * from './DropApiProvider/DropApiProvider'; | ||
export * from './RegistryApiProvider/RegistryApiProvider'; | ||
export { HttpProvider } from './HttpProvider/HttpProvider'; | ||
export { CompassProvider } from './CompassProvider/CompassProvider'; |
{ | ||
"name": "@poap-xyz/providers", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Providers module for the poap.js library", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
89503
68
1061