@story-protocol/core-sdk 1.2.0-rc.4 → 1.3.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/declarations/src/abi/generated.d.ts +12683 -4297
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/client.d.ts +5 -0
- package/dist/declarations/src/client.d.ts.map +1 -1
- package/dist/declarations/src/constants/common.d.ts +3 -0
- package/dist/declarations/src/constants/common.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +1 -1
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/dispute.d.ts +8 -4
- package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/resources/group.d.ts +73 -20
- package/dist/declarations/src/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +304 -206
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +15 -4
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/resources/nftClient.d.ts +1 -1
- package/dist/declarations/src/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/resources/royalty.d.ts +11 -87
- package/dist/declarations/src/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/resources/wip.d.ts +29 -0
- package/dist/declarations/src/resources/wip.d.ts.map +1 -0
- package/dist/declarations/src/types/common.d.ts +25 -10
- package/dist/declarations/src/types/common.d.ts.map +1 -1
- package/dist/declarations/src/types/config.d.ts +1 -1
- package/dist/declarations/src/types/config.d.ts.map +1 -1
- package/dist/declarations/src/types/options.d.ts +3 -3
- package/dist/declarations/src/types/options.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/dispute.d.ts +3 -2
- package/dist/declarations/src/types/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/group.d.ts +21 -11
- package/dist/declarations/src/types/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +86 -59
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +15 -10
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/permission.d.ts +0 -1
- package/dist/declarations/src/types/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/royalty.d.ts +68 -8
- package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/wip.d.ts +16 -0
- package/dist/declarations/src/types/resources/wip.d.ts.map +1 -0
- package/dist/declarations/src/types/utils/txOptions.d.ts +13 -0
- package/dist/declarations/src/types/utils/txOptions.d.ts.map +1 -0
- package/dist/declarations/src/types/utils/wip.d.ts +87 -0
- package/dist/declarations/src/types/utils/wip.d.ts.map +1 -0
- package/dist/declarations/src/utils/chain.d.ts +5 -5
- package/dist/declarations/src/utils/chain.d.ts.map +1 -1
- package/dist/declarations/src/utils/getIpMetadataForWorkflow.d.ts +9 -0
- package/dist/declarations/src/utils/getIpMetadataForWorkflow.d.ts.map +1 -0
- package/dist/declarations/src/utils/sign.d.ts +0 -1
- package/dist/declarations/src/utils/sign.d.ts.map +1 -1
- package/dist/story-protocol-core-sdk.cjs.dev.js +5185 -3807
- package/dist/story-protocol-core-sdk.cjs.prod.js +5185 -3807
- package/dist/story-protocol-core-sdk.esm.js +5186 -3808
- package/package.json +2 -2
@@ -0,0 +1,87 @@
|
|
1
|
+
import { Address, Hash, PublicClient } from "viem";
|
2
|
+
import { Multicall3Aggregate3Request, Multicall3Client, Erc20TokenClient, EncodedTxData, SimpleWalletClient, PiLicenseTemplateClient, LicensingModuleClient } from "../../abi/generated.js";
|
3
|
+
import { TxOptions } from "../options.js";
|
4
|
+
/**
|
5
|
+
* Options to override the default behavior of the auto wrapping IP
|
6
|
+
* and auto approve logic.
|
7
|
+
*/
|
8
|
+
export type WithWipOptions = {
|
9
|
+
/** options to configure WIP behavior */
|
10
|
+
wipOptions?: {
|
11
|
+
/**
|
12
|
+
* Use multicall to batch the WIP calls into one transaction when possible.
|
13
|
+
*
|
14
|
+
* @default true
|
15
|
+
*/
|
16
|
+
useMulticallWhenPossible?: boolean;
|
17
|
+
/**
|
18
|
+
* By default IP is converted to WIP if the current WIP
|
19
|
+
* balance does not cover the fees.
|
20
|
+
* Set this to `false` to disable this behavior.
|
21
|
+
*
|
22
|
+
* @default true
|
23
|
+
*/
|
24
|
+
enableAutoWrapIp?: boolean;
|
25
|
+
/**
|
26
|
+
* Automatically approve WIP usage when WIP is needed but current allowance
|
27
|
+
* is not sufficient.
|
28
|
+
* Set this to `false` to disable this behavior.
|
29
|
+
*
|
30
|
+
* @default true
|
31
|
+
*/
|
32
|
+
enableAutoApprove?: boolean;
|
33
|
+
};
|
34
|
+
};
|
35
|
+
export type Multicall3ValueCall = Multicall3Aggregate3Request["calls"][0] & {
|
36
|
+
value: bigint;
|
37
|
+
};
|
38
|
+
export type WipSpender = {
|
39
|
+
address: Address;
|
40
|
+
/**
|
41
|
+
* Amount that the address will spend in WIP.
|
42
|
+
* If not provided, then unlimited amount is assumed.
|
43
|
+
*/
|
44
|
+
amount?: bigint;
|
45
|
+
};
|
46
|
+
export type WipApprovalCall = {
|
47
|
+
spenders: WipSpender[];
|
48
|
+
client: Erc20TokenClient;
|
49
|
+
rpcClient: PublicClient;
|
50
|
+
/** owner is the address calling the approval */
|
51
|
+
owner: Address;
|
52
|
+
/** when true, will return an array of {@link Multicall3ValueCall} */
|
53
|
+
useMultiCall: boolean;
|
54
|
+
};
|
55
|
+
export type ContractCallWithWipFees = WithWipOptions & {
|
56
|
+
totalFees: bigint;
|
57
|
+
multicall3Client: Multicall3Client;
|
58
|
+
wipClient: Erc20TokenClient;
|
59
|
+
/** all possible spenders of the wip */
|
60
|
+
wipSpenders: WipSpender[];
|
61
|
+
contractCall: () => Promise<Hash>;
|
62
|
+
encodedTxs: EncodedTxData[];
|
63
|
+
rpcClient: PublicClient;
|
64
|
+
wallet: SimpleWalletClient;
|
65
|
+
sender: Address;
|
66
|
+
txOptions?: TxOptions;
|
67
|
+
};
|
68
|
+
export type MulticallWithWrapIp = WithWipOptions & {
|
69
|
+
calls: Multicall3ValueCall[];
|
70
|
+
ipAmountToWrap: bigint;
|
71
|
+
contractCall: () => Promise<Hash>;
|
72
|
+
wipSpenders: WipSpender[];
|
73
|
+
multicall3Client: Multicall3Client;
|
74
|
+
wipClient: Erc20TokenClient;
|
75
|
+
rpcClient: PublicClient;
|
76
|
+
wallet: SimpleWalletClient;
|
77
|
+
};
|
78
|
+
export type CalculateDerivativeMintFeeParams = {
|
79
|
+
multicall3Client: Multicall3Client;
|
80
|
+
licenseTemplateClient: PiLicenseTemplateClient;
|
81
|
+
licensingModuleClient: LicensingModuleClient;
|
82
|
+
parentIpId: Address;
|
83
|
+
licenseTermsId: bigint;
|
84
|
+
receiver: Address;
|
85
|
+
amount: bigint;
|
86
|
+
};
|
87
|
+
//# sourceMappingURL=wip.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wip.d.ts","sourceRoot":"../../../../../src/types/utils","sources":["wip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACtB,+BAA4B;AAC7B,OAAO,EAAE,SAAS,EAAE,sBAAmB;AAEvC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,wCAAwC;IACxC,UAAU,CAAC,EAAE;QACX;;;;WAIG;QACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;QAEnC;;;;;;WAMG;QACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAE3B;;;;;;WAMG;QACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF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,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export declare const
|
1
|
+
export declare const aeneid: {
|
2
2
|
blockExplorers: {
|
3
3
|
readonly default: {
|
4
4
|
readonly name: "Explorer";
|
5
|
-
readonly url: "https://
|
5
|
+
readonly url: "https://aeneid.storyscan.xyz/";
|
6
6
|
};
|
7
7
|
};
|
8
8
|
contracts: {
|
@@ -11,8 +11,8 @@ export declare const odyssey: {
|
|
11
11
|
readonly blockCreated: 5882;
|
12
12
|
};
|
13
13
|
};
|
14
|
-
id:
|
15
|
-
name: "
|
14
|
+
id: 1315;
|
15
|
+
name: "aeneid";
|
16
16
|
nativeCurrency: {
|
17
17
|
readonly name: "IP";
|
18
18
|
readonly symbol: "IP";
|
@@ -20,7 +20,7 @@ export declare const odyssey: {
|
|
20
20
|
};
|
21
21
|
rpcUrls: {
|
22
22
|
readonly default: {
|
23
|
-
readonly http: readonly ["https://
|
23
|
+
readonly http: readonly ["https://aeneid.storyrpc.io/"];
|
24
24
|
};
|
25
25
|
};
|
26
26
|
sourceId?: number | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"../../../../src/utils","sources":["chain.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"../../../../src/utils","sources":["chain.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBjB,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Hex } from "viem";
|
2
|
+
export type IpMetadataForWorkflow = {
|
3
|
+
ipMetadataURI: string;
|
4
|
+
ipMetadataHash: Hex;
|
5
|
+
nftMetadataURI: string;
|
6
|
+
nftMetadataHash: Hex;
|
7
|
+
};
|
8
|
+
export declare const getIpMetadataForWorkflow: (metadata?: Partial<IpMetadataForWorkflow>) => IpMetadataForWorkflow;
|
9
|
+
//# sourceMappingURL=getIpMetadataForWorkflow.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getIpMetadataForWorkflow.d.ts","sourceRoot":"../../../../src/utils","sources":["getIpMetadataForWorkflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAY,MAAM,MAAM,CAAC;AAErC,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,GAAG,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,wBAAwB,cACxB,QAAQ,qBAAqB,CAAC,KACxC,qBAOF,CAAC"}
|
@@ -7,7 +7,6 @@ import { PermissionSignatureRequest, SignatureRequest, SignatureResponse } from
|
|
7
7
|
* @param param.nonce - The nonce.
|
8
8
|
* @param param.wallet - The wallet client.
|
9
9
|
* @param param.chainId - The chain ID.
|
10
|
-
* @param param.permissions - The permissions.
|
11
10
|
* @param param.permissionFunc - The permission function,default function is setPermission.
|
12
11
|
* @returns A Promise that resolves to the signature.
|
13
12
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sign.d.ts","sourceRoot":"../../../../src/utils","sources":["sign.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EAClB,yCAAsC;AAEvC
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"../../../../src/utils","sources":["sign.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EAClB,yCAAsC;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,UAC1B,0BAA0B,KAChC,QAAQ,iBAAiB,CAqC3B,CAAC;AAEF,eAAO,MAAM,WAAW,kBAAmB,MAAM,aAAa,MAAM,GAAG,MAAM,GAAG,MAAM,KAAG,MAKxF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,6EAQtB,gBAAgB,KAAG,QAAQ,iBAAiB,CAkD9C,CAAC"}
|