diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5c80861 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,100 @@ +# Dependencies +node_modules/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Build outputs +dist/ +trace/ +docs/ +coverage/ + +# Environment variables +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# IDE and editor files +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Git +.git/ +.gitignore + +# CI/CD +.github/ +.gitlab-ci.yml +.travis.yml +.circleci/ + +# Cache directories +.npm/ +.eslintcache +.nyc_output/ +.cache/ + +# Logs +logs/ +*.log + +# Runtime data +pids/ +*.pid +*.seed +*.pid.lock + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# Development files +src/ +tests/ +*.test.js +*.spec.js +jest.config.js +babel.config.js + +# Documentation +README.md +CHANGELOG.md +LICENSE +*.md +docs/ + +# TypeScript +tsconfig*.json +*.tsbuildinfo + +# Linting +.eslintrc* +.prettierrc* + +# Other config files +.editorconfig +.gitattributes \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 376e700..74a3287 100644 --- a/.eslintrc +++ b/.eslintrc @@ -15,6 +15,7 @@ "project": "./tsconfig.eslint.json" }, "plugins": ["@typescript-eslint"], + "ignorePatterns": ["**/*.d.ts", "dist/**/*", "node_modules/**/*"], "rules": { "class-methods-use-this": 0, "import/prefer-default-export": 0, @@ -22,6 +23,24 @@ "@typescript-eslint/naming-convention": 0, "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], "@typescript-eslint/no-use-before-define": ["error", "nofunc"], - "func-names": 0 + "func-names": 0, + + // Architecture-specific overrides for perfect 10/10 architecture + "max-classes-per-file": ["error", 5], // Allow multiple related classes in architecture files + "no-underscore-dangle": ["error", { + "allow": ["__brand", "__constraint", "__phantom"] // Allow TypeScript branded type symbols + }], + "no-restricted-syntax": ["error", + // Keep most restrictions but allow for...of loops for dependency checking + "ForInStatement", + "LabeledStatement", + "WithStatement" + ], + + // Allow .js extensions for proper ESM compatibility + "import/extensions": ["error", "ignorePackages", { + "js": "always", + "ts": "never" + }] } } diff --git a/.github/badges/coverage.svg b/.github/badges/coverage.svg new file mode 100644 index 0000000..143bccf --- /dev/null +++ b/.github/badges/coverage.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ad1780b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,61 @@ +version: 2 + +updates: + # NPM package updates + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "06:00" + timezone: "UTC" + open-pull-requests-limit: 10 + assignees: + - "tabaktoni" + reviewers: + - "tabaktoni" + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependencies" + - "automerge" + ignore: + # Ignore major version updates for breaking changes + - dependency-name: "*" + update-types: ["version-update:semver-major"] + groups: + # Group development dependencies + development-dependencies: + dependency-type: "development" + patterns: + - "@types/*" + - "@typescript-eslint/*" + - "eslint*" + - "prettier*" + - "semantic-release*" + update-types: + - "minor" + - "patch" + + # Group production dependencies + production-dependencies: + dependency-type: "production" + update-types: + - "patch" + + # GitHub Actions updates + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "sunday" + time: "08:00" + timezone: "UTC" + open-pull-requests-limit: 5 + commit-message: + prefix: "ci" + include: "scope" + labels: + - "github-actions" + - "automerge" \ No newline at end of file diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 0000000..892f749 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,69 @@ +name: Dependabot Auto-merge + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +permissions: + contents: write + pull-requests: write + checks: read + +jobs: + dependabot-automerge: + name: Auto-merge Dependabot PRs + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' && !github.event.pull_request.draft + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Wait for status checks + uses: WyriHaximus/github-action-wait-for-status@v1.7.0 + id: wait-for-status + with: + ignoreActions: "dependabot-automerge" + checkInterval: 30 + timeout: 900 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Auto-merge minor/patch updates + if: > + steps.wait-for-status.outputs.status == 'success' && + ( + steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || + steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' + ) + run: | + echo "โ Auto-merging ${{ steps.dependabot-metadata.outputs.update-type }} update" + gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Comment on major updates + if: steps.dependabot-metadata.outputs.update-type == 'version-update:semver-major' + run: | + gh pr comment "${{ github.event.pull_request.html_url }}" --body \ + "๐จ **Major version update detected** - Manual review required before merging. + + **Dependency:** ${{ steps.dependabot-metadata.outputs.dependency-names }} + **Update type:** ${{ steps.dependabot-metadata.outputs.update-type }} + + Please review the changelog and breaking changes before approving." + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Label security updates + if: steps.dependabot-metadata.outputs.package-ecosystem == 'npm' && contains(steps.dependabot-metadata.outputs.dependency-names, 'security') + run: | + gh pr edit "${{ github.event.pull_request.html_url }}" --add-label "security,priority:high" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/docs-manual.yml b/.github/workflows/docs-manual.yml new file mode 100644 index 0000000..279ed0a --- /dev/null +++ b/.github/workflows/docs-manual.yml @@ -0,0 +1,248 @@ +name: ๐ง Manual Documentation Deployment + +on: + workflow_dispatch: + inputs: + environment: + description: 'Deployment Environment' + required: true + default: 'production' + type: choice + options: + - 'production' + - 'staging' + force_rebuild: + description: 'Force complete rebuild' + required: false + default: false + type: boolean + include_dev_guides: + description: 'Include development guides' + required: false + default: true + type: boolean + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "manual-pages-${{ github.event.inputs.environment }}" + cancel-in-progress: true + +jobs: + manual-deploy: + name: ๐ Manual Documentation Deploy + runs-on: ubuntu-latest + timeout-minutes: 15 + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: ๐ Display Deployment Configuration + run: | + echo "๐ง Manual Deployment Configuration:" + echo "Environment: ${{ github.event.inputs.environment }}" + echo "Force Rebuild: ${{ github.event.inputs.force_rebuild }}" + echo "Include Dev Guides: ${{ github.event.inputs.include_dev_guides }}" + echo "Triggered by: ${{ github.actor }}" + echo "Branch: ${{ github.ref_name }}" + + - name: ๐ฅ Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: ๐ฆ Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: ๐งน Clean Previous Build (if forced) + if: github.event.inputs.force_rebuild == 'true' + run: | + echo "๐งน Force rebuild requested - cleaning previous builds..." + npm run clean || true + rm -rf docs/ || true + rm -rf node_modules/.cache/ || true + + - name: ๐ง Install Dependencies + run: | + echo "๐ฆ Installing dependencies..." + npm ci --prefer-offline --no-audit + + - name: ๐๏ธ Build TypeScript + run: | + echo "๐๏ธ Building TypeScript..." + npm run build + + - name: ๐ Pre-build Analysis + run: | + echo "๐ Pre-build Analysis:" + echo "Source files: $(find src -name "*.ts" | wc -l)" + echo "Guide files: $(find guides -name "*.md" | wc -l)" + echo "Package version: $(node -p "require('./package.json').version")" + + - name: ๐ Generate Documentation + run: | + echo "๐ Generating TypeDoc documentation..." + + # Ensure clean docs directory + rm -rf docs/ + + # Generate documentation + npm run docs:generate + + echo "โ Documentation generation complete" + + - name: ๐ Configure Guide Integration + if: github.event.inputs.include_dev_guides == 'true' + run: | + echo "๐ Configuring guide integration..." + + # Verify guide links are in the generated documentation + if grep -q "Developer Guides" docs/index.html; then + echo "โ Guide links found in documentation" + else + echo "โ ๏ธ Guide links not found - this may indicate a configuration issue" + fi + + # Create a guides index redirect (for direct access) + mkdir -p docs/guides/ + cat > docs/guides/index.html << 'EOF' + + +
+ +If you are not redirected, click here to view the developer guides.
+ + + EOF + + - name: ๐จ Apply Custom Styling + run: | + echo "๐จ Applying custom documentation styling..." + + # Check if custom CSS exists and is being used + if [ -f "docs-theme.css" ]; then + echo "โ Custom CSS file found" + + # Verify it's referenced in TypeDoc config + if grep -q "docs-theme.css" typedoc.json; then + echo "โ Custom CSS properly configured in TypeDoc" + else + echo "โ ๏ธ Custom CSS not referenced in typedoc.json" + fi + fi + + - name: ๐ Quality Validation + run: | + echo "๐ Running quality validation..." + + # File structure validation + test -f docs/index.html || { echo "โ Missing main index.html"; exit 1; } + test -d docs/functions || { echo "โ Missing functions directory"; exit 1; } + test -d docs/types || { echo "โ Missing types directory"; exit 1; } + + # Content validation + if ! grep -q "@starknet-io/types-js" docs/index.html; then + echo "โ Package name not found in documentation" + exit 1 + fi + + # Size validation + DOCS_SIZE=$(du -sm docs | cut -f1) + if [ "$DOCS_SIZE" -gt 50 ]; then + echo "โ ๏ธ Documentation size is large: ${DOCS_SIZE}MB" + else + echo "โ Documentation size acceptable: ${DOCS_SIZE}MB" + fi + + echo "โ Quality validation passed" + + - name: ๐ Generate Deployment Report + run: | + echo "๐ Generating deployment report..." + + cat > deployment-report.md << EOF + # ๐ Documentation Deployment Report + + **Deployment Date**: $(date -u +"%Y-%m-%d %H:%M:%S UTC") + **Environment**: ${{ github.event.inputs.environment }} + **Triggered by**: ${{ github.actor }} + **Branch**: ${{ github.ref_name }} + **Commit**: ${{ github.sha }} + + ## ๐ Statistics + - **Total HTML files**: $(find docs -name "*.html" | wc -l) + - **Total assets**: $(find docs/assets -type f 2>/dev/null | wc -l) + - **Documentation size**: $(du -sh docs | cut -f1) + - **Functions documented**: $(find docs/functions -name "*.html" 2>/dev/null | wc -l) + - **Types documented**: $(find docs/types -name "*.html" 2>/dev/null | wc -l) + + ## ๐ Integration Status + - **Guide links**: ${{ github.event.inputs.include_dev_guides == 'true' && 'โ Included' || 'โ Excluded' }} + - **Custom CSS**: $([ -f docs-theme.css ] && echo "โ Applied" || echo "โ Not found") + - **Search functionality**: $(grep -q "search" docs/index.html && echo "โ Available" || echo "โ Not available") + + ## ๐ Available Resources + - ๐ [Main Documentation](https://starknet-io.github.io/types-js/) + - ๐ [Developer Guides](https://github.com/starknet-io/types-js/tree/main/guides) + - ๐ [Performance Guide](https://github.com/starknet-io/types-js/blob/main/guides/PERFORMANCE_GUIDE.md) + - ๐ณ [Tree Shaking Guide](https://github.com/starknet-io/types-js/blob/main/guides/TREE_SHAKING_GUIDE.md) + - ๐ [Usage Guide](https://github.com/starknet-io/types-js/blob/main/guides/USAGE_GUIDE.md) + - ๐ [Migration Guide](https://github.com/starknet-io/types-js/blob/main/guides/MIGRATION_GUIDE.md) + EOF + + echo "๐ Deployment Report:" + cat deployment-report.md + + - name: ๐ Upload Documentation Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./docs + name: github-pages-manual + retention-days: 30 + + - name: ๐ Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + with: + artifact_name: github-pages-manual + + - name: โ Deployment Complete + run: | + echo "๐ Manual deployment completed successfully!" + echo "" + echo "๐ Deployment Details:" + echo " URL: ${{ steps.deployment.outputs.page_url }}" + echo " Environment: ${{ github.event.inputs.environment }}" + echo " Deployment ID: ${{ github.run_id }}" + echo "" + echo "๐ Quick Links:" + echo " โข Documentation: ${{ steps.deployment.outputs.page_url }}" + echo " โข Developer Guides: https://github.com/starknet-io/types-js/tree/main/guides" + echo " โข Repository: https://github.com/starknet-io/types-js" + echo "" + echo "โฑ๏ธ The documentation should be available within 5-10 minutes." + + - name: ๐ง Deployment Notification + if: always() + run: | + if [ "${{ job.status }}" = "success" ]; then + echo "โ Deployment notification: SUCCESS" + echo "Documentation deployed to: ${{ steps.deployment.outputs.page_url }}" + else + echo "โ Deployment notification: FAILED" + echo "Check the workflow logs for details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + fi \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..d5f258e --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,300 @@ +name: ๐ Deploy Documentation to GitHub Pages + +on: + push: + branches: [ main ] + paths: + - 'src/**' + - 'guides/**' + - 'README.md' + - 'typedoc.json' + - 'tsconfig.docs.json' + - 'docs-theme.css' + - '.github/workflows/docs.yml' + pull_request: + branches: [ main ] + paths: + - 'src/**' + - 'guides/**' + - 'README.md' + - 'typedoc.json' + - 'tsconfig.docs.json' + - 'docs-theme.css' + workflow_dispatch: + inputs: + force_deploy: + description: 'Force deployment even on PR' + required: false + default: false + type: boolean + +# Security: Restrict permissions to minimum required +permissions: + contents: read + pages: write + id-token: write + +# Prevent concurrent deployments +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build documentation + build: + name: ๐ Build Documentation + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: ๐ฅ Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history for git-based features + + - name: ๐ฆ Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: ๐ง Install Dependencies + run: | + npm ci --prefer-offline --no-audit + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: ๐๏ธ Build Package + run: | + npm run build + timeout-minutes: 5 + + - name: ๐ Generate Documentation + run: | + echo "๐๏ธ Generating TypeDoc documentation..." + npm run docs:generate + + echo "โ Documentation generated successfully" + echo "๐ Documentation structure:" + find docs -type f -name "*.html" | head -10 + + - name: ๐ Validate Documentation + run: | + # Check that essential files exist + test -f docs/index.html || { echo "โ Missing docs/index.html"; exit 1; } + test -f docs/.nojekyll || { echo "โ Missing docs/.nojekyll"; exit 1; } + + # Check guide links in documentation + if grep -q "Developer Guides" docs/index.html; then + echo "โ Guide links found in documentation" + else + echo "โ ๏ธ Guide links not found in documentation" + fi + + # Validate HTML structure + if command -v tidy >/dev/null 2>&1; then + tidy -q -e docs/index.html || echo "โ ๏ธ HTML validation warnings (non-critical)" + fi + + - name: ๐ Documentation Statistics + run: | + echo "๐ Documentation Statistics:" + echo "Total HTML files: $(find docs -name "*.html" | wc -l)" + echo "Total assets: $(find docs/assets -type f | wc -l)" + echo "Documentation size: $(du -sh docs | cut -f1)" + + echo "๐ Guide files:" + ls -la guides/ + + - name: ๐ง Setup Pages Configuration + run: | + # Ensure .nojekyll exists to disable Jekyll processing + touch docs/.nojekyll + + # Create custom 404 page if it doesn't exist + if [ ! -f docs/404.html ]; then + cat > docs/404.html << 'EOF' + + + + +The requested documentation page could not be found.
+You will be redirected to the main documentation in 5 seconds.
+
+ Available Resources:
+ โข API Documentation
+ โข Developer Guides
+ โข GitHub Repository
+
Validates if an array contains valid FELT signatures
+Array to validate
+Type predicate indicating if value is SIGNATURE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+๐บ Starknet TypeScript types ๐ definitions for Starknet projects +
+ +RPC 0.9 - Upcoming
+npm i @starknet-io/types-js@beta
+
+RPC 0.8 - Latest
+npm i @starknet-io/types-js
+
+RPC 0.7 - Deprecated - deadline (28.07.2025)
+npm i @starknet-io/types-js@0.7.10
+
+// type import
import type { SomeApiType } from '@starknet-io/types-js';
// or entire namespace import
import { API } from '@starknet-io/types-js';
+
+// type import
import type { SomeWalletApiType } from '@starknet-io/types-js';
// or entire namespace import
import { WALLET_API } from '@starknet-io/types-js';
+
+// type import
import type { TypedData } from '@starknet-io/types-js';
+
+
+// namespace import
import { PAYMASTER_API } from '@starknet-io/types-js';
+
+MAJOR and MINOR version of this package follows starknet-spec semantic versioning. The PATCH version can diverge based on the bug fixes.
+Ex. Starknet types-js v0.7 == Starknet Spec v0.7
+npm run build
- Main build command (cleans and builds all formats in parallel)npm run build:cjs
- Builds CommonJS module format (Node.js)npm run build:esm
- Builds ES Module format (modern bundlers with tree-shaking)npm run build:types
- Generates TypeScript declaration files (.d.ts)npm run build:analyze
- Counts TypeScript processed files (compilation debugging)npm run build:trace
- Generates detailed TypeScript compilation tracenpm run analyze
- Runs bundlesize check (ensures <10KB gzipped)npm run clean
- Removes build artifacts (dist folder and trace files)npm run format
- Auto-formats all code files using Prettiernpm run lint
- Runs ESLint to check code quality and auto-fix issuesnpm run ts:check
- Type-checks code without emitting filesnpm run validate
- Comprehensive validation: lint + type-check + build (parallel)npm run test:types
- Type-checks test files specificallynpm run docs:generate
- Creates API documentation using TypeDocnpm run docs:serve
- Serves documentation locally on port 3000For development:
+npm run validate # Before committing - checks everything
npm run build # When you need fresh builds
npm run format # To format code before committing
+
+For debugging:
+npm run build:analyze # Count compiled files
npm run build:trace # Detailed compilation analysis
npm run analyze # Check bundle sizes
+
+This repository is licensed under the MIT License, see LICENSE for more information.
+"More data about the compilation failure
+the execution trace up to the point of failure
+The index of the first transaction failing in a sequence of given transactions
+0
+the execution trace up to the point of failure
+SPEC: ACCOUNT_DEPLOYMENT_DATA
+Optional
sigdataSPEC: DECLARE_TXN
+Optional
class_The hash of the declare transaction
+The hash of the declared class
+INVOKE_TXN_V1
+Calls to invoke by the account
+EIP-3085:
+Optional
rpc_Optional
block_Optional
native_Optional
icon_Maps each RPC message type to its corresponding parameters and result type.
+Get permissions from the wallet.
+Optional
params?: ApiVersionRequestAn array of permissions.
+Request active accounts from the wallet.
+Optional
params?: RequestAccountsParameters & ApiVersionRequestOptional parameters for requesting accounts.
+An array of account addresses as strings.
+Watch an asset in the wallet.
+The parameters required to watch an asset.
+A boolean indicating if the operation was successful.
+Add a new Starknet chain to the wallet.
+The parameters required to add a new chain.
+A boolean indicating if the operation was successful.
+Switch the current Starknet chain in the wallet.
+The parameters required to switch chains.
+A boolean indicating if the operation was successful.
+Request the current chain ID from the wallet.
+Optional
params?: ApiVersionRequestThe current Starknet chain ID.
+Get deployment data for a contract.
+Optional
params?: ApiVersionRequestThe deployment data result.
+Add an invoke transaction to the wallet.
+The parameters required for the invoke transaction.
+The result of adding the invoke transaction.
+Add a declare transaction to the wallet.
+The parameters required for the declare transaction.
+The result of adding the declare transaction.
+Sign typed data using the wallet.
+The typed data to sign.
+An array of signatures as strings.
+Get the list of supported RPC specification versions.
+Optional
params?: undefinedAn array of supported specification strings.
+Returns a list of wallet api versions compatible with the wallet. +Notice this might be different from Starknet JSON-RPC spec
+Optional
params?: undefinedAn array of supported wallet api versions.
+The EIP712 domain struct. Any of these fields are optional, but it must contain at least one field.
+Optional
nameOptional
versionOptional
chainOptional
revisionSPEC: TYPED_DATA +The complete typed data, with all the structs, domain data, primary type of the message, and the message itself.
+EIP-747:
+Optional
symbol?: stringOptional
decimals?: numberOptional
image?: stringOptional
name?: stringcommon definition
+common outputs
+A block identifier that can be either a block hash, block number, or a block tag
+0
+A block selector that can be either a block hash or block number
+A tag specifying a dynamic reference to a block.
+Tag l1_accepted
refers to the latest Starknet block which was included in a state update on L1 and finalized by the consensus on L1.
+Tag latest
refers to the latest Starknet block finalized by the consensus on L2.
+Tag pre_confirmed
refers to the block which is currently being built by the block proposer in height latest
+ 1.
EBlockTag
+A block with full transactions and receipts
+A block with transaction hashes
+Starknet get compiled CASM result
+Array of 2-tuple of pc value and an array of hints to execute.
+Optional
bytecode_a list of sizes of segments in the bytecode, each segment is hashed individually when computing the bytecode hash. +Integer
+Common properties shared by all transaction receipts
+Cairo v>=2 Contract ABI
+the (Cairo) enum name, including namespacing
+name of the enum variant. +type of the enum variant, including namespacing.
+enum variants
+the name of the (Cairo) type associated with the event
+the name of the struct member or enum variant
+the Cairo type of the member or variant, including namespacing
+the function's name
+the arguments name and type.
+the output type.
+the name of an impl containing contract entry points
+the name of the trait corresponding to this impl
+the (Cairo) struct name, including namespacing
+name of the struct member. +type of the struct member, including namespacing.
+struct members
+The definition of a StarkNet contract class
+structured error that can later be processed by wallets or sdks. +error frame or the error raised during execution
+structured error that can later be processed by wallets or sdks. +error frame or the error raised during execution
+The contract address for which the storage changed
+The changes in the storage of the contract
+Data availability mode. +Specifies a storage domain in Starknet. Each domain has different guarantees regarding availability
+A transaction receipt for a declare transaction
+A transaction trace for a declare transaction
+Optional
validate_Optional
fee_Optional
state_Starknet 0.14 will not support this transaction
+Starknet 0.14 will not support this transaction
+Starknet 0.14 will not support this transaction
+A transaction receipt for a deploy account transaction
+A transaction trace for a deploy account transaction
+The trace of the constructor call
+Optional
validate_Optional
fee_Optional
state_Starknet 0.14 will not support this transaction
+A transaction receipt for a deploy transaction
+"The offset of the entry point in the program"
+A unique identifier of the entry point (function) in the program
+represents a path to the highest non-zero descendant node
+an unsigned integer whose binary representation represents the path from the current node to its highest non-zero descendant (bounded by 2^251)
+the length of the path (bounded by 251)
+0
+the hash of the unique non-zero maximal-height descendant node
+Represents the type of an entry point.
+an ethereum address represented as 40 hex digits
+^0x[a-fA-F0-9]{40}$
+Starknet 0.14 will not support this transaction
+Returns matching events
+Optional
continuation_Use this token in a subsequent query to obtain the next page. Should not appear if there are no more pages.
+Event ABI type
+Event name
+Optional
from_Optional
to_Optional
address?: ADDRESSOptional
keys?: EVENT_KEYSThe keys to filter over. +Per key (by position), designate the possible values to be matched for events to be returned. Empty array designates 'any' value.
+the resources consumed by the transaction
+l1 gas consumed by this transaction, used for l2-->l1 messages and state updates if blobs are not used. +integer
+0
+data gas consumed by this transaction, 0 if blobs are not used +integer
+0
+l2 gas consumed by this transaction, used for computation and calldata +Integer
+0
+Units in which the fee is given, can only be FRI
+The Ethereum gas consumption of the transaction, charged for L1->L2 messages and, depending on the block's DA_MODE, state diffs. +Prev. name gas_consumed
+The gas price (in wei or fri, depending on the tx version) that was used in the cost estimation. +Prev. name gas_price
+The L2 gas consumption of the transaction.
+The L2 gas price (in wei or fri, depending on the tx version) that was used in the cost estimation.
+The Ethereum data gas consumption of the transaction. +Prev. name data_gas_consumed
+The data gas price (in wei or fri, depending on the tx version) that was used in the cost estimation. +Prev. name data_gas_price
+The estimated fee for the transaction (in wei or fri, depending on the tx version), equals to l1_gas_consumedl1_gas_price + l1_data_gas_consumedl1_data_gas_price + l2_gas_consumed*l2_gas_price
+A field element. represented by at most 63 hex digits
+^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
+Function ABI type
+Function name
+Typed parameter
+Typed parameter
+Optional
stateFunction state mutability
+Represents a function invocation along with its execution details.
+The address of the invoking contract. 0 for the root invocation
+The hash of the class being called
+The value returned from the function invocation
+The calls made by this invocation
+The events emitted in this invocation
+The messages sent by this invocation to L1
+Resources consumed by the call tree rooted at this given call (including the root)
+true if this inner call panicked
+the resources consumed by an inner call (does not account for state diffs since data is squashed across the transaction)
+l1 gas consumed by this transaction, used for l2-->l1 messages and state updates if blobs are not used
+0
+l2 gas consumed by this transaction, used for computation and calldata
+0
+A transaction receipt for an invoke transaction
+A transaction trace for an invoke transaction
+The trace of the execute call
+Optional
validate_Optional
fee_Optional
state_Starknet 0.14 will not support this transaction
+Starknet 0.14 will not support this transaction
+Possible permutations of transaction. + BLOCK TYPE + TYPE OF TRANSACTION + EXECUTION (Reverted or not) + FINALITY (Rejected on not) Receipt do not have Rejected
+Ethereum l1_handler tx hash and status for L1 -> L2 messages sent by the l1 transaction
+l1_handler tx hash
+finality status of the L1 -> L2 messages sent by the l1 transaction
+the failure reason, only appears if finality_status is REJECTED
+Optional
failure_The failure reason. Only appears if execution_status
is REVERTED
A transaction receipt for an L1 handler transaction
+A transaction trace for an L1 handler transaction
+The trace of the L1 handler call
+Optional
state_a node in the Merkle-Patricia tree, can be a leaf, binary node, or an edge node
+Message fee estimate
+Units in which the fee is given, can only be WEI
+A message sent from L1 to L2
+a node_hash -> node mapping of all the nodes in the union of the paths between the requested leaves and the root
+string representing an unsigned integer number in prefixed hexadecimal format
+"0x.."
+
+^0x[a-fA-F0-9]+$
+The block number of the block that the proposer is currently building. Note that this is a local view of the node, whose accuracy depends on its polling interval length.
+The time in which the block was created, encoded in Unix time
+The StarkNet identity of the sequencer submitting this block
+The price of l1 gas in the block
+The price of l2 gas in the block
+The price of l1 data gas in the block
+specifies whether the data of this block is published via blob data or calldata
+Semver of the current Starknet protocol
+Pre-confirmed block state update
+Data about reorganized blocks, starting and ending block number and hash
+Hash of the first known block of the orphaned chain
+Number of the first known block of the orphaned chain
+The last known block of the orphaned chain
+Number of the last known block of the orphaned chain
+The max amount and max price per unit of L1 gas used in this tx
+The max amount and max price per unit of L1 blob gas used in this tx
+The max amount and max price per unit of L2 gas used in this tx
+Optional
continuation_The token returned from the previous query. If no token is provided the first page is returned.
+Chunk size
+Flags that indicate how to simulate a given transaction. By default, the sequencer behavior is replicated locally (enough funds are expected to be in the account, and the fee will be deducted from the balance before the simulation of the next transaction). To skip the fee charge, use the SKIP_FEE_CHARGE flag.
+The change in state applied in this block
+The transaction/block was accepted on Ethereum (L1)
+The transaction/block was accepted on L2 and included
+The transaction is a candidate for inclusion in the next block
+The transaction/block was written to the feeder gateway's storage by a sequencer
+The transaction was received by the sequencer
+The block was rejected and will not be included
+The transaction passed validation but failed during execution by the sequencer, and is included in a block as reverted
+The transaction was successfully executed
+A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.
+^0x(0|[0-7]{1}[a-fA-F0-9]{0,62}$)
+Struct ABI type
+Struct name
+offset of this property within the struct
+0
+same as BLOCK_ID, but without 'pre_confirmed'
+An identifier for this subscription stream used to associate events with this subscription. +Integer
+An object describing the node synchronization status
+The nodes in the union of the paths from the contracts tree root to the requested leaves
+The nonce and class hash for each requested contract address, in the order in which they appear in the request. These values are needed to construct the associated leaf node
+A transaction trace including the execution details
+The execution status of the transaction
+The finality status of the transaction
+All possible transaction receipt types
+A transaction receipt with block information
+Represents the finality status of the transaction, including the case the txn is still in the mempool or failed validation during the block construction phase
+Transaction status result, including finality status and execution status
+Optional
execution_Optional
failure_The failure reason, only appears if execution_status is REVERTED
+The type of the transaction
+Parameter name
+Parameter type
+All Type Transaction Receipt
+All Type Transaction Receipt from pre confirmed block
+All Type Transaction Receipt from production block
+Server -> Client events over WebSockets
+New block headers subscription. +Creates a WebSocket stream which will fire events for new block headers.
+Optional
block_The block to get notifications from, default is latest, limited to 1024 blocks back
+New events subscription. +Creates a WebSocket stream which will fire events for new Starknet events with applied filters.
+Optional
from_Filter events by from_address which emitted the event
+Optional
keys?: EVENT_KEYSOptional
block_The block to get notifications from, default is latest, limited to 1024 blocks back
+New transaction status subscription. +Creates a WebSocket stream which at first fires an event with the current known transaction status, followed by events for every transaction status update
+New Pending Transactions subscription. +Creates a WebSocket stream which will fire events when a new pending transaction is added. While there is no mempool, this notifies of transactions in the pending block.
+Optional
transaction_"Get all transaction details, and not only the hash. If not provided, only hash is returned. Default is false"
+Optional
sender_Filter transactions to only receive notification from address list
+Close a previously opened ws stream, with the corresponding subscription id
+128 bit unsigned integers, represented by hex string of length at most 32 +"pattern": "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,31})$"
+64 bit unsigned integers, represented by hex string of length at most 16 +"pattern": "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,15})$"
+A contract address on Starknet (branded FELT)
+"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"
+
+Block number
+0
+Chain ID
+A field element represented by at most 63 hex digits
+^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
+"0x1234567890abcdef"
+
+"0x0"
+
+https://docs.starknet.io/documentation/architecture_and_concepts/Cryptography/hash-functions/
+The hash of a Starknet transaction
+User transaction
+Optional
time_Execution parameters
+A unique identifier corresponding to an execute
request to the paymaster
User transaction
+256 bit unsigned integers, represented by a hex string of length at most 64
+^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,63})$
+Optional
accounts: string[]Starknet Token +Details of an onchain Starknet ERC20 token
+Optional
symbol?: TokenSymbolOptional
decimals?: numberOptional
image?: stringOptional
name?: stringOptional
chainId: ChainIdOptional
accounts: string[]"A typed data object (in the sense of SNIP-12) which represents an outside execution payload, according to SNIP-9
+A padded felt represent 0x0 + (0-7) + (62 hex digits)
+^0x(0[0-7]{1}[a-fA-F0-9]{62}$)
+The transaction hash, as assigned in Starknet
+A Starknet RPC spec version, only two numbers are provided
+^[0-9]+\.[0-9]+$
+SPEC: STARKNET_TYPE
+A single type, as part of a struct. The type
field can be any of the EIP-712 supported types.
+Note that the uint
and int
aliases like in Solidity, and fixed point numbers are not supported by the EIP-712
+standard.
Object containing timestamps corresponding to Execute After
and Execute Before
ERC20 Token Symbol (min:1 char - max:6 chars)
+^[A-Za-z0-9]{1,6}$
+Const
Represents the type of a function call.
+Readonly
DELEGATE: "DELEGATE"Readonly
LIBRARY_Readonly
CALL: "CALL"Const
Readonly
PRE_Readonly
ACCEPTED_Readonly
ACCEPTED_Const
A tag specifying a dynamic reference to a block.
+Readonly
LATEST: "latest"Tag latest
refers to the latest Starknet block finalized by the consensus on L2.
Readonly
PRE_Tag pre_confirmed
refers to the block which is currently being built by the block proposer in height latest
+ 1.
Readonly
L1_Tag l1_accepted
refers to the latest Starknet block which was included in a state update on L1 and finalized by the consensus on L1.
Const
Readonly
L1: 0Readonly
L2: 1Const
Readonly
L1: "L1"Readonly
L2: "L2"Const
Readonly
SKIP_Readonly
SKIP_Const
Readonly
SUCCEEDED: "SUCCEEDED"Readonly
REVERTED: "REVERTED"Const
Readonly
PRE_Readonly
ACCEPTED_Readonly
ACCEPTED_Const
Readonly
RECEIVED: "RECEIVED"Readonly
CANDIDATE: "CANDIDATE"Readonly
PRE_Readonly
ACCEPTED_Readonly
ACCEPTED_Const
Readonly
DECLARE: "DECLARE"Readonly
DEPLOY: "DEPLOY"Readonly
DEPLOY_Readonly
INVOKE: "INVOKE"Readonly
L1_Const
V_ Transaction versions HexString +F_ Fee Transaction Versions HexString (2 ** 128 + TRANSACTION_VERSION)
+Readonly
V0: "0x0"Starknet 0.14 will not support this transaction
+Readonly
V1: "0x1"Starknet 0.14 will not support this transaction
+Readonly
V2: "0x2"Starknet 0.14 will not support this transaction
+Readonly
V3: "0x3"Readonly
F0: "0x100000000000000000000000000000000"Starknet 0.14 will not support this transaction
+Readonly
F1: "0x100000000000000000000000000000001"Starknet 0.14 will not support this transaction
+Readonly
F2: "0x100000000000000000000000000000002"Starknet 0.14 will not support this transaction
+Readonly
F3: "0x100000000000000000000000000000003"Const
Readonly
V0: "0x0"Readonly
V1: "0x1"Readonly
V2: "0x2"Readonly
F0: "0x100000000000000000000000000000000"Readonly
F1: "0x100000000000000000000000000000001"Readonly
F2: "0x100000000000000000000000000000002"Starknet 0.14 will not support this transaction
+Const
V3 Transaction Versions
+Readonly
V3: "0x3"Readonly
F3: "0x100000000000000000000000000000003"Const
Readonly
BLOB: "BLOB"Readonly
CALLDATA: "CALLDATA"Const
Readonly
ACCOUNTS: "accounts"Const
Readonly
ACTIVE: "1"Readonly
LEGACY: "0"
Assertion functions for runtime type checking
+