Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions docs/src/components/contract-addresses.astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ const contractOrder = [
'endorsements',
] as const

// biome-ignore lint/correctness/noUnusedVariables: astro...
const rows = contractOrder
.filter((key) => {
// @ts-expect-error - chain.contracts is a record of ChainContract
const contract = chain.contracts[key]
return contract?.address && contract.address !== '0x0000000000000000000000000000000000000000'
})
.map((key) => {
// @ts-expect-error - chain.contracts is a record of ChainContract
const contract = chain.contracts[key]
const address = contract.address
return {
Expand Down
3 changes: 1 addition & 2 deletions packages/synapse-core/src/sp/sp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
AddPiecesError,
CreateDataSetError,
DeletePieceError,
DownloadPieceError,
type DownloadPieceError,
FindPieceError,
InvalidUploadSizeError,
LocationHeaderError,
Expand All @@ -16,7 +16,6 @@ import type { PieceCID } from '../piece/piece.ts'
import * as Piece from '../piece/piece.ts'
import type * as TypedData from '../typed-data/index.ts'
import { RETRY_CONSTANTS, SIZE_CONSTANTS } from '../utils/constants.ts'
import { createPieceUrlPDP } from '../utils/piece-url.ts'
import { isUint8Array } from '../utils/streams.ts'

export namespace createDataSet {
Expand Down
1 change: 0 additions & 1 deletion packages/synapse-core/test/download-piece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { HttpResponse, http } from 'msw'
import { DownloadPieceError } from '../src/errors/pdp.ts'
import { downloadAndValidate } from '../src/piece/download.ts'
import * as Piece from '../src/piece/piece.ts'
import {} from '../src/sp/sp.ts'

describe('Piece download and validation', () => {
const server = setup()
Expand Down
2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ allowBuilds:
blockExoticSubdeps: true

catalog:
'@biomejs/biome': 2.3.14
'@biomejs/biome': 2.4.4
'@types/mocha': ^10.0.10
'@types/node': ^25.1.0
'@types/react': ^19.2.7
Expand Down
8 changes: 4 additions & 4 deletions utils/data-sets-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ <h1>Data Sets Viewer</h1>
</div>
<div class="section">
<h2>Connection</h2>
<button id="connectBtn">Connect MetaMask</button>
<button type="button" id="connectBtn">Connect MetaMask</button>
<div id="connectionResult"></div>
</div>
<div class="section">
Expand All @@ -285,9 +285,9 @@ <h2>View Data Sets</h2>
<label>Client Address:</label>
<input type="text" id="clientAddressInput" placeholder="0x... (leave empty for connected wallet)">
</div>
<button id="reconnectBtn" disabled>Reconnect with Selected Warm Storage</button>
<button id="getDataSetsBtn" disabled>Get Data Sets</button>
<button id="getMyDataSetsBtn" disabled>Get My Data Sets</button>
<button type="button" id="reconnectBtn" disabled>Reconnect with Selected Warm Storage</button>
<button type="button" id="getDataSetsBtn" disabled>Get Data Sets</button>
<button type="button" id="getMyDataSetsBtn" disabled>Get My Data Sets</button>
<div id="dataSetsSummary" style="margin-top: 20px;"></div>
<div id="dataSetsResult" class="data-sets-container"></div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions utils/payment-apis-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,24 @@ <h1>Synapse SDK - Enhanced Payment APIs Demo</h1>
</div>
<div class="section">
<h2>Connection</h2>
<button id="connectBtn">Connect MetaMask</button>
<button type="button" id="connectBtn">Connect MetaMask</button>
<div id="connectionResult"></div>
</div>
<div class="section">
<h2>Warm Storage Contract Configuration</h2>
<div class="input-group">
<label>Warm Storage Address:</label>
<input type="text" id="warmStorageAddressInput" placeholder="0x..." value="">
<button id="updateWarm StorageBtn" disabled>Update Warm Storage Address</button>
<button type="button" id="updateWarm StorageBtn" disabled>Update Warm Storage Address</button>
</div>
<div id="warmStorageStatus" class="warning">Storage cost functions require Warm Storage contract to be
configured</div>
</div>
<div class="section">
<h2>Account Information</h2>
<button id="accountInfoBtn" disabled>Get Account Info</button>
<button id="walletBalanceBtn" disabled>Get Wallet Balances</button>
<button id="getCurrentEpochBtn" disabled>Get Current Epoch</button>
<button type="button" id="accountInfoBtn" disabled>Get Account Info</button>
<button type="button" id="walletBalanceBtn" disabled>Get Wallet Balances</button>
<button type="button" id="getCurrentEpochBtn" disabled>Get Current Epoch</button>
<div id="accountResult" class="result"></div>
</div>
<div class="section">
Expand All @@ -158,7 +158,7 @@ <h2>Storage Cost Calculator</h2>
<label>With CDN:</label>
<input type="checkbox" id="costWithCDNCheckbox">
</div>
<button id="calculateCostBtn" disabled>Calculate Storage Costs</button>
<button type="button" id="calculateCostBtn" disabled>Calculate Storage Costs</button>
<div id="costResult" class="result"></div>
<div id="fundingAnalysis" style="margin-top: 20px; display: none;">
<h3>Funding Analysis</h3>
Expand All @@ -183,8 +183,8 @@ <h2>Storage Allowance Checker</h2>
<label>With CDN:</label>
<input type="checkbox" id="withCDNCheckbox">
</div>
<button id="checkAllowanceBtn" disabled>Check Allowance</button>
<button id="prepareUploadBtn" disabled>Prepare Storage Upload</button>
<button type="button" id="checkAllowanceBtn" disabled>Check Allowance</button>
<button type="button" id="prepareUploadBtn" disabled>Prepare Storage Upload</button>
<div id="allowanceResult" class="result"></div>
</div>
<!-- Load ethers.js first -->
Expand Down
24 changes: 12 additions & 12 deletions utils/payments-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h1>Synapse Payments Demo</h1>
<h3>Connection Status</h3>
<div id="connectionInfo">
<p><span class="status-indicator disconnected"></span> Not connected to MetaMask</p>
<button onclick="_connectWallet()">Connect MetaMask</button>
<button type="button" onclick="_connectWallet()">Connect MetaMask</button>
</div>
</div>
<div class="section" id="balancesSection" style="display: none;">
Expand All @@ -253,15 +253,15 @@ <h2>Account Balances</h2>
<span class="balance-label">USDFC Balance (Payments Contract):</span>
<span class="balance-value" id="usdfcPaymentsBalance">-</span>
</div>
<button onclick="refreshBalances()">Refresh Balances</button>
<button type="button" onclick="refreshBalances()" disabled>Refresh Balances</button>
</div>
<div class="section" id="operationsSection" style="display: none;">
<h2>Payment Operations</h2>
<div class="tab-container">
<div class="tabs">
<button class="tab active" onclick="switchTab('deposit')">Deposit/Withdraw</button>
<button class="tab" onclick="switchTab('token')">Token Approvals</button>
<button class="tab" onclick="switchTab('service')">Service Approvals</button>
<button class="tab active" type="button" onclick="switchTab('deposit')">Deposit/Withdraw</button>
<button class="tab" type="button" onclick="switchTab('token')">Token Approvals</button>
<button class="tab" type="button" onclick="switchTab('service')">Service Approvals</button>
</div>
<!-- Deposit/Withdraw Tab -->
<div class="tab-content active" id="depositTab">
Expand All @@ -274,7 +274,7 @@ <h3>Deposit USDFC</h3>
<label>Amount (USDFC):</label>
<input type="number" id="depositAmount" placeholder="10.0" step="0.1" min="0">
</div>
<button onclick="deposit()">Deposit</button>
<button type="button" onclick="deposit()">Deposit</button>
<div id="depositResult"></div>
</div>
<div>
Expand All @@ -284,7 +284,7 @@ <h3>Withdraw USDFC</h3>
<label>Amount (USDFC):</label>
<input type="number" id="withdrawAmount" placeholder="10.0" step="0.1" min="0">
</div>
<button onclick="withdraw()">Withdraw</button>
<button type="button" onclick="withdraw()">Withdraw</button>
<div id="withdrawResult"></div>
</div>
</div>
Expand All @@ -300,7 +300,7 @@ <h3>Check Allowance</h3>
<input type="text" id="allowanceSpender" placeholder="0x...">
<small style="color: #666;">Default: Payments Contract</small>
</div>
<button onclick="checkAllowance()">Check Allowance</button>
<button type="button" onclick="checkAllowance()">Check Allowance</button>
<div id="allowanceResult"></div>
</div>
<div>
Expand All @@ -316,7 +316,7 @@ <h3>Approve Token Spending</h3>
<label>Amount (USDFC):</label>
<input type="number" id="approveAmount" placeholder="100.0" step="0.1" min="0">
</div>
<button onclick="approveToken()">Approve</button>
<button type="button" onclick="approveToken()">Approve</button>
<div id="approveResult"></div>
</div>
</div>
Expand All @@ -339,7 +339,7 @@ <h4>Check Service Approval</h4>
<input type="text" id="checkServiceAddress" placeholder="0x...">
<small style="color: #666;">Warm Storage address</small>
</div>
<button onclick="checkServiceApproval()">Check Approval</button>
<button type="button" onclick="checkServiceApproval()">Check Approval</button>
<div id="checkServiceResult"></div>
</div>
<div>
Expand All @@ -363,7 +363,7 @@ <h4>Approve Service</h4>
<input type="number" id="maxLockupPeriod" placeholder="86400" step="1" min="0">
<small style="color: #666;">Default: 86400 epochs (30 days)</small>
</div>
<button onclick="approveService()">Approve Service</button>
<button type="button" onclick="approveService()">Approve Service</button>
<div id="approveServiceResult"></div>
</div>
<div>
Expand All @@ -372,7 +372,7 @@ <h4>Revoke Service</h4>
<label>Service Contract Address:</label>
<input type="text" id="revokeServiceAddress" placeholder="0x...">
</div>
<button onclick="revokeService()">Revoke Service</button>
<button type="button" onclick="revokeService()">Revoke Service</button>
<div id="revokeServiceResult"></div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions utils/pdp-auth-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
<h1>PDP Auth Signature Demo</h1>
<div class="container">
<div id="status" class="status disconnected"> Not connected to MetaMask </div>
<button id="connectWallet" class="connect-button">Connect MetaMask</button>
<button type="button" id="connectWallet" class="connect-button">Connect MetaMask</button>
<div id="accountInfo"></div>
</div>
<div class="container">
Expand Down Expand Up @@ -178,7 +178,7 @@ <h2>1. Create Data Set</h2>
<label>
<input type="checkbox" id="createWithCDN"> With CDN </label>
</div>
<button id="signCreateDataSet">Sign Create Data Set</button>
<button type="button" id="signCreateDataSet">Sign Create Data Set</button>
<div id="createDataSetResult"></div>
</div>
<div class="container">
Expand All @@ -196,9 +196,9 @@ <h2>2. Add Pieces</h2>
<div id="piecesContainer">
<h3>Piece Data Entries</h3>
<div id="pieceEntries"></div>
<button id="addPieceEntry">Add Piece Entry</button>
<button type="button" id="addPieceEntry">Add Piece Entry</button>
</div>
<button id="signAddPieces">Sign Add Pieces</button>
<button type="button" id="signAddPieces">Sign Add Pieces</button>
<div id="addPiecesResult"></div>
</div>
<div class="container">
Expand All @@ -213,7 +213,7 @@ <h2>3. Schedule Removals</h2>
<label for="removePieceIds">Piece IDs (comma-separated):</label>
<input type="text" id="removePieceIds" placeholder="1,3,5" value="1,3,5">
</div>
<button id="signScheduleRemovals">Sign Schedule Removals</button>
<button type="button" id="signScheduleRemovals">Sign Schedule Removals</button>
<div id="scheduleRemovalsResult"></div>
</div>
<div class="container">
Expand All @@ -223,7 +223,7 @@ <h2>4. Delete Data Set</h2>
<label for="deleteClientDataSetId">Client Data Set ID:</label>
<input type="text" id="deleteClientDataSetId" placeholder="12345" value="12345">
</div>
<button id="signDeleteDataSet">Sign Delete Data Set</button>
<button type="button" id="signDeleteDataSet">Sign Delete Data Set</button>
<div id="deleteDataSetResult"></div>
</div>
<!-- Load ethers and SDK -->
Expand Down
18 changes: 10 additions & 8 deletions utils/pdp-tool-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ <h1>Synapse PDP Testing Tool</h1>
</div>
<div class="form-group">
<label>Wallet Connection:</label>
<button id="connectWalletBtn">Connect MetaMask</button>
<button type="button" id="connectWalletBtn">Connect MetaMask</button>
<div id="walletStatus" class="help-text">Click to connect your MetaMask wallet for signing</div>
</div>
<div class="form-group">
Expand All @@ -214,7 +214,7 @@ <h1>Synapse PDP Testing Tool</h1>
<div class="section">
<h2>Service Providers</h2>
<div class="form-group">
<button id="listProvidersBtn">List Approved Providers</button>
<button type="button" id="listProvidersBtn">List Approved Providers</button>
<div class="help-text">View all service providers approved to use this Warm Storage service</div>
</div>
<div id="providersStatus" class="status info" style="display: none; margin-top: 10px;"></div>
Expand Down Expand Up @@ -246,9 +246,10 @@ <h2>Create Data Set</h2>
<div class="help-text">Whether to enable CDN services for faster retrieval</div>
</div>
<div class="form-group">
<button id="createDataSetBtn" disabled>Create Data Set</button>
<button id="checkStatusBtn" disabled>Check Status</button>
<button id="autoMonitorBtn" disabled style="background-color: #28a745;">Auto-Monitor</button>
<button type="button" id="createDataSetBtn" disabled>Create Data Set</button>
<button type="button" id="checkStatusBtn" disabled>Check Status</button>
<button type="button" id="autoMonitorBtn" disabled
style="background-color: #28a745;">Auto-Monitor</button>
</div>
</div>
<!-- ADD PIECES SECTION -->
Expand Down Expand Up @@ -294,10 +295,11 @@ <h4>Piece Entry 1</h4>
<button type="button" class="remove-piece-btn" onclick="removePieceEntry(this)">Remove</button>
</div>
</div>
<button type="button" class="add-piece-btn" onclick="addPieceEntry()">Add Another Piece</button>
<button type="button" class="add-piece-btn" onclick="addPieceEntry()" disabled>Add Another
Piece</button>
</div>
<div class="form-group">
<button id="addPiecesBtn" disabled>Add Pieces</button>
<button type="button" id="addPiecesBtn" disabled>Add Pieces</button>
</div>
</div>
<!-- MONITOR DATA SET SECTION -->
Expand All @@ -309,7 +311,7 @@ <h2>Monitor Data Set</h2>
<div class="help-text">Enter a data set creation transaction hash to monitor its status</div>
</div>
<div class="form-group">
<button id="monitorTxBtn">Check Transaction Status</button>
<button type="button" id="monitorTxBtn">Check Transaction Status</button>
</div>
</div>
<div id="status" class="status info" style="display: none;"></div>
Expand Down
Loading