-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from marigold-dev/quyen@staging
Minting and stashing UX: add some visual feedback to the corresponding buttons.
- Loading branch information
Showing
7 changed files
with
422 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/examples/nft/node_modules/ | ||
/examples/nft/.svelte-kit/ | ||
node_modules | ||
dist | ||
dist | ||
**/*d.ts | ||
**/*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Tezos Gas Station library | ||
|
||
This library helps you | ||
- use [Marigold's Gas Station API](https://github.com/marigold-dev/gas-station) in TypeScript | ||
- create [TZIP-17 permit contracts](https://tzip.tezosagora.org/proposal/tzip-17/), which are FA2 | ||
contracts that can be manipulated by a 3rd party (such as the gas station API). Permits are signed | ||
This library facilitates the following: | ||
- Utilizing [Marigold's Gas Station API](https://github.com/marigold-dev/gas-station) in TypeScript. | ||
- Creating [TZIP-17 permit contracts](https://tzip.tezosagora.org/proposal/tzip-17/), which are FA2 | ||
contracts capable of being manipulated by a 3rd party, such as the gas station API. Permits are signed | ||
off-chain and can be posted and executed by anyone. | ||
|
||
A toy webapp example is available in the `examples/` directory. | ||
An example of a toy web app is provided in the `examples/nft` directory. | ||
|
||
Contributions welcome at https://github.com/marigold-dev/gas-station-lib. | ||
Feel free to contribute and provide feedback on https://github.com/marigold-dev/gas-station-lib. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,82 @@ | ||
Toy example of a webapp using a gas station API and a permit contract. The webapp lets you mint a | ||
NFT and transfer it to a “staking” contract even if you have no tez in your wallet. | ||
# Gas Station Demo | ||
|
||
The contracts are already deployed on Ghostnet. Their addresses, together with the API URL, can be | ||
changed in the `.env` file. | ||
This project is a toy web application demonstrating the use of a Gas Station API and a Permit Contract on the Tezos blockchain. | ||
|
||
The web app allows you to mint a non-fungible token (NFT) and transfer it to a "staking" contract, even if you have no Tez in your wallet. | ||
|
||
|
||
## Prerequisites | ||
|
||
Before you start, ensure you have the following installed on your machine: | ||
|
||
- Node.js [Download and Install Node.js](https://nodejs.org/) | ||
- npm (Node Package Manager): Comes with Node.js installation | ||
- NVM (Node Version Manager): This is the key component for managing Node.js versions. | ||
To install NVM for managing Node.js versions, refer to the official installation guide | ||
at [install](https://github.com/nvm-sh/nvm#installing-and-updating) | ||
|
||
## Gas Station API and Permit Contract | ||
|
||
This project interacts with a Gas Station API and a Permit Contract on the Tezos blockchain. The contracts are already deloyed on Ghostnet. Configure the follwing in the `.env` file: | ||
|
||
- **Gas Station API URL**: the URL of the Gas Station API that handles the reply of operations to the blockchain. | ||
- **Permit Contract Address**: the address of the Permit Contract on the Tezos blockchain. This contract is used for authorizing and signing operations. | ||
- **Staking Contract Address (Optional)**: If applicable, the address of the Staking Contract where NFTs can be transferred. | ||
|
||
**Note:** The contract addresses and API URL can be changed in the `.env` file. | ||
|
||
|
||
## Configuration | ||
|
||
Copy the `.env.example` file to `.env` and update the following variables based on your deployment: | ||
|
||
```dotenv | ||
PUBLIC_TZKT_API=https://api.ghostnet.tzkt.io | ||
PUBLIC_TEZOS_RPC=https://ghostnet.smartpy.io | ||
# Gas Station API URL | ||
PUBLIC_GAS_STATION_API=http://localhost:8000 | ||
# Permit Contract Address | ||
PUBLIC_PERMIT=KT1HUdxmgZUw21ED9gqELVvCty5d1ff41p7J | ||
# Staking Contract Address (if applicable) | ||
PUBLIC_STAKING_CONTRACT=KT1VVotciVbvz1SopVfoXsxXcpyBBSryQgEn | ||
PUBLIC_APP_BASE_URL=http://localhost:5173 | ||
``` | ||
|
||
## Running locally | ||
|
||
Navigate to the project folder: | ||
|
||
``` | ||
cd examples/nft | ||
``` | ||
|
||
To install dependencies, run: | ||
|
||
``` | ||
npm install | ||
``` | ||
or | ||
|
||
``` | ||
npm i | ||
``` | ||
|
||
To launch the project on your localhost using a development server, run: | ||
|
||
``` | ||
npm run dev | ||
``` | ||
|
||
Your project will be accessible at http://localhost:5173/ | ||
|
||
To clean up generated files, run: | ||
|
||
``` | ||
rm -rf node_modules | ||
``` | ||
|
||
Make sure to configure the `.env` file with the appropriate values before running the project locally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.