{"_id":"t-core-sdk","name":"t-core-sdk","dist-tags":{"latest":"1.0.0-rc.20"},"versions":{"1.0.0-rc.20":{"name":"t-core-sdk","version":"1.0.0-rc.20","description":"Story Protocol Core SDK","main":"dist/story-protocol-core-sdk.cjs.js","module":"dist/story-protocol-core-sdk.esm.js","exports":{".":{"module":"./dist/story-protocol-core-sdk.esm.js","default":"./dist/story-protocol-core-sdk.cjs.js"},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"pnpm run fix && preconstruct build","test":"pnpm run test:unit && pnpm run test:integration","test:unit":"TS_NODE_PROJECT='./tsconfig.test.json' c8 --all --src ./src mocha -r ts-node/register './test/unit/**/*.test.ts'","test:integration":"TS_NODE_PROJECT='./tsconfig.test.json' mocha -r ts-node/register './test/integration/**/*.test.ts' --timeout 240000","fix":"pnpm run format:fix && pnpm run lint:fix","format":"prettier --check .","format:fix":"prettier --write .","lint:fix":"pnpm run lint --fix","lint":"eslint ./src","tsc":"tsc --noEmit"},"license":"MIT","dependencies":{"abitype":"^0.10.2","axios":"^1.5.1","dotenv":"^16.3.1","viem":"^2.8.12"},"devDependencies":{"@babel/core":"^7.23.0","@babel/preset-env":"^7.22.20","@babel/preset-typescript":"^7.23.0","@preconstruct/cli":"^2.8.1","@story-protocol/eslint-config":"workspace:*","@story-protocol/prettier-config":"workspace:*","@story-protocol/tsconfig":"workspace:*","@types/chai":"^4.3.6","@types/chai-as-promised":"^7.1.6","@types/mocha":"^10.0.2","@types/node":"^20.8.2","@types/sinon":"^10.0.18","c8":"^8.0.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","eslint":"^8.50.0","mocha":"^10.2.0","prettier":"^2.8.8","sinon":"^16.0.0","ts-node":"^10.9.1","typechain":"^8.3.1","typescript":"^5.2.2"},"prettier":"@story-protocol/prettier-config","babel":{"presets":["@babel/preset-env","@babel/preset-typescript"]},"preconstruct":{"entrypoints":["index.ts"],"exports":true},"c8":{"exclude":["test/**/*","src/abi/**/*","src/index.ts","src/types/**/*"],"check-coverage":true,"lines":90,"functions":90,"branches":90,"statements":90},"typedoc":{"entryPoint":"./src/index.ts","tsconfig":"./tsconfig.json"},"_id":"t-core-sdk@1.0.0-rc.20","gitHead":"74f95b506351b4bb65ad151e3d6e7d5469922ca6","types":"./dist/story-protocol-core-sdk.cjs.d.ts","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-phVKp97mvDOzczWQkDQhHX8NynHTPg64bivPhsCMCgC6UW5U+x0hK+aWxmf3NQeucxOiRQ0hZmC6+DTPw1koOw==","shasum":"f014b1faf1cd683d8ae79fb6114662b2ee66b2a5","tarball":"https://registry.npmjs.org/t-core-sdk/-/t-core-sdk-1.0.0-rc.20.tgz","fileCount":51,"unpackedSize":2914642,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwcSBxd40ZLIWDLPgrCw0p4qvjLzVbhBukXkL/rv5I7AIhAMnivzPt/B7x5Ji+x267LXvrs8SOQBcem7h5dBp9uiiO"}]},"_npmUser":{"name":"adamcanray","email":"adamcool180@gmail.com"},"directories":{},"maintainers":[{"name":"adamcanray","email":"adamcool180@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/t-core-sdk_1.0.0-rc.20_1724733387191_0.4254268684378124"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-27T04:36:27.190Z","1.0.0-rc.20":"2024-08-27T04:36:27.425Z","modified":"2024-08-27T04:36:27.687Z"},"maintainers":[{"name":"adamcanray","email":"adamcool180@gmail.com"}],"description":"Story Protocol Core SDK","license":"MIT","readme":"# Story Protocol SDK\n\nWelcome to the documents for Story Protocol SDK. The SDK provides the APIs for developers to build applications with Story Protocol. By using the SDK, developers can create the resources like IP assets and perform actions to interact with the resource.\n\n## How to use Story Protocol SDK in Your Project\n\n### Install Story Protocol core SDK\n\nSuppose you already have a node project or created a new node project. First, you need to install `@story-protocol/core-sdk` in your project. You can use one of the following command to install the package:\n\nUse `npm`:\n\n```\nnpm install --save @story-protocol/core-sdk viem@1.21.4\n```\n\nUse `pnpm`:\n\n```\npnpm install @story-protocol/core-sdk viem@1.21.4\n```\n\nUse `yarn`:\n\n```\nyarn add @story-protocol/core-sdk viem@1.21.4\n```\n\nBesides the Story Protocol SDK package `@story-protocol/core-sdk`, we also require the package `viem` (https://www.npmjs.com/package/viem) to access the DeFi wallet accounts.\n\n# Initiate SDK Client\n\nNext we can initiate the SDK Client by first setting up our wallet and then the client itself.\n\n## Set up your wallet\n\nThe 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:\n\n> :information-source: Make sure to have WALLET_PRIVATE_KEY set up in your .env file.\n\n```typescript index.ts\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nconst WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY || \"0x\";\nconst account = privateKeyToAccount(WALLET_PRIVATE_KEY as Address);\n```\n\nThe preceding code created the `account` object for creating the SDK client.\n\n## Set up SDK client\n\nTo set up the SDK client, import `StoryClient` and `StoryConfig` from `@story-protocol/core-sdk`. Write the following code, utilizing the `account` we created previously.\n\n> :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`.\n\n```typescript index.ts\nimport { StoryClient, StoryConfig } from \"@story-protocol/core-sdk\";\n\nconst config: StoryConfig = {\n  transport: http(process.env.RPC_PROVIDER_URL),\n  account: account,\n};\nconst client = StoryClient.newClient(config);\n```\n\n## How To Build and Test Story Protocol SDK for local testing\n\nThis section provides the instructions on how to build Story Protocol SDK from source code.\n\n### Prerequisite\n\n- Install PNPM: Execute `npm install -g pnpm`\n- Install TypeScript: Run `pnpm add typescript -D`\n- Install Yalc: Use `npm install -g yalc`\n\n### Steps for Using Yalc for Local Testing of Core-SDK\n\nFor 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.\n\nUnder the `typescript-sdk/packages/core-sdk` directory:\n\n- Navigate to the `core-sdk` directory.\n- Execute `npm run build` to build your latest code.\n- Run `yalc publish`. You should see a message like `@story-protocol/core-sdk@<version> published in store.` (Note: The version number may vary).\n\nTo 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).\n\n- Run `pnpm install`. This installs `@story-protocol/core-sdk@<version>` with your local changes.\n\n### Steps to Refresh the Changes\n\nUnder the `typescript-sdk/packages/core-sdk` directory:\n\n- Execute `npm run build` to build your latest code.\n- Run `yalc push`.\n\nIn your testing environment:\n\n- Run `yalc update` to pull the latest changes.\n\n## 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)\n\n- run `cd packages/wagmi-generator && npm run generate`\n\n## Release\n\n| Package                           | Description                                     |\n| :-------------------------------- | :---------------------------------------------- |\n| [core-sdk](./packages/core-sdk)   | The core sdk for interacting with the protocol  |\n| [react-sdk](./packages/react-sdk) | The react sdk for interacting with the protocol |\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change. Details see: [CONTRIBUTING](/CONTRIBUTING.md)\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT License](/LICENSE.md)\n\n## Contact Us\n","readmeFilename":"README.md"}