@story-protocol/core-sdk 1.0.0-rc.6 → 1.1.0-stable
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 +8 -9
 - package/dist/declarations/src/abi/generated.d.ts +18329 -10708
 - package/dist/declarations/src/abi/generated.d.ts.map +1 -1
 - package/dist/declarations/src/client.d.ts +9 -0
 - package/dist/declarations/src/client.d.ts.map +1 -1
 - package/dist/declarations/src/constants/common.d.ts +2 -1
 - package/dist/declarations/src/constants/common.d.ts.map +1 -1
 - package/dist/declarations/src/index.d.ts +17 -8
 - package/dist/declarations/src/index.d.ts.map +1 -1
 - package/dist/declarations/src/resources/dispute.d.ts +3 -1
 - package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
 - package/dist/declarations/src/resources/ipAccount.d.ts +17 -2
 - package/dist/declarations/src/resources/ipAccount.d.ts.map +1 -1
 - package/dist/declarations/src/resources/ipAsset.d.ts +154 -7
 - package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
 - package/dist/declarations/src/resources/license.d.ts +45 -15
 - package/dist/declarations/src/resources/license.d.ts.map +1 -1
 - package/dist/declarations/src/resources/nftClient.d.ts +24 -0
 - package/dist/declarations/src/resources/nftClient.d.ts.map +1 -0
 - package/dist/declarations/src/resources/permission.d.ts +70 -8
 - package/dist/declarations/src/resources/permission.d.ts.map +1 -1
 - package/dist/declarations/src/resources/royalty.d.ts +14 -9
 - package/dist/declarations/src/resources/royalty.d.ts.map +1 -1
 - package/dist/declarations/src/types/common.d.ts +12 -1
 - package/dist/declarations/src/types/common.d.ts.map +1 -1
 - package/dist/declarations/src/types/config.d.ts +2 -2
 - package/dist/declarations/src/types/config.d.ts.map +1 -1
 - package/dist/declarations/src/types/options.d.ts +4 -5
 - package/dist/declarations/src/types/options.d.ts.map +1 -1
 - package/dist/declarations/src/types/resources/dispute.d.ts +13 -30
 - package/dist/declarations/src/types/resources/dispute.d.ts.map +1 -1
 - package/dist/declarations/src/types/resources/ipAccount.d.ts +21 -11
 - package/dist/declarations/src/types/resources/ipAccount.d.ts.map +1 -1
 - package/dist/declarations/src/types/resources/ipAsset.d.ts +160 -14
 - package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
 - package/dist/declarations/src/types/resources/license.d.ts +50 -25
 - package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
 - package/dist/declarations/src/types/resources/nftClient.d.ts +18 -0
 - package/dist/declarations/src/types/resources/nftClient.d.ts.map +1 -0
 - package/dist/declarations/src/types/resources/permission.d.ts +34 -5
 - package/dist/declarations/src/types/resources/permission.d.ts.map +1 -1
 - package/dist/declarations/src/types/resources/royalty.d.ts +34 -30
 - package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
 - package/dist/declarations/src/utils/chain.d.ts +34 -0
 - package/dist/declarations/src/utils/chain.d.ts.map +1 -0
 - package/dist/declarations/src/utils/sign.d.ts +16 -0
 - package/dist/declarations/src/utils/sign.d.ts.map +1 -0
 - package/dist/story-protocol-core-sdk.cjs.dev.js +15290 -8037
 - package/dist/story-protocol-core-sdk.cjs.prod.js +15290 -8037
 - package/dist/story-protocol-core-sdk.esm.js +15285 -8039
 - package/package.json +2 -2
 
| 
         @@ -1,10 +1,11 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import {  
     | 
| 
      
 1 
     | 
    
         
            +
            import { Address } from "viem";
         
     | 
| 
       2 
2 
     | 
    
         
             
            import { TxOptions } from "../options.js";
         
     | 
| 
      
 3 
     | 
    
         
            +
            import { EncodedTxData } from "../../abi/generated.js";
         
     | 
| 
       3 
4 
     | 
    
         
             
            export type RoyaltyPolicyApiResponse = {
         
     | 
| 
       4 
5 
     | 
    
         
             
                data: RoyaltyPolicy;
         
     | 
| 
       5 
6 
     | 
    
         
             
            };
         
     | 
| 
       6 
7 
     | 
    
         
             
            export type RoyaltyPolicy = {
         
     | 
| 
       7 
     | 
    
         
            -
                id:  
     | 
| 
      
 8 
     | 
    
         
            +
                id: Address;
         
     | 
| 
       8 
9 
     | 
    
         
             
                targetAncestors: string[];
         
     | 
| 
       9 
10 
     | 
    
         
             
                targetRoyaltyAmount: string[];
         
     | 
| 
       10 
11 
     | 
    
         
             
            };
         
     | 
| 
         @@ -17,56 +18,59 @@ export type RoyaltyContext = { 
     | 
|
| 
       17 
18 
     | 
    
         
             
                parentAncestorsRoyalties2: number[];
         
     | 
| 
       18 
19 
     | 
    
         
             
            };
         
     | 
| 
       19 
20 
     | 
    
         
             
            export type CollectRoyaltyTokensRequest = {
         
     | 
| 
       20 
     | 
    
         
            -
                parentIpId:  
     | 
| 
       21 
     | 
    
         
            -
                royaltyVaultIpId:  
     | 
| 
      
 21 
     | 
    
         
            +
                parentIpId: Address;
         
     | 
| 
      
 22 
     | 
    
         
            +
                royaltyVaultIpId: Address;
         
     | 
| 
       22 
23 
     | 
    
         
             
                txOptions?: TxOptions;
         
     | 
| 
       23 
24 
     | 
    
         
             
            };
         
     | 
| 
       24 
25 
     | 
    
         
             
            export type CollectRoyaltyTokensResponse = {
         
     | 
| 
       25 
     | 
    
         
            -
                txHash 
     | 
| 
       26 
     | 
    
         
            -
                 
     | 
| 
      
 26 
     | 
    
         
            +
                txHash?: string;
         
     | 
| 
      
 27 
     | 
    
         
            +
                encodedTxData?: EncodedTxData;
         
     | 
| 
      
 28 
     | 
    
         
            +
                royaltyTokensCollected?: bigint;
         
     | 
| 
       27 
29 
     | 
    
         
             
            };
         
     | 
| 
       28 
30 
     | 
    
         
             
            export type RoyaltyData = [
         
     | 
| 
       29 
31 
     | 
    
         
             
                isUnlinkableToParents: boolean,
         
     | 
| 
       30 
     | 
    
         
            -
                ipRoyaltyVault:  
     | 
| 
      
 32 
     | 
    
         
            +
                ipRoyaltyVault: Address,
         
     | 
| 
       31 
33 
     | 
    
         
             
                royaltyStack: bigint,
         
     | 
| 
       32 
     | 
    
         
            -
                ancestorsAddresses:  
     | 
| 
      
 34 
     | 
    
         
            +
                ancestorsAddresses: Address,
         
     | 
| 
       33 
35 
     | 
    
         
             
                ancestorsRoyalties: bigint[]
         
     | 
| 
       34 
36 
     | 
    
         
             
            ];
         
     | 
| 
       35 
37 
     | 
    
         
             
            export type ClaimableRevenueRequest = {
         
     | 
| 
       36 
     | 
    
         
            -
                royaltyVaultIpId:  
     | 
| 
       37 
     | 
    
         
            -
                account:  
     | 
| 
       38 
     | 
    
         
            -
                snapshotId: string;
         
     | 
| 
       39 
     | 
    
         
            -
                token:  
     | 
| 
      
 38 
     | 
    
         
            +
                royaltyVaultIpId: Address;
         
     | 
| 
      
 39 
     | 
    
         
            +
                account: Address;
         
     | 
| 
      
 40 
     | 
    
         
            +
                snapshotId: string | number | bigint;
         
     | 
| 
      
 41 
     | 
    
         
            +
                token: Address;
         
     | 
| 
       40 
42 
     | 
    
         
             
            };
         
     | 
| 
       41 
     | 
    
         
            -
            export type ClaimableRevenueResponse =  
     | 
| 
      
 43 
     | 
    
         
            +
            export type ClaimableRevenueResponse = bigint;
         
     | 
| 
       42 
44 
     | 
    
         
             
            export type PayRoyaltyOnBehalfRequest = {
         
     | 
| 
       43 
     | 
    
         
            -
                receiverIpId:  
     | 
| 
       44 
     | 
    
         
            -
                payerIpId:  
     | 
| 
       45 
     | 
    
         
            -
                token:  
     | 
| 
       46 
     | 
    
         
            -
                amount: string;
         
     | 
| 
      
 45 
     | 
    
         
            +
                receiverIpId: Address;
         
     | 
| 
      
 46 
     | 
    
         
            +
                payerIpId: Address;
         
     | 
| 
      
 47 
     | 
    
         
            +
                token: Address;
         
     | 
| 
      
 48 
     | 
    
         
            +
                amount: string | number | bigint;
         
     | 
| 
       47 
49 
     | 
    
         
             
                txOptions?: TxOptions;
         
     | 
| 
       48 
50 
     | 
    
         
             
            };
         
     | 
| 
       49 
51 
     | 
    
         
             
            export type PayRoyaltyOnBehalfResponse = {
         
     | 
| 
       50 
     | 
    
         
            -
                txHash 
     | 
| 
      
 52 
     | 
    
         
            +
                txHash?: string;
         
     | 
| 
      
 53 
     | 
    
         
            +
                encodedTxData?: EncodedTxData;
         
     | 
| 
       51 
54 
     | 
    
         
             
            };
         
     | 
| 
       52 
55 
     | 
    
         
             
            export type SnapshotRequest = {
         
     | 
| 
       53 
     | 
    
         
            -
                royaltyVaultIpId:  
     | 
| 
      
 56 
     | 
    
         
            +
                royaltyVaultIpId: Address;
         
     | 
| 
       54 
57 
     | 
    
         
             
                txOptions?: TxOptions;
         
     | 
| 
       55 
58 
     | 
    
         
             
            };
         
     | 
| 
       56 
     | 
    
         
            -
            export type  
     | 
| 
       57 
     | 
    
         
            -
                snapshotIds: string[];
         
     | 
| 
       58 
     | 
    
         
            -
                token:  
     | 
| 
       59 
     | 
    
         
            -
                 
     | 
| 
       60 
     | 
    
         
            -
                 
     | 
| 
      
 59 
     | 
    
         
            +
            export type ClaimRevenueRequest = {
         
     | 
| 
      
 60 
     | 
    
         
            +
                snapshotIds: string[] | number[] | bigint[];
         
     | 
| 
      
 61 
     | 
    
         
            +
                token: Address;
         
     | 
| 
      
 62 
     | 
    
         
            +
                royaltyVaultIpId: Address;
         
     | 
| 
      
 63 
     | 
    
         
            +
                account?: Address;
         
     | 
| 
       61 
64 
     | 
    
         
             
                txOptions?: TxOptions;
         
     | 
| 
       62 
65 
     | 
    
         
             
            };
         
     | 
| 
       63 
     | 
    
         
            -
            export type  
     | 
| 
       64 
     | 
    
         
            -
                txHash 
     | 
| 
       65 
     | 
    
         
            -
                 
     | 
| 
      
 66 
     | 
    
         
            +
            export type ClaimRevenueResponse = {
         
     | 
| 
      
 67 
     | 
    
         
            +
                txHash?: string;
         
     | 
| 
      
 68 
     | 
    
         
            +
                encodedTxData?: EncodedTxData;
         
     | 
| 
      
 69 
     | 
    
         
            +
                claimableToken?: bigint;
         
     | 
| 
       66 
70 
     | 
    
         
             
            };
         
     | 
| 
       67 
71 
     | 
    
         
             
            export type SnapshotResponse = {
         
     | 
| 
       68 
     | 
    
         
            -
                txHash 
     | 
| 
       69 
     | 
    
         
            -
                 
     | 
| 
      
 72 
     | 
    
         
            +
                txHash?: string;
         
     | 
| 
      
 73 
     | 
    
         
            +
                encodedTxData?: EncodedTxData;
         
     | 
| 
      
 74 
     | 
    
         
            +
                snapshotId?: bigint;
         
     | 
| 
       70 
75 
     | 
    
         
             
            };
         
     | 
| 
       71 
     | 
    
         
            -
            export type RoyaltyVaultAddress = Hex;
         
     | 
| 
       72 
76 
     | 
    
         
             
            //# sourceMappingURL=royalty.d.ts.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"royalty.d.ts","sourceRoot":"../../../../../src/types/resources","sources":["royalty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE, 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"royalty.d.ts","sourceRoot":"../../../../../src/types/resources","sources":["royalty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,sBAAmB;AACvC,OAAO,EAAE,aAAa,EAAE,+BAA4B;AAEpD,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,yBAAyB,EAAE,MAAM,EAAE,CAAC;IACpC,yBAAyB,EAAE,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAA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,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
         
     | 
| 
         @@ -0,0 +1,34 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            export declare const iliad: {
         
     | 
| 
      
 2 
     | 
    
         
            +
                blockExplorers: {
         
     | 
| 
      
 3 
     | 
    
         
            +
                    readonly default: {
         
     | 
| 
      
 4 
     | 
    
         
            +
                        readonly name: "Explorer";
         
     | 
| 
      
 5 
     | 
    
         
            +
                        readonly url: "https://testnet.storyscan.xyz";
         
     | 
| 
      
 6 
     | 
    
         
            +
                    };
         
     | 
| 
      
 7 
     | 
    
         
            +
                };
         
     | 
| 
      
 8 
     | 
    
         
            +
                contracts: {
         
     | 
| 
      
 9 
     | 
    
         
            +
                    readonly multicall3: {
         
     | 
| 
      
 10 
     | 
    
         
            +
                        readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
         
     | 
| 
      
 11 
     | 
    
         
            +
                        readonly blockCreated: 5882;
         
     | 
| 
      
 12 
     | 
    
         
            +
                    };
         
     | 
| 
      
 13 
     | 
    
         
            +
                };
         
     | 
| 
      
 14 
     | 
    
         
            +
                id: 1513;
         
     | 
| 
      
 15 
     | 
    
         
            +
                name: "iliad";
         
     | 
| 
      
 16 
     | 
    
         
            +
                nativeCurrency: {
         
     | 
| 
      
 17 
     | 
    
         
            +
                    readonly name: "IP";
         
     | 
| 
      
 18 
     | 
    
         
            +
                    readonly symbol: "IP";
         
     | 
| 
      
 19 
     | 
    
         
            +
                    readonly decimals: 18;
         
     | 
| 
      
 20 
     | 
    
         
            +
                };
         
     | 
| 
      
 21 
     | 
    
         
            +
                rpcUrls: {
         
     | 
| 
      
 22 
     | 
    
         
            +
                    readonly default: {
         
     | 
| 
      
 23 
     | 
    
         
            +
                        readonly http: readonly ["https://testnet.storyrpc.io"];
         
     | 
| 
      
 24 
     | 
    
         
            +
                        readonly webSocket: readonly ["wss://story-network.rpc.caldera.xyz/ws"];
         
     | 
| 
      
 25 
     | 
    
         
            +
                    };
         
     | 
| 
      
 26 
     | 
    
         
            +
                };
         
     | 
| 
      
 27 
     | 
    
         
            +
                sourceId?: number | undefined;
         
     | 
| 
      
 28 
     | 
    
         
            +
                testnet: true;
         
     | 
| 
      
 29 
     | 
    
         
            +
                custom?: Record<string, unknown> | undefined;
         
     | 
| 
      
 30 
     | 
    
         
            +
                formatters?: undefined;
         
     | 
| 
      
 31 
     | 
    
         
            +
                serializers?: import("viem").ChainSerializers<undefined> | undefined;
         
     | 
| 
      
 32 
     | 
    
         
            +
                fees?: import("viem").ChainFees<undefined> | undefined;
         
     | 
| 
      
 33 
     | 
    
         
            +
            };
         
     | 
| 
      
 34 
     | 
    
         
            +
            //# sourceMappingURL=chain.d.ts.map
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"chain.d.ts","sourceRoot":"../../../../src/utils","sources":["chain.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBhB,CAAC"}
         
     | 
| 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            import { PermissionSignatureRequest, PermissionSignatureResponse } from "../types/common.js";
         
     | 
| 
      
 2 
     | 
    
         
            +
            /**
         
     | 
| 
      
 3 
     | 
    
         
            +
             * Get the signature for setting permissions.
         
     | 
| 
      
 4 
     | 
    
         
            +
             * @param param - The parameter object containing necessary data to get the signature.
         
     | 
| 
      
 5 
     | 
    
         
            +
             * @param param.ipId - The IP ID.
         
     | 
| 
      
 6 
     | 
    
         
            +
             * @param param.deadline - The deadline.
         
     | 
| 
      
 7 
     | 
    
         
            +
             * @param param.nonce - The nonce.
         
     | 
| 
      
 8 
     | 
    
         
            +
             * @param param.wallet - The wallet client.
         
     | 
| 
      
 9 
     | 
    
         
            +
             * @param param.chainId - The chain ID.
         
     | 
| 
      
 10 
     | 
    
         
            +
             * @param param.permissions - The permissions.
         
     | 
| 
      
 11 
     | 
    
         
            +
             * @param param.permissionFunc - The permission function,default function is setPermission.
         
     | 
| 
      
 12 
     | 
    
         
            +
             * @returns A Promise that resolves to the signature.
         
     | 
| 
      
 13 
     | 
    
         
            +
             */
         
     | 
| 
      
 14 
     | 
    
         
            +
            export declare const getPermissionSignature: (param: PermissionSignatureRequest) => Promise<PermissionSignatureResponse>;
         
     | 
| 
      
 15 
     | 
    
         
            +
            export declare const getDeadline: (deadline?: bigint | number | string) => bigint;
         
     | 
| 
      
 16 
     | 
    
         
            +
            //# sourceMappingURL=sign.d.ts.map
         
     | 
| 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"sign.d.ts","sourceRoot":"../../../../src/utils","sources":["sign.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,2BAAwB;AAE1F;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,UAC1B,0BAA0B,KAChC,QAAQ,2BAA2B,CA8ErC,CAAC;AAEF,eAAO,MAAM,WAAW,cAAe,MAAM,GAAG,MAAM,GAAG,MAAM,KAAG,MAMjE,CAAC"}
         
     |