@story-protocol/core-sdk 1.3.2 → 1.4.0-rc.1

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.
Files changed (31) hide show
  1. package/dist/declarations/src/abi/generated.d.ts +981 -168
  2. package/dist/declarations/src/abi/generated.d.ts.map +1 -1
  3. package/dist/declarations/src/index.d.ts +2 -0
  4. package/dist/declarations/src/index.d.ts.map +1 -1
  5. package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
  6. package/dist/declarations/src/resources/ipAsset.d.ts +25 -2
  7. package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
  8. package/dist/declarations/src/resources/license.d.ts +27 -3
  9. package/dist/declarations/src/resources/license.d.ts.map +1 -1
  10. package/dist/declarations/src/types/common.d.ts +13 -5
  11. package/dist/declarations/src/types/common.d.ts.map +1 -1
  12. package/dist/declarations/src/types/options.d.ts +1 -2
  13. package/dist/declarations/src/types/options.d.ts.map +1 -1
  14. package/dist/declarations/src/types/resources/group.d.ts +8 -2
  15. package/dist/declarations/src/types/resources/group.d.ts.map +1 -1
  16. package/dist/declarations/src/types/resources/ipAsset.d.ts +62 -6
  17. package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
  18. package/dist/declarations/src/types/resources/license.d.ts +24 -2
  19. package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
  20. package/dist/declarations/src/types/resources/royalty.d.ts +4 -1
  21. package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
  22. package/dist/declarations/src/types/utils/pilFlavor.d.ts +75 -0
  23. package/dist/declarations/src/types/utils/pilFlavor.d.ts.map +1 -0
  24. package/dist/declarations/src/utils/chain.d.ts +4 -0
  25. package/dist/declarations/src/utils/chain.d.ts.map +1 -1
  26. package/dist/declarations/src/utils/pilFlavor.d.ts +54 -0
  27. package/dist/declarations/src/utils/pilFlavor.d.ts.map +1 -0
  28. package/dist/story-protocol-core-sdk.cjs.dev.js +1917 -1090
  29. package/dist/story-protocol-core-sdk.cjs.prod.js +1917 -1090
  30. package/dist/story-protocol-core-sdk.esm.js +1918 -1092
  31. package/package.json +5 -4
@@ -0,0 +1,75 @@
1
+ import { Address } from "viem";
2
+ import { SupportedChainIds } from "../config.js";
3
+ import { LicenseTermsInput } from "../resources/license.js";
4
+ import { RoyaltyPolicyInput } from "../resources/royalty.js";
5
+ export type NonCommercialSocialRemixingRequest = {
6
+ /** Optional overrides for the default license terms. */
7
+ override?: Partial<LicenseTermsInput>;
8
+ /**
9
+ * The chain ID to use for this license flavor.
10
+ *
11
+ * @default aeneid
12
+ */
13
+ chainId?: SupportedChainIds;
14
+ };
15
+ export type CommercialRemixRequest = {
16
+ /** The fee to be paid when minting a license. */
17
+ defaultMintingFee: bigint | number;
18
+ /** Percentage of revenue that must be shared with the licensor. Must be between 0 and 100. */
19
+ commercialRevShare: number;
20
+ /** The ERC20 token to be used to pay the minting fee */
21
+ currency: Address;
22
+ /**
23
+ * The type of royalty policy to be used.
24
+ *
25
+ * @default LAP
26
+ */
27
+ royaltyPolicy?: RoyaltyPolicyInput;
28
+ /**
29
+ * The chain ID to use for this license flavor.
30
+ *
31
+ * @default aeneid
32
+ */
33
+ chainId?: SupportedChainIds;
34
+ /** Optional overrides for the default license terms. */
35
+ override?: Partial<LicenseTermsInput>;
36
+ };
37
+ export type CommercialUseRequest = {
38
+ /** The fee to be paid when minting a license. */
39
+ defaultMintingFee: bigint | number;
40
+ /** The ERC20 token to be used to pay the minting fee. */
41
+ currency: Address;
42
+ /**
43
+ * The type of royalty policy to be used.
44
+ *
45
+ * @default LAP
46
+ */
47
+ royaltyPolicy?: RoyaltyPolicyInput;
48
+ /**
49
+ * The chain ID to use for this license flavor.
50
+ *
51
+ * @default aeneid
52
+ */
53
+ chainId?: SupportedChainIds;
54
+ /** Optional overrides for the default license terms. */
55
+ override?: Partial<LicenseTermsInput>;
56
+ };
57
+ export type CreativeCommonsAttributionRequest = {
58
+ /** The ERC20 token to be used to pay the minting fee. */
59
+ currency: Address;
60
+ /**
61
+ * The type of royalty policy to be used.
62
+ *
63
+ * @default LAP
64
+ */
65
+ royaltyPolicy?: RoyaltyPolicyInput;
66
+ /**
67
+ * The chain ID to use for this license flavor.
68
+ *
69
+ * @default aeneid
70
+ */
71
+ chainId?: SupportedChainIds;
72
+ /** Optional overrides for the default license terms. */
73
+ override?: Partial<LicenseTermsInput>;
74
+ };
75
+ //# sourceMappingURL=pilFlavor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pilFlavor.d.ts","sourceRoot":"../../../../../src/types/utils","sources":["pilFlavor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,qBAAkB;AAC9C,OAAO,EAAE,iBAAiB,EAAE,gCAA6B;AACzD,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAE1D,MAAM,MAAM,kCAAkC,GAAG;IAC/C,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,8FAA8F;IAC9F,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wDAAwD;IACxD,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,iDAAiD;IACjD,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACvC,CAAC"}
@@ -5,6 +5,7 @@ export declare const aeneid: {
5
5
  readonly url: "https://aeneid.storyscan.xyz/";
6
6
  };
7
7
  };
8
+ blockTime?: number | undefined | undefined;
8
9
  contracts: {
9
10
  readonly multicall3: {
10
11
  readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
@@ -19,6 +20,7 @@ export declare const aeneid: {
19
20
  readonly symbol: "IP";
20
21
  readonly decimals: 18;
21
22
  };
23
+ experimental_preconfirmationTime?: number | undefined | undefined;
22
24
  rpcUrls: {
23
25
  readonly default: {
24
26
  readonly http: readonly ["https://aeneid.storyrpc.io/"];
@@ -38,6 +40,7 @@ export declare const mainnet: {
38
40
  readonly url: "https://dev-mainnet.storyscan.xyz/";
39
41
  };
40
42
  };
43
+ blockTime?: number | undefined | undefined;
41
44
  contracts: {
42
45
  readonly multicall3: {
43
46
  readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
@@ -52,6 +55,7 @@ export declare const mainnet: {
52
55
  readonly symbol: "IP";
53
56
  readonly decimals: 18;
54
57
  };
58
+ experimental_preconfirmationTime?: number | undefined | undefined;
55
59
  rpcUrls: {
56
60
  readonly default: {
57
61
  readonly http: readonly ["https://mainnet.storyrpc.io/"];
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"../../../../src/utils","sources":["chain.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBjB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBlB,CAAC"}
1
+ {"version":3,"file":"chain.d.ts","sourceRoot":"../../../../src/utils","sources":["chain.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBjB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBlB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { SupportedChainIds } from "../types/config.js";
2
+ import { LicenseTerms, LicenseTermsInput } from "../types/resources/license.js";
3
+ import { CommercialRemixRequest, CommercialUseRequest, CreativeCommonsAttributionRequest, NonCommercialSocialRemixingRequest } from "../types/utils/pilFlavor.js";
4
+ /**
5
+ * Pre-configured Programmable IP License (PIL) flavors for ease of use.
6
+ *
7
+ * The PIL is highly configurable, but these pre-configured license terms (flavors)
8
+ * are the most popular options that cover common use cases.
9
+ *
10
+ * @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors | PIL Flavors Documentation}
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * // Create a commercial use license
15
+ * const commercialLicense = PILFlavor.commercialUse({
16
+ * defaultMintingFee: 1000000000000000000n, // 1 IP minting fee
17
+ * currencyToken: "0x1234...", // currency token
18
+ * royaltyPolicy: "LAP" // royalty policy
19
+ * });
20
+ *
21
+ * // Create a non-commercial social remixing license
22
+ * const remixLicense = PILFlavor.nonCommercialSocialRemixing();
23
+ * ```
24
+ */
25
+ export declare class PILFlavor {
26
+ private static readonly _nonComSocialRemixingPIL;
27
+ private static readonly _commercialUse;
28
+ private static readonly _commercialRemix;
29
+ private static readonly _creativeCommonsAttribution;
30
+ /**
31
+ * Gets the values to create a Non-Commercial Social Remixing license terms flavor.
32
+ * @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#non-commercial-social-remixing | Non Commercial Social Remixing}
33
+ */
34
+ static nonCommercialSocialRemixing: (request?: NonCommercialSocialRemixingRequest) => LicenseTerms;
35
+ /**
36
+ * Gets the values to create a Commercial Use license terms flavor.
37
+ * @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#commercial-use | Commercial Use}
38
+ */
39
+ static commercialUse: ({ defaultMintingFee, currency, royaltyPolicy, chainId, override, }: CommercialUseRequest) => LicenseTerms;
40
+ /**
41
+ * Gets the values to create a Commercial Remixing license terms flavor.
42
+ * @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#commercial-remix | Commercial Remix}
43
+ */
44
+ static commercialRemix: ({ defaultMintingFee, royaltyPolicy, currency, commercialRevShare, chainId, override, }: CommercialRemixRequest) => LicenseTerms;
45
+ /**
46
+ * Gets the values to create a Creative Commons Attribution (CC-BY) license terms flavor.
47
+ * @see {@link https://docs.story.foundation/concepts/programmable-ip-license/pil-flavors#creative-commons-attribution | Creative Commons Attribution}
48
+ */
49
+ static creativeCommonsAttribution: ({ royaltyPolicy, currency, chainId, override, }: CreativeCommonsAttributionRequest) => LicenseTerms;
50
+ static validateLicenseTerms: (params: LicenseTermsInput, chainId?: SupportedChainIds) => LicenseTerms;
51
+ private static verifyCommercialUse;
52
+ private static verifyDerivatives;
53
+ }
54
+ //# sourceMappingURL=pilFlavor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pilFlavor.d.ts","sourceRoot":"../../../../src/utils","sources":["pilFlavor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,2BAAwB;AACpD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,sCAAmC;AAC7E,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iCAAiC,EACjC,kCAAkC,EACnC,oCAAiC;AAyBlC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAS9C;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CASpC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAStC;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,2BAA2B,CASjD;IAEF;;;OAGG;IACH,OAAc,2BAA2B,GACvC,UAAU,kCAAkC,KAC3C,YAAY,CAQb;IAEF;;;OAGG;IACH,OAAc,aAAa,GAAI,oEAM5B,oBAAoB,KAAG,YAAY,CAWpC;IAEF;;;OAGG;IACH,OAAc,eAAe,GAAI,wFAO9B,sBAAsB,KAAG,YAAY,CAYtC;IAEF;;;OAGG;IACH,OAAc,0BAA0B,GAAI,iDAKzC,iCAAiC,KAAG,YAAY,CAUjD;IAEF,OAAc,oBAAoB,GAChC,QAAQ,iBAAiB,EACzB,UAAU,iBAAiB,KAC1B,YAAY,CAmCb;IAEF,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAqBhC;IAEF,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAe9B;CACH"}