@story-protocol/ipkit 0.4.0-beta.9 → 0.4.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 +183 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/stories/useLicenseTokens.stories.d.ts +38 -0
- package/dist/hooks/stories/useLicenseTokens.stories.d.ts.map +1 -0
- package/dist/hooks/useLicenseTokens.d.ts +12 -0
- package/dist/hooks/useLicenseTokens.d.ts.map +1 -0
- package/dist/lib/api/getCollections.d.ts +3 -3
- package/dist/lib/api/getIpAssetEdges.d.ts +3 -3
- package/dist/lib/api/getIpAssets.d.ts +6 -6
- package/dist/lib/api/getLicenseTokens.d.ts +273 -0
- package/dist/lib/api/getLicenseTokens.d.ts.map +1 -0
- package/dist/lib/api/getSearch.d.ts +3 -3
- package/dist/lib/api/getTransactions.d.ts +3 -3
- package/dist/lib/api/index.d.ts +1 -0
- package/dist/lib/api/index.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +0 -8
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/providers/IpKitProvider/IpKitProvider.d.ts +1 -8
- package/dist/providers/IpKitProvider/IpKitProvider.d.ts.map +1 -1
- package/dist/providers/IpKitProvider/__docs__/Example.d.ts +0 -3
- package/dist/providers/IpKitProvider/__docs__/Example.d.ts.map +1 -1
- package/dist/providers/IpKitProvider/__docs__/IpKitProvider.stories.d.ts +0 -12
- package/dist/providers/IpKitProvider/__docs__/IpKitProvider.stories.d.ts.map +1 -1
- package/dist/server-types.d.ts +412 -37
- package/dist/server.cjs.js +1 -1
- package/dist/server.cjs.js.map +1 -1
- package/dist/server.esm.js +1 -1
- package/dist/server.esm.js.map +1 -1
- package/dist/storyprotocol-storykit.cjs.js +1 -1
- package/dist/storyprotocol-storykit.cjs.js.map +1 -1
- package/dist/storyprotocol-storykit.esm.js +1 -1
- package/dist/storyprotocol-storykit.esm.js.map +1 -1
- package/dist/types/openapi.d.ts +1 -0
- package/dist/types/openapi.d.ts.map +1 -1
- package/dist/types/schema.d.ts +120 -3
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/types.d.ts +421 -45
- package/package.json +20 -31
- package/dist/lib/functions/convertLicenseTermObject.d.ts +0 -6
- package/dist/lib/functions/convertLicenseTermObject.d.ts.map +0 -1
package/dist/server.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,r;!function(e){e.NON_COMMERCIAL_SOCIAL_REMIXING="Non-Commercial Social Remixing",e.COMMERCIAL_USE="Commercial Use",e.COMMERCIAL_REMIX="Commercial Remix",e.CUSTOM="Custom",e.OPEN_USE="Open Use"}(e||(e={})),function(e){e.AENEID_TESTNET="story-aeneid",e.STORY_MAINNET="story"}(r||(r={}));var t={name:"Wrapped IP",address:"0x1514000000000000000000000000000000000000",symbol:"WIP"},o=function(){return o=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},o.apply(this,arguments)};function n(e,r,t,o){return new(t||(t=Promise))((function(n,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var r;e.done?n(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(s,a)}l((o=o.apply(e,r||[])).next())}))}function i(e,r){var t,o,n,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(t=1,o&&(n=2&a[0]?o.return:a[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;switch(o=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=r.call(e,i)}catch(e){a=[6,e],o=0}finally{t=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function s(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(t=s(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}"function"==typeof SuppressedError&&SuppressedError;const a="-";function l(e){const r=function(e){const{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]},n=function(e,r){if(!r)return e;return e.map((([e,t])=>[e,t.map((e=>"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,t])=>[r+e,t]))):e))]))}(Object.entries(e.classGroups),t);return n.forEach((([e,t])=>{u(t,o,e,r)})),o}(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:function(e){const t=e.split(a);return""===t[0]&&1!==t.length&&t.shift(),c(t,r)||function(e){if(d.test(e)){const r=d.exec(e)[1],t=r?.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}}(e)},getConflictingClassGroupIds:function(e,r){const n=t[e]||[];return r&&o[e]?[...n,...o[e]]:n}}}function c(e,r){if(0===e.length)return r.classGroupId;const t=e[0],o=r.nextPart.get(t),n=o?c(e.slice(1),o):void 0;if(n)return n;if(0===r.validators.length)return;const i=e.join(a);return r.validators.find((({validator:e})=>e(i)))?.classGroupId}const d=/^\[(.+)\]$/;function u(e,r,t,o){e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return e.isThemeGetter?void u(e(o),r,t,o):void r.validators.push({validator:e,classGroupId:t});Object.entries(e).forEach((([e,n])=>{u(n,p(r,e),t,o)}))}else{(""===e?r:p(r,e)).classGroupId=t}}))}function p(e,r){let t=e;return r.split(a).forEach((e=>{t.nextPart.has(e)||t.nextPart.set(e,{nextPart:new Map,validators:[]}),t=t.nextPart.get(e)})),t}function f(e){if(e<1)return{get:()=>{},set:()=>{}};let r=0,t=new Map,o=new Map;function n(n,i){t.set(n,i),r++,r>e&&(r=0,o=t,t=new Map)}return{get(e){let r=t.get(e);return void 0!==r?r:void 0!==(r=o.get(e))?(n(e,r),r):void 0},set(e,r){t.has(e)?t.set(e,r):n(e,r)}}}const b="!";function h(e){const r=e.separator,t=1===r.length,o=r[0],n=r.length;return function(e){const i=[];let s,a=0,l=0;for(let c=0;c<e.length;c++){let d=e[c];if(0===a){if(d===o&&(t||e.slice(c,c+n)===r)){i.push(e.slice(l,c)),l=c+n;continue}if("/"===d){s=c;continue}}"["===d?a++:"]"===d&&a--}const c=0===i.length?e:e.substring(l),d=c.startsWith(b);return{modifiers:i,hasImportantModifier:d,baseClassName:d?c.substring(1):c,maybePostfixModifierPosition:s&&s>l?s-l:void 0}}}const m=/\s+/;function y(){let e,r,t=0,o="";for(;t<arguments.length;)(e=arguments[t++])&&(r=g(e))&&(o&&(o+=" "),o+=r);return o}function g(e){if("string"==typeof e)return e;let r,t="";for(let o=0;o<e.length;o++)e[o]&&(r=g(e[o]))&&(t&&(t+=" "),t+=r);return t}function v(e,...r){let t,o,n,i=function(a){const c=r.reduce(((e,r)=>r(e)),e());return t=function(e){return{cache:f(e.cacheSize),splitModifiers:h(e),...l(e)}}(c),o=t.cache.get,n=t.cache.set,i=s,s(a)};function s(e){const r=o(e);if(r)return r;const i=function(e,r){const{splitModifiers:t,getClassGroupId:o,getConflictingClassGroupIds:n}=r,i=new Set;return e.trim().split(m).map((e=>{const{modifiers:r,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:s}=t(e);let a=o(s?i.substring(0,s):i),l=Boolean(s);if(!a){if(!s)return{isTailwindClass:!1,originalClassName:e};if(a=o(i),!a)return{isTailwindClass:!1,originalClassName:e};l=!1}const c=function(e){if(e.length<=1)return e;const r=[];let t=[];return e.forEach((e=>{"["===e[0]?(r.push(...t.sort(),e),t=[]):t.push(e)})),r.push(...t.sort()),r}(r).join(":");return{isTailwindClass:!0,modifierId:n?c+b:c,classGroupId:a,originalClassName:e,hasPostfixModifier:l}})).reverse().filter((e=>{if(!e.isTailwindClass)return!0;const{modifierId:r,classGroupId:t,hasPostfixModifier:o}=e,s=r+t;return!i.has(s)&&(i.add(s),n(t,o).forEach((e=>i.add(r+e))),!0)})).reverse().map((e=>e.originalClassName)).join(" ")}(e,t);return n(e,i),i}return function(){return i(y.apply(null,arguments))}}function w(e){const r=r=>r[e]||[];return r.isThemeGetter=!0,r}const x=/^\[(?:([a-z-]+):)?(.+)\]$/i,C=/^\d+\/\d+$/,k=new Set(["px","full","screen"]),I=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,j=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function S(e){return T(e)||k.has(e)||C.test(e)}function O(e){return W(e,"length",H)}function T(e){return Boolean(e)&&!Number.isNaN(Number(e))}function A(e){return W(e,"number",T)}function N(e){return Boolean(e)&&Number.isInteger(Number(e))}function M(e){return e.endsWith("%")&&T(e.slice(0,-1))}function P(e){return x.test(e)}function U(e){return I.test(e)}const $=new Set(["length","size","percentage"]);function q(e){return W(e,$,B)}function G(e){return W(e,"position",B)}const K=new Set(["image","url"]);function D(e){return W(e,K,F)}function _(e){return W(e,"",X)}function L(){return!0}function W(e,r,t){const o=x.exec(e);return!!o&&(o[1]?"string"==typeof r?o[1]===r:r.has(o[1]):t(o[2]))}function H(e){return E.test(e)&&!j.test(e)}function B(){return!1}function X(e){return R.test(e)}function F(e){return z.test(e)}function J(){const e=w("colors"),r=w("spacing"),t=w("blur"),o=w("brightness"),n=w("borderColor"),i=w("borderRadius"),s=w("borderSpacing"),a=w("borderWidth"),l=w("contrast"),c=w("grayscale"),d=w("hueRotate"),u=w("invert"),p=w("gap"),f=w("gradientColorStops"),b=w("gradientColorStopPositions"),h=w("inset"),m=w("margin"),y=w("opacity"),g=w("padding"),v=w("saturate"),x=w("scale"),C=w("sepia"),k=w("skew"),I=w("space"),E=w("translate"),j=()=>["auto",P,r],R=()=>[P,r],z=()=>["",S,O],$=()=>["auto",T,P],K=()=>["","0",P],W=()=>[T,A],H=()=>[T,P];return{cacheSize:500,separator:":",theme:{colors:[L],spacing:[S,O],blur:["none","",U,P],brightness:W(),borderColor:[e],borderRadius:["none","","full",U,P],borderSpacing:R(),borderWidth:z(),contrast:W(),grayscale:K(),hueRotate:H(),invert:K(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[M,O],inset:j(),margin:j(),opacity:W(),padding:R(),saturate:W(),scale:W(),sepia:K(),skew:H(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",P]}],container:["container"],columns:[{columns:[U]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",P]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",N,P]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",P]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",N,P]}],"grid-cols":[{"grid-cols":[L]}],"col-start-end":[{col:["auto",{span:["full",N,P]},P]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[L]}],"row-start-end":[{row:["auto",{span:[N,P]},P]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",P]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",P]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",P,r]}],"min-w":[{"min-w":[P,r,"min","max","fit"]}],"max-w":[{"max-w":[P,r,"none","full","min","max","fit","prose",{screen:[U]},U]}],h:[{h:[P,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[P,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[P,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[P,r,"auto","min","max","fit"]}],"font-size":[{text:["base",U,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",A]}],"font-family":[{font:[L]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",P]}],"line-clamp":[{"line-clamp":["none",T,A]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",S,P]}],"list-image":[{"list-image":["none",P]}],"list-style-type":[{list:["none","disc","decimal",P]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",S,O]}],"underline-offset":[{"underline-offset":["auto",S,P]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",P]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",G]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",q]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},D]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[S,P]}],"outline-w":[{outline:[S,O]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[S,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",U,_]}],"shadow-color":[{shadow:[L]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",U,P]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",P]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",P]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",P]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[N,P]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",P]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",P]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",P]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[S,O,A]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}function V(e,r,t){void 0!==t&&(e[r]=t)}function Y(e,r){if(r)for(const t in r)V(e,t,r[t])}function Z(e,r){if(r)for(const t in r){const o=r[t];void 0!==o&&(e[t]=(e[t]||[]).concat(o))}}var Q,ee=function(e,...r){return"function"==typeof e?v(J,e,...r):v((()=>function(e,{cacheSize:r,prefix:t,separator:o,extend:n={},override:i={}}){V(e,"cacheSize",r),V(e,"prefix",t),V(e,"separator",o);for(const r in i)Y(e[r],i[r]);for(const r in n)Z(e[r],n[r]);return e}(J(),e)),...r)}({prefix:"sk-"});function re(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return ee(function(){for(var e,r,t=0,o="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=s(e))&&(o&&(o+=" "),o+=r);return o}(e))}function te(e,r){if(void 0===r&&(r=4),!e)return"";if(e.length<2*r+2)return e;var t=e.substring(0,r+2),o=e.substring(e.length-r);return"".concat(t,"...").concat(o)}function oe(e){return e.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,(function(e,r){return 0==+e?"":0===r?e.toLowerCase():e.toUpperCase()}))}function ne(r){var t=r.commercialUse,o=r.derivativesAllowed,n=r.derivativesAttribution,i=r.commercialRevShare;return!t&&o?n?e.NON_COMMERCIAL_SOCIAL_REMIXING:e.OPEN_USE:!t||o||n||0!==i?t&&o&&n&&i&&i>0?e.COMMERCIAL_REMIX:e.CUSTOM:e.COMMERCIAL_USE}function ie(e){return n(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,fetch(e).then((function(e){return e.json()}))];case 1:return[2,se(r.sent().image)]}}))}))}function se(e){if(!e.startsWith("ipfs://"))return e;var r=e.slice(7);return"https://ipfs.io/ipfs/".concat(r)}function ae(e){return n(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,fetch(e).then((function(e){return e.json()}))];case 1:return[2,r.sent()]}}))}))}function le(e){return n(this,void 0,void 0,(function(){var r;return i(this,(function(t){switch(t.label){case 0:return""===e?[2]:(r=e,e.startsWith("https://github.com/")&&(r=e.replace("https://github.com/","https://raw.githubusercontent.com/").replace("/blob/","/")),[4,ae(se(r))]);case 1:return[2,t.sent()]}}))}))}function ce(e){return e.reduce((function(e,r){return e[oe(r.trait_type)]="true"===r.value||"false"!==r.value&&r.value,e}),{})}!function(e){e.STAGING="https://staging-api.storyprotocol.net/api/v4",e.PRODUCTION="https://api.storyapis.com/api/v4"}(Q||(Q={}));const de=/\{[^{}]+\}/g;function ue(e){let{baseUrl:r="",Request:t=globalThis.Request,fetch:o=globalThis.fetch,querySerializer:n,bodySerializer:i,headers:s,requestInitExt:a,...l}={...e};a="object"==typeof process&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici?a:void 0,r=ge(r);const c=[];async function d(e,d){const{baseUrl:u,fetch:p=o,Request:f=t,headers:b,params:h={},parseAs:m="json",querySerializer:y,bodySerializer:g=i??me,body:v,...w}=d||{};u&&(r=ge(u));let x="function"==typeof n?n:he(n);y&&(x="function"==typeof y?y:he({..."object"==typeof n?n:{},...y}));const C=void 0===v?void 0:g(v),k=void 0===C||C instanceof FormData?{}:{"Content-Type":"application/json"},I={redirect:"follow",...l,...w,body:C,headers:ye(k,s,b,h.header)};let E,j,R,z=new t(function(e,r){let t=`${r.baseUrl}${e}`;r.params?.path&&(t=function(e,r){let t=e;for(const o of e.match(de)??[]){let e=o.substring(1,o.length-1),n=!1,i="simple";if(e.endsWith("*")&&(n=!0,e=e.substring(0,e.length-1)),e.startsWith(".")?(i="label",e=e.substring(1)):e.startsWith(";")&&(i="matrix",e=e.substring(1)),!r||void 0===r[e]||null===r[e])continue;const s=r[e];Array.isArray(s)?t=t.replace(o,be(e,s,{style:i,explode:n})):t="object"!=typeof s?"matrix"!==i?t.replace(o,"label"===i?`.${encodeURIComponent(s)}`:encodeURIComponent(s)):t.replace(o,`;${pe(e,s)}`):t.replace(o,fe(e,s,{style:i,explode:n}))}return t}(t,r.params.path));let o=r.querySerializer(r.params.query??{});o.startsWith("?")&&(o=o.substring(1));o&&(t+=`?${o}`);return t}(e,{baseUrl:r,params:h,querySerializer:x}),I);for(const e in w)e in z||(z[e]=w[e]);if(c.length){E=Math.random().toString(36).slice(2,11),j=Object.freeze({baseUrl:r,fetch:p,parseAs:m,querySerializer:x,bodySerializer:g});for(const r of c)if(r&&"object"==typeof r&&"function"==typeof r.onRequest){const o=await r.onRequest({request:z,schemaPath:e,params:h,options:j,id:E});if(o){if(!(o instanceof t)){if(o instanceof Response){R=o;break}throw new Error("onRequest: must return new Request() or Response() when modifying the request")}z=o}}}if(!R){try{R=await p(z,a)}catch(S){let r=S;if(c.length)for(let t=c.length-1;t>=0;t--){const o=c[t];if(o&&"object"==typeof o&&"function"==typeof o.onError){const t=await o.onError({request:z,error:r,schemaPath:e,params:h,options:j,id:E});if(t){if(t instanceof Response){r=void 0,R=t;break}if(t instanceof Error){r=t;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(r)throw r}if(c.length)for(let r=c.length-1;r>=0;r--){const t=c[r];if(t&&"object"==typeof t&&"function"==typeof t.onResponse){const r=await t.onResponse({request:z,response:R,schemaPath:e,params:h,options:j,id:E});if(r){if(!(r instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");R=r}}}}if(204===R.status||"0"===R.headers.get("Content-Length"))return R.ok?{data:void 0,response:R}:{error:void 0,response:R};if(R.ok)return"stream"===m?{data:R.body,response:R}:{data:await R[m](),response:R};let S=await R.text();try{S=JSON.parse(S)}catch{}return{error:S,response:R}}return{request:(e,r,t)=>d(r,{...t,method:e.toUpperCase()}),GET:(e,r)=>d(e,{...r,method:"GET"}),PUT:(e,r)=>d(e,{...r,method:"PUT"}),POST:(e,r)=>d(e,{...r,method:"POST"}),DELETE:(e,r)=>d(e,{...r,method:"DELETE"}),OPTIONS:(e,r)=>d(e,{...r,method:"OPTIONS"}),HEAD:(e,r)=>d(e,{...r,method:"HEAD"}),PATCH:(e,r)=>d(e,{...r,method:"PATCH"}),TRACE:(e,r)=>d(e,{...r,method:"TRACE"}),use(...e){for(const r of e)if(r){if("object"!=typeof r||!("onRequest"in r||"onResponse"in r||"onError"in r))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");c.push(r)}},eject(...e){for(const r of e){const e=c.indexOf(r);-1!==e&&c.splice(e,1)}}}}function pe(e,r,t){if(null==r)return"";if("object"==typeof r)throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${!0===t?.allowReserved?r:encodeURIComponent(r)}`}function fe(e,r,t){if(!r||"object"!=typeof r)return"";const o=[],n={simple:",",label:".",matrix:";"}[t.style]||"&";if("deepObject"!==t.style&&!1===t.explode){for(const e in r)o.push(e,!0===t.allowReserved?r[e]:encodeURIComponent(r[e]));const n=o.join(",");switch(t.style){case"form":return`${e}=${n}`;case"label":return`.${n}`;case"matrix":return`;${e}=${n}`;default:return n}}for(const n in r){const i="deepObject"===t.style?`${e}[${n}]`:n;o.push(pe(i,r[n],t))}const i=o.join(n);return"label"===t.style||"matrix"===t.style?`${n}${i}`:i}function be(e,r,t){if(!Array.isArray(r))return"";if(!1===t.explode){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[t.style]||",",n=(!0===t.allowReserved?r:r.map((e=>encodeURIComponent(e)))).join(o);switch(t.style){case"simple":return n;case"label":return`.${n}`;case"matrix":return`;${e}=${n}`;default:return`${e}=${n}`}}const o={simple:",",label:".",matrix:";"}[t.style]||"&",n=[];for(const o of r)"simple"===t.style||"label"===t.style?n.push(!0===t.allowReserved?o:encodeURIComponent(o)):n.push(pe(e,o,t));return"label"===t.style||"matrix"===t.style?`${o}${n.join(o)}`:n.join(o)}function he(e){return function(r){const t=[];if(r&&"object"==typeof r)for(const o in r){const n=r[o];if(null!=n)if(Array.isArray(n)){if(0===n.length)continue;t.push(be(o,n,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}))}else"object"!=typeof n?t.push(pe(o,n,e)):t.push(fe(o,n,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}))}return t.join("&")}}function me(e){return e instanceof FormData?e:JSON.stringify(e)}function ye(...e){const r=new Headers;for(const t of e){if(!t||"object"!=typeof t)continue;const e=t instanceof Headers?t.entries():Object.entries(t);for(const[t,o]of e)if(null===o)r.delete(t);else if(Array.isArray(o))for(const e of o)r.append(t,e);else void 0!==o&&r.set(t,o)}return r}function ge(e){return e.endsWith("/")?e.substring(0,e.length-1):e}var ve,we={onRequest:function(e){return n(this,arguments,void 0,(function(e){var r=e.request;return i(this,(function(e){return r.headers.set("Content-Type","application/json"),[2,r]}))}))}},xe=function(e){var r=ue({baseUrl:e});return r.use(we),r},Ce=xe(Q.STAGING),ke=xe(Q.PRODUCTION);function Ie(e){var r=e.apiClient,t=e.path,n=e.apiKey,i=e.body,s=e.additionalHeaders,a={params:{header:o({"X-Api-Key":n},s)}},l={body:i||{}};return r.POST(t,o(o({},a),l))}function Ee(e){var r=e.collectionAddresses,t=e.apiClient,n=e.options,i=e.apiKey;return Ie({apiClient:t,path:"/collections",body:o(o({orderBy:"updatedAt",orderDirection:"desc"},n),{where:o(o({},null==n?void 0:n.where),r?{collectionAddresses:r}:{})}),apiKey:i})}function je(e){return function(e){var r=e.apiClient,t=e.path,n=e.apiKey,i=e.pathParams,s=e.additionalHeaders,a={params:{path:i,header:o({"X-Api-Key":n},s)}};return r.GET(t,a)}({apiClient:e.apiClient,path:"/disputes/{disputeId}",pathParams:{disputeId:e.disputeId},apiKey:e.apiKey})}function Re(e){var r=e.apiClient,t=e.initiator,n=e.targetIpId,i=e.options,s=e.apiKey;return Ie({apiClient:r,path:"/disputes",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},i),{where:o(o(o({},null==i?void 0:i.where),t?{initiator:t}:{}),n?{targetIpId:n}:{})}),apiKey:s})}function ze(e){var r=e.apiClient,t=e.ipId,n=e.parentIpId,i=e.options,s=e.apiKey;return Ie({apiClient:r,path:"/assets/edges",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},i),{where:o(o(o({},null==i?void 0:i.where),t?{childIpId:t}:{}),n?{parentIpId:n}:{})}),apiKey:s})}function Se(e){var r=e.apiClient,t=e.ownerAddress,n=e.tokenContract,i=e.includeLicenses,s=e.moderated,a=e.ipIds,l=e.options,c=e.apiKey;return Ie({apiClient:r,path:"/assets",body:o(o({orderBy:"blockNumber",orderDirection:"desc",includeLicenses:null!=i&&i,moderated:null!=s&&s},l),{where:o(o(o(o({},null==l?void 0:l.where),a?{ipIds:a}:{}),t?{ownerAddress:t}:{}),n?{tokenContract:n}:{})}),apiKey:c})}function Oe(e){var r=e.apiClient,t=e.query,n=e.mediaType,i=e.options,s=e.apiKey;return Ie({apiClient:r,path:"/search",body:o(o({query:t},n?{mediaType:n}:{}),i),apiKey:s})}function Te(e){var r=e.apiClient,t=e.txHashes,n=e.ipIds,i=e.initiators,s=e.eventTypes,a=e.options,l=e.apiKey;return Ie({apiClient:r,path:"/transactions",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},a),{where:o(o(o(o(o({},null==a?void 0:a.where),t?{txHashes:t}:{}),n?{ipIds:n}:{}),i?{initiators:i}:{}),s?{eventTypes:s}:{})}),apiKey:l})}var Ae={id:1315,name:"story-aeneid",apiVersion:"v3",displayName:"Story Aeneid Testnet",rpcUrl:"https://aeneid.storyrpc.io/",blockExplorerUrl:"https://aeneid.storyscan.io",protocolExplorerUrl:"https://aeneid.explorer.story.foundation",defaultCurrency:t},Ne={id:1514,name:"story",apiVersion:"v3",displayName:"Story Mainnet",rpcUrl:"https://mainnet.storyrpc.io",blockExplorerUrl:"https://storyscan.io",protocolExplorerUrl:"https://explorer.story.foundation",defaultCurrency:t},Me=((ve={})[Ae.name]=Ae,ve[Ne.name]=Ne,ve),Pe={1315:"story-aeneid",1514:"story"};export{Q as API_URL,Pe as CHAINID_TO_CHAINNAME,Me as CHAINS,r as IPKIT_SUPPORTED_CHAIN,e as PIL_FLAVOR,Ae as STORY_AENEID,Ne as STORY_MAINNET,t as WRAPPED_IP,oe as camelize,re as cn,se as convertIpfsUriToUrl,ce as convertLicenseTermObject,xe as createApiClient,le as fetchLicenseOffChainData,Ee as getCollections,je as getDispute,Re as getDisputes,ie as getImageUrlFromIpfsUrl,ze as getIpAssetEdges,Se as getIpAssets,ae as getMetadataFromIpfs,ne as getPilFlavorByLicenseTerms,Oe as getSearch,Te as getTransactions,ke as prodClient,te as shortenAddress,Ce as stagingClient};
|
|
1
|
+
var e,t;!function(e){e.NON_COMMERCIAL_SOCIAL_REMIXING="Non-Commercial Social Remixing",e.COMMERCIAL_USE="Commercial Use",e.COMMERCIAL_REMIX="Commercial Remix",e.CUSTOM="Custom",e.OPEN_USE="Open Use"}(e||(e={})),function(e){e.AENEID_TESTNET="story-aeneid",e.STORY_MAINNET="story"}(t||(t={}));var r,n={name:"Wrapped IP",address:"0x1514000000000000000000000000000000000000",symbol:"WIP"},o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.STAGING="https://staging-api.storyprotocol.net/api/v4",e.PRODUCTION="https://api.storyapis.com/api/v4"}(r||(r={}));const a=/\{[^{}]+\}/g;function l(e){let{baseUrl:t="",Request:r=globalThis.Request,fetch:n=globalThis.fetch,querySerializer:o,bodySerializer:i,headers:s,requestInitExt:l,...b}={...e};l="object"==typeof process&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici?l:void 0,t=h(t);const m=[];async function w(e,w){const{baseUrl:v,fetch:C=n,Request:I=r,headers:R,params:E={},parseAs:g="json",querySerializer:T,bodySerializer:j=i??f,body:x,...A}=w||{};v&&(t=h(v));let O="function"==typeof o?o:d(o);T&&(O="function"==typeof T?T:d({..."object"==typeof o?o:{},...T}));const S=void 0===x?void 0:j(x),U=void 0===S||S instanceof FormData?{}:{"Content-Type":"application/json"},q={redirect:"follow",...b,...A,body:S,headers:y(U,s,R,E.header)};let N,$,P,K=new r(function(e,t){let r=`${t.baseUrl}${e}`;t.params?.path&&(r=function(e,t){let r=e;for(const n of e.match(a)??[]){let e=n.substring(1,n.length-1),o=!1,i="simple";if(e.endsWith("*")&&(o=!0,e=e.substring(0,e.length-1)),e.startsWith(".")?(i="label",e=e.substring(1)):e.startsWith(";")&&(i="matrix",e=e.substring(1)),!t||void 0===t[e]||null===t[e])continue;const s=t[e];Array.isArray(s)?r=r.replace(n,u(e,s,{style:i,explode:o})):r="object"!=typeof s?"matrix"!==i?r.replace(n,"label"===i?`.${encodeURIComponent(s)}`:encodeURIComponent(s)):r.replace(n,`;${p(e,s)}`):r.replace(n,c(e,s,{style:i,explode:o}))}return r}(r,t.params.path));let n=t.querySerializer(t.params.query??{});n.startsWith("?")&&(n=n.substring(1));n&&(r+=`?${n}`);return r}(e,{baseUrl:t,params:E,querySerializer:O}),q);for(const e in A)e in K||(K[e]=A[e]);if(m.length){N=Math.random().toString(36).slice(2,11),$=Object.freeze({baseUrl:t,fetch:C,parseAs:g,querySerializer:O,bodySerializer:j});for(const t of m)if(t&&"object"==typeof t&&"function"==typeof t.onRequest){const n=await t.onRequest({request:K,schemaPath:e,params:E,options:$,id:N});if(n){if(!(n instanceof r)){if(n instanceof Response){P=n;break}throw new Error("onRequest: must return new Request() or Response() when modifying the request")}K=n}}}if(!P){try{P=await C(K,l)}catch(k){let t=k;if(m.length)for(let r=m.length-1;r>=0;r--){const n=m[r];if(n&&"object"==typeof n&&"function"==typeof n.onError){const r=await n.onError({request:K,error:t,schemaPath:e,params:E,options:$,id:N});if(r){if(r instanceof Response){t=void 0,P=r;break}if(r instanceof Error){t=r;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(t)throw t}if(m.length)for(let t=m.length-1;t>=0;t--){const r=m[t];if(r&&"object"==typeof r&&"function"==typeof r.onResponse){const t=await r.onResponse({request:K,response:P,schemaPath:e,params:E,options:$,id:N});if(t){if(!(t instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");P=t}}}}if(204===P.status||"0"===P.headers.get("Content-Length"))return P.ok?{data:void 0,response:P}:{error:void 0,response:P};if(P.ok)return"stream"===g?{data:P.body,response:P}:{data:await P[g](),response:P};let k=await P.text();try{k=JSON.parse(k)}catch{}return{error:k,response:P}}return{request:(e,t,r)=>w(t,{...r,method:e.toUpperCase()}),GET:(e,t)=>w(e,{...t,method:"GET"}),PUT:(e,t)=>w(e,{...t,method:"PUT"}),POST:(e,t)=>w(e,{...t,method:"POST"}),DELETE:(e,t)=>w(e,{...t,method:"DELETE"}),OPTIONS:(e,t)=>w(e,{...t,method:"OPTIONS"}),HEAD:(e,t)=>w(e,{...t,method:"HEAD"}),PATCH:(e,t)=>w(e,{...t,method:"PATCH"}),TRACE:(e,t)=>w(e,{...t,method:"TRACE"}),use(...e){for(const t of e)if(t){if("object"!=typeof t||!("onRequest"in t||"onResponse"in t||"onError"in t))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");m.push(t)}},eject(...e){for(const t of e){const e=m.indexOf(t);-1!==e&&m.splice(e,1)}}}}function p(e,t,r){if(null==t)return"";if("object"==typeof t)throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${!0===r?.allowReserved?t:encodeURIComponent(t)}`}function c(e,t,r){if(!t||"object"!=typeof t)return"";const n=[],o={simple:",",label:".",matrix:";"}[r.style]||"&";if("deepObject"!==r.style&&!1===r.explode){for(const e in t)n.push(e,!0===r.allowReserved?t[e]:encodeURIComponent(t[e]));const o=n.join(",");switch(r.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const i="deepObject"===r.style?`${e}[${o}]`:o;n.push(p(i,t[o],r))}const i=n.join(o);return"label"===r.style||"matrix"===r.style?`${o}${i}`:i}function u(e,t,r){if(!Array.isArray(t))return"";if(!1===r.explode){const n={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[r.style]||",",o=(!0===r.allowReserved?t:t.map((e=>encodeURIComponent(e)))).join(n);switch(r.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const n={simple:",",label:".",matrix:";"}[r.style]||"&",o=[];for(const n of t)"simple"===r.style||"label"===r.style?o.push(!0===r.allowReserved?n:encodeURIComponent(n)):o.push(p(e,n,r));return"label"===r.style||"matrix"===r.style?`${n}${o.join(n)}`:o.join(n)}function d(e){return function(t){const r=[];if(t&&"object"==typeof t)for(const n in t){const o=t[n];if(null!=o)if(Array.isArray(o)){if(0===o.length)continue;r.push(u(n,o,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}))}else"object"!=typeof o?r.push(p(n,o,e)):r.push(c(n,o,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}))}return r.join("&")}}function f(e){return e instanceof FormData?e:JSON.stringify(e)}function y(...e){const t=new Headers;for(const r of e){if(!r||"object"!=typeof r)continue;const e=r instanceof Headers?r.entries():Object.entries(r);for(const[r,n]of e)if(null===n)t.delete(r);else if(Array.isArray(n))for(const e of n)t.append(r,e);else void 0!==n&&t.set(r,n)}return t}function h(e){return e.endsWith("/")?e.substring(0,e.length-1):e}var b,m={onRequest:function(e){return i(this,arguments,void 0,(function(e){var t=e.request;return s(this,(function(e){return t.headers.set("Content-Type","application/json"),[2,t]}))}))}},w=function(e){var t=l({baseUrl:e});return t.use(m),t},v=w(r.STAGING),C=w(r.PRODUCTION);function I(e){var t=e.apiClient,r=e.path,n=e.apiKey,i=e.body,s=e.additionalHeaders,a={params:{header:o({"X-Api-Key":n},s)}},l={body:i||{}};return t.POST(r,o(o({},a),l))}function R(e){var t=e.collectionAddresses,r=e.apiClient,n=e.options,i=e.apiKey;return I({apiClient:r,path:"/collections",body:o(o({orderBy:"updatedAt",orderDirection:"desc"},n),{where:o(o({},null==n?void 0:n.where),t?{collectionAddresses:t}:{})}),apiKey:i})}function E(e){return function(e){var t=e.apiClient,r=e.path,n=e.apiKey,i=e.pathParams,s=e.additionalHeaders,a={params:{path:i,header:o({"X-Api-Key":n},s)}};return t.GET(r,a)}({apiClient:e.apiClient,path:"/disputes/{disputeId}",pathParams:{disputeId:e.disputeId},apiKey:e.apiKey})}function g(e){var t=e.apiClient,r=e.initiator,n=e.targetIpId,i=e.options,s=e.apiKey;return I({apiClient:t,path:"/disputes",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},i),{where:o(o(o({},null==i?void 0:i.where),r?{initiator:r}:{}),n?{targetIpId:n}:{})}),apiKey:s})}function T(e){var t=e.apiClient,r=e.ipId,n=e.parentIpId,i=e.options,s=e.apiKey;return I({apiClient:t,path:"/assets/edges",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},i),{where:o(o(o({},null==i?void 0:i.where),r?{childIpId:r}:{}),n?{parentIpId:n}:{})}),apiKey:s})}function j(e){var t=e.apiClient,r=e.ownerAddress,n=e.tokenContract,i=e.includeLicenses,s=e.moderated,a=e.ipIds,l=e.options,p=e.apiKey;return I({apiClient:t,path:"/assets",body:o(o({orderBy:"blockNumber",orderDirection:"desc",includeLicenses:null!=i&&i,moderated:null!=s&&s},l),{where:o(o(o(o({},null==l?void 0:l.where),a?{ipIds:a}:{}),r?{ownerAddress:r}:{}),n?{tokenContract:n}:{})}),apiKey:p})}function x(e){var t=e.apiClient,r=e.ownerAddress,n=e.licensorIpId,i=e.options,s=e.apiKey;return I({apiClient:t,path:"/licenses/tokens",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},i),{where:o(o(o({},null==i?void 0:i.where),(null==r?void 0:r.length)?{ownerAddress:r}:{}),(null==n?void 0:n.length)?{licensorIpId:n}:{})}),apiKey:s})}function A(e){var t=e.apiClient,r=e.query,n=e.mediaType,i=e.options,s=e.apiKey;return I({apiClient:t,path:"/search",body:o(o({query:r},n?{mediaType:n}:{}),i),apiKey:s})}function O(e){var t=e.apiClient,r=e.txHashes,n=e.ipIds,i=e.initiators,s=e.eventTypes,a=e.options,l=e.apiKey;return I({apiClient:t,path:"/transactions",body:o(o({orderBy:"blockNumber",orderDirection:"desc"},a),{where:o(o(o(o(o({},null==a?void 0:a.where),r?{txHashes:r}:{}),n?{ipIds:n}:{}),i?{initiators:i}:{}),s?{eventTypes:s}:{})}),apiKey:l})}var S={id:1315,name:"story-aeneid",apiVersion:"v3",displayName:"Story Aeneid Testnet",rpcUrl:"https://aeneid.storyrpc.io/",blockExplorerUrl:"https://aeneid.storyscan.io",protocolExplorerUrl:"https://aeneid.explorer.story.foundation",defaultCurrency:n},U={id:1514,name:"story",apiVersion:"v3",displayName:"Story Mainnet",rpcUrl:"https://mainnet.storyrpc.io",blockExplorerUrl:"https://storyscan.io",protocolExplorerUrl:"https://explorer.story.foundation",defaultCurrency:n},q=((b={})[S.name]=S,b[U.name]=U,b),N={1315:"story-aeneid",1514:"story"};export{r as API_URL,N as CHAINID_TO_CHAINNAME,q as CHAINS,t as IPKIT_SUPPORTED_CHAIN,e as PIL_FLAVOR,S as STORY_AENEID,U as STORY_MAINNET,n as WRAPPED_IP,w as createApiClient,R as getCollections,E as getDispute,g as getDisputes,T as getIpAssetEdges,j as getIpAssets,x as getLicenseTokens,A as getSearch,O as getTransactions,C as prodClient,v as stagingClient};
|
|
2
2
|
//# sourceMappingURL=server.esm.js.map
|