@center-inc/hooks
Advanced tools
Comparing version 1.0.1 to 1.0.3
@@ -1,2 +0,2 @@ | ||
import r,{useContext as e,useMemo as t}from"react";import a from"swr";import"swr/infinite";import{URL as n}from"url";var o=r.createContext({apiKey:""}),i=function(e){/*#__PURE__*/return r.createElement(o.Provider,{value:{apiKey:e.apiKey}},e.children)},d=function(r){var t=e(o).apiKey,n=a(r,function(r){return function(r,e){try{return Promise.resolve(fetch(r,{headers:(t={apiKey:e},{"X-Center-User-Agent":"@center-inc/hooks","X-API-Key":t.apiKey})}).then(function(r){return r.json()}))}catch(r){return Promise.reject(r)}var t}(r,t)}),i=n.data;return{data:i,error:n.error,loading:!i}},s=function(r){var e=d("https://api.center.dev/v1/"+r.network+"/"+r.address+"/"+r.tokenId);return{data:e.data,loading:e.loading,error:e.error}},c=function(r){var e=d("https://api.center.dev/experimental/alchemy/"+r.network+"/nft/v2/test/getContractsForOwner?owner="+r.owner);return{data:e.data,loading:e.loading,error:e.error}},u=function(r){var e=d("https://api.center.dev/v1/"+r.network+"/"+r.address);return{data:e.data,error:e.error,loading:e.loading}},p=function(r){var e=r.network,a=r.address,n=r.trait,o=t(function(){return new o("https://api.center.dev/v1/"+e+"/"+a+"/traits/"+n)},[a,e,n]),i=d(o);return{data:i.data,loading:i.loading,error:i.error}},v=function(r){var e=d("https://api.center.dev/v1/"+r.network+"/"+r.address+"/traits");return{data:e.data,loading:e.loading,error:e.error}},f=function(r){var e=r.network,a=r.query,o=r.limit,i=r.offset,s=r.type,c=t(function(){var r=new n("https://api.center.dev/v1/"+e+"/search");return a&&r.searchParams.set("query",a),o&&r.searchParams.set("limit",o.toString()),i&&r.searchParams.set("offset",i.toString()),s&&r.searchParams.set("type",s),r.toString()},[e,a]),u=d(c);return{data:u.data,loading:u.loading,error:u.error}};export{i as CenterHooksProvider,s as useAsset,v as useAssetTraits,u as useCollection,c as useContractsOfOwner,f as useSearch,p as useTraitAttributes}; | ||
import r,{useContext as e,useMemo as t}from"react";import a from"swr";import"swr/infinite";var n=r.createContext({apiKey:""}),o=function(e){/*#__PURE__*/return r.createElement(n.Provider,{value:{apiKey:e.apiKey}},e.children)},i=function(r){var t=e(n).apiKey,o=a(r,function(r){return function(r,e){try{return Promise.resolve(fetch(r,{headers:(t={apiKey:e},{"X-Center-User-Agent":"@center-inc/hooks","X-API-Key":t.apiKey})}).then(function(r){return r.json()}))}catch(r){return Promise.reject(r)}var t}(r,t)}),i=o.data;return{data:i,error:o.error,loading:!i}},d=function(r){var e=i("https://api.center.dev/v1/"+r.network+"/"+r.address+"/"+r.tokenId);return{data:e.data,loading:e.loading,error:e.error}},s=function(r){var e=i("https://api.center.dev/experimental/alchemy/"+r.network+"/nft/v2/test/getContractsForOwner?owner="+r.owner);return{data:e.data,loading:e.loading,error:e.error}},c=function(r){var e=i("https://api.center.dev/v1/"+r.network+"/"+r.address);return{data:e.data,error:e.error,loading:e.loading}},u=function(r){var e=r.network,a=r.address,n=r.trait,o=t(function(){return new o("https://api.center.dev/v1/"+e+"/"+a+"/traits/"+n)},[a,e,n]),d=i(o);return{data:d.data,loading:d.loading,error:d.error}},p=function(r){var e=i("https://api.center.dev/v1/"+r.network+"/"+r.address+"/traits");return{data:e.data,loading:e.loading,error:e.error}},v=function(r){var e=r.network,a=r.query,n=r.limit,o=r.offset,d=r.type,s=t(function(){var r=new URL("https://api.center.dev/v1/"+e+"/search");return a&&r.searchParams.set("query",a),n&&r.searchParams.set("limit",n.toString()),o&&r.searchParams.set("offset",o.toString()),d&&r.searchParams.set("type",d),r.toString()},[e,a]),c=i(s);return{data:c.data,loading:c.loading,error:c.error}};export{o as CenterHooksProvider,d as useAsset,p as useAssetTraits,c as useCollection,s as useContractsOfOwner,v as useSearch,u as useTraitAttributes}; | ||
//# sourceMappingURL=hooks.module.js.map |
@@ -5,3 +5,3 @@ { | ||
"author": "Center Pixel, Inc <opensource@center.app>", | ||
"version": "1.0.1", | ||
"version": "1.0.3", | ||
"publishConfig": { | ||
@@ -8,0 +8,0 @@ "access": "public" |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43537