Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose API url variables for ghostnet & mainnet #5

Merged
merged 25 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3663417
:wrench: update NFT example contracts for staging
Dec 15, 2023
d345f1c
:recycle: add apiURL variables && update constructor of GasStation class
Dec 18, 2023
ee914fd
:arrow_up: bump gas-station deps
Dec 18, 2023
f8be644
:bug: replace env var to Gas station API
Dec 19, 2023
07360bb
:recycle: review PR
Jan 8, 2024
bf392cc
:arrow_up: bump version of GS lib
Jan 8, 2024
3327be9
New permit contract with multiple admins
aguillon Jan 8, 2024
2a23b79
Minor change in the interface of examples/nft.
aguillon Dec 27, 2023
960af77
Merge pull request #7 from marigold-dev/contract-update
aguillon Jan 9, 2024
d454a08
New contract for stash too
aguillon Jan 9, 2024
5e19c75
Maintain a set of minted token ids and randomize minting and stashing
aguillon Jan 9, 2024
587112d
CSS shenanigans (thank you Jules)
aguillon Jan 9, 2024
b31ff1a
Pardon my French
aguillon Jan 9, 2024
9150161
Merge pull request #6 from marigold-dev/example-nft-qol
aguillon Jan 9, 2024
3dff258
index/comment: add comments
lykimq Jan 18, 2024
e8b4c10
Minting: add progress bar and formating code
lykimq Jan 18, 2024
0a7ed1f
Doc: add Readme for the example
lykimq Jan 18, 2024
997e0f5
Git: add ignore .d.ts and .js
lykimq Jan 18, 2024
53d47f8
HomePage: rework the introduction display on the webpage, formatting
lykimq Jan 18, 2024
e42b6e3
Doc: refine the README of the project
lykimq Jan 18, 2024
cdde4c7
Console_log: remove console_log, and formatting
lykimq Jan 22, 2024
36a91b2
StakingComponent: add progress bar for stashing button, add comments
lykimq Jan 22, 2024
e960a99
Merge pull request #8 from marigold-dev/quyen@staging
aguillon Jan 22, 2024
f3a7b00
:bug: fix progress bar display
Jan 22, 2024
6129ada
Version bump 0.0.8
aguillon Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docker-nft-ghostnet-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
set -x
ls -last .
sed -i 's|http://localhost:8000|https://staging.gas-station-api.marigold.dev|g' ./examples/nft/.env
sed -i 's|KT1Re88VMEJ7TLHTkXSHQYZQTD3MP3k7j6Ar|KT199yuNkHQKpy331A6fvWJtQ1uan9uya2jx|g' ./examples/nft/.env
sed -i 's|KT1Rp1rgfwS25XrWU6fUnR8cw6KMZBhDvXdq|KT1MLMXwFEMcfByGbGcQ9ow3nsrQCkLbcRAu|g' ./examples/nft/.env
sed -i 's|KT1Re88VMEJ7TLHTkXSHQYZQTD3MP3k7j6Ar|KT1CvtrTV7snJSxdnQqhSqh47tyVYhm4ACGB|g' ./examples/nft/.env
sed -i 's|KT1Rp1rgfwS25XrWU6fUnR8cw6KMZBhDvXdq|KT1K9X6QpuTWFX4S5ieDGTUdjAHQtiFRH5op|g' ./examples/nft/.env
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you're not changing the file directly? Is it because we're using a different account for the gas station on Ghostnet and Staging? I'm not sure it's worth it; and even then, we can change the contract to allow several admins.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could just originate a single contract that can have two admins, see aguillon/permit-cameligo#3

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's because the contract has only one admin but we can deploy the contract with several admin and just remove this part after.

cat ./examples/nft/.env

- name: Set up Docker Buildx
Expand Down
8 changes: 4 additions & 4 deletions examples/nft/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/nft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"type": "module",
"dependencies": {
"@marigold-dev/gas-station-lib": "^0.0.4",
"@marigold-dev/gas-station-lib": "^0.0.6",
"@airgap/beacon-sdk": "^4.0.4",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@picocss/pico": "^1.5.10",
Expand Down
4 changes: 2 additions & 2 deletions examples/nft/src/lib/MintingComponent.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Tezos, subTezos } from "$lib/tezos";
import { GasStation } from "@marigold-dev/gas-station-lib";
import { PUBLIC_PERMIT, PUBLIC_GAS_STATION_API, PUBLIC_TZKT_API } from '$env/static/public';
import { GasStation, GAS_STATION_PUBLIC_API_GHOSTNET } from "@marigold-dev/gas-station-lib";
import { PUBLIC_GAS_STATION_API, PUBLIC_PERMIT, PUBLIC_TZKT_API } from '$env/static/public';

export let user_address = '';

Expand Down
8 changes: 2 additions & 6 deletions examples/nft/src/lib/StakingComponent.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<script lang="ts">
import { Tezos, wallet, subTezos } from "$lib/tezos";
import { GasStation, PermitContract } from "@marigold-dev/gas-station-lib";
import { RpcClient } from "@taquito/rpc";
import { InMemorySigner } from "@taquito/signer";
import { ParameterSchema } from "@taquito/michelson-encoder";
import { PUBLIC_PERMIT, PUBLIC_TEZOS_RPC, PUBLIC_STAKING_CONTRACT, PUBLIC_TZKT_API,
PUBLIC_GAS_STATION_API } from '$env/static/public';
import { GasStation, PermitContract, GAS_STATION_PUBLIC_API_GHOSTNET } from "@marigold-dev/gas-station-lib";
import { PUBLIC_GAS_STATION_API, PUBLIC_PERMIT, PUBLIC_STAKING_CONTRACT, PUBLIC_TZKT_API } from '$env/static/public';
import { SigningType } from "@airgap/beacon-types";

export let user_address = '';
Expand Down
16 changes: 14 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,21 @@ export type PermitOperation = {
transferHash: string;
};

export const GAS_STATION_PUBLIC_API_GHOSTNET =
"https://ghostnet.gas-station-api.marigold.dev/operation";
export const GAS_STATION_PUBLIC_API_MAINNET =
"https://gas-station-api.marigold.dev/operation";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the trailing /operation and add it in postOperations.

export class GasStation {
url: string;

constructor(settings: Settings) {
this.url = settings.apiURL;
/**
*
* @param settings (optional) object
* - apiURL: the URL of Gas Station API. /!\ For this version, the URL must redirect to the endpoint /operation
*/
constructor(settings?: Settings) {
this.url = settings?.apiURL || GAS_STATION_PUBLIC_API_GHOSTNET;
}

async postOperations(sender: string, ops: Array<Operation>) {
Expand Down Expand Up @@ -62,6 +72,8 @@ export class GasStation {
}
}

const g = new GasStation();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?


export class PermitContract {
address: string;
tezos: TezosToolkit;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@marigold-dev/gas-station-lib",
"version": "0.0.4",
"version": "0.0.6",
"description": "Interact with a gas station API and produce TZIP 17 permits",
"main": "./dist/index.js",
"files": [
Expand Down