@story-protocol/core-sdk 1.3.0 → 1.3.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.
- package/dist/declarations/src/abi/generated.d.ts +615 -5104
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/resources/group.d.ts +28 -1
- package/dist/declarations/src/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +38 -7
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +4 -3
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/resources/nftClient.d.ts +13 -1
- package/dist/declarations/src/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/types/common.d.ts +10 -4
- package/dist/declarations/src/types/common.d.ts.map +1 -1
- package/dist/declarations/src/types/options.d.ts +9 -4
- package/dist/declarations/src/types/options.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/group.d.ts +48 -1
- package/dist/declarations/src/types/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +45 -3
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +12 -7
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/nftClient.d.ts +11 -0
- package/dist/declarations/src/types/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/permission.d.ts +2 -2
- package/dist/declarations/src/types/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/types/utils/wip.d.ts +64 -0
- package/dist/declarations/src/types/utils/wip.d.ts.map +1 -0
- package/dist/declarations/src/utils/token.d.ts +28 -0
- package/dist/declarations/src/utils/token.d.ts.map +1 -0
- package/dist/story-protocol-core-sdk.cjs.dev.js +4147 -2907
- package/dist/story-protocol-core-sdk.cjs.prod.js +4147 -2907
- package/dist/story-protocol-core-sdk.esm.js +4148 -2908
- package/package.json +1 -1
@@ -0,0 +1,64 @@
|
|
1
|
+
import { Address, Hash, PublicClient } from "viem";
|
2
|
+
import { Multicall3Aggregate3Request, EncodedTxData, SimpleWalletClient, Erc20Client } from "../../abi/generated.js";
|
3
|
+
import { ERC20Options, TransactionResponse, TxOptions, WipOptions, WithWipOptions } from "../options.js";
|
4
|
+
import { TokenClient, WipTokenClient } from "../../utils/token.js";
|
5
|
+
export type Multicall3ValueCall = Multicall3Aggregate3Request["calls"][0] & {
|
6
|
+
value: bigint;
|
7
|
+
};
|
8
|
+
export type Erc20Spender = {
|
9
|
+
address: Address;
|
10
|
+
/**
|
11
|
+
* Amount that the address will spend in erc20 token.
|
12
|
+
* If not provided, then unlimited amount is assumed.
|
13
|
+
*/
|
14
|
+
amount?: bigint;
|
15
|
+
};
|
16
|
+
export type ApprovalCall = {
|
17
|
+
spenders: Erc20Spender[];
|
18
|
+
client: TokenClient;
|
19
|
+
rpcClient: PublicClient;
|
20
|
+
/** owner is the address calling the approval */
|
21
|
+
owner: Address;
|
22
|
+
/** when true, will return an array of {@link Multicall3ValueCall} */
|
23
|
+
useMultiCall: boolean;
|
24
|
+
multicallAddress?: Address;
|
25
|
+
};
|
26
|
+
export type TokenApprovalCall = {
|
27
|
+
spenders: Erc20Spender[];
|
28
|
+
client: Erc20Client;
|
29
|
+
multicallAddress: Address;
|
30
|
+
rpcClient: PublicClient;
|
31
|
+
/** owner is the address calling the approval */
|
32
|
+
owner: Address;
|
33
|
+
/** when true, will return an array of {@link Multicall3ValueCall} */
|
34
|
+
useMultiCall: boolean;
|
35
|
+
};
|
36
|
+
export type ContractCallWithFees<T extends Hash | Hash[] = Hash> = {
|
37
|
+
totalFees: bigint;
|
38
|
+
multicall3Address: Address;
|
39
|
+
/** all possible spenders of the erc20 token */
|
40
|
+
tokenSpenders: Erc20Spender[];
|
41
|
+
contractCall: () => Promise<T>;
|
42
|
+
encodedTxs: EncodedTxData[];
|
43
|
+
rpcClient: PublicClient;
|
44
|
+
wallet: SimpleWalletClient;
|
45
|
+
sender: Address;
|
46
|
+
options: {
|
47
|
+
wipOptions?: WipOptions;
|
48
|
+
erc20Options?: ERC20Options;
|
49
|
+
};
|
50
|
+
token?: Address;
|
51
|
+
txOptions?: TxOptions;
|
52
|
+
};
|
53
|
+
export type MulticallWithWrapIp = WithWipOptions & {
|
54
|
+
calls: Multicall3ValueCall[];
|
55
|
+
ipAmountToWrap: bigint;
|
56
|
+
contractCall: () => Promise<Hash | Hash[]>;
|
57
|
+
wipSpenders: Erc20Spender[];
|
58
|
+
multicall3Address: Address;
|
59
|
+
wipClient: WipTokenClient;
|
60
|
+
rpcClient: PublicClient;
|
61
|
+
wallet: SimpleWalletClient;
|
62
|
+
};
|
63
|
+
export type ContractCallWithFeesResponse<T extends Hash | Hash[]> = Promise<T extends Hash[] ? TransactionResponse[] : TransactionResponse>;
|
64
|
+
//# 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,aAAa,EACb,kBAAkB,EAClB,WAAW,EACZ,+BAA4B;AAC7B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,cAAc,EACf,sBAAmB;AACpB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,6BAA0B;AAEhE,MAAM,MAAM,mBAAmB,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9F,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM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M,OAAO,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3C,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,YAAY,CAAC;IACxB,MAAM,EAAE,kBAAkB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,IAAI,OAAO,CACzE,CAAC,SAAS,IAAI,EAAE,GAAG,mBAAmB,EAAE,GAAG,mBAAmB,CAC/D,CAAC"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Address, Hash, PublicClient } from "viem";
|
2
|
+
import { EncodedTxData, SimpleWalletClient } from "../abi/generated.js";
|
3
|
+
export interface TokenClient {
|
4
|
+
balanceOf(account: Address): Promise<bigint>;
|
5
|
+
allowance(owner: string, spender: string): Promise<bigint>;
|
6
|
+
approve(spender: string, value: bigint): Promise<Hash>;
|
7
|
+
approveEncode(spender: Address, value: bigint): EncodedTxData;
|
8
|
+
}
|
9
|
+
export declare class ERC20Client implements TokenClient {
|
10
|
+
private ercClient;
|
11
|
+
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient, address: Address);
|
12
|
+
balanceOf(account: Address): Promise<bigint>;
|
13
|
+
allowance(owner: Address, spender: Address): Promise<bigint>;
|
14
|
+
approve(spender: Address, value: bigint): Promise<Hash>;
|
15
|
+
approveEncode(spender: Address, value: bigint): EncodedTxData;
|
16
|
+
mint(to: Address, amount: bigint): Promise<`0x${string}`>;
|
17
|
+
}
|
18
|
+
export declare class WipTokenClient implements TokenClient {
|
19
|
+
private wipClient;
|
20
|
+
constructor(rpcClient: PublicClient, wallet: SimpleWalletClient);
|
21
|
+
balanceOf(account: Address): Promise<bigint>;
|
22
|
+
allowance(owner: Address, spender: Address): Promise<bigint>;
|
23
|
+
approve(spender: Address, value: bigint): Promise<Hash>;
|
24
|
+
approveEncode(spender: Address, value: bigint): EncodedTxData;
|
25
|
+
depositEncode(): EncodedTxData;
|
26
|
+
get address(): Address;
|
27
|
+
}
|
28
|
+
//# sourceMappingURL=token.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"../../../../src/utils","sources":["token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAe,kBAAkB,EAAmB,4BAAyB;AAEnG,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC;CAC/D;AAED,qBAAa,WAAY,YAAW,WAAW;IAC7C,OAAO,CAAC,SAAS,CAAc;gBAEnB,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO;IAI3E,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5C,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAI5D,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa;IAIvD,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,M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