From c3e794be7c5481db3ad03d48c7ae08ad0a889404 Mon Sep 17 00:00:00 2001 From: Ryan Waits Date: Sun, 3 Aug 2025 14:37:55 -0500 Subject: [PATCH 1/4] properly ignore files for biome --- biome.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/biome.json b/biome.json index 182cc9e7e..362a1296b 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,17 @@ { "$schema": "https://biomejs.dev/schemas/2.1.3/schema.json", "files": { - "ignoreUnknown": false + "ignoreUnknown": false, + "includes": [ + "app/**/*.{js,jsx,ts,tsx}", + "components/**/*.{js,jsx,ts,tsx}", + "lib/**/*.{js,jsx,ts,tsx}", + "scripts/**/*.{js,jsx,ts,tsx,mts}", + "content/**/*.{js,jsx,ts,tsx,mdx}", + "*.{js,jsx,ts,tsx,mjs,mts}", + "!**/*.min.js", + "!**/generated/**" + ] }, "formatter": { "enabled": true, From 906c951d1515a596a1aa18d155cc6f31cbdca1be Mon Sep 17 00:00:00 2001 From: Ryan Waits Date: Sun, 3 Aug 2025 14:49:56 -0500 Subject: [PATCH 2/4] add explicit checks --- biome.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/biome.json b/biome.json index 362a1296b..182cc9e7e 100644 --- a/biome.json +++ b/biome.json @@ -1,17 +1,7 @@ { "$schema": "https://biomejs.dev/schemas/2.1.3/schema.json", "files": { - "ignoreUnknown": false, - "includes": [ - "app/**/*.{js,jsx,ts,tsx}", - "components/**/*.{js,jsx,ts,tsx}", - "lib/**/*.{js,jsx,ts,tsx}", - "scripts/**/*.{js,jsx,ts,tsx,mts}", - "content/**/*.{js,jsx,ts,tsx,mdx}", - "*.{js,jsx,ts,tsx,mjs,mts}", - "!**/*.min.js", - "!**/generated/**" - ] + "ignoreUnknown": false }, "formatter": { "enabled": true, From c5aa57c131cf656daed426b35ff52988df76f60f Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 5 Aug 2025 21:42:33 -0500 Subject: [PATCH 3/4] remove broken link and use next steps directive (#1055) --- .../guides/using-pyth-price-feeds.mdx | 61 ++++++++----------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/content/docs/resources/guides/using-pyth-price-feeds.mdx b/content/docs/resources/guides/using-pyth-price-feeds.mdx index 7144b9fe8..26f02e0c0 100644 --- a/content/docs/resources/guides/using-pyth-price-feeds.mdx +++ b/content/docs/resources/guides/using-pyth-price-feeds.mdx @@ -28,7 +28,7 @@ graph LR D -->|Submit VAA + TX| E[Stacks Chain] E -->|Verify & Update| F[Pyth Oracle Contract] F -->|Fresh Price| G[Your Contract] - + style A fill:#FF7733,stroke:#0d0c0c,stroke-width:2px,color:#0d0c0c style C fill:#B3D9FF,stroke:#0d0c0c,stroke-width:2px,color:#0d0c0c style D fill:#F5F5F5,stroke:#0d0c0c,stroke-width:2px,color:#0d0c0c @@ -72,7 +72,7 @@ We'll create a "Benjamin Club" - an exclusive NFT that costs exactly $100 worth ### Write the smart contract - + First, implement the Clarity contract that reads Pyth price data: ```clarity contracts/benjamin-club.clar @@ -105,32 +105,32 @@ We'll create a "Benjamin Club" - an exclusive NFT that costs exactly $100 worth pyth-decoder-contract: PYTH-DECODER, wormhole-core-contract: WORMHOLE-CORE }))) - + ;; Get the updated BTC price (price-data (try! (contract-call? PYTH-ORACLE get-price BTC-USD-FEED-ID PYTH-STORAGE))) - + ;; Process the price data (btc-price (process-price-data price-data)) - + ;; Calculate required sBTC amount for $100 (required-sbtc (calculate-sbtc-amount btc-price)) - + ;; Get user's sBTC balance - (user-balance (unwrap! + (user-balance (unwrap! (contract-call? .sbtc-token get-balance tx-sender) ERR-INSUFFICIENT-FUNDS)) ) ;; Verify price is fresh (less than 5 minutes old) (try! (verify-price-freshness price-data)) - + ;; Verify user has enough sBTC (asserts! (>= user-balance required-sbtc) ERR-INSUFFICIENT-FUNDS) - + ;; Transfer sBTC from user - (try! (contract-call? .sbtc-token transfer + (try! (contract-call? .sbtc-token transfer required-sbtc tx-sender (as-contract tx-sender) none)) - + ;; Mint the NFT (let ((token-id (+ (var-get last-token-id) u1))) (try! (nft-mint? benjamin-nft token-id tx-sender)) @@ -182,7 +182,7 @@ We'll create a "Benjamin Club" - an exclusive NFT that costs exactly $100 worth ### Build the frontend integration - + Create a service to fetch price data from Pyth: ```typescript frontend/pyth-service.ts @@ -201,7 +201,7 @@ We'll create a "Benjamin Club" - an exclusive NFT that costs exactly $100 worth const vaas = await pythClient.getLatestVaas([PRICE_FEEDS.BTC_USD]); const messageBuffer = Buffer.from(vaas[0], 'base64'); - + return `0x${messageBuffer.toString('hex')}`; } ``` @@ -222,7 +222,7 @@ We'll create a "Benjamin Club" - an exclusive NFT that costs exactly $100 worth try { // Fetch fresh price data const priceVAA = await fetchBTCPriceVAA(); - + // Create post-conditions for safety const postConditions = [ // Oracle fee (1 uSTX max) @@ -249,8 +249,8 @@ We'll create a "Benjamin Club" - an exclusive NFT that costs exactly $100 worth }; return ( -