@story-protocol/core-sdk 1.3.0-rc.2 → 1.3.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 +29 -101
- package/dist/declarations/src/abi/generated.d.ts +88 -535
- package/dist/declarations/src/abi/generated.d.ts.map +1 -1
- package/dist/declarations/src/client.d.ts +3 -27
- package/dist/declarations/src/client.d.ts.map +1 -1
- package/dist/declarations/src/constants/common.d.ts +1 -4
- package/dist/declarations/src/constants/common.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +13 -13
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/resources/dispute.d.ts +13 -29
- package/dist/declarations/src/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/resources/group.d.ts +19 -15
- package/dist/declarations/src/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAccount.d.ts +6 -24
- package/dist/declarations/src/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/resources/ipAsset.d.ts +36 -164
- package/dist/declarations/src/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/resources/license.d.ts +18 -76
- package/dist/declarations/src/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/resources/nftClient.d.ts +3 -15
- package/dist/declarations/src/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/resources/permission.d.ts +13 -56
- package/dist/declarations/src/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/resources/royalty.d.ts +21 -10
- package/dist/declarations/src/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/types/common.d.ts +11 -3
- package/dist/declarations/src/types/common.d.ts.map +1 -1
- package/dist/declarations/src/types/config.d.ts +15 -0
- package/dist/declarations/src/types/config.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/dispute.d.ts +14 -3
- package/dist/declarations/src/types/resources/dispute.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/group.d.ts +38 -11
- package/dist/declarations/src/types/resources/group.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAccount.d.ts +13 -2
- package/dist/declarations/src/types/resources/ipAccount.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/ipAsset.d.ts +54 -32
- package/dist/declarations/src/types/resources/ipAsset.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/license.d.ts +65 -6
- package/dist/declarations/src/types/resources/license.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/nftClient.d.ts +11 -3
- package/dist/declarations/src/types/resources/nftClient.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/permission.d.ts +34 -2
- package/dist/declarations/src/types/resources/permission.d.ts.map +1 -1
- package/dist/declarations/src/types/resources/royalty.d.ts +23 -1
- package/dist/declarations/src/types/resources/royalty.d.ts.map +1 -1
- package/dist/declarations/src/utils/chain.d.ts +8 -6
- package/dist/declarations/src/utils/chain.d.ts.map +1 -1
- package/dist/declarations/src/utils/getIpMetadataForWorkflow.d.ts +1 -1
- package/dist/declarations/src/utils/getIpMetadataForWorkflow.d.ts.map +1 -1
- package/dist/declarations/src/utils/ipfs.d.ts.map +1 -1
- package/dist/declarations/src/utils/sign.d.ts +0 -17
- package/dist/declarations/src/utils/sign.d.ts.map +1 -1
- package/dist/story-protocol-core-sdk.cjs.d.ts +1 -1
- package/dist/story-protocol-core-sdk.cjs.dev.js +1506 -1739
- package/dist/story-protocol-core-sdk.cjs.prod.js +1506 -1739
- package/dist/story-protocol-core-sdk.esm.js +1506 -1739
- package/package.json +2 -1
package/README.md
CHANGED
@@ -1,113 +1,43 @@
|
|
1
|
-
# Story Protocol SDK
|
1
|
+
# Story Protocol SDK [](https://github.com/storyprotocol/sdk/blob/main/LICENSE.md)[](https://www.npmjs.com/package/@story-protocol/core-sdk)[](https://www.npmjs.com/package/@story-protocol/core-sdk)
|
2
2
|
|
3
|
-
Welcome to the
|
3
|
+
Welcome to the Story Protocol SDK - a comprehensive toolkit for building applications on Story Protocol. This SDK empowers developers to seamlessly interact with intellectual property (IP) assets on the blockchain through an intuitive API interface.
|
4
4
|
|
5
|
-
|
5
|
+
Key Features:
|
6
6
|
|
7
|
-
|
7
|
+
- IP Asset Module: Register, and manage intellectual property assets on-chain
|
8
|
+
- License Module: Create customizable license terms, attach them to IP assets, and mint transferable license tokens
|
9
|
+
- Royalty Module: Claim royalties, and manage payment distributions
|
10
|
+
- Dispute Module: Initiate, manage and resolve IP-related disputes through on-chain governance
|
11
|
+
- Group Module: Create IP collections with shared revenue pools
|
12
|
+
- WIP Module: Wrap native IP into ERC-20 tokens for DeFi integrations
|
13
|
+
- NFT Client Module: Mint a new SPG collection for use with Story Protocol.
|
8
14
|
|
9
|
-
|
15
|
+
The SDK provides robust support for the following networks:
|
10
16
|
|
11
|
-
|
17
|
+
- [aeneid](https://docs.story.foundation/network/network-info/aeneid) - A dedicated testnet environment for development and testing
|
18
|
+
- [mainnet](https://docs.story.foundation/network/network-info/mainnet) - The production network for live deployments
|
12
19
|
|
13
|
-
|
14
|
-
npm install --save @story-protocol/core-sdk viem@1.21.4
|
15
|
-
```
|
20
|
+
# Documentation
|
16
21
|
|
17
|
-
|
22
|
+
For more detailed information on using the SDK, refer to the [TypeScript SDK Guide](https://docs.story.foundation/developers/typescript-sdk/overview).
|
18
23
|
|
19
|
-
|
20
|
-
pnpm install @story-protocol/core-sdk viem@1.21.4
|
21
|
-
```
|
24
|
+
The documentation is divided into the following sections:
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Next we can initiate the SDK Client by first setting up our wallet and then the client itself.
|
34
|
-
|
35
|
-
## Set up your wallet
|
36
|
-
|
37
|
-
The SDK supports using `viem` for initiating SDK client. Create a typescript file and write the following code to initiate the client with a private key:
|
38
|
-
|
39
|
-
> :information-source: Make sure to have WALLET_PRIVATE_KEY set up in your .env file.
|
40
|
-
|
41
|
-
```typescript index.ts
|
42
|
-
import { privateKeyToAccount } from "viem/accounts";
|
43
|
-
|
44
|
-
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY || "0x";
|
45
|
-
const account = privateKeyToAccount(WALLET_PRIVATE_KEY as Address);
|
46
|
-
```
|
47
|
-
|
48
|
-
The preceding code created the `account` object for creating the SDK client.
|
49
|
-
|
50
|
-
## Set up SDK client
|
51
|
-
|
52
|
-
To set up the SDK client, import `StoryClient` and `StoryConfig` from `@story-protocol/core-sdk`. Write the following code, utilizing the `account` we created previously.
|
53
|
-
|
54
|
-
> :information-source: Make sure to have RPC_PROVIDER_URL for your desired chain set up in your .env file. We recommend using the Iliad network with `RPC_PROVIDER_URL=https://rpc.partner.testnet.storyprotocol.net`.
|
55
|
-
|
56
|
-
```typescript index.ts
|
57
|
-
import { StoryClient, StoryConfig } from "@story-protocol/core-sdk";
|
58
|
-
|
59
|
-
const config: StoryConfig = {
|
60
|
-
transport: http(process.env.RPC_PROVIDER_URL),
|
61
|
-
account: account,
|
62
|
-
};
|
63
|
-
const client = StoryClient.newClient(config);
|
64
|
-
```
|
65
|
-
|
66
|
-
## How To Build and Test Story Protocol SDK for local testing
|
67
|
-
|
68
|
-
This section provides the instructions on how to build Story Protocol SDK from source code.
|
69
|
-
|
70
|
-
### Prerequisite
|
71
|
-
|
72
|
-
- Install PNPM: Execute `npm install -g pnpm`
|
73
|
-
- Install TypeScript: Run `pnpm add typescript -D`
|
74
|
-
- Install Yalc: Use `npm install -g yalc`
|
75
|
-
|
76
|
-
### Steps for Using Yalc for Local Testing of Core-SDK
|
77
|
-
|
78
|
-
For manual testing of the core-sdk, set up a separate web project. The guide below uses `yalc` to link the `core-sdk` locally, enabling its installation and import for testing.
|
79
|
-
|
80
|
-
Under the `typescript-sdk/packages/core-sdk` directory:
|
81
|
-
|
82
|
-
- Navigate to the `core-sdk` directory.
|
83
|
-
- Execute `npm run build` to build your latest code.
|
84
|
-
- Run `yalc publish`. You should see a message like `@story-protocol/core-sdk@<version> published in store.` (Note: The version number may vary).
|
85
|
-
|
86
|
-
To set up your testing environment (e.g., a new Next.js project), use `yalc add @story-protocol/core-sdk@<version>` (ensure the version number is updated accordingly).
|
87
|
-
|
88
|
-
- Run `pnpm install`. This installs `@story-protocol/core-sdk@<version>` with your local changes.
|
89
|
-
|
90
|
-
### Steps to Refresh the Changes
|
91
|
-
|
92
|
-
Under the `typescript-sdk/packages/core-sdk` directory:
|
93
|
-
|
94
|
-
- Execute `npm run build` to build your latest code.
|
95
|
-
- Run `yalc push`.
|
96
|
-
|
97
|
-
In your testing environment:
|
98
|
-
|
99
|
-
- Run `yalc update` to pull the latest changes.
|
100
|
-
|
101
|
-
## Steps to pull and compile latest Protocol Core & Periphery v1 Smart Contract ABIs (Currently pulls from the protocol-core-v1 and protocol-periphery-v1 `release-v1.x.x` branch)
|
102
|
-
|
103
|
-
- run `cd packages/wagmi-generator && npm run generate`
|
26
|
+
- [Overview](https://docs.story.foundation/developers/typescript-sdk/overview)
|
27
|
+
- [Setup](https://docs.story.foundation/developers/typescript-sdk/setup)
|
28
|
+
- [Register an IP Asset](https://docs.story.foundation/developers/typescript-sdk/register-ip-asset)
|
29
|
+
- [Attach Terms to an IPA](https://docs.story.foundation/developers/typescript-sdk/attach-terms)
|
30
|
+
- [Mint a License Token](https://docs.story.foundation/developers/typescript-sdk/mint-license)
|
31
|
+
- [Register a Derivative](https://docs.story.foundation/developers/typescript-sdk/register-derivative)
|
32
|
+
- [Pay an IPA](https://docs.story.foundation/developers/typescript-sdk/pay-ipa)
|
33
|
+
- [Claim Revenue](https://docs.story.foundation/developers/typescript-sdk/claim-revenue)
|
34
|
+
- [Raise a Dispute](https://docs.story.foundation/developers/typescript-sdk/raise-dispute)
|
104
35
|
|
105
36
|
## Release
|
106
37
|
|
107
|
-
| Package
|
108
|
-
|
|
109
|
-
| [core-sdk](./packages/core-sdk)
|
110
|
-
| [react-sdk](./packages/react-sdk) | The react sdk for interacting with the protocol |
|
38
|
+
| Package | Description |
|
39
|
+
| :------------------------------ | :--------------------------------------------- |
|
40
|
+
| [core-sdk](./packages/core-sdk) | The core sdk for interacting with the protocol |
|
111
41
|
|
112
42
|
## Contributing
|
113
43
|
|
@@ -118,6 +48,4 @@ Please make sure to update tests as appropriate.
|
|
118
48
|
|
119
49
|
## License
|
120
50
|
|
121
|
-
[
|
122
|
-
|
123
|
-
## Contact Us
|
51
|
+
[Copyright (c) 2023-Present Story Protocol Inc.](/LICENSE.md)
|