To build an application that uses Streambird API for deploying a ThirdWeb NFT marketplace, developers will need to follow a series of steps. Below is a tutorial that outlines these steps and provides examples of code to help developers get started.
To use Streambird API, developers need to register for an API key. To do this, visit the Streambird API website (https://app.streambird.io/) and sign up for an account. After signing up, developers will be able to access the API key on their dashboard, and use the API key to authorize requests.
Create a wallet if you do not have using the following cURL script or use an existing wallet:
$API_KEY
with your Streambird API Key.$USER_ID
with your user ID.To build the application, developers will need to install the following dependencies:
ethers
: A JavaScript library that provides a simple interface to interact with Ethereum nodes and smart contracts.
node-fetch-commonjs: A light-weight module that brings the Fetch API to Node.js.
To install these dependencies, use the following command:
Add the following lines to the top of your JavaScript file to import the required dependencies:
Create a new instance of ethers.providers.JsonRpcProvider using the Goerli test network’s RPC URL. You can use Infura as the provider to access the Goerli network.
ALCHEMY_API_KEY
with your Alchemy API Key.Create an async function called getGasPrice
that calculates the gas price for the transaction. The function uses the getGasPrice
method to retrieve the current gas price, formats the price to ether, multiplies it by the given multiplier, and then converts it back to wei.
Create an async function called sendRawTransaction
that sends a raw transaction to the Goerli network via the Ethereum JSON-RPC endpoint. This function is used to deploy the Thirdweb marketplace. The function does the following:
deployProxyByImplementation
function.fetchSignedTx
function to sign the transaction.fetchSignedTx
functionThe fetchSignedTx
function takes a transaction object as input, signs the transaction using a Streambird Wallet API, and returns the signed transaction object. You can find more information about the WalletSignTransaction endpoint in the Streambird API.
$API_KEY
with your Streambird API Key.$WALLET_ID
variable to match the ID of the wallet from which you want to sign the transaction.In conclusion, deploying a ThirdWeb marketplace using the Streambird API requires a few key steps. First, developers must create an account with Streambird and generate an API key. They must then install the necessary dependencies and configure their application to use the Streambird API. Once this is done, developers can use the API to perform various functions, such as creating wallets, signing transactions, and querying blockchain data. By following the steps outlined in this tutorial, developers can get up and running with the Streambird API and begin building their own decentralized marketplaces.
While this tutorial focused on deploying a ThirdWeb marketplace using the Streambird Wallet API, the same general steps can be used to launch any smart contract. Developers can follow these steps to deploy their own smart contracts and integrate them into their applications. By leveraging the Streambird API, developers can simplify the process of signing transactions and interacting with the Ethereum network, allowing them to focus on building their applications and bringing their ideas to life. With the power of smart contracts and the growing ecosystem of tools and services available to developers, the possibilities are endless.
You will also need an ABI file for the Thirdweb marketplace called proxy.json
.