Skip to content

NFTMerchant/StoryProtocolSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Story Protocol TypeScript SDK Examples

Get Started

  1. Install the dependencies:

    npm install
    
  2. Rename the .env.example file to .env

  3. Read the docs below associated with the example you want to run

📄 Run Non-Commercial Example

  1. Add your Story Network Testnet wallet's private key to .env file:

    WALLET_PRIVATE_KEY=<YOUR_WALLET_PRIVATE_KEY>
    
  2. npm run non-commercial

💰 Run Commercial Example

  1. Add your Story Network Testnet wallet's private key to .env file:

    WALLET_PRIVATE_KEY=<YOUR_WALLET_PRIVATE_KEY>
    
  2. You will be paying for the License Token using a test ERC-20 token.

    2a. Mint some tokens by running this transaction (10 is good).

    2b. Next, you have to allow the royalty contract to spend those tokens on your behalf to mint the License Token. Run the approve transaction where the spender is the address of RoyaltyPolicyLAP here. And the value is >= 1 (that's the minting fee used in the script).

  3. npm run commercial

🖼️ Run Metadata Example

  1. Add your Story Network Testnet wallet's private key to .env file:

    WALLET_PRIVATE_KEY=<YOUR_WALLET_PRIVATE_KEY>
    
  2. Go to Pinata and create a new API key. Add the JWT to your .env file:

    PINATA_JWT=<YOUR_PINATA_JWT>
    
  3. Create a new SPG NFT collection by running npm run create-spg-collection in your terminal.

    2a. Look at the console output, and copy the NFT contract address. Add that value as NFT_CONTRACT_ADDRESS to your .env file:

    NFT_CONTRACT_ADDRESS=<NFT_CONTRACT_ADDRESS>
    
  4. npm run metadata

About

SDK for story

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •