├── .eslintignore ├── .eslintrc.js ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .husky └── pre-commit ├── .prettierrc.js ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── api ├── README.mdx ├── anti-goals.mdx ├── goals.mdx ├── json-rpc.mdx ├── methods │ ├── getEvents.mdx │ ├── getHealth.mdx │ ├── getLatestLedger.mdx │ ├── getLedgerEntries.mdx │ ├── getNetwork.mdx │ ├── getTransaction.mdx │ ├── sendTransaction.mdx │ └── simulateTransaction.mdx └── pagination.mdx ├── babel.config.js ├── dapps ├── README.mdx ├── _category_.json ├── dapp-challenges │ ├── _category_.json │ ├── challenge-0-crowdfund.mdx │ ├── challenge-1-payment.mdx │ ├── challenge-2-liquidity-pool.mdx │ ├── challenge-3-oracle.mdx │ └── styles.css ├── guides │ ├── _category_.json │ ├── docker.mdx │ ├── initialization.mdx │ ├── react.mdx │ ├── smart-contracts.mdx │ └── wallets.mdx └── scaffold-soroban.mdx ├── docs ├── README.mdx ├── developer-tools.mdx ├── faq.mdx ├── getting-started │ ├── _category_.json │ ├── create-an-app.mdx │ ├── deploy-increment-contract.mdx │ ├── deploy-to-testnet.mdx │ ├── hello-world.mdx │ ├── setup.mdx │ └── storing-data.mdx ├── guides │ ├── README.mdx │ ├── _category_.json │ ├── archival │ │ ├── README.mdx │ │ ├── create-restoration-footprint-js.mdx │ │ ├── restore-contract-js.mdx │ │ └── restore-data-js.mdx │ ├── cli │ │ ├── README.mdx │ │ ├── deploy-contract.mdx │ │ ├── deploy-stellar-asset-contract.mdx │ │ ├── extend-contract-instance.mdx │ │ ├── extend-contract-storage.mdx │ │ ├── extend-contract-wasm.mdx │ │ ├── install-deploy.mdx │ │ ├── install-wasm.mdx │ │ ├── restore-contract-instance.mdx │ │ └── restore-contract-storage.mdx │ ├── conventions │ │ ├── README.mdx │ │ ├── error-enum.mdx │ │ ├── upgrading-contracts.mdx │ │ ├── wasm-metadata.mdx │ │ └── work-contractspec-js.mdx │ ├── conversions │ │ ├── README.mdx │ │ ├── address-to-bytesn.mdx │ │ ├── address-to-id.mdx │ │ └── id-to-address.mdx │ ├── events │ │ ├── README.mdx │ │ ├── consume.mdx │ │ ├── ingest.mdx │ │ └── publish.mdx │ ├── fees │ │ ├── README.mdx │ │ └── cost-analysis.mdx │ ├── rpc │ │ ├── README.mdx │ │ ├── generate-ledger-keys-python.mdx │ │ ├── retrieve-contract-code-js.mdx │ │ ├── retrieve-contract-code-python.mdx │ │ ├── self-deploy-rpc.mdx │ │ └── use-public-rpc.mdx │ ├── storage │ │ ├── README.mdx │ │ ├── choose-type.mdx │ │ ├── use-instance.mdx │ │ ├── use-persistent.mdx │ │ └── use-temporary.mdx │ ├── testing │ │ ├── README.mdx │ │ ├── basic-contract-tests.mdx │ │ ├── integration-testing-multiple-contracts.mdx │ │ ├── mint-native-token.mdx │ │ ├── test-contract-auth.mdx │ │ └── testnet-reset.mdx │ └── transactions │ │ ├── README.mdx │ │ ├── invoke-contract-tx-js.mdx │ │ └── submit-transaction-wait-js.mdx ├── migrate │ ├── _category_.json │ ├── cosmos.mdx │ ├── evm │ │ ├── _category_.json │ │ ├── introduction-to-solidity-and-rust.mdx │ │ ├── smart-contract-deployment.mdx │ │ ├── solidity-and-rust-advanced-concepts.mdx │ │ └── solidity-and-rust-basics.mdx │ ├── near.mdx │ └── solana.mdx ├── reference │ ├── _category_.json │ ├── data-providers.mdx │ ├── freighter.mdx │ ├── networks.mdx │ ├── resource-limits-fees.mdx │ ├── rpc-list.mdx │ ├── rpc.mdx │ ├── sdks │ │ ├── _category_.json │ │ ├── build-your-own-sdk.mdx │ │ ├── interact-with-contracts.mdx │ │ └── write-contracts.mdx │ └── soroban-cli.mdx ├── releases.mdx ├── soroban-internals │ ├── _category_.json │ ├── authorization.mdx │ ├── contract-interactions │ │ ├── _category_.json │ │ ├── cross-contract.mdx │ │ ├── overview.mdx │ │ ├── stellar-transaction.mdx │ │ ├── tests.mdx │ │ └── transaction-simulation.mdx │ ├── contract-lifecycle.mdx │ ├── debugging.mdx │ ├── environment-concepts.mdx │ ├── errors.mdx │ ├── events.mdx │ ├── fees-and-metering.mdx │ ├── high-level-overview.mdx │ ├── persisting-data.mdx │ ├── rust-dialect.mdx │ ├── state-archival.mdx │ ├── transaction-lifecycle.mdx │ └── types │ │ ├── _category_.json │ │ ├── built-in-types.mdx │ │ ├── custom-types.mdx │ │ └── fully-typed-contracts.mdx ├── tokens │ ├── _category_.json │ ├── stellar-asset-contract.mdx │ └── token-interface.mdx └── tutorials │ ├── README.mdx │ ├── TEMPLATE.mdx │ ├── _category_.json │ ├── alloc.mdx │ ├── atomic-multi-swap.mdx │ ├── atomic-swap.mdx │ ├── auth.mdx │ ├── cross-contract-call.mdx │ ├── custom-account.mdx │ ├── custom-types.mdx │ ├── deployer.mdx │ ├── errors.mdx │ ├── events.mdx │ ├── fuzzing.mdx │ ├── liquidity-pool.mdx │ ├── logging.mdx │ ├── single-offer-sale.mdx │ ├── timelock.mdx │ └── tokens.mdx ├── docusaurus.config.js ├── meeting-notes ├── 2024-01-18.mdx ├── 2024-01-26.mdx ├── 2024-02-01.mdx ├── 2024-02-09.mdx ├── 2024-02-15.mdx ├── 2024-02-22.mdx └── authors.yml ├── nginx ├── conf.d │ └── default.conf └── includes │ └── redirects.conf ├── openrpc ├── README.md ├── scripts │ ├── build.mjs │ └── validate.mjs └── src │ ├── contentDescriptors │ ├── EventFilters.json │ ├── LedgerKeys.json │ ├── Pagination.json │ ├── ResourceConfig.json │ ├── StartLedger.json │ ├── Transaction.json │ └── TransactionHash.json │ ├── examplePairingObjects │ ├── EventsPairs.json │ ├── GetTransactionPairs.json │ ├── LedgerEntriesPairs.json │ ├── NetworkPairs.json │ ├── SendTransactionPairs.json │ └── SimulationPairs.json │ ├── examples │ ├── Events.json │ ├── LedgerEntries.json │ ├── Simulations.json │ └── Transactions.json │ ├── methods │ ├── getEvents.json │ ├── getHealth.json │ ├── getLatestLedger.json │ ├── getLedgerEntries.json │ ├── getNetwork.json │ ├── getTransaction.json │ ├── sendTransaction.json │ └── simulateTransaction.json │ └── schemas │ ├── ContractIds.json │ ├── Event.json │ ├── EventFilters.json │ ├── Hash.json │ ├── LedgerCloseTime.json │ ├── LedgerEntries.json │ ├── LedgerSequence.json │ ├── NetworkConfig.json │ ├── Pagination.json │ ├── ResourceConfig.json │ └── Transaction.json ├── package.json ├── patches └── @metamask+open-rpc-docs-react+0.1.2.patch ├── sidebars.js ├── sidebarsApi.js ├── sidebarsDapps.js ├── sidebarsGuides.js ├── src ├── analytics-module.js ├── components │ ├── ReaderFeedback │ │ └── index.js │ ├── RpcMethod.tsx │ ├── atoms │ │ ├── ProviderExample.tsx │ │ ├── SortableRow │ │ │ └── index.js │ │ ├── UI │ │ │ ├── carousel │ │ │ │ ├── index.tsx │ │ │ │ └── style.module.css │ │ │ ├── loading │ │ │ │ └── index.tsx │ │ │ └── switcher │ │ │ │ ├── index.tsx │ │ │ │ └── style.module.css │ │ ├── challenge-card │ │ │ ├── challenge-icons.tsx │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ ├── challenge-contract-form │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ ├── challenge-form │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ ├── challenges-list │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ ├── complete-step-button │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ ├── confirm-modal │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ ├── dashboard-header │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ ├── index.tsx │ │ ├── start-challenge-button │ │ │ ├── index.tsx │ │ │ └── style.module.css │ │ └── style.module.css │ └── molecules │ │ ├── SortableTable │ │ ├── index.js │ │ └── style.module.css │ │ └── leaderboard │ │ ├── index.tsx │ │ └── style.module.css ├── contants.ts ├── css │ ├── components │ │ ├── _doc-page.scss │ │ ├── _footer.scss │ │ ├── _navbar.scss │ │ ├── _sidebar.scss │ │ └── _toc.scss │ ├── custom.scss │ └── variables.scss ├── dev-server-plugin.js ├── hooks │ └── useAuth.tsx ├── interfaces │ └── challenge.ts ├── pages │ ├── _index.js │ ├── _sorobanathon.js │ ├── dashboard │ │ ├── index.tsx │ │ └── style.module.css │ ├── index.scss │ └── sorobanathon.scss ├── services │ ├── challenges.ts │ ├── http-client.ts │ └── leaderboard.ts ├── sidebar-generator.js ├── store │ ├── UserChallengesContextProvider.tsx │ └── user-challenges-context.ts ├── theme │ ├── DocCardList │ │ ├── index.js │ │ └── style.module.css │ ├── DocItem │ │ └── Footer │ │ │ ├── index.js │ │ │ └── styles.module.css │ ├── Root.tsx │ └── style.module.css └── utils │ ├── get-active-challenge.ts │ └── get-contract-balance.ts ├── static ├── .nojekyll ├── diagrams │ └── environment-concepts.png ├── icons │ ├── icon-avatar-1.svg │ ├── icon-avatar-10.svg │ ├── icon-avatar-2.svg │ ├── icon-avatar-3.svg │ ├── icon-avatar-4.svg │ ├── icon-avatar-5.svg │ ├── icon-avatar-6.svg │ ├── icon-avatar-7.svg │ ├── icon-avatar-8.svg │ ├── icon-avatar-9.svg │ ├── icon-copy.svg │ ├── icon-ranking.svg │ ├── icon-star-yellow.svg │ ├── icon-star.svg │ ├── smiley-face-1.svg │ ├── smiley-face-2.svg │ ├── thumbs-down.svg │ └── thumbs-up.svg ├── img │ ├── add_token.png │ ├── added_balance.png │ ├── approveTokenMint.png │ ├── approveTxn.png │ ├── aucb_balance.png │ ├── back100.png │ ├── backedResult.png │ ├── balance_rcvr.png │ ├── choose_token.png │ ├── confirm_mint.png │ ├── confirm_pmt.png │ ├── connect_freighter.png │ ├── connect_freighter_example.png │ ├── connect_wallet.png │ ├── counter.png │ ├── dashboard-bg.png │ ├── deploy-counter.png │ ├── deployed-contracts.png │ ├── deployedDApp.png │ ├── deposit50.png │ ├── docusaurus-social-card.jpg │ ├── docusaurus.png │ ├── dt_acct_bal.png │ ├── end.png │ ├── example.png │ ├── favicon.ico │ ├── freighter_settings.png │ ├── futurenetDeployment.png │ ├── gear_icon.png │ ├── hex2str.png │ ├── increment.png │ ├── input_token_id.png │ ├── landing │ │ ├── arrow-black.svg │ │ ├── arrow-white.svg │ │ ├── designed-for-icon.svg │ │ ├── discord-1.svg │ │ ├── earn.svg │ │ ├── group-245.svg │ │ ├── icon.svg │ │ ├── icon1.svg │ │ ├── icon2.svg │ │ ├── icon3.svg │ │ ├── icon4.svg │ │ ├── icon5.svg │ │ ├── icon6.svg │ │ ├── image-1.svg │ │ ├── image-11.svg │ │ ├── image-111@3x.png │ │ ├── image-1@2x.png │ │ ├── image-2.svg │ │ ├── image-23.svg │ │ ├── image-231@3x.png │ │ ├── image-3.svg │ │ ├── image-39@2x.png │ │ ├── image-4.svg │ │ ├── image-4@2x.png │ │ ├── image-5.svg │ │ ├── image-54.svg │ │ ├── learn.svg │ │ ├── scf.svg │ │ ├── ships.svg │ │ ├── soroban-white.svg │ │ ├── twitter-1.svg │ │ ├── vector-6.svg │ │ ├── vector-7.svg │ │ ├── vector-8.svg │ │ ├── vector.svg │ │ ├── vector1.svg │ │ ├── vector2.svg │ │ ├── vector3.svg │ │ ├── vector4.svg │ │ └── youtube-1.svg │ ├── leaderboard-placeholder.png │ ├── logo.svg │ ├── manage_assets.png │ ├── meta.png │ ├── mintToken.png │ ├── mint_amt.png │ ├── mint_token.png │ ├── mint_token_landing.png │ ├── mint_tokens.png │ ├── mint_tx_result.png │ ├── new_token.png │ ├── next.png │ ├── oracle_approve.png │ ├── oracle_balance_contract.png │ ├── oracle_balance_user.png │ ├── oracle_calculate.png │ ├── oracle_connect.png │ ├── oracle_deployed.png │ ├── oracle_home.png │ ├── oracle_mint.png │ ├── oracle_mintBal.png │ ├── payment_settings.png │ ├── pmt_dest.png │ ├── preferences_menu.png │ ├── select_token.png │ ├── sign_tx.png │ ├── soroban-fav-icon.png │ ├── soroban-wordmark-temp-dark.svg │ ├── soroban-wordmark-temp.svg │ ├── soroban_fees.png │ ├── stellar-logo-dark.svg │ ├── stellar-logo.svg │ ├── submit_mint_tx.png │ ├── submit_pmt.png │ ├── success.png │ ├── swap.png │ ├── swapComplete.png │ ├── timeline-drk.png │ ├── timeline-lgt.png │ ├── token_to_mint.png │ ├── tutorial │ │ ├── docsVersionDropdown.png │ │ └── localeDropdown.png │ ├── tx_settings.png │ ├── undraw_docusaurus_mountain.svg │ ├── undraw_docusaurus_react.svg │ ├── undraw_docusaurus_tree.svg │ ├── updatedBalance.png │ ├── updatedBalances.png │ ├── updatedBalances50.png │ ├── vault-project.png │ ├── wallet_connected.png │ └── wdraw.png ├── openrpc.json └── robots.txt ├── tsconfig.json └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | docs 4 | .github 5 | build 6 | /*.js 7 | /*.ts 8 | /*.d.ts 9 | static 10 | .docusaurus -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@stellar/eslint-config"], 3 | rules: { 4 | "import/no-unresolved": 0, 5 | "react/jsx-filename-extension": [1, { "extensions": [".tsx"] }], 6 | "jsdoc/newline-after-description": 0, 7 | "arrow-body-style": 0, 8 | "no-return-await": 0, 9 | "@typescript-eslint/naming-convention": 0, 10 | "no-unused-expressions": 0, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Format MDX and Lint 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout App Repo 16 | uses: actions/checkout@v3 17 | 18 | - name: Setup Node 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: '16' 22 | cache: 'yarn' 23 | cache-dependency-path: '**/yarn.lock' 24 | 25 | - name: Install App Dependencies 26 | run: yarn --prefer-offline 27 | 28 | - name: Check MDX 29 | run: yarn check:mdx 30 | 31 | - name: Build app 32 | run: yarn build -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | .vercel 22 | 23 | # non-production openrpc.json files 24 | /openrpc/*openrpc.json 25 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | G='\033[0;32m' 5 | P='\033[0;35m' 6 | CLEAN='\033[0;0m' 7 | 8 | yarn run check:mdx || (echo -e "${G}Hint:${CLEAN} execute ${P}yarn format:mdx${CLEAN} to format files" && exit 1) 9 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ...require("@stellar/prettier-config"), 3 | // This is mostly content, and prose wrap has a way of exploding markdown 4 | // diffs. Override the default for a better experience. 5 | overrides: [ 6 | { 7 | files: "*.mdx", 8 | options: { 9 | proseWrap: "never", 10 | }, 11 | }, 12 | ], 13 | }; -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 as build 2 | 3 | LABEL maintainer="SDF Ops Team " 4 | 5 | RUN mkdir -p /app 6 | WORKDIR /app 7 | 8 | ENV DEBIAN_FRONTEND=noninteractive 9 | ENV INLINE_RUNTIME_CHUNK=false 10 | RUN apt-get update && apt-get install --no-install-recommends -y gpg curl git make ca-certificates apt-transport-https && \ 11 | curl -sSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key|gpg --dearmor >/etc/apt/trusted.gpg.d/nodesource-key.gpg && \ 12 | echo "deb https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ 13 | curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg |gpg --dearmor >/etc/apt/trusted.gpg.d/yarnpkg.gpg && \ 14 | echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ 15 | apt-get update && apt-get install -y nodejs yarn && apt-get clean 16 | 17 | COPY . /app/ 18 | 19 | RUN yarn install 20 | RUN yarn rpcspec:build 21 | RUN yarn build 22 | 23 | FROM nginx:1.17 24 | 25 | COPY --from=build /app/build/ /usr/share/nginx/html/ 26 | COPY --from=build /app/nginx/ /etc/nginx/ 27 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Check if we need to prepend docker commands with sudo 2 | SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo") 3 | 4 | # If LABEL is not provided set default value 5 | LABEL ?= $(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n)) 6 | # If TAG is not provided set default value 7 | TAG ?= stellar/soroban-docs:$(LABEL) 8 | # https://github.com/opencontainers/image-spec/blob/master/annotations.md 9 | BUILD_DATE := $(shell date -u +%FT%TZ) 10 | 11 | docker-build: 12 | $(SUDO) docker build --no-cache --pull --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) . 13 | 14 | docker-push: 15 | $(SUDO) docker push $(TAG) 16 | -------------------------------------------------------------------------------- /api/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction 3 | --- 4 | 5 | import DocCardList from "@theme/DocCardList"; 6 | 7 | A public discussion about the design of soroban-rpc. 8 | 9 | 10 | -------------------------------------------------------------------------------- /api/anti-goals.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | title: Anti-Goals 4 | description: What Soroban-RPC is not. 5 | --- 6 | 7 | - Soroban-RPC is not a Horizon replacement. Horizon is better suited for historical reporting and analytics queries. Horizon is more concerned with Stellar Vanilla data. 8 | - Soroban-RPC should not depend on Horizon. Horizon is expensive and difficult to run, so if Soroban-RPC depended on Horizon, it would inherit that. 9 | - Soroban-RPC should also provide an API basis for infrastructure providers to implement, but not necessarily be an off-the-shelf solution for them. 10 | - Soroban-RPC is not a reporting/analytics tool and does not provide thorough historical data querying. It does not provide any data aggregation, compilations, or multi-server coordination requests. 11 | - Soroban-RPC does not target ultra-low latency. The latency should be low enough to build and submit successful soroban transactions, but supporting high-frequency traders is not the goal. 12 | 13 | :::note todo 14 | 15 | TODO: Decide on direct exposure support (i.e. should we support exposing soroban-rpc directly to the internet?). People will do it regardless, so it might be best to... 16 | 17 | ::: 18 | -------------------------------------------------------------------------------- /api/goals.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 0 3 | title: Goals 4 | description: Features Soroban-RPC should provide. 5 | --- 6 | 7 | Soroban-RPC can be simply described as a "live network gateway for Soroban." It provides information that the network currently has in its view (i.e. current state). It also has the ability to send a transaction to the network, and query the network for the status of previously sent transactions. It is meant to be simple, minimal, scalable, and familiar to blockchain developers from other ecosystems. 8 | 9 | Soroban-RPC should provide all the basic data that a dapp developer would need, provided they are: 10 | 11 | - Only interested in current state data, or are willing to ingest events into their own infrastructure to support reporting/analytics queries. 12 | - Caveat: Soroban-RPC should provide enough data-retention to support reliable ingestion of events. 13 | - Only interested in building and submitting Soroban transactions (not Stellar Vanilla). 14 | 15 | Soroban-RPC should support the developer from local testing (via the quickstart image), all the way through to production deployments. 16 | 17 | - This implies it should be easy to deploy, and easy to maintain; with low cost, and little "admin" needed. 18 | - The developer should be able to simply run the quickstart docker image, and quickly be ready to serve requests without needing to set up or maintain dependent infrastructure. 19 | -------------------------------------------------------------------------------- /api/json-rpc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | title: JSON-RPC 4 | description: Design goals for Soroban-RPC's JSON-RPC spec. 5 | --- 6 | 7 | Soroban-RPC will accept HTTP POST requests using the [JSON-RPC 2.0] specification. Errors are returned via the [jsonrpc error object] wherever possible (and makes sense). 8 | 9 | For production and other publicly-accessible instances, the JSON-RPC endpoint should be served over SSL on port 443, where possible, for security and ease of use. Though, soroban-rpc does not terminate ssl by itself, so will need a load-balancer or other service to terminate SSL for it. 10 | 11 | To interact with soroban-rpc from inside a JavaScript application, use the [JavaScript SDK] package, which gives a convenient interface for the RPC methods inside of its `SorobanRpc` module. 12 | 13 | When XDR is passed as a parameter or returned, it is always a string encoded using standard base64. 14 | 15 | :::info 16 | 17 | Please note that parameter structure must contain named parameters as a by-name 18 | object, and not as positional arguments as a by-position array. Positional 19 | arguments as a by-position array will be deprecated in future RPC releases. 20 | 21 | ::: 22 | 23 | ## Open-RPC Specification 24 | 25 | Soroban-RPC provides an [OpenRPC] specification document that can be used to mock, build, and/or validate both server and client software implementations. This document is used to generate all of our [methods] documentation pages. You can view the full [specification document here]. Additionally, you can experiment with this specificaiton document in the [OpenRPC Playground]. 26 | 27 | [JSON-RPC 2.0]: https://www.jsonrpc.org/specification 28 | [jsonrpc error object]: https://www.jsonrpc.org/specification#error_object 29 | [JavaScript SDK]: https://github.com/stellar/js-stellar-sdk 30 | [OpenRPC]: https://open-rpc.org/ 31 | [methods]: ./methods 32 | [specification document here]: https://raw.githubusercontent.com/stellar/soroban-docs/main/static/openrpc.json 33 | [OpenRPC Playground]: https://playground.open-rpc.org/?schemaUrl=https://raw.githubusercontent.com/stellar/soroban-docs/main/static/openrpc.json 34 | -------------------------------------------------------------------------------- /api/methods/getEvents.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Returns contract events 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/methods/getHealth.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Returns node health 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/methods/getLatestLedger.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Returns latest known ledger 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/methods/getNetwork.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Returns network config 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/methods/getTransaction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Returns transaction details 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/methods/sendTransaction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Submits a transaction 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/methods/simulateTransaction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | hide_title: true 3 | description: Submits a trial contract invocation transaction 4 | --- 5 | 6 | import { RpcMethod } from "@site/src/components/RpcMethod"; 7 | 8 | 9 | -------------------------------------------------------------------------------- /api/pagination.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | title: Pagination 4 | description: Pagination in Soroban-RPC is similar to in Horizon. 5 | --- 6 | 7 | Pagination in soroban-rpc is similar to pagination in Horizon. 8 | 9 | For methods which support it, the pagination arguments are passed as a final object argument with two values: 10 | 11 | - `cursor`: string - (optional) A string ID that points to a specific location in a collection of responses and is pulled from the paging*token value of a record. When a cursor is provided Soroban-RPC will \_not* include the element whose id matches the cursor in the response. Only elements which appear _after_ the cursor are included. 12 | - `limit`: number - (optional) The maximum number of records returned. The limit for [getEvents](methods/getEvents.mdx) can range from 1 to 10000 - an upper limit that is hardcoded in Soroban-RPC for performance reasons. If this argument isn't designated, it defaults to 100. 13 | 14 | For example, calling a method with pagination parameter set: 15 | 16 | ```json 17 | { 18 | "jsonrpc": "2.0", 19 | "id": "1", 20 | "method": "exampleMethod", 21 | "params": { 22 | "some": "argument", 23 | "pagination": { 24 | "cursor": "1234-1", 25 | "limit": 100 26 | } 27 | } 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /dapps/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 1, 3 | "label": "Dapps", 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } -------------------------------------------------------------------------------- /dapps/dapp-challenges/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 2, 3 | "label": "Challenges", 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } -------------------------------------------------------------------------------- /dapps/dapp-challenges/styles.css: -------------------------------------------------------------------------------- 1 | .image-style { 2 | border-radius: 10px; /* Rounded corners */ 3 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Drop shadow */ 4 | transition: transform 0.3s; /* Smooth transition for hover effect */ 5 | width: 40% 6 | } 7 | 8 | .image-style_reg { 9 | border-radius: 10px; /* Rounded corners */ 10 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Drop shadow */ 11 | transition: transform 0.3s; /* Smooth transition for hover effect */ 12 | } 13 | 14 | .image-style_lp { 15 | border-radius: 10px; /* Rounded corners */ 16 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Drop shadow */ 17 | transition: transform 0.3s; /* Smooth transition for hover effect */ 18 | width: 85% 19 | } 20 | 21 | .image-style:hover { 22 | transform: translateY(-5px); /* Rise effect on hover */ 23 | } 24 | 25 | .image-style_reg:hover { 26 | transform: translateY(-5px); /* Rise effect on hover */ 27 | } 28 | 29 | .image-style_lp:hover { 30 | transform: translateY(-5px); /* Rise effect on hover */ 31 | } -------------------------------------------------------------------------------- /dapps/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 2, 3 | "label": "Guides", 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } -------------------------------------------------------------------------------- /docs/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 10 3 | title: We've Moved! 4 | --- 5 | 6 | All of our documentation content previously available at `soroban.stellar.org` has now been merged into one, consolidated collection available in the [Stellar Developers Documentation](https://developers.stellar.org). Redirects from this site are in-place, and links have been updated everywhere we've found them. 7 | 8 | If you have any issues finding the content you're looking for, please give our [docs search](https://developers.stellar.org/search) a try. If you still have trouble, we welcome all feedback, issues, and pull requests in the [stellar-docs GitHub repo](https://github.com/stellar/stellar-docs). 9 | -------------------------------------------------------------------------------- /docs/developer-tools.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 75 3 | title: Developer Tools 4 | sidebar_custom_props: 5 | migration: 6 | href: https://developers.stellar.org/docs/tools/developer-tools 7 | label: Developer Tools 8 | --- 9 | 10 | :::danger These are not the droids you're looking for 11 | 12 | This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/developer-tools) for the most up-to-date information 13 | 14 | ::: 15 | 16 | :::info 17 | 18 | All tools currently listed are built and maintained by dedicated community members. 19 | 20 | ::: 21 | 22 | ### [Soroban Dev](https://sorobandev.com/) 23 | 24 | A web developer's guide to Soroban. Contains guides for learning Soroban and Rust, developer tools, example applications, and more. 25 | 26 | ### [Use Soroban](https://usesoroban.app/) 27 | 28 | A web GUI for building, deploying, and testing contracts. 29 | 30 | ### [Soroban Copilot](https://github.com/mootz12/soroban-copilot) 31 | 32 | A collection of no_std Rust packages focused on making Soroban development easier. 33 | 34 | ### [Soroban React](https://github.com/esteblock/soroban-react) 35 | 36 | A simple, powerful framework for building modern Soroban dApps using React. 37 | 38 | ### [Sorobix](https://sorobix.vercel.app/) 39 | 40 | An IDE where you can write, deploy, and invoke contracts on the Stellar network using Soroban. 41 | 42 | ### [SubQuery](https://subquery.network/) 43 | 44 | An open-source and flexible data indexer that supports both Stellar and Soroban. SubQuery allows users to build a custom API for their dapp or smart contract in minutes and provides clean indexed data to any service. You can index ledgers, transactions, operations, and effects from Stellar, and transactions and events from Soroban, into your own Postgres database. Read the [quick start guide here](https://academy.subquery.network/quickstart/quickstart_chains/stellar.html). 45 | 46 | ### [Keizai](https://keizai.dev/) 47 | 48 | Keizai is an open-source postman-inspired application, designed to simplify and elevate the testing process for developers working with Soroban smart contracts. 49 | -------------------------------------------------------------------------------- /docs/getting-started/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 20, 3 | "label": "Getting Started" 4 | } 5 | -------------------------------------------------------------------------------- /docs/guides/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: How-To Guides 3 | description: here you will find really useful guides 4 | hide_table_of_contents: true 5 | sidebar_custom_props: 6 | migration: 7 | href: https://developers.stellar.org/docs/smart-contracts/guides 8 | label: How-To Guides 9 | --- 10 | 11 | :::danger These are not the droids you're looking for 12 | 13 | This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/smart-contracts/guides) for the most up-to-date information 14 | 15 | ::: 16 | 17 | The page lists all guides we have available for Soroban. Simply put, a "guide" is a short, bite-sized example that details how to accomplish a specific task. These guides are focused on a single topic, and are limited in scope. 18 | -------------------------------------------------------------------------------- /docs/guides/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 35, 3 | "collapsible": false 4 | } 5 | -------------------------------------------------------------------------------- /docs/guides/archival/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: State Archival 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Soroban's novel strategy to combat state bloat can present a learning curve for developers. Here are some quick guides that will help you through the process. 7 | -------------------------------------------------------------------------------- /docs/guides/archival/create-restoration-footprint-js.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Create a restoration footprint manually to restore archived data using the JavaScript SDK 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | Placeholder text here. 8 | -------------------------------------------------------------------------------- /docs/guides/cli/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Soroban CLI 3 | hide_table_of_contents: true 4 | --- 5 | 6 | The [Soroban CLI] is a crucial tool for developers to use while creating and interacting with Soroban smart contracts. 7 | 8 | [Soroban CLI]: https://developers.stellar.org/docs/tools/developer-tools#soroban-cli 9 | -------------------------------------------------------------------------------- /docs/guides/cli/deploy-contract.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Deploy a Contract from Installed Wasm Bytecode 3 | hide_table_of_contents: true 4 | --- 5 | 6 | To deploy an instance of a compiled smart contract that has already been isntalled onto the Stellar network, use the `soroban contract deploy` command: 7 | 8 | ```bash 9 | soroban contract deploy \ 10 | --source S... \ 11 | --network testnet \ 12 | --wasm-hash 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/guides/cli/extend-contract-instance.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Extend a deployed contract instance's TTL 3 | hide_table_of_contents: true 4 | --- 5 | 6 | You can use the Soroban CLI to extend the TTL of a contract instance like so: 7 | 8 | ```bash 9 | soroban contract extend \ 10 | --source S... \ 11 | --network testnet \ 12 | --id C... \ 13 | --ledgers-to-extend 535679 \ 14 | --durability persistent 15 | ``` 16 | 17 | This example uses 535,679 ledgers as the new archival TTL. This is the maximum allowable value for this argument on the CLI. This corresponds to roughly 30 days (averaging 5 second ledger close times). 18 | 19 | When you extend a contract instance, this includes: 20 | 21 | - the contract instance itself 22 | - any `env.storage().instance()` entries in the contract 23 | - the contract's Wasm code 24 | -------------------------------------------------------------------------------- /docs/guides/cli/extend-contract-storage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Extend a deployed contract's storage entry TTL 3 | hide_table_of_contents: true 4 | --- 5 | 6 | You can use the Soroban CLI to extend the TTL of a contract's persistent storage entry. For a storage entry that uses a simple `Symbol` as its storage key, you can run a command like so: 7 | 8 | ```bash 9 | soroban contract extend \ 10 | --source S... \ 11 | --network testnet \ 12 | --id C... \ 13 | --key COUNTER \ 14 | --ledgers-to-extend 535679 \ 15 | --durability persistent 16 | ``` 17 | 18 | This example uses 535,679 ledgers as the new archival TTL. This is the maximum allowable value for this argument on the CLI. This corresponds to roughly 30 days (averaging 5 second ledger close times). 19 | 20 | If your storage entry uses a more advanced storage key, such as `Balance(Address)` in a token contract, you'll need to provide the key in a base64-encoded XDR form: 21 | 22 | ```bash 23 | soroban contract extend \ 24 | --source S... \ 25 | --network testnet \ 26 | --id C... \ 27 | --key-xdr AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAA4AAAAHQmFsYW5jZQAAAAAB \ 28 | --ledgers-to-extend 535679 \ 29 | --durability persistent 30 | ``` 31 | 32 | :::info 33 | 34 | Be sure to check out our [guide on creating XDR ledger keys](../rpc/generate-ledger-keys-python.mdx) for help generating them. 35 | 36 | ::: 37 | -------------------------------------------------------------------------------- /docs/guides/cli/extend-contract-wasm.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Extend a deployed contract's Wasm code TTL 3 | hide_table_of_contents: true 4 | --- 5 | 6 | You can use the Soroban CLI to extend the TTL of a contract's Wasm bytecode. This can be done in two forms: if you do or do not have the compiled contract locally. If you do have the compiled binary on your local machine: 7 | 8 | ```bash 9 | soroban contract extend \ 10 | --source S... \ 11 | --network testnet \ 12 | --wasm ../relative/path/to/soroban_contract.wasm \ 13 | --ledgers-to-extend 535679 \ 14 | --durability persistent 15 | ``` 16 | 17 | This example uses 535,679 ledgers as the new archival TTL. This is the maximum allowable value for this argument on the CLI. This corresponds to roughly 30 days (averaging 5 second ledger close times). 18 | 19 | If you do not have the compiled binary on your local machine, you can still use the CLI to extend the bytecode TTL. You'll need to know the Wasm hash of the installed contract code: 20 | 21 | ```bash 22 | soroban contract extend \ 23 | --source S... \ 24 | --network testnet \ 25 | --wasm-hash \ 26 | --ledgers-to-extend 535679 \ 27 | --durability persistent 28 | ``` 29 | 30 | :::info 31 | 32 | You can learn more about finding the correct Wasm hash for a contract instance [here (JavaScript)](../rpc/retrieve-contract-code-js.mdx) and [here (Python)](../rpc/retrieve-contract-code-python.mdx). 33 | 34 | ::: 35 | -------------------------------------------------------------------------------- /docs/guides/cli/install-deploy.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Install and Deploy a Smart Contract 3 | hide_table_of_contents: true 4 | --- 5 | 6 | You can combine the `install` and `deploy` commands of the Soroban CLI to accomplish both tasks: 7 | 8 | ```bash 9 | soroban contract deploy \ 10 | --source S... \ 11 | --network testnet \ 12 | --wasm ../relative/path/to/soroban_contract.wasm 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/guides/cli/install-wasm.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Install Wasm Bytecode 3 | hide_table_of_contents: true 4 | --- 5 | 6 | To use the Soroban CLI to install a compiled smart contract on the ledger, use the `soroban contract install` command: 7 | 8 | ```bash 9 | soroban contract install \ 10 | --source S... \ 11 | --network testnet \ 12 | --wasm ../relative/path/to/soroban_contract.wasm 13 | ``` 14 | 15 | :::note 16 | 17 | Note this command will return the hash ID of the Wasm bytecode, rather than an address for a contract instance. 18 | 19 | ::: 20 | -------------------------------------------------------------------------------- /docs/guides/cli/restore-contract-instance.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Restore an archived contract using the Soroban CLI 3 | hide_table_of_contents: true 4 | --- 5 | 6 | If your contract instance has been archived, it can easily be restored using the Soroban CLI. 7 | 8 | ```bash 9 | soroban contract restore \ 10 | --source S... \ 11 | --network testnet \ 12 | --id C... \ 13 | --durability persistent 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/guides/cli/restore-contract-storage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Restore archived contract data using the Soroban CLI 3 | hide_table_of_contents: true 4 | --- 5 | 6 | If a contract's persistent storage entry has been archived, you can restore it using the Soroban CLI. For a storage entry that uses a simple `Symbol` as its storage key, you can run a command like so: 7 | 8 | ```bash 9 | soroban contract restore \ 10 | --source S... \ 11 | --network testnet \ 12 | --id C... \ 13 | --key COUNTER \ 14 | --durability persistent 15 | ``` 16 | 17 | If your storage entry uses a more advanced storage key, such as `Balance(Address)` in a token contract, you'll need to provide the key in a base64-encoded XDR form: 18 | 19 | ```bash 20 | soroban contract restore \ 21 | --source S... \ 22 | --network testnet \ 23 | --id C... \ 24 | --key-xdr AAAABgAAAAHXkotywnA8z+r365/0701QSlWouXn8m0UOoshCtNHOYQAAAA4AAAAHQmFsYW5jZQAAAAAB \ 25 | --durability persistent 26 | ``` 27 | 28 | :::info 29 | 30 | Be sure to check out our [guide on creating XDR ledger keys](../rpc/generate-ledger-keys-python.mdx) for help generating them. 31 | 32 | ::: 33 | -------------------------------------------------------------------------------- /docs/guides/conventions/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Conventions 3 | hide_table_of_contents: true 4 | --- 5 | 6 | These guides describe the "typical" way something might be accomplished in a Rust contract. These guides aren't meant to be quite as _prescriptive_ as some others; instead, they serve to highlight some of the norms we've seen when crop up in contract development. 7 | -------------------------------------------------------------------------------- /docs/guides/conventions/error-enum.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Organize contract errors with an error enum type 3 | hide_table_of_contents: true 4 | --- 5 | 6 | A convenient way to manage and meaningfully communicate contract errors is to collect them into an `enum` struct. These errors are a special type of enum integer type that are stored on ledger as Status values containing a `u32` code. First, create the `Error` struct in your smart contract. 7 | 8 | ```rust 9 | #[contracterror] 10 | #[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] 11 | #[repr(u32)] 12 | pub enum Error { 13 | FirstError = 1, 14 | AnotherError = 2, 15 | YetAnotherError = 3, 16 | GenericError = 4 17 | } 18 | ``` 19 | 20 | Then, panic with an error when the conditions are met. This example will panic with the specified error. 21 | 22 | ```rust 23 | #[contractimpl] 24 | impl Contract { 25 | pub fn causeerror(env: Env, error_code: u32) -> Result<(), Error> { 26 | match error_code { 27 | 1 => Err(Error::FirstError), 28 | 2 => Err(Error::AnotherError), 29 | 3 => Err(Error::YetAnotherError), 30 | _ => Err(Error::GenericError), 31 | } 32 | } 33 | } 34 | ``` 35 | 36 | When converted to XDR, the value becomes an `ScVal`, containing a `ScStatus`, containing the integer value of the error as contract error. 37 | 38 | ```json 39 | { "status": { "contractError": 1 } } 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/guides/conventions/wasm-metadata.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Write metadata for your contract. 3 | hide_table_of_contents: true 4 | --- 5 | 6 | 7 | Write structured metadata. 8 | 9 | 10 | 14 | 18 | 19 | 20 | The [`contractmeta!`] macro provided in the Rust SDK allows users to write two 21 | strings - a `key` and a `val` - within a serialized `SCMetaEntry::SCMetaV0` XDR 22 | object to the custom section of Wasm contracts. The section name for this 23 | metadata is `contractmetav0`. Developers can utilize this macro to write 24 | metadata, and tools can then read and display this information to users. 25 | 26 | The [liquidity pool example] provides a clear demonstration of how to use the 27 | `contractmeta!` macro: 28 | 29 | ```rust 30 | // Metadata that is added on to the Wasm custom section 31 | contractmeta!( 32 | key = "Description", 33 | val = "Constant product AMM with a .3% swap fee" 34 | ); 35 | 36 | pub trait LiquidityPoolTrait {... 37 | ``` 38 | 39 | [`contractmeta!`]: https://docs.rs/soroban-sdk/20.0.2/soroban_sdk/macro.contractmeta.html 40 | [liquidity pool example]: https://github.com/stellar/soroban-examples/blob/v20.0.0/liquidity_pool/src/lib.rs#L152-L155 41 | -------------------------------------------------------------------------------- /docs/guides/conventions/work-contractspec-js.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Work with ContractSpecs in JavaScript 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | You do something... 8 | -------------------------------------------------------------------------------- /docs/guides/conversions/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Type Conversions 3 | hide_table_of_contents: true 4 | --- 5 | 6 | A collection of guides for converting from one data type to another, in a variety of SDK languages. 7 | -------------------------------------------------------------------------------- /docs/guides/conversions/address-to-bytesn.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Convert an Address to BytesN using the Rust SDK 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | The `Address` is an opaque type that could represent an "account" on the Stellar network (i.e., a keypair), or a "contract." From Soroban's point of view, it doesn't really matter which it is. The "account" variety of these addresses are typically displayed as a `G...` public address, and the "contract" variatey is typically displayed as a `C...` address. Another way that can be used to display an address is an array of 32 bytes. The Rust SDK can handle conversion between the two easily: 8 | 9 | ```rust 10 | 11 | ``` 12 | -------------------------------------------------------------------------------- /docs/guides/conversions/address-to-id.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Convert a contract Address to a contract ID in Rust 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | `C...` converts to a hex-encoded `deadb33f` ID. 8 | -------------------------------------------------------------------------------- /docs/guides/conversions/id-to-address.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Convert a contract ID to a contract Address 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | The hex-encoded `deadb33f` ID converts to a `C...` StrKey. 8 | -------------------------------------------------------------------------------- /docs/guides/events/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Events 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Learn how to emit, ingest, and use events published from a Soroban smart contract. 7 | -------------------------------------------------------------------------------- /docs/guides/events/consume.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Consume previously ingested events 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | Placeholder text goes here. 8 | -------------------------------------------------------------------------------- /docs/guides/events/publish.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Publish events from a Rust contract 3 | hide_table_of_contents: true 4 | --- 5 | 6 | An event can contain up to 4 topics, alongside the data it is publishing. The `data` can be any value or type you want. However, the topics must not contain: 7 | 8 | - `Vec` 9 | - `Map` 10 | - `Bytes` or `BytesN` longer than 32 bytes 11 | - `contracttype` 12 | 13 | ```rust 14 | // This function does nothing beside publishing events. Topics we are using are 15 | // some `u32` integers for the sake of simplicity here. 16 | pub fn events_function(env: Env) { 17 | // A symbol will be our `data` we want published 18 | my_data = Symbol::new(&env, "data_to_publish"); 19 | 20 | // an event with 0 topics 21 | env.events().publish((), my_data.clone()); 22 | 23 | // an event with 1 topic (Notice the extra comma after the topic in the 24 | // tuple? That comma is required in Rust to make a one-element tuple) 25 | env.events().publish((1u32,), my_data.clone()); 26 | 27 | // an event with 2 topics 28 | env.events().publish((1u32, 2u32), my_data.clone()); 29 | 30 | // an event with 3 topics 31 | env.events().publish((1u32, 2u32, 3u32), my_data.clone()); 32 | 33 | // an event with 4 topics 34 | env.events().publish((1u32, 2u32, 3u32, 4u32), my_data.clone()); 35 | } 36 | ``` 37 | 38 | A more realistic example can be found in the way the [token interface] works. For example, the interface requires an event to be published every time the `transfer` function is invoked, with the following information: 39 | 40 | ```rust 41 | pub fn transfer(env: Env, from: Address, to: Address, amount: i128) { 42 | // transfer logic omitted here 43 | env.events().publish( 44 | (symbol_short!("transfer"), from, to), 45 | amount 46 | ); 47 | } 48 | ``` 49 | 50 | [token interface]: ../../tokens/token-interface.mdx 51 | -------------------------------------------------------------------------------- /docs/guides/fees/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Fees & Metering 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Fees and metering in Soroban smart contracts work differently than the fees for "regular" Stellar transactions. The Stellar network still provides cheap, accessible transaction and that now includes smart contract metering! 7 | -------------------------------------------------------------------------------- /docs/guides/fees/cost-analysis.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Analyze contract cost and efficiency 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | See [issue #552](https://github.com/stellar/soroban-docs/issues/552) for more context 8 | -------------------------------------------------------------------------------- /docs/guides/rpc/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: RPC 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Using and interacting with Soroban RPC is an important part of the smart contract development lifecycle. 7 | -------------------------------------------------------------------------------- /docs/guides/rpc/generate-ledger-keys-python.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Generate ledger key parameters with a symbol key using the Python SDK 3 | hide_table_of_contents: true 4 | --- 5 | 6 | In the [`increment` example contract] stores an integer value in a ledger entry that is identified by a key with the symbol `COUNTER`. The value of this ledger key can be derived using the following code snippets. 7 | 8 | ```python 9 | from stellar_sdk import xdr, scval, Address 10 | 11 | def get_ledger_key_symbol(contract_id: str, symbol_text: str) -> str: 12 | ledger_key = xdr.LedgerKey( 13 | type=xdr.LedgerEntryType.CONTRACT_DATA, 14 | contract_data=xdr.LedgerKeyContractData( 15 | contract=Address(contract_id).to_xdr_sc_address(), 16 | key=scval.to_symbol(symbol_text), 17 | durability=xdr.ContractDataDurability.PERSISTENT 18 | ), 19 | ) 20 | return ledger_key.to_xdr() 21 | 22 | print( 23 | get_ledger_key_symbol( 24 | "CCPYZFKEAXHHS5VVW5J45TOU7S2EODJ7TZNJIA5LKDVL3PESCES6FNCI", 25 | "COUNTER" 26 | ) 27 | ) 28 | ``` 29 | 30 | [`increment` example contract]: ../../getting-started/storing-data.mdx 31 | -------------------------------------------------------------------------------- /docs/guides/rpc/self-deploy-rpc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Self-deploy and use your own RPC instance 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | Placeholder text goes here. 8 | -------------------------------------------------------------------------------- /docs/guides/rpc/use-public-rpc.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Make use of a public RPC instance 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | Placeholder text goes here. 8 | -------------------------------------------------------------------------------- /docs/guides/storage/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Storage 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Soroban storage is available to affordably accommodate a wide range of uses. 7 | -------------------------------------------------------------------------------- /docs/guides/storage/choose-type.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Choose the right storage type for your use-case 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | Placeholder text goes here. 8 | -------------------------------------------------------------------------------- /docs/guides/storage/use-instance.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Use instance storage in a contract 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Under the hood, instance storage is exactly like persistent storage. The only difference is that anything stored in instance storage has an archival TTL that is tied to the contract instance itself. So, if a contract is live and available, the instance storage is guaranteed to be so, too. 7 | 8 | Instance storage is really useful for global contract data that is shared among all users of the contract (token administrator, for example). From the [token example contract](../../tutorials/tokens.mdx), the helper functions to set and retrieve the admininistrator address are basically just wrappers surrounding the one Admin ledger entry. 9 | 10 | :::caution 11 | 12 | It should be noted that _every_ piece of data stored in `instance()` storage is retrieved from the ledger _every_ time the contract is invoked. Even if the invoked function does not interact with any ledger data at all. This can lead to more expensive (computationally and financially) function invocations if the stored data grows over time. Choose judiciously which bits of data actually belong in the instance storage, and which should be kept in persistent storage. 13 | 14 | ::: 15 | 16 | ```rust 17 | pub fn has_administrator(e: &Env) -> bool { 18 | let key = DataKey::Admin; 19 | e.storage().instance().has(&key) 20 | } 21 | 22 | pub fn read_administrator(e: &Env) -> Address { 23 | let key = DataKey::Admin; 24 | e.storage().instance().get(&key).unwrap() 25 | } 26 | 27 | pub fn write_administrator(e: &Env, id: &Address) { 28 | let key = DataKey::Admin; 29 | e.storage().instance().set(&key, id); 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/guides/storage/use-persistent.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Use persistent storage in a contract 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Persistent storage can be very useful for ledger entrys that are not common across every user of the contract instance, but that are not suitable to be temporary (user balances, for example). In this guide, we'll assume we want to store a random number for a user, and store it in the contract's persistent storage as though it were their favorite number. 7 | 8 | ```rust 9 | #[contracttype] 10 | pub enum DataKey { 11 | Favorite(Address), 12 | } 13 | 14 | #[contract] 15 | pub struct FavoriteContract; 16 | 17 | #[contractimpl] 18 | impl FavoriteContract { 19 | // This function generates, stores, and returns a random number for the user 20 | pub fn generate_fave(env: Env, user: Address) -> u64 { 21 | let key = DataKey::Favorite(user); 22 | let fave: u64 = env.prng().gen(); 23 | env.storage().persistent().set(&key, &fave); 24 | fave 25 | } 26 | 27 | // This function retrieves and returns the random number for the user 28 | pub fn get_fave(env: Env, user: Address) -> u64 { 29 | let key = DataKey::Favorite(user); 30 | if let Some(fave) = env.storage().persistent().get(&key) { 31 | fave 32 | } else { 33 | 0 34 | } 35 | } 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/guides/storage/use-temporary.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Use temporary storage in a contract 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Temporary storage is useful for a contract to store data that can quickly become irrelevant or out-dated. For example, here's how a contract might be used to store a recent price of BTC against the US Dollar. 7 | 8 | ```rust 9 | // This function updates the BTC price 10 | pub fn update_btc_price(env: Env, price: i128) { 11 | env.storage().temporary().set(&!symbol_short("BTC"), &price); 12 | } 13 | 14 | // This function reads and returns the current BTC price (zero if the storage 15 | // entry is archived) 16 | pub fn get_btc_price(env: Env) -> i128 { 17 | if let Some(price) = env.storage().temporary().get(&!symbol_short("BTC")) { 18 | price 19 | } else { 20 | 0 21 | } 22 | } 23 | ``` 24 | -------------------------------------------------------------------------------- /docs/guides/testing/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Testing 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Smart contract testing is vital to ensure safe, resilient, and accurate computation. 7 | -------------------------------------------------------------------------------- /docs/guides/testing/basic-contract-tests.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Implement basic tests for a contract 3 | hide_table_of_contents: true 4 | --- 5 | 6 | A contract's test functions can be used as a simple way to ensure a contract's functions behave as expected. The [increment example contract](../../getting-started/deploy-increment-contract.mdx) has a function that increments a counter by one on every invocation. The corresponding test invokes that function several time, ensuring with `assert_eq!(...)` the count increases as expected. 7 | 8 | ```rust 9 | #![cfg(test)] 10 | 11 | use super::{IncrementContract, IncrementContractClient}; 12 | use soroban_sdk::{Env}; 13 | 14 | #[test] 15 | fn test() { 16 | // Almost every test will begin this same way. A default Soroban environment 17 | // is created and the contract (along with its client) is registered in it. 18 | let env = Env::default(); 19 | let contract_id = env.register_contract(None, IncrementContract); 20 | let client = IncrementContractClient::new(&env, &contract_id); 21 | 22 | assert_eq!(client.increment(), 1); 23 | assert_eq!(client.increment(), 2); 24 | assert_eq!(client.increment(), 3); 25 | } 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/guides/testing/integration-testing-multiple-contracts.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Integration testing in multiple contracts 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | See [issue #553](https://github.com/stellar/soroban-docs/issues/553) for more context. 8 | -------------------------------------------------------------------------------- /docs/guides/testing/mint-native-token.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Mint native XLM in a contract test 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | It can often be necessary to test whether your contract's interactions surrounding tokens work as intended. Often, the token you test again can be created from arbitrary details. However, there are occassions where testing against a specific token can be advantageous. Here is a test function that makes use of the Stellar Asset Contract for the native XLM token. 8 | 9 | ```rust 10 | env.token.native_asset_contract(); // or some such... 11 | ``` 12 | -------------------------------------------------------------------------------- /docs/guides/testing/test-contract-auth.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Test authorized contract invocations 3 | hide_table_of_contents: true 4 | --- 5 | 6 | A contract's test functions can be used as a way to ensure the authorization is indeed carried out the way a developer intends. A simple example can be found in the [auth example contract](../../tutorials/auth.mdx). (In the following code block, some code has been omitted for brevity.) 7 | 8 | ```rust 9 | #[test] 10 | fn test() { 11 | let env = Env::default(); 12 | env.mock_all_auths(); 13 | 14 | assert_eq!(client.increment(&user_1, &5), 5); 15 | // Verify that the user indeed had to authorize a call of `increment` with 16 | // the expected arguments: 17 | assert_eq!( 18 | env.auths(), 19 | std::vec![( 20 | // Address for which authorization check is performed 21 | user_1.clone(), 22 | // Invocation tree that needs to be authorized 23 | AuthorizedInvocation { 24 | // Function that is authorized. Can be a contract function or 25 | // a host function that requires authorization. 26 | function: AuthorizedFunction::Contract(( 27 | // Address of the called contract 28 | contract_id.clone(), 29 | // Name of the called function 30 | symbol_short!("increment"), 31 | // Arguments used to call `increment` (converted to the 32 | // env-managed vector via `into_val`) 33 | (user_1.clone(), 5_u32).into_val(&env), 34 | )), 35 | // The contract doesn't call any other contracts that require 36 | // authorization, 37 | sub_invocations: std::vec![] 38 | } 39 | )] 40 | ) 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/guides/testing/testnet-reset.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Automate Testnet and Futurenet reset data 3 | hide_table_of_contents: true 4 | draft: true 5 | --- 6 | 7 | Talk about how to automate contract creation/deployment/etc. 8 | -------------------------------------------------------------------------------- /docs/guides/transactions/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Transactions 3 | hide_table_of_contents: true 4 | --- 5 | 6 | The entry point for every smart contract interaction is ultimately a [transaction] on the Stellar network. 7 | 8 | [transaction]: https://developers.stellar.org/docs/fundamentals-and-concepts/stellar-data-structures/operations-and-transactions 9 | -------------------------------------------------------------------------------- /docs/guides/transactions/submit-transaction-wait-js.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Submit a transaction to Soroban RPC using the JavaScript SDK 3 | hide_table_of_contents: true 4 | --- 5 | 6 | Here is a simple, rudimentary looping mechanism to submit a transaction to Soroban RPC and wait for a result. 7 | 8 | ```typescript 9 | import { 10 | Transaction, 11 | FeeBumpTransaction, 12 | SorobanRpc, 13 | } from "@stellar/stellar-sdk"; 14 | 15 | const RPC_SERVER = "https://soroban-testnet.stellar.org/"; 16 | const server = new SorobanRpc.Server(RPC_SERVER); 17 | 18 | // Submits a tx and then polls for its status until a timeout is reached. 19 | async function yeetTx( 20 | tx: Transaction | FeeBumpTransaction, 21 | ): Promise { 22 | return server.sendTransaction(tx).then(async (reply) => { 23 | if (reply.status !== "PENDING") { 24 | throw reply; 25 | } 26 | 27 | let status; 28 | let attempts = 0; 29 | while (attempts++ < 5) { 30 | const tmpStatus = await server.getTransaction(reply.hash); 31 | switch (tmpStatus.status) { 32 | case "FAILED": 33 | throw tmpStatus; 34 | case "NOT_FOUND": 35 | await sleep(500); 36 | continue; 37 | case "SUCCESS": 38 | status = tmpStatus; 39 | break; 40 | } 41 | } 42 | 43 | if (attempts >= 5 || !status) { 44 | throw new Error(`Failed to find transaction ${reply.hash} in time.`); 45 | } 46 | 47 | return status; 48 | }); 49 | } 50 | 51 | function sleep(ms: number) { 52 | return new Promise((resolve) => setTimeout(resolve, ms)); 53 | } 54 | ``` 55 | 56 | :::caution 57 | 58 | Remember: You should always handle errors gracefully! This is a fail-hard and fail-fast approach that should only be used in these examples. 59 | 60 | ::: 61 | -------------------------------------------------------------------------------- /docs/migrate/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 60, 3 | "label": "Migrate from Another Chain" 4 | } 5 | -------------------------------------------------------------------------------- /docs/migrate/cosmos.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 30 3 | title: Cosmos 4 | description: Migrate your smart contract code from Cosmos to Soroban 5 | draft: true 6 | --- 7 | 8 | I dunno, like copy/paste it? 9 | -------------------------------------------------------------------------------- /docs/migrate/evm/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 10, 3 | "label": "EVM Networks" 4 | } 5 | -------------------------------------------------------------------------------- /docs/migrate/near.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 40 3 | title: Near 4 | description: Migrate your smart contract code from Near to Soroban 5 | draft: true 6 | --- 7 | 8 | I dunno, like copy/paste it? 9 | -------------------------------------------------------------------------------- /docs/migrate/solana.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 20 3 | title: Solana 4 | description: Migrate your smart contract code from Solana to Soroban 5 | draft: true 6 | --- 7 | 8 | I dunno, like copy/paste it? 9 | -------------------------------------------------------------------------------- /docs/reference/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 70, 3 | "label": "Reference" 4 | } 5 | -------------------------------------------------------------------------------- /docs/reference/sdks/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 20, 3 | "label": "SDKs", 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/reference/soroban-cli.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 80 3 | title: Soroban CLI 4 | description: The command line tool for interacting with Soroban and deployed contracts. 5 | sidebar_custom_props: 6 | migration: 7 | href: https://developers.stellar.org/docs/tools/developer-tools#soroban-cli 8 | label: Soroban CLI 9 | --- 10 | 11 | :::danger These are not the droids you're looking for 12 | 13 | This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/tools/developer-tools#soroban-cli) for the most up-to-date information 14 | 15 | ::: 16 | 17 | The Soroban CLI is the command line interface to Soroban. It allows you to build, deploy, and interact with smart contracts; configure identities; generate key pairs; manage networks; and more. 18 | 19 | - [Installation](../getting-started/setup.mdx) 20 | - [Autocomplete](https://github.com/stellar/soroban-cli/blob/main/docs/soroban-cli-full-docs.md#soroban-completion) 21 | - [Docs](https://github.com/stellar/soroban-cli/blob/main/docs/soroban-cli-full-docs.md) 22 | - [Latest Release](https://github.com/stellar/soroban-cli/releases) 23 | 24 | :::info 25 | 26 | To report issues or request feature enhancements about Soroban CLI, please open 27 | a Github issue here: 28 | https://github.com/stellar/soroban-cli/issues/new/choose 29 | 30 | ::: 31 | -------------------------------------------------------------------------------- /docs/soroban-internals/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 40, 3 | "label": "Soroban Internals", 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/soroban-internals/contract-interactions/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Contract Interactions", 3 | "position": 120 4 | } 5 | -------------------------------------------------------------------------------- /docs/soroban-internals/errors.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 90 3 | title: Errors 4 | description: Generating errors from smart contracts. 5 | sidebar_custom_props: 6 | migration: 7 | href: https://developers.stellar.org/docs/learn/smart-contract-internals/errors 8 | label: Errors 9 | --- 10 | 11 | 12 | Generating errors from smart contracts. 13 | 14 | 15 | 19 | 23 | 24 | 25 | :::danger These are not the droids you're looking for 26 | 27 | This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/learn/smart-contract-internals/errors) for the most up-to-date information 28 | 29 | ::: 30 | 31 | There are a number of ways to generate errors in contracts. 32 | 33 | One way is error enum types, that are defined by contracts and that map errors 34 | to unsigned 32-bit integer values. They are usable as error values in the return 35 | types of contract functions. 36 | 37 | :::info 38 | 39 | The [errors example] demonstrates how to define your own error types. 40 | [errors example]: ../tutorials/errors.mdx 41 | 42 | ::: 43 | 44 | ## Error Enums 45 | 46 | Errors are a special type of enum integer type that are stored on ledger as 47 | `Status` values containing a `u32` code. 48 | 49 | ```rust 50 | #[contracterror] 51 | #[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] 52 | #[repr(u32)] 53 | pub enum Error { 54 | AnError = 1, 55 | } 56 | ``` 57 | 58 | When converted to XDR, the value becomes an `ScVal`, containing a `ScStatus`, 59 | containing the integer value of the error as contract error. 60 | 61 | ```json 62 | { "status": { "contractError": 1 } } 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/soroban-internals/transaction-lifecycle.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 50 3 | title: Transaction Lifecycle 4 | description: here's how a transaction works, and stuff. 5 | draft: true 6 | --- 7 | 8 | See [GH issue #532](https://github.com/stellar/soroban-docs/issues/532) for details. 9 | 10 | We're getting a lot of questions that relate to the transaction lifecycle and don't have a great resource to send people to. 11 | 12 | The regular Stellar resources are confusing because: 13 | 14 | 1. they don't have any information on preflight and 15 | 2. soroban-rpc's tx submission is async 16 | -------------------------------------------------------------------------------- /docs/soroban-internals/types/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 30, 3 | "label": "Types" 4 | } 5 | -------------------------------------------------------------------------------- /docs/tokens/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 50, 3 | "label": "Tokens", 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/tutorials/README.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tutorials 3 | hide_table_of_contents: true 4 | sidebar_custom_props: 5 | migration: 6 | href: https://developers.stellar.org/docs/smart-contracts/example-contracts 7 | label: Tutorials 8 | --- 9 | 10 | :::danger These are not the droids you're looking for 11 | 12 | This page has been migrated to the Stellar Developers documentation. Please [click here](https://developers.stellar.org/docs/smart-contracts/example-contracts) for the most up-to-date information 13 | 14 | ::: 15 | 16 | The Soroban team has put together a large collection of [example contracts] to demonstrate use of the Soroban smart contracts platform. For many of these example contracts, we've written an accompanying "tutorial" that will walk you through the example contracts and describe a bit more about their design. You can think of these "tutorials" as example contracts that end with a deployable smart contract. You can use the provided filters to find a relevant tutorial for your experience level. 17 | 18 | [example contracts]: https://github.com/stellar/soroban-examples 19 | -------------------------------------------------------------------------------- /docs/tutorials/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "position": 30, 3 | "label": "Tutorials", 4 | "link": { 5 | "type": "doc", 6 | "id": "tutorials/README" 7 | }, 8 | "collapsible": false 9 | } 10 | -------------------------------------------------------------------------------- /docs/tutorials/atomic-multi-swap.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Batched Atomic Swaps 3 | description: Swap a token pair among groups of authorized users. 4 | sidebar_custom_props: 5 | tutorial: 6 | level: advanced 7 | --- 8 | 9 | 10 | Swap a token pair among groups of authorized users. 11 | 12 | 16 | 20 | 24 | 25 | 26 | The [atomic swap batching example] swaps a pair of tokens between the two groups 27 | of users that authorized the `swap` operation from the [Atomic Swap] example. 28 | 29 | This contract basically batches the multiple swaps while following some simple 30 | rules to match the swap participants. 31 | 32 | Follow the comments in the code for more information. 33 | 34 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] 35 | 36 | [oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v20.0.0 37 | [Atomic Swap]: atomic-swap.mdx 38 | [atomic swap batching example]: https://github.com/stellar/soroban-examples/tree/v20.0.0/atomic_multiswap 39 | -------------------------------------------------------------------------------- /docs/tutorials/single-offer-sale.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Single Offer Sale 3 | description: Make a standing offer to sell a token in exchange for another token. 4 | sidebar_custom_props: 5 | tutorial: 6 | level: intermediate 7 | --- 8 | 9 | 10 | 11 | Make a standing offer to sell a token in exchange for another token. 12 | 13 | 14 | 18 | 22 | 26 | 27 | 28 | The [single offer sale example] demonstrates how to write a contract that allows 29 | a seller to set up an offer to sell token A for token B to multiple buyers. The 30 | comments in the [source code] explain how the contract should be used. 31 | 32 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] 33 | [oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v20.0.0 34 | 35 | [single offer sale example]: https://github.com/stellar/soroban-examples/tree/v20.0.0/single_offer 36 | [source code]: https://github.com/stellar/soroban-examples/blob/v20.0.0/single_offer/src/lib.rs 37 | -------------------------------------------------------------------------------- /docs/tutorials/timelock.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Timelock 3 | description: Lockup some token to be claimed by another user under set conditions. 4 | sidebar_custom_props: 5 | tutorial: 6 | level: intermediate 7 | --- 8 | 9 | 10 | 11 | Lockup some token to be claimed by another user under set conditions 12 | 13 | 14 | 18 | 22 | 26 | 27 | 28 | The [timelock example] demonstrates how to write a timelock and implements a 29 | greatly simplified claimable balance similar to the [claimable balance] feature 30 | available on Stellar. 31 | 32 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][oigp] 33 | [oigp]: https://gitpod.io/#https://github.com/stellar/soroban-examples/tree/v20.0.0 34 | 35 | The contract accepts deposits of an amount of a token, and allows other users 36 | to claim it before or after a time point. 37 | 38 | [timelock example]: https://github.com/stellar/soroban-examples/tree/v20.0.0/timelock 39 | [claimable balance]: https://developers.stellar.org/docs/glossary/claimable-balance 40 | -------------------------------------------------------------------------------- /meeting-notes/2024-01-26.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '2024-01-26' 3 | authors: kalepail 4 | tags: [developer] 5 | --- 6 | 7 | 14 | 15 | [Discord agenda thread](https://discord.com/channels/897514728459468821/1199121845656486009) 16 | 17 | 1. Plan and schedule for these meetings 18 | 1. Protocol meetings every other Thursday at 4pm ET 19 | 2. Developer meetings every other Friday at 1pm ET 20 | 3. Will continue to adjust as needed 21 | 2. Fee bump bug - [announcement](https://stellar.org/blog/developers/fee-bump-bug-disclosure) | [discussion thread](https://discord.com/channels/897514728459468821/1200432249594707998/1200432306314281000) 22 | 1. Fee sponsorship bug: unused fee is refunded to the inner tx source rather than the sponsor source. 23 | 2. Fix in new release. Up to the ecosystem and validators to upgrade. The fix will likely be rolled out before Phase 2. 24 | 3. Up to validators to determine if they’d like to push the v20 upgrade date to wait for the fix; or upgrade with current release. 25 | 3. TxMeta Deprecation in Horizon - [announcement](https://discord.com/channels/897514728459468821/900374272751591424/1199438109796999298) 26 | 4. Ideas around testing against ledger snapshots - [request](https://discord.com/channels/897514728459468821/1199121845656486009/1199158421254049912) 27 | 1. Define the needs a bit more clearly 28 | 2. Definitely something here we should be addressing to make testing against specific ledger state easier 29 | 5. How do you get a list of smart contracts? - [thread](https://discord.com/channels/897514728459468821/1199121845656486009/1199739331078803496) 30 | 1. Observe create contract ops as ledgers close 31 | 2. Use an [indexing service](https://developers.stellar.org/docs/tools/developer-tools#data-indexers) 32 | 6. What is the status of contracts caching support? - [question](https://discord.com/channels/897514728459468821/1199121845656486009/1200484710447587490) 33 | 1. [response](https://discord.com/channels/897514728459468821/1199121845656486009/1200516877680644276) 34 | -------------------------------------------------------------------------------- /meeting-notes/2024-02-01.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '2024-02-01' 3 | authors: naman 4 | tags: [protocol] 5 | --- 6 | 7 | 14 | 15 | [Discord agenda thread](https://discord.com/channels/897514728459468821/1201979721211203614) 16 | 17 | 1. The proposal is to advance stellar-core by adding a host function to verify the secp256r1 signature, which is the most common elliptic curve used outside of the blockchain space. It is useful in connecting off-chain authentication interfaces with on-chain functionality. 18 | 1. Note that the proposal is not for a new signer type but a host function. 19 | 1. Leigh investigated adding support for the WebAuthN use case, by allowing a custom account / smart contract to sign soroban auth entries using a secp256r1-signed payload. 20 | 1. secp256r1 is supported by phones, passkeys, and enables an app to replace passwords. This is a massive benefit to user-facing applications like wallets. 21 | 1. Pros and cons of the interface: blockchains generally implement the recovery interface over the verification interface but verification is easier for developers as it reduces burden on the client and the network. 22 | 1. The WebAuthN use case requires encoding and decoding of base64 payloads and decoding JSON blobs, which is not currently supported in Soroban. 23 | 1. While there are hacky ways of accomplishing the latter, it’s not a great developer experience and final implementation is susceptible to breakages on updates. 24 | 1. It is also costly to bundle decoding with verification in guest. 25 | 1. Soroban has always led with a batteries included mindset. Keeping in line with that approach, it makes sense to further investigate and determine whether a host function makes sense for these as well. 26 | 1. Leigh’s implementation may require further evaluation of the crates used for ecdsa and p256. 27 | 1. Brief discussion around proposed process for adding of a host function by a non-core dev. -------------------------------------------------------------------------------- /meeting-notes/2024-02-09.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '2024-02-09' 3 | authors: kalepail 4 | tags: [developer] 5 | --- 6 | 7 | 13 | 14 | [Discord agenda thread](https://discord.com/channels/897514728459468821/1204462856037470248) 15 | 16 | 1. Stellar Asset List (SEP-0042) draft presentation by [OrbitLens](https://github.com/orbitlens) 17 | 1. [SEP draft](https://github.com/orbitlens/stellar-protocol/blob/sep-0042-token-lists/ecosystem/sep-0042.md) 18 | 2. [Discord discussion](https://discord.com/channels/897514728459468821/1162558946867953704) 19 | 2. Stellar + Soroban documentation survey 20 | 1. [Take the survey](https://discord.com/channels/897514728459468821/1204462856037470248/1205196745877757962) -------------------------------------------------------------------------------- /meeting-notes/2024-02-22.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: '2024-02-22' 3 | authors: kalepail 4 | tags: [developer] 5 | --- 6 | 7 | 13 | 14 | [Discord agenda thread](https://discord.com/channels/897514728459468821/1209582245824823337) 15 | 16 | 1. Latest and greatest on the TypeScript bindings with [@chadoh](https://github.com/chadoh) 17 | 2. [Available RPC providers](https://soroban.stellar.org/docs/reference/rpc-list#ecosystem-providers) 18 | 3. Standing up a [`soroban-rpc` docker container](https://soroban.stellar.org/docs/reference/rpc#docker-image) 19 | 4. Installing and invoking a [Stellar Asset Contract](https://soroban.stellar.org/docs/tokens/stellar-asset-contract) on mainnet in Phase 0 20 | -------------------------------------------------------------------------------- /meeting-notes/authors.yml: -------------------------------------------------------------------------------- 1 | kalepail: 2 | name: Tyler van der Hoeven 3 | title: Lead Developer Advocate 4 | url: https://github.com/kalepail 5 | image_url: https://github.com/kalepail.png 6 | naman: 7 | name: Naman Kumar 8 | title: Senior Product Manager 9 | url: https://github.com/namankumar 10 | image_url: https://github.com/namankumar.png 11 | -------------------------------------------------------------------------------- /nginx/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | root /usr/share/nginx/html; 3 | 4 | listen 80 default_server; 5 | listen [::]:80 default ipv6only=on; 6 | server_name _; 7 | include includes/redirects.conf; 8 | 9 | # index index.html; 10 | error_page 404 /404.html; 11 | 12 | location = / { 13 | rewrite ^/$ /docs/ permanent; 14 | } 15 | 16 | location / { 17 | rewrite ^/(.*)/$ /$1 permanent; 18 | try_files $uri $uri/index.html $uri/ =404; # /index.html index.html =404; 19 | } 20 | location /diagrams/ { 21 | try_files $uri $uri/ =404; 22 | } 23 | location /assets/ { 24 | try_files $uri $uri/ =404; 25 | } 26 | location /img/ { 27 | try_files $uri $uri/ =404; 28 | } 29 | location /index.html { 30 | add_header 'Cache-Control' 'no-store' always; 31 | } 32 | location /404.html { 33 | add_header 'Cache-Control' 'no-store' always; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /openrpc/scripts/validate.mjs: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | import { 3 | parseOpenRPCDocument, 4 | validateOpenRPCDocument 5 | } from "@open-rpc/schema-utils-js"; 6 | 7 | let rawdata = fs.readFileSync("openrpc/openrpc.json"); 8 | let openrpc = JSON.parse(rawdata); 9 | 10 | const error = validateOpenRPCDocument(openrpc); 11 | if (error != true) { 12 | console.log(error.name); 13 | console.log(error.message); 14 | process.exit(1); 15 | } 16 | 17 | try { 18 | await Promise.resolve(parseOpenRPCDocument(openrpc)); 19 | } catch(e) { 20 | console.log(e.name); 21 | let end = e.message.indexOf("schema in question"); 22 | let msg = e.message.substring(0, end); 23 | console.log(msg); 24 | process.exit(1); 25 | } 26 | 27 | console.log("OpenRPC spec validated successfully."); 28 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/EventFilters.json: -------------------------------------------------------------------------------- 1 | { 2 | "EventFilters": { 3 | "name": "filters", 4 | "summary": "filters to narrow events search", 5 | "description": "List of filters for the returned events. Events matching any of the filters are included. To match a filter, an event must match both a contractId and a topic. Maximum 5 filters are allowed per request.", 6 | "schema": { 7 | "$ref": "#/components/schemas/EventFilters" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/LedgerKeys.json: -------------------------------------------------------------------------------- 1 | { 2 | "LedgerKeys": { 3 | "name": "keys", 4 | "summary": "array of ledger keys", 5 | "description": "Array containing the keys of the ledger entries you wish to retrieve. (an array of serialized base64 strings)", 6 | "required": true, 7 | "schema": { 8 | "$ref": "#/components/schemas/LedgerKeys" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/Pagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "Pagination": { 3 | "name": "pagination", 4 | "summary": "pagination options", 5 | "description": "Pagination in soroban-rpc is similar to pagination in Horizon. See [Pagination](https://soroban.stellar.org/api/pagination).", 6 | "required": false, 7 | "schema": { 8 | "$ref": "#/components/schemas/Pagination" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/ResourceConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ResourceConfig": { 3 | "name": "resourceConfig", 4 | "summary": "configuration for how resources will be calculated", 5 | "description": "Contains configuration for how resources will be calculated when simulating transactions.", 6 | "required": false, 7 | "schema": { 8 | "$ref": "#/components/schemas/ResourceConfig" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/StartLedger.json: -------------------------------------------------------------------------------- 1 | { 2 | "StartLedger": { 3 | "name": "startLedger", 4 | "summary": "ledger to begin searching from", 5 | "description": "Ledger sequence number to fetch events after (inclusive). This method will return an error if `startLedger` is less than the oldest ledger stored in this node, or greater than the latest ledger seen by this node. If a cursor is included in the request, `startLedger` must be omitted.", 6 | "required": true, 7 | "schema": { 8 | "$ref": "#/components/schemas/LedgerSequence" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/Transaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "SignedTransaction": { 3 | "name": "transaction", 4 | "summary": "transaction to be submitted to the network", 5 | "description": "The signed transaction to broadcast for inclusion in a ledger.", 6 | "required": true, 7 | "schema": { 8 | "$ref": "#/components/schemas/Transaction" 9 | } 10 | }, 11 | "UnsignedTransaction": { 12 | "name": "transaction", 13 | "summary": "transaction to be simulated", 14 | "description": "In order for the RPC server to successfully simulate a Stellar transaction, the provided transaction must contain only a single operation of the type `invokeHostFunction`.", 15 | "required": true, 16 | "schema": { 17 | "$ref": "#/components/schemas/Transaction" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /openrpc/src/contentDescriptors/TransactionHash.json: -------------------------------------------------------------------------------- 1 | { 2 | "TransactionHash": { 3 | "name": "hash", 4 | "summary": "transaction hash to query", 5 | "description": "Transaction hash to query as a hex-encoded string. This transaction hash should correspond to transaction that has been previously submitted to the network.", 6 | "required": true, 7 | "schema": { 8 | "$ref": "#/components/schemas/TransactionHash" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /openrpc/src/examplePairingObjects/EventsPairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "NativeTransferEventsExample": { 3 | "name": "Native XLM Transfer Events", 4 | "description": "Example request to the `getEvents` method, filtering for `transfer` events for native Lumens, and limiting the number of returned events to 2.", 5 | "params": [ 6 | { "$ref": "#/components/examples/StartLedger" }, 7 | { "$ref": "#/components/examples/NativeTransfersFilter" }, 8 | { "$ref": "#/components/examples/PaginationLimitTwo" } 9 | ], 10 | "result": { 11 | "$ref": "#/components/examples/TwoNativeTransferEvents" 12 | } 13 | }, 14 | "AnyEventsExample": { 15 | "name": "All Events", 16 | "description": "Example request to the `getEvents` method, filtering for all events of all types for any and all contracts.", 17 | "params": [ 18 | { "$ref": "#/components/examples/StartLedger" }, 19 | { "$ref": "#/components/examples/PaginationLimitTwo" } 20 | ], 21 | "result": { 22 | "$ref": "#/components/examples/AnyTwoEvents" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /openrpc/src/examplePairingObjects/GetTransactionPairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "SuccessfulTransaction": { 3 | "name": "Successful Transaction", 4 | "description": "Query for a transaction hash that returns `SUCCESS` from the RPC node.", 5 | "params": [ 6 | { "$ref": "#/components/examples/RecentTransactionHash" } 7 | ], 8 | "result": { 9 | "$ref": "#/components/examples/SuccessTransactionResult" 10 | } 11 | }, 12 | "NotFoundTransaction": { 13 | "name": "Not Found Transaction", 14 | "description": "Query for a transaction hash that returns `NOT_FOUND` from the RPC node.", 15 | "params": [ 16 | { "$ref": "#/components/examples/TooOldTransactionHash" } 17 | ], 18 | "result": { 19 | "$ref": "#/components/examples/NotFoundTransactionResult" 20 | } 21 | }, 22 | "FailedTransaction": { 23 | "name": "Failed Transaction", 24 | "description": "Query for a transaction hash that returns `FAILED` from the RPC node.", 25 | "params": [ 26 | { "$ref": "#/components/examples/FailedTransactionHash" } 27 | ], 28 | "result": { 29 | "$ref": "#/components/examples/FailedTransactionResult" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /openrpc/src/examplePairingObjects/LedgerEntriesPairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "CounterLedgerEntryExample": { 3 | "name": "Retrieve a Contract's Counter Entry for an Address", 4 | "description": "Example request to the `getNetwork` method for a `Counter(Address)` ledger entry.", 5 | "params": [ 6 | { "$ref": "#/components/examples/LedgerKeyCounterAddress" } 7 | ], 8 | "result": { 9 | "$ref": "#/components/examples/LedgerEntryCounterAddressResult" 10 | } 11 | }, 12 | "ContractBalanceLedgerEntryExample": { 13 | "name": "Retrieve a Token's Balance Entry for Contract", 14 | "description": "Example request to the `getNetwork` method for a SAC balance ledger entry belonging to a contract.", 15 | "params": [ 16 | { "$ref": "#/components/examples/LedgerKeyContractBalance" } 17 | ], 18 | "result": { 19 | "$ref": "#/components/examples/LedgerEntryContractBalanceResult" 20 | } 21 | }, 22 | "CombinedLedgerEntryExample": { 23 | "name": "Retrieve Multiple Ledger Entries from Different Contracts.", 24 | "description": "Example request to the `getNetwork` method for a `Counter(Address)` ledger entry and a SAC balance ledger entry.", 25 | "params": [ 26 | { "$ref": "#/components/examples/CombinedLedgerKeys" } 27 | ], 28 | "result": { 29 | "$ref": "#/components/examples/CombinedLedgerEntryResult" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /openrpc/src/examplePairingObjects/NetworkPairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestnetNetworkConfig": { 3 | "name": "Testnet Network Configuration", 4 | "description": "Example request to the `getNetwork` method for a node connected to the Stellar Testnet network.", 5 | "params": [], 6 | "result": { 7 | "name": "getNetworkResult", 8 | "value": { 9 | "friendbotUrl": "https://friendbot-testnet.stellar.org/", 10 | "passphrase": "Test SDF Network ; September 2015", 11 | "protocolVersion": 20 12 | } 13 | } 14 | }, 15 | "FuturenetNetworkConfig": { 16 | "name": "Futurenet Network Configuration", 17 | "description": "Example request to the `getNetwork` method for a node connected to the Stellar Futurenet network.", 18 | "params": [], 19 | "result": { 20 | "name": "getNetworkResult", 21 | "value": { 22 | "friendbotUrl": "https://friendbot-futurenet.stellar.org/", 23 | "passphrase": "Test SDF Future Network ; October 2022", 24 | "protocolVersion": 20 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /openrpc/src/examplePairingObjects/SendTransactionPairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "PendingTransaction": { 3 | "name": "Pending Transaction", 4 | "description": "Submitting a valid transaction using the `sendTransaction` method, resulting in a `PENDING` status.", 5 | "params": [ 6 | { "$ref": "#/components/examples/ValidSentTransaction" } 7 | ], 8 | "result": { 9 | "$ref": "#/components/examples/PendingTransactionResult" 10 | } 11 | }, 12 | "DuplicateTransaction": { 13 | "name": "Duplicate Transaction", 14 | "description": "Submitting a valid, yet duplicate transaction using the `sendTransaction` method, resulting in a `DUPLICATE` status.", 15 | "params": [ 16 | { "$ref": "#/components/examples/ValidSentTransaction" } 17 | ], 18 | "result": { 19 | "$ref": "#/components/examples/DuplicateTransactionResult" 20 | } 21 | }, 22 | "ErrorTransaction": { 23 | "name": "Error Transaction", 24 | "description": "Submitting an invalid transaction using the `sendTransaction` method, resulting in an `ERROR` status.", 25 | "params": [ 26 | { "$ref": "#/components/examples/InvalidSentTransaction" } 27 | ], 28 | "result": { 29 | "$ref": "#/components/examples/ErrorTransactionResult" 30 | } 31 | }, 32 | "TryAgainLaterTransaction": { 33 | "name": "Try Again Later Transaction", 34 | "description": "Submitting a valid transaction before an account's previously submitted transaction has settled using the `sendTransaction` method, resulting in a `TRY_AGAIN_LATER` status.", 35 | "params": [ 36 | { "$ref": "#/components/examples/ValidSentTransaction" } 37 | ], 38 | "result": { 39 | "$ref": "#/components/examples/TryAgainLaterTransactionResult" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /openrpc/src/examplePairingObjects/SimulationPairs.json: -------------------------------------------------------------------------------- 1 | { 2 | "SuccessfulTransactionSimulation": { 3 | "name": "Successful Transaction Simulation", 4 | "description": "Transaction simulation that succeeds and returns the necessary information to prepare and submit the transaction.", 5 | "params": [ 6 | { "$ref": "#/components/examples/ValidContractTransaction" }, 7 | { "$ref": "#/components/examples/DefaultResourceConfig" } 8 | ], 9 | "result": { 10 | "$ref": "#/components/examples/SuccessfulSimulationResult" 11 | } 12 | }, 13 | "FailedTransactionSimulation": { 14 | "name": "Failed Transaction Simulation", 15 | "description": "Transaction simulation that fails due to the contract invocation being constructed with an improper number of arguments.", 16 | "params": [ 17 | { "$ref": "#/components/examples/InvalidContractTransaction" }, 18 | { "$ref": "#/components/examples/DefaultResourceConfig" } 19 | ], 20 | "result": { 21 | "$ref": "#/components/examples/FailedSimulationResult" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /openrpc/src/methods/getEvents.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getEvents", 3 | "summary": "returns contract events", 4 | "description": "Clients can request a filtered list of events emitted by a given ledger range.\n\nSoroban-RPC will support querying within a maximum 24 hours of recent ledgers.\n\nNote, this could be used by the client to only prompt a refresh when there is a new ledger with relevant events. It should also be used by backend Dapp components to \"ingest\" events into their own database for querying and serving.\n\nIf making multiple requests, clients should deduplicate any events received, based on the event's unique id field. This prevents double-processing in the case of duplicate events being received.\n\nBy default soroban-rpc retains the most recent 24 hours of events.", 5 | "externalDocs": { 6 | "url": "https://soroban.stellar.org/api/methods/getEvents" 7 | }, 8 | "paramStructure": "by-name", 9 | "params": [ 10 | { 11 | "$ref": "#/components/contentDescriptors/StartLedger" 12 | }, 13 | { 14 | "$ref": "#/components/contentDescriptors/EventFilters" 15 | }, 16 | { 17 | "$ref": "#/components/contentDescriptors/Pagination" 18 | } 19 | ], 20 | "result": { 21 | "name": "getEventsResult", 22 | "schema": { 23 | "type": "object", 24 | "properties": { 25 | "latestLedger": { 26 | "$ref": "#/components/schemas/LatestLedger" 27 | }, 28 | "events": { 29 | "type": "array", 30 | "items": { 31 | "$ref": "#/components/schemas/Event" 32 | } 33 | } 34 | } 35 | } 36 | }, 37 | "examples": [ 38 | { "$ref": "#/components/examplePairingObjects/NativeTransferEventsExample" }, 39 | { "$ref": "#/components/examplePairingObjects/AnyEventsExample" } 40 | ] 41 | } 42 | 43 | -------------------------------------------------------------------------------- /openrpc/src/methods/getHealth.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getHealth", 3 | "summary": "returns node health", 4 | "description": "General node health check.", 5 | "externalDocs": { 6 | "url": "https://soroban.stellar.org/api/methods/getHealth" 7 | }, 8 | "paramStructure": "by-name", 9 | "params": [], 10 | "result": { 11 | "name": "getHealthResult", 12 | "schema": { 13 | "type": "object", 14 | "properties": { 15 | "status": { 16 | "type": "string", 17 | "description": "\"healthy\"" 18 | } 19 | } 20 | } 21 | }, 22 | "examples": [ 23 | { 24 | "name": "Current node health", 25 | "description": "Example request to the `getHealth` method", 26 | "params": [], 27 | "result": { 28 | "name": "getHealthResult", 29 | "value": { 30 | "status": "healthy" 31 | } 32 | } 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /openrpc/src/methods/getLatestLedger.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getLatestLedger", 3 | "summary": "returns latest known ledger", 4 | "description": "For finding out the current latest known ledger of this node. This is a subset of the ledger info from Horizon.", 5 | "externalDocs": { 6 | "url": "https://soroban.stellar.org/api/methods/getLatestLedger" 7 | }, 8 | "paramStructure": "by-name", 9 | "params": [], 10 | "result": { 11 | "name": "getLatestLedgerResult", 12 | "schema": { 13 | "type": "object", 14 | "properties": { 15 | "id": { 16 | "$ref": "#/components/schemas/LedgerHash" 17 | }, 18 | "protocolVersion": { 19 | "$ref": "#/components/schemas/ProtocolVersion" 20 | }, 21 | "sequence": { 22 | "$ref": "#/components/schemas/LatestLedger" 23 | } 24 | } 25 | } 26 | }, 27 | "examples": [ 28 | { 29 | "name": "Details of the Current Ledger", 30 | "description": "Example request to the `getLatestLedger` method.", 31 | "params": [], 32 | "result": { 33 | "name": "getLatestLedgerResult", 34 | "value": { 35 | "id": "c73c5eac58a441d4eb733c35253ae85f783e018f7be5ef974258fed067aabb36", 36 | "protocolVersion": 20, 37 | "sequence": 2539605 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /openrpc/src/methods/getLedgerEntries.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getLedgerEntries", 3 | "summary": "returns ledger entries", 4 | "description": "For reading the current value of ledger entries directly.\n\nAllows you to directly inspect the current state of a contract, a contract's code, or any other ledger entry. This is a backup way to access your contract data which may not be available via events or `simulateTransaction`.\n\nTo fetch contract wasm byte-code, use the ContractCode ledger entry key.", 5 | "externalDocs": { 6 | "url": "https://soroban.stellar.org/api/methods/getLedgerEntries" 7 | }, 8 | "paramStructure": "by-name", 9 | "params": [ 10 | { 11 | "$ref": "#/components/contentDescriptors/LedgerKeys" 12 | } 13 | ], 14 | "result": { 15 | "name": "getLedgerEntriesResult", 16 | "schema": { 17 | "type": "object", 18 | "properties": { 19 | "latestLedger": { 20 | "$ref": "#/components/schemas/LatestLedger" 21 | }, 22 | "entries": { 23 | "type": "array", 24 | "description": "Array of objects containing all found ledger entries", 25 | "items": { 26 | "$ref": "#/components/schemas/LedgerEntry" 27 | } 28 | } 29 | }, 30 | "required": [ "latestLedger" ] 31 | } 32 | }, 33 | "examples": [ 34 | { "$ref": "#/components/examplePairingObjects/CounterLedgerEntryExample" }, 35 | { "$ref": "#/components/examplePairingObjects/ContractBalanceLedgerEntryExample" }, 36 | { "$ref": "#/components/examplePairingObjects/CombinedLedgerEntryExample" } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /openrpc/src/methods/getNetwork.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "getNetwork", 3 | "summary": "returns network config", 4 | "description": "General information about the currently configured network. This response will contain all the information needed to successfully submit transactions to the network this node serves.", 5 | "externalDocs": { 6 | "url": "https://soroban.stellar.org/api/methods/getNetwork" 7 | }, 8 | "paramStructure": "by-name", 9 | "params": [], 10 | "result": { 11 | "name": "getNetworkResult", 12 | "schema": { 13 | "type": "object", 14 | "properties": { 15 | "passphrase": { 16 | "$ref": "#/components/schemas/NetworkPassphrase" 17 | }, 18 | "protocolVersion": { 19 | "$ref": "#/components/schemas/ProtocolVersion" 20 | }, 21 | "friendbotUrl": { 22 | "type": "string", 23 | "description": "(optional) The URL of this network's \"friendbot\" faucet" 24 | } 25 | }, 26 | "required": [ "passphrase", "protocolVersion" ] 27 | } 28 | }, 29 | "examples": [ 30 | { "$ref": "#/components/examplePairingObjects/TestnetNetworkConfig" }, 31 | { "$ref": "#/components/examplePairingObjects/FuturenetNetworkConfig" } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /openrpc/src/schemas/ContractIds.json: -------------------------------------------------------------------------------- 1 | { 2 | "ContractId": { 3 | "title": "contractId", 4 | "description": "A StrKey representation of a contract address (`C...`). ([SEP-23](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0023.md#specification)).", 5 | "type": "string" 6 | }, 7 | "ContractIds": { 8 | "title": "contractIds", 9 | "type": "array", 10 | "description": "List of contract IDs to query for events. If omitted, return events for all contracts. Maximum 5 contract IDs are allowed per request.", 11 | "maxItems": 5, 12 | "items": { 13 | "$ref": "#/components/schemas/ContractId" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /openrpc/src/schemas/EventFilters.json: -------------------------------------------------------------------------------- 1 | { 2 | "EventFilters": { 3 | "type": "array", 4 | "maxItems": 5, 5 | "items": { 6 | "$ref": "#/components/schemas/EventFilter" 7 | } 8 | }, 9 | "EventFilter": { 10 | "type": "object", 11 | "properties": { 12 | "type": { 13 | "$ref": "#/components/schemas/EventFilterType" 14 | }, 15 | "contractIds": { 16 | "$ref": "#/components/schemas/ContractIds" 17 | }, 18 | "topics": { 19 | "$ref": "#/components/schemas/TopicFilters" 20 | } 21 | }, 22 | "required": [] 23 | }, 24 | "EventFilterType": { 25 | "title": "type", 26 | "type": "string", 27 | "description": "A comma separated list of event types (system, contract, or diagnostic) used to filter events. If omitted, all event types are included." 28 | }, 29 | "TopicFilters": { 30 | "title": "topics", 31 | "type": "array", 32 | "description": "List of topic filters. If omitted, query for all events. If multiple filters are specified, events will be included if they match any of the filters. Maximum 5 filters are allowed per request.", 33 | "maxItems": 5, 34 | "items": { 35 | "$ref": "#/components/schemas/TopicFilter" 36 | } 37 | }, 38 | "SegmentMatcher": { 39 | "title": "SegmentMatcher", 40 | "type": "string", 41 | "description": "A `SegmentMatcher` is one of the following:\n\n- For an exact segment match, a string containing a base64-encoded ScVal\n\n- For a wildcard single-segment match, the string \"*\", matches exactly one segment." 42 | }, 43 | "TopicFilter": { 44 | "type": "array", 45 | "description": "A `TopicFilter` is `SegmentMatcher[]`\n\n- The list can be 1-4 `SegmentMatchers` long.", 46 | "minItems": 1, 47 | "maxItems": 4, 48 | "items": { 49 | "$ref": "#/components/schemas/SegmentMatcher" 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /openrpc/src/schemas/Hash.json: -------------------------------------------------------------------------------- 1 | { 2 | "Hash": { 3 | "title": "hash", 4 | "type": "string", 5 | "minLength": 64, 6 | "maxLength": 64, 7 | "pattern": "^[a-f\\d]{64}$" 8 | }, 9 | "TransactionHash": { 10 | "title": "hash", 11 | "description": "Transaction hash (as a hex-encoded string)", 12 | "$ref": "#/components/schemas/Hash" 13 | }, 14 | "LedgerHash": { 15 | "title": "id", 16 | "description": "Hash identifier of the latest ledger (as a hex-encoded string) known to Soroban RPC at the time it handled the request.", 17 | "$ref": "#/components/schemas/Hash" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /openrpc/src/schemas/LedgerCloseTime.json: -------------------------------------------------------------------------------- 1 | { 2 | "LedgerCloseTime": { 3 | "title": "ledgerCloseTime", 4 | "description": "The unix timestamp of the close time of the ledger.", 5 | "type": "string" 6 | }, 7 | "LatestLedgerCloseTime": { 8 | "title": "latestLedgerCloseTime", 9 | "description": "The unix timestamp of the close time of the latest ledger known to Soroban RPC at the time it handled the request.", 10 | "$ref": "#/components/schemas/LedgerCloseTime" 11 | }, 12 | "OldestLedgerCloseTime": { 13 | "title": "oldestLedgerCloseTime", 14 | "description": "The unix timestamp of the close time of the oldest ledger ingested by Soroban RPC at the time it handled the request.", 15 | "$ref": "#/components/schemas/LedgerCloseTime" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openrpc/src/schemas/LedgerEntries.json: -------------------------------------------------------------------------------- 1 | { 2 | "LedgerKey": { 3 | "type": "string", 4 | "description": "Ledger key, serialized as a base64 string, corresponding to an existing ledger entry you wish to retrieve." 5 | }, 6 | "LedgerKeys": { 7 | "description": "Array containing ledger keys.", 8 | "type": "array", 9 | "items": { 10 | "$ref": "#/components/schemas/LedgerKey" 11 | } 12 | }, 13 | "LedgerEntry": { 14 | "type": "object", 15 | "description": "Object containing information about an existing ledger entry.", 16 | "properties": { 17 | "key": { 18 | "type": "string", 19 | "description": "The key of the ledger entry (serialized in a base64 string)." 20 | }, 21 | "xdr": { 22 | "type": "string", 23 | "description": "The current value of the given ledger entry (serialized in a base64 string)." 24 | }, 25 | "lastModifiedLedgerSeq": { 26 | "description": "The ledger sequence number of the last time this entry was updated.", 27 | "$ref": "#/components/schemas/LedgerSequence" 28 | }, 29 | "liveUntilLedgerSeq": { 30 | "$ref": "#/components/schemas/LedgerSequence" 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /openrpc/src/schemas/LedgerSequence.json: -------------------------------------------------------------------------------- 1 | { 2 | "LedgerSequence": { 3 | "title": "ledgerSequence", 4 | "description": "Sequence number of the ledger.", 5 | "type": "number" 6 | }, 7 | "LatestLedger": { 8 | "title": "latestLedger", 9 | "description": "The sequence number of the latest ledger known to Soroban RPC at the time it handled the request.", 10 | "$ref": "#/components/schemas/LedgerSequence" 11 | }, 12 | "OldestLedger": { 13 | "title": "oldestLedger", 14 | "description": "The sequence number of the oldest ledger ingested by Soroban RPC at the time it handled the request.", 15 | "$ref": "#/components/schemas/LedgerSequence" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /openrpc/src/schemas/NetworkConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProtocolVersion": { 3 | "title": "protocolVersion", 4 | "description": "Stellar Core protocol version associated with the latest ledger.", 5 | "type": "number" 6 | }, 7 | "NetworkPassphrase": { 8 | "title": "networkPassphrase", 9 | "description": "Network passphrase configured for this Soroban RPC node.", 10 | "type": "string" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /openrpc/src/schemas/Pagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "Pagination": { 3 | "type": "object", 4 | "properties": { 5 | "cursor": { 6 | "type": "string", 7 | "description": "A string ID that points to a specific location in a collection of responses and is pulled from the `paging_token` value of a record. When a cursor is provided Soroban-RPC will _not_ include the element whose id matches the cursor in the response. Only elements which appear _after_ the cursor are included." 8 | }, 9 | "limit": { 10 | "type": "number", 11 | "description": "The maximum number of records returned. The limit for [getEvents](https://soroban.stellar.org/api/getEvents) can range from 1 to 10000 - an upper limit that is hardcoded in Soroban-RPC for performance reasons. If this argument isn't designated, it defaults to 100." 12 | } 13 | }, 14 | "required": [] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /openrpc/src/schemas/ResourceConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "ResourceConfig": { 3 | "title": "resourceConfig", 4 | "description": "Configuration for how resources will be calculated.", 5 | "type": "object", 6 | "properties": { 7 | "instructionLeeway": { 8 | "title": "instructionLeeway", 9 | "description": "Allow this many extra instructions when budgeting resources.", 10 | "type": "number" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /openrpc/src/schemas/Transaction.json: -------------------------------------------------------------------------------- 1 | { 2 | "Transaction": { 3 | "title": "transaction", 4 | "description": "A Stellar transaction, serialized as a base64 string", 5 | "type": "string" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /sidebars.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | myAutogeneratedSidebar: [ 3 | { 4 | type: 'autogenerated', 5 | dirName: '.', 6 | }, 7 | { 8 | type: 'link', 9 | label: 'Meeting Notes', 10 | href: 'https://developers.stellar.org/meetings', 11 | } 12 | ] 13 | }; 14 | -------------------------------------------------------------------------------- /sidebarsApi.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | apiSidebar: [ 3 | { 4 | type: 'category', 5 | label: 'Introduction', 6 | collapsible: true, 7 | collapsed: false, 8 | link: { 9 | type: 'doc', 10 | id: 'README', 11 | }, 12 | items: [ 13 | 'goals', 14 | 'anti-goals', 15 | 'json-rpc', 16 | 'pagination', 17 | ], 18 | }, 19 | { 20 | type: 'category', 21 | label: 'Methods', 22 | collapsible: true, 23 | collapsed: false, 24 | link: { 25 | type: 'generated-index', 26 | title: 'Methods', 27 | slug: 'methods', 28 | }, 29 | items: [ 30 | 'methods/getEvents', 31 | 'methods/getHealth', 32 | 'methods/getLatestLedger', 33 | 'methods/getLedgerEntries', 34 | 'methods/getNetwork', 35 | 'methods/getTransaction', 36 | 'methods/sendTransaction', 37 | 'methods/simulateTransaction', 38 | ], 39 | }, 40 | { 41 | type: 'category', 42 | label: 'Incomplete Methods', 43 | collapsible: true, 44 | collapsed: false, 45 | link: { 46 | type: 'generated-index', 47 | title: 'Incomplete Methods', 48 | slug: 'incomplete-methods', 49 | }, 50 | items: [], 51 | }, 52 | ], 53 | }; 54 | -------------------------------------------------------------------------------- /sidebarsDapps.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mySidebar: [ 3 | { 4 | type: 'link', 5 | label: 'Welcome', 6 | href: 'https://developers.stellar.org/docs/learn/migrate/introduction-to-solidity-and-rust', 7 | }, 8 | { 9 | type: 'link', 10 | label: 'Dashboard', 11 | href: 'https://developers.stellar.org/docs/learn/interactive/dapps/dashboard', 12 | }, 13 | { 14 | type: 'link', 15 | label: 'Scaffold Soroban', 16 | href: 'https://developers.stellar.org/docs/learn/interactive/dapps/scaffold-soroban', 17 | }, 18 | { 19 | type: 'category', 20 | label: 'Guides', 21 | items: [ 22 | { 23 | type: 'link', 24 | label: 'Docker', 25 | href: 'https://developers.stellar.org/docs/smart-contracts/guides/dapps/docker' 26 | }, 27 | { 28 | type: 'link', 29 | label: 'Initialization', 30 | href: 'https://developers.stellar.org/docs/smart-contracts/guides/dapps/initialization' 31 | }, 32 | { 33 | type: 'link', 34 | label: 'React', 35 | href: 'https://developers.stellar.org/docs/smart-contracts/guides/dapps/react' 36 | }, 37 | { 38 | type: 'link', 39 | label: 'Smart Contracts', 40 | href: 'https://developers.stellar.org/docs/learn/interactive/dapps/challenges/challenge-0-crowdfund' 41 | }, 42 | { 43 | type: 'link', 44 | label: 'Wallets', 45 | href: 'https://developers.stellar.org/docs/smart-contracts/guides/freighter/integrate-freighter-react' 46 | }, 47 | ], 48 | collapsible: true, // The category can be collapsed. 49 | collapsed: true, // Initially, the category will be collapsed. 50 | }, 51 | ], 52 | }; 53 | -------------------------------------------------------------------------------- /sidebarsGuides.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | guidesSidebar: [ 3 | { 4 | type: 'category', 5 | label: 'Guides', 6 | link: { 7 | type: 'doc', 8 | id: 'README', 9 | }, 10 | items: [ 11 | { 12 | type: 'autogenerated', 13 | dirName: '.' 14 | } 15 | ] 16 | }, 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /src/analytics-module.js: -------------------------------------------------------------------------------- 1 | module.exports = () => ({ 2 | name: 'analytics-module', 3 | 4 | injectHtmlTags() { 5 | return { 6 | headTags: [ 7 | { 8 | tagName: 'script', 9 | innerHTML: ` 10 | (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 11 | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 12 | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 13 | 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 14 | })(window,document,'script','dataLayer','GTM-55LZM97'); 15 | ` 16 | }, 17 | { 18 | tagName: 'meta', 19 | attributes: { 20 | name: 'facebook-domain-verification', 21 | content: 'll8iy5eqaqpremxnd6bo2qg2qjxrtj', 22 | }, 23 | }, 24 | ], 25 | preBodyTags: [ 26 | { 27 | tagName: 'script', 28 | innerHTML: ` 29 | if (typeof window.ga === "function") { 30 | window.ga("require", "linker"); 31 | window.ga("linker:autolink", ["www.stellar.org", "stellar.org"]); 32 | } 33 | `, 34 | }, 35 | { 36 | tagName: 'noscript', 37 | innerHTML: ` 38 | 40 | ` 41 | }, 42 | ], 43 | }; 44 | }, 45 | }); 46 | -------------------------------------------------------------------------------- /src/components/ReaderFeedback/index.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import useIsBrowser from '@docusaurus/useIsBrowser'; 3 | 4 | import IconThumbsUp from '@site/static/icons/thumbs-up.svg'; 5 | import IconThumbsDown from '@site/static/icons/thumbs-down.svg'; 6 | 7 | const ReaderFeedback = ({ pageId }) => { 8 | const [feedbackGiven, setFeedbackGiven] = useState(false); 9 | const isBrowser = useIsBrowser(); 10 | if (!isBrowser) { 11 | return null; 12 | } 13 | 14 | const giveFeedback = (value) => { 15 | setFeedbackGiven(true); 16 | }; 17 | 18 | return ( 19 |
20 | {feedbackGiven ? ( 21 | 'Thanks for your feedback!' 22 | ) : ( 23 | <> 24 | Did you find this page helpful? 25 | 30 | 35 | 36 | )} 37 |
38 | ); 39 | }; 40 | 41 | export default ReaderFeedback; 42 | -------------------------------------------------------------------------------- /src/components/RpcMethod.tsx: -------------------------------------------------------------------------------- 1 | import Method from "@metamask/open-rpc-docs-react"; 2 | import React from "react"; 3 | 4 | const CodeBlock = require('@theme/CodeBlock').default; 5 | const Tabs = require('@theme/Tabs').default; 6 | const TabItem = require('@theme/TabItem').default; 7 | 8 | export const RpcMethod = (param: { method:string; }) => { 9 | const rpcDoc = require('@site/static/openrpc.json') 10 | const rpcMethod = rpcDoc.methods.filter((meth: any) => meth.name === param.method )[0] 11 | 12 | return ( 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/components/atoms/ProviderExample.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {SorobanReactProvider} from '@soroban-react/core'; 3 | import {SorobanEventsProvider} from '@soroban-react/events'; 4 | import {futurenet, sandbox, standalone, testnet} from '@soroban-react/chains'; 5 | import {freighter} from '@soroban-react/freighter'; 6 | import {ChainMetadata, Connector} from "@soroban-react/types"; 7 | 8 | const chains: ChainMetadata[] = [sandbox, standalone, futurenet, testnet]; 9 | const connectors: Connector[] = [freighter()]; 10 | 11 | export default function ProviderExample({children}:{children: React.ReactNode}) { 12 | return ( 13 | 17 | 18 | {children} 19 | 20 | 21 | ) 22 | } -------------------------------------------------------------------------------- /src/components/atoms/SortableRow/index.js: -------------------------------------------------------------------------------- 1 | import React from "react" 2 | 3 | const SortableRow = (props) => { 4 | return ( 5 | 6 | {props.title} 7 | click here 8 | {props.difficulty} 9 | 10 | ) 11 | } 12 | 13 | export default SortableRow 14 | -------------------------------------------------------------------------------- /src/components/atoms/UI/carousel/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode, useState } from "react"; 2 | import styles from "./style.module.css"; 3 | import { ImageHolder } from "../../course-images"; 4 | 5 | interface CarouselProps { 6 | images: ReactNode[]; 7 | } 8 | 9 | export function Carousel({ images }: CarouselProps) { 10 | const [currentIndex, setCurrentIndex] = useState(0); 11 | 12 | const nextSlide = () => { 13 | setCurrentIndex((prevIndex) => 14 | prevIndex === images.length - 1 ? 0 : prevIndex + 1 15 | ); 16 | }; 17 | 18 | const previousSlide = () => { 19 | setCurrentIndex((prevIndex) => 20 | prevIndex === 0 ? images.length - 1 : prevIndex - 1 21 | ); 22 | }; 23 | 24 | return ( 25 |
26 | 27 |
28 |
32 | {images.map((image, index) => ( 33 |
39 | 40 |
41 | ))} 42 |
43 |
44 | 45 |
46 | ); 47 | } 48 | -------------------------------------------------------------------------------- /src/components/atoms/UI/carousel/style.module.css: -------------------------------------------------------------------------------- 1 | .image_holder { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: center; 5 | align-items: center; 6 | padding: 16px 12px; 7 | gap: 8px; 8 | border-radius: 8px; 9 | border: 0; 10 | height: auto; 11 | color: #ffffff; 12 | } 13 | -------------------------------------------------------------------------------- /src/components/atoms/UI/loading/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Image from "next/image"; 3 | import { LoadingSvg } from "../../../assets/icons"; 4 | 5 | export interface SpacerProps { 6 | size: number; 7 | } 8 | 9 | export function Loading({ size }: SpacerProps) { 10 | return loading...; 11 | } 12 | -------------------------------------------------------------------------------- /src/components/atoms/UI/switcher/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { ChangeEvent, useState } from "react"; 2 | import styles from "./style.module.css"; 3 | 4 | interface SwitcherProps { 5 | id: string; 6 | labelText?: string; 7 | onChange?: (value: boolean) => void; 8 | } 9 | 10 | export default function Switcher({ id, labelText, onChange }: SwitcherProps) { 11 | const [isSwitched, setIsSwitched] = useState(false); 12 | const switcherClasses = isSwitched 13 | ? `${styles.switcher} ${styles.switcherOn}` 14 | : styles.switcher; 15 | 16 | const changeHandler = ({ target }: ChangeEvent) => { 17 | setIsSwitched(target.checked); 18 | onChange && onChange(target.checked); 19 | }; 20 | 21 | return ( 22 |
23 | {labelText} 24 | 25 |
33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /src/components/atoms/UI/switcher/style.module.css: -------------------------------------------------------------------------------- 1 | .switcherWrapper { 2 | display: flex; 3 | align-items: center; 4 | } 5 | 6 | .switcher { 7 | display: block; 8 | width: 24px; 9 | height: 16px; 10 | border: 2px solid #369EA7; 11 | border-radius: 16px; 12 | background-color: transparent; 13 | position: relative; 14 | transition: all .2s ease-in-out; 15 | cursor: pointer; 16 | } 17 | 18 | .switcher::before { 19 | content: ''; 20 | display: block; 21 | width: 4px; 22 | height: 4px; 23 | border: 2px solid #369EA7; 24 | background-color: transparent; 25 | border-radius: 50%; 26 | position: absolute; 27 | top: 2px; 28 | left: 2px; 29 | } 30 | 31 | .switcherOn { 32 | background-color: #369EA7; 33 | } 34 | 35 | .switcher.switcherOn::before { 36 | background-color: #FFFFFF; 37 | border-color: #FFFFFF; 38 | left: unset; 39 | right: 2px; 40 | } 41 | 42 | .switcherLabel { 43 | color: #585858; 44 | font-size: 14px; 45 | margin-right: 10px; 46 | } 47 | 48 | .switcherInput { 49 | width: 0; 50 | height: 0; 51 | } -------------------------------------------------------------------------------- /src/components/atoms/challenge-contract-form/style.module.css: -------------------------------------------------------------------------------- 1 | .challengeform { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: left; 5 | align-items: center; 6 | gap: 16px; 7 | margin-right: 1rem; 8 | } 9 | 10 | /* .displayData { 11 | display: flex; 12 | } */ 13 | 14 | .button { 15 | display: flex; 16 | flex-direction: row; 17 | justify-content: center; 18 | align-items: center; 19 | padding: 16px 12px; 20 | gap: 8px; 21 | background: #1a1523; 22 | border-radius: 8px; 23 | border: 0; 24 | height: 38px; 25 | font-weight: 600; 26 | font-size: 14px; 27 | line-height: 22px; 28 | color: #f5f5f5; 29 | cursor: pointer; 30 | align-self: baseline; 31 | } 32 | 33 | .success { 34 | display: flex; 35 | flex-direction: column; 36 | justify-content: center; 37 | align-items: left; 38 | gap: 8px; 39 | border-radius: 8px; 40 | border: 0; 41 | height: 38px; 42 | font-weight: 600; 43 | font-size: 18px; 44 | line-height: 22px; 45 | color: #1a1523; 46 | cursor: pointer; 47 | align-self: baseline; 48 | } 49 | 50 | 51 | [data-theme="dark"] .button { 52 | display: flex; 53 | flex-direction: row; 54 | justify-content: center; 55 | align-items: center; 56 | padding: 16px 12px; 57 | gap: 8px; 58 | background: #767676; 59 | border-radius: 8px; 60 | border: 0; 61 | height: 38px; 62 | font-weight: 600; 63 | font-size: 14px; 64 | line-height: 22px; 65 | color: #f5f5f5; 66 | cursor: pointer; 67 | align-self: baseline; 68 | } 69 | 70 | .input { 71 | display: flex; 72 | flex-direction: row; 73 | justify-content: center; 74 | width: 100%; 75 | align-items: center; 76 | padding: 11px; 77 | gap: 8px; 78 | background: #ffffff; 79 | border-radius: 2px; 80 | border: 0; 81 | font-size: 16px; 82 | color: #585858; 83 | border: 1px solid #ECECEC; 84 | cursor: pointer; 85 | } 86 | 87 | .inputWithError { 88 | border-color: #DF0101; 89 | } 90 | 91 | .errorMessage { 92 | position: absolute; 93 | color: #DF0101; 94 | } -------------------------------------------------------------------------------- /src/components/atoms/challenge-form/style.module.css: -------------------------------------------------------------------------------- 1 | .challengeform { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: left; 5 | align-items: center; 6 | gap: 16px; 7 | margin-right: 1rem; 8 | } 9 | 10 | /* .displayData { 11 | display: flex; 12 | } */ 13 | 14 | .button { 15 | display: flex; 16 | flex-direction: row; 17 | justify-content: center; 18 | align-items: center; 19 | padding: 16px 12px; 20 | gap: 8px; 21 | background: #1a1523; 22 | border-radius: 8px; 23 | border: 0; 24 | height: 38px; 25 | font-weight: 600; 26 | font-size: 14px; 27 | line-height: 22px; 28 | color: #f5f5f5; 29 | cursor: pointer; 30 | align-self: baseline; 31 | } 32 | 33 | .success { 34 | display: flex; 35 | flex-direction: column; 36 | justify-content: center; 37 | align-items: left; 38 | gap: 8px; 39 | border-radius: 8px; 40 | border: 0; 41 | height: 38px; 42 | font-weight: 600; 43 | font-size: 18px; 44 | line-height: 22px; 45 | color: #1a1523; 46 | cursor: pointer; 47 | align-self: baseline; 48 | } 49 | 50 | 51 | [data-theme="dark"] .button { 52 | display: flex; 53 | flex-direction: row; 54 | justify-content: center; 55 | align-items: center; 56 | padding: 16px 12px; 57 | gap: 8px; 58 | background: #767676; 59 | border-radius: 8px; 60 | border: 0; 61 | height: 38px; 62 | font-weight: 600; 63 | font-size: 14px; 64 | line-height: 22px; 65 | color: #f5f5f5; 66 | cursor: pointer; 67 | align-self: baseline; 68 | } 69 | 70 | .input { 71 | display: flex; 72 | flex-direction: row; 73 | justify-content: center; 74 | width: 100%; 75 | align-items: center; 76 | padding: 11px; 77 | gap: 8px; 78 | background: #ffffff; 79 | border-radius: 2px; 80 | border: 0; 81 | font-size: 16px; 82 | color: #585858; 83 | border: 1px solid #ECECEC; 84 | cursor: pointer; 85 | } 86 | 87 | .inputWithError { 88 | border-color: #DF0101; 89 | } 90 | 91 | .errorMessage { 92 | position: absolute; 93 | color: #DF0101; 94 | } -------------------------------------------------------------------------------- /src/components/atoms/challenges-list/style.module.css: -------------------------------------------------------------------------------- 1 | .dashboardContent { 2 | flex-grow: 2; 3 | width: 75%; 4 | margin: 32px auto; 5 | } 6 | 7 | .challengeCards { 8 | padding: 16px 0 0; 9 | display: grid; 10 | grid-template-columns: repeat(3, 1fr); 11 | grid-template-rows: max-content; 12 | grid-gap: 30px; 13 | } 14 | 15 | .listHeader { 16 | display: flex; 17 | justify-content: space-between; 18 | } 19 | 20 | .dataControls { 21 | display: flex; 22 | } 23 | 24 | .refreshBtn { 25 | font-size: 14px; 26 | font-weight: 500; 27 | font-family: var(--ifm-font-family-base); 28 | background-color: transparent; 29 | color: #369ea7; 30 | border-radius: 4px; 31 | border: 1px solid #369ea7; 32 | padding: 12px 8px; 33 | line-height: 0.8; 34 | width: max-content; 35 | cursor: pointer; 36 | } 37 | 38 | .resetBtn { 39 | font-size: 14px; 40 | font-weight: 500; 41 | font-family: var(--ifm-font-family-base); 42 | background-color: transparent; 43 | color: #df0101; 44 | border-radius: 4px; 45 | border: 1px solid #df0101; 46 | padding: 12px 8px; 47 | line-height: 0.8; 48 | width: max-content; 49 | cursor: pointer; 50 | } 51 | 52 | div + .refreshBtn { 53 | margin-left: 20px; 54 | } 55 | -------------------------------------------------------------------------------- /src/components/atoms/complete-step-button/styles.module.css: -------------------------------------------------------------------------------- 1 | .completeStep { 2 | display: flex; 3 | justify-content: center; 4 | align-self: center; 5 | } 6 | 7 | .completeStepButton { 8 | font-family: var(--ifm-font-family-base); 9 | font-size: 14px; 10 | font-weight: 600; 11 | background-color: #FFD748; 12 | color: #222222; 13 | border-radius: 4px; 14 | border: none; 15 | padding: 16px 8px; 16 | line-height: 0.8; 17 | width: max-content; 18 | cursor: pointer; 19 | } 20 | 21 | .completeStepButton:disabled { 22 | background-color: #ECECEC; 23 | color: #9F9F9F; 24 | cursor: not-allowed; 25 | } 26 | 27 | .notification { 28 | display: flex; 29 | align-items: center; 30 | padding-left: 16px; 31 | } 32 | 33 | .notificationText { 34 | color: #222222; 35 | font-size: 14px; 36 | font-weight: 500; 37 | font-family: var(--ifm-font-family-base); 38 | margin-left: 8px; 39 | } -------------------------------------------------------------------------------- /src/components/atoms/confirm-modal/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styles from "./style.module.css"; 3 | 4 | interface Props { 5 | onCancel: () => void; 6 | onReset: () => void; 7 | } 8 | 9 | export default function ConfirmModal({ onCancel, onReset }: Props) { 10 | return ( 11 | <> 12 |
13 |
14 |

Reseting progress!

15 | It may take up to minute!
16 | Are you sure you want to continue? 17 |
18 | 21 | 24 |
25 |
26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /src/components/atoms/confirm-modal/style.module.css: -------------------------------------------------------------------------------- 1 | .blurContainer { 2 | position: absolute; 3 | height: 100vh; 4 | width: 100vw; 5 | overflow: hidden; 6 | top: 0; 7 | left: 0; 8 | background: rgba(0, 0, 0, 0.7); 9 | z-index: 1000; 10 | } 11 | 12 | .modalContainer { 13 | position: absolute; 14 | width: 350px; 15 | height: 200px; 16 | top: calc(50% - 100px); 17 | left: calc(50% - 175px); 18 | background-color: #ffffff; 19 | padding: 20px; 20 | border-radius: 8px; 21 | text-align: center; 22 | z-index: 1001; 23 | } 24 | 25 | .title { 26 | font-size: 18px; 27 | font-weight: 600; 28 | } 29 | 30 | .buttons { 31 | margin-top: 20px; 32 | display: flex; 33 | justify-content: center; 34 | gap: 20px; 35 | } 36 | 37 | .cancelBtn { 38 | font-size: 14px; 39 | font-weight: 500; 40 | font-family: var(--ifm-font-family-base); 41 | background-color: transparent; 42 | color: #369ea7; 43 | border-radius: 4px; 44 | border: 1px solid #369ea7; 45 | padding: 12px 8px; 46 | line-height: 0.8; 47 | width: max-content; 48 | cursor: pointer; 49 | } 50 | 51 | .resetBtn { 52 | font-size: 14px; 53 | font-weight: 500; 54 | font-family: var(--ifm-font-family-base); 55 | background-color: transparent; 56 | color: #df0101; 57 | border-radius: 4px; 58 | border: 1px solid #df0101; 59 | padding: 12px 8px; 60 | line-height: 0.8; 61 | width: max-content; 62 | cursor: pointer; 63 | } 64 | -------------------------------------------------------------------------------- /src/components/atoms/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useSorobanReact } from "@soroban-react/core"; 3 | import styles from "./style.module.css"; 4 | 5 | export interface ConnectButtonProps { 6 | label: string; 7 | isHigher?: boolean; 8 | } 9 | 10 | export function ConnectButton({ label, isHigher }: ConnectButtonProps) { 11 | const { connect } = useSorobanReact(); 12 | const openConnectModal = async () => { 13 | await connect(); 14 | }; 15 | 16 | return ( 17 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /src/components/atoms/start-challenge-button/style.module.css: -------------------------------------------------------------------------------- 1 | .button { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: center; 5 | align-items: center; 6 | padding: 12px 8px; 7 | margin-bottom: 20px; 8 | gap: 8px; 9 | background: #FFD748; 10 | color: #222222; 11 | border-radius: 4px; 12 | border: 0; 13 | font-family: var(--ifm-font-family-base); 14 | font-weight: 600; 15 | font-size: 14px; 16 | cursor: pointer; 17 | } 18 | 19 | .button:disabled { 20 | background-color: #ECECEC; 21 | color: #9F9F9F; 22 | cursor: not-allowed; 23 | } 24 | 25 | .notification { 26 | display: flex; 27 | align-items: center; 28 | padding-left: 16px; 29 | } 30 | 31 | .notificationText { 32 | color: #222222; 33 | font-size: 14px; 34 | font-weight: 500; 35 | font-family: var(--ifm-font-family-base); 36 | margin-left: 8px; 37 | } -------------------------------------------------------------------------------- /src/components/atoms/style.module.css: -------------------------------------------------------------------------------- 1 | .button { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: center; 5 | align-items: center; 6 | padding: 16px 12px; 7 | gap: 8px; 8 | background: #1a1523; 9 | border-radius: 8px; 10 | border: 0; 11 | height: 38px; 12 | font-weight: 600; 13 | font-size: 14px; 14 | line-height: 22px; 15 | color: #ffffff; 16 | cursor: pointer; 17 | } 18 | 19 | .higher { 20 | height: 58px; 21 | } -------------------------------------------------------------------------------- /src/components/molecules/SortableTable/index.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react" 2 | import styles from "./style.module.css"; 3 | 4 | const arrowDown = ; 5 | const arrowUp = ; 6 | 7 | const SortableTable = (props) => { 8 | const [isAscending, setIsAscending] = useState(false); 9 | const [sortColumn, setSortColumn] = useState(null) 10 | 11 | const sortTable = (val) => { 12 | const sortDirection = col === val ? !isAscending : false 13 | setIsAscending(sortDirection) 14 | setSortColumn(val) 15 | } 16 | 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {props.children} 28 | 29 |
TitleLinkTags
30 | ) 31 | } 32 | 33 | export default SortableTable 34 | -------------------------------------------------------------------------------- /src/components/molecules/SortableTable/style.module.css: -------------------------------------------------------------------------------- 1 | .sortable { 2 | width: 100%; 3 | display: table; 4 | } 5 | -------------------------------------------------------------------------------- /src/contants.ts: -------------------------------------------------------------------------------- 1 | export const FUTURENET_DETAILS = { 2 | network: "FUTURENET", 3 | networkUrl: "https://horizon-futurenet.stellar.org", 4 | networkPassphrase: "Test SDF Future Network ; October 2022", 5 | }; 6 | -------------------------------------------------------------------------------- /src/css/components/_doc-page.scss: -------------------------------------------------------------------------------- 1 | #__docusaurus { 2 | .main-wrapper > div { 3 | max-width: var(--page-max-width); 4 | margin: 0 auto; 5 | } 6 | 7 | .theme-doc-markdown { 8 | h1 { 9 | font-size: 2rem; 10 | } 11 | 12 | h2 { 13 | font-size: 1.5rem; 14 | } 15 | 16 | h3 { 17 | font-size: 1.125rem; 18 | } 19 | 20 | code { 21 | color: var(--ifm-color-primary); 22 | } 23 | 24 | a { 25 | font-weight: 500; 26 | } 27 | 28 | table { 29 | font-size: 0.875rem; 30 | 31 | thead { 32 | background-color: transparent; 33 | border: none; 34 | } 35 | 36 | tr { 37 | border: none; 38 | } 39 | 40 | th { 41 | padding-left: 0; 42 | text-transform: uppercase; 43 | text-align: left; 44 | border: none; 45 | min-width: 8.5rem; 46 | } 47 | } 48 | } 49 | 50 | .container > .row > .col:not([class*='col--']) { 51 | padding: 0 4rem; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/css/components/_footer.scss: -------------------------------------------------------------------------------- 1 | #__docusaurus { 2 | --ifm-footer-padding-vertical: 4rem; 3 | --ifm-footer-background-color: var(--ifm-background-surface-color); 4 | 5 | .footer { 6 | border-top: var(--ifm-global-border-width) solid var(--ifm-toc-border-color); 7 | } 8 | 9 | .footer__title { 10 | text-transform: uppercase; 11 | } 12 | 13 | .footer__link-item { 14 | text-decoration: none; 15 | svg { 16 | display: none; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/css/components/_navbar.scss: -------------------------------------------------------------------------------- 1 | #__docusaurus { 2 | .navbar { 3 | padding: 0; 4 | box-shadow: none; 5 | border-bottom: var(--ifm-global-border-width) solid 6 | var(--ifm-toc-border-color); 7 | } 8 | 9 | .navbar__inner { 10 | max-width: var(--page-max-width); 11 | padding: 0 var(--ifm-spacing-horizontal); 12 | margin: 0 auto; 13 | } 14 | 15 | .navbar__link svg { 16 | display: none; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/css/components/_sidebar.scss: -------------------------------------------------------------------------------- 1 | #__docusaurus { 2 | --ifm-menu-color-background-active: transparent; 3 | // --ifm-menu-color-background-hover: transparent; 4 | 5 | .theme-doc-sidebar-container { 6 | clip-path: none; 7 | position: relative; 8 | 9 | &::before { 10 | content: ''; 11 | position: absolute; 12 | inset: 0 0 0 -100rem; 13 | background-color: var(--ifm-background-surface-color); 14 | z-index: -2; 15 | } 16 | } 17 | 18 | .menu { 19 | padding-bottom: 4rem; 20 | margin-top: calc(-1 * var(--ifm-global-border-width)); 21 | border-top: var(--ifm-global-border-width) solid var(--ifm-toc-border-color); 22 | 23 | font-weight: var(--ifm-font-weight-normal); 24 | font-size: 0.875rem; 25 | } 26 | 27 | .menu__link--sublist-caret:after, 28 | .menu__caret:before { 29 | background-size: 1.25rem; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/css/components/_toc.scss: -------------------------------------------------------------------------------- 1 | #__docusaurus { 2 | .row .col[class*='col--'] { 3 | padding: 0; 4 | } 5 | 6 | .table-of-contents { 7 | font-size: 0.875rem; 8 | } 9 | 10 | .table-of-contents__link--active { 11 | position: relative; 12 | 13 | &::before { 14 | content: ''; 15 | position: absolute; 16 | height: 100%; 17 | width: calc(2 * var(--ifm-global-border-width)); 18 | left: calc( 19 | -2 * var(--ifm-toc-padding-horizontal) - var(--ifm-global-border-width) 20 | ); 21 | background-color: var(--ifm-color-primary); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/css/variables.scss: -------------------------------------------------------------------------------- 1 | $ifm-narrow-window: 997px; 2 | -------------------------------------------------------------------------------- /src/dev-server-plugin.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | 3 | module.exports = () => ({ 4 | name: "dev-server-plugin", 5 | 6 | configureWebpack(config) { 7 | config.module.rules.push({ 8 | test: /\.(js|mjs|jsx)$/, 9 | enforce: "pre", 10 | loader: require.resolve("source-map-loader"), 11 | resolve: { 12 | fullySpecified: false, 13 | }, 14 | }); 15 | 16 | return { 17 | devServer: { 18 | host: "0.0.0.0", 19 | client: { 20 | webSocketURL: { 21 | port: 0, 22 | }, 23 | }, 24 | }, 25 | resolve: { 26 | fallback: { 27 | path: false, 28 | }, 29 | }, 30 | plugins: [ 31 | new webpack.ProvidePlugin({ 32 | process: 'process', 33 | }), 34 | ], 35 | }; 36 | }, 37 | }); 38 | -------------------------------------------------------------------------------- /src/hooks/useAuth.tsx: -------------------------------------------------------------------------------- 1 | import { useContext, useState } from "react"; 2 | import { toast } from "react-toastify"; 3 | import UserChallengesContext, { 4 | UserChallengesContextProps, 5 | } from "../store/user-challenges-context"; 6 | 7 | // Import the Freighter library 8 | import { isConnected, setAllowed, getPublicKey } from "@stellar/freighter-api"; 9 | 10 | const useAuth = () => { 11 | const { address, setAddress } = useContext( 12 | UserChallengesContext 13 | ); 14 | 15 | const [loading, setLoading] = useState(false); 16 | 17 | const disconnect = () => { 18 | setAddress(""); 19 | }; 20 | 21 | const connect = async () => { 22 | try { 23 | setLoading(true); 24 | 25 | // Check if the user has Freighter installed 26 | if (await isConnected()) { 27 | // Prompt the user for authorization if needed 28 | await setAllowed(); 29 | 30 | // Retrieve the user's public key 31 | const publicKey = await getPublicKey(); 32 | 33 | // Store the user's public key in the context 34 | setAddress(publicKey); 35 | 36 | setLoading(false); 37 | 38 | return true; 39 | } else { 40 | // Handle the case where Freighter is not installed 41 | toast("Freighter is not installed!", { 42 | type: "error", 43 | hideProgressBar: true, 44 | position: "top-center", 45 | autoClose: 2000, 46 | }); 47 | return false; 48 | } 49 | } catch (e) { 50 | console.error("Connection error", e); 51 | 52 | toast("Connection error!", { 53 | type: "error", 54 | hideProgressBar: true, 55 | position: "top-center", 56 | autoClose: 2000, 57 | }); 58 | return false; 59 | } 60 | }; 61 | 62 | const onConnectFreighter = () => { 63 | // Call the connect function to initiate the Freighter connection 64 | connect(); 65 | }; 66 | 67 | return { 68 | address, 69 | isConnected: !!address, 70 | loading, 71 | connect: onConnectFreighter, 72 | disconnect, 73 | }; 74 | }; 75 | 76 | export default useAuth; 77 | -------------------------------------------------------------------------------- /src/interfaces/challenge.ts: -------------------------------------------------------------------------------- 1 | export interface UserChallengeData { 2 | userId: string; 3 | challenge: ChallengeInfo; 4 | } 5 | 6 | export interface UpdateProgressData { 7 | userId: string; 8 | challengeId: number; 9 | challengeProgress: number; 10 | url?: string; 11 | startDate?: number; 12 | completedAt?: number; 13 | contractId?: string; 14 | totalValueLocked?: number; 15 | } 16 | 17 | export interface Ranking { 18 | current: number; 19 | total: number; 20 | } 21 | 22 | export interface Leaderboard { 23 | userId: string; 24 | ranking: Ranking; 25 | totalValueLocked: number; 26 | minutesSpent: number; 27 | challengesCompleted: number; 28 | } 29 | 30 | export interface Challenge { 31 | id: number; 32 | name: string; 33 | milestonesAmount: number; 34 | isPullRequestRequired: boolean; 35 | } 36 | 37 | export interface ChallengeInfo extends Challenge { 38 | progress?: number; 39 | url?: string; 40 | contractId?: string; 41 | startDate?: number; 42 | completedAt?: number; 43 | isCompleted?: boolean; 44 | totalValueLocked?: number; 45 | } 46 | 47 | export interface UserProgress { 48 | userId: string; 49 | completedChallenges: number; 50 | ranking: Ranking; 51 | challenges: ChallengeInfo[]; 52 | } 53 | -------------------------------------------------------------------------------- /src/pages/dashboard/style.module.css: -------------------------------------------------------------------------------- 1 | .dashboard { 2 | display: flex; 3 | flex-direction: column; 4 | flex: 1; 5 | background-color: #F9F9F9; 6 | } 7 | 8 | .dashboardContent { 9 | flex-grow: 2; 10 | width: 75%; 11 | margin: 32px auto; 12 | } 13 | 14 | .dashboardFooter { 15 | display: flex; 16 | justify-content: flex-end; 17 | align-items: center; 18 | flex: 0; 19 | background-color: #FFFFFF; 20 | color: #585858; 21 | padding: 16px 10%; 22 | } 23 | 24 | .challengeCards { 25 | padding: 0; 26 | display: grid; 27 | grid-template-columns: repeat(3, 1fr); 28 | grid-template-rows: max-content; 29 | grid-gap: 30px; 30 | } 31 | 32 | .loginButton { 33 | font-size: 14px; 34 | font-weight: 500; 35 | font-family: var(--ifm-font-family-base); 36 | background-color: #369EA7; 37 | color: #FFFFFF; 38 | border-radius: 4px; 39 | border: none; 40 | padding: 12px 8px; 41 | line-height: 0.8; 42 | width: max-content; 43 | cursor: pointer; 44 | margin-left: 32px; 45 | } 46 | -------------------------------------------------------------------------------- /src/services/challenges.ts: -------------------------------------------------------------------------------- 1 | import { AxiosResponse } from "axios"; 2 | import { 3 | Challenge, 4 | UserChallengeData, 5 | UpdateProgressData, 6 | UserProgress, 7 | } from "../interfaces/challenge"; 8 | import { httpClient } from "./http-client"; 9 | 10 | export const fetchInitialChallenges = async () => { 11 | return await httpClient.get("/challenges"); 12 | }; 13 | 14 | export const fetchUserProgress = async (userId: string) => { 15 | return await httpClient.get("/users", { 16 | validateStatus: (status) => { 17 | return (status >= 200 && status < 300) || status === 404; 18 | }, 19 | params: { userId }, 20 | }); 21 | }; 22 | 23 | export const resetUserProgress = async (userId: string) => { 24 | return await httpClient.delete("/users", { 25 | params: { userId }, 26 | }); 27 | }; 28 | 29 | export const updateUserProgress = async (challenge: UpdateProgressData) => { 30 | return await httpClient.post< 31 | Partial, 32 | AxiosResponse 33 | >("/", challenge); 34 | }; 35 | -------------------------------------------------------------------------------- /src/services/http-client.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios"; 2 | 3 | const headers: Readonly> = { 4 | Accept: "application/json", 5 | "Content-Type": "application/json; charset=utf-8", 6 | "Access-Control-Allow-Credentials": true, 7 | }; 8 | 9 | class HttpClient { 10 | private instance: AxiosInstance | null = null; 11 | 12 | private get http(): AxiosInstance { 13 | return this.instance != null ? this.instance : this.initHttp(); 14 | } 15 | 16 | get>( 17 | url: string, 18 | config?: AxiosRequestConfig, 19 | ): Promise { 20 | return this.http.get(url, config); 21 | } 22 | 23 | post>( 24 | url: string, 25 | data?: T, 26 | config?: AxiosRequestConfig, 27 | ): Promise { 28 | return this.http.post(url, data, config); 29 | } 30 | 31 | put>( 32 | url: string, 33 | data?: T, 34 | config?: AxiosRequestConfig, 35 | ): Promise { 36 | return this.http.put(url, data, config); 37 | } 38 | 39 | patch>( 40 | url: string, 41 | data?: T, 42 | config?: AxiosRequestConfig, 43 | ): Promise { 44 | return this.http.patch(url, data, config); 45 | } 46 | 47 | delete>( 48 | url: string, 49 | config?: AxiosRequestConfig, 50 | ): Promise { 51 | return this.http.delete(url, config); 52 | } 53 | 54 | private initHttp() { 55 | const http = axios.create({ 56 | baseURL: 57 | "https://soroban-dapps-challenge-wrangler.julian-martinez.workers.dev", 58 | headers, 59 | }); 60 | 61 | this.instance = http; 62 | return http; 63 | } 64 | } 65 | 66 | export const httpClient = new HttpClient(); 67 | -------------------------------------------------------------------------------- /src/services/leaderboard.ts: -------------------------------------------------------------------------------- 1 | import { Leaderboard } from "../interfaces/challenge"; 2 | import { httpClient } from "./http-client"; 3 | 4 | export enum LeaderboardColumn { 5 | ChallengesCompleted = "challengesCompleted", 6 | MinutesSpent = "minutesSpent", 7 | TotalValueLocked = "totalValueLocked", 8 | } 9 | 10 | export type LeaderboardParams = { 11 | colName?: LeaderboardColumn; 12 | direction?: "asc" | "desc"; 13 | pageNumber?: number; 14 | }; 15 | 16 | export const fetchLeaderboard = async ({ 17 | colName, 18 | direction = "asc", 19 | pageNumber, 20 | }: LeaderboardParams) => { 21 | return await httpClient.get("/leaderboard", { 22 | params: { 23 | ...(colName 24 | ? { 25 | sort: `${colName},${direction}`, 26 | } 27 | : {}), 28 | ...(pageNumber ? { pageNumber } : {}), 29 | }, 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /src/store/user-challenges-context.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { ChallengeInfo } from "../interfaces/challenge"; 3 | 4 | export type UserChallengesContextProps = { 5 | data: ChallengeInfo[]; 6 | address: string; 7 | setData: (data: ChallengeInfo[]) => void; 8 | updateProgress: (item: ChallengeInfo) => void; 9 | setAddress: (address: string) => void; 10 | }; 11 | 12 | const UserChallengesContext = React.createContext({ 13 | data: [], 14 | address: "", 15 | setData: () => {}, 16 | updateProgress: () => {}, 17 | setAddress: () => {}, 18 | }); 19 | 20 | export default UserChallengesContext; 21 | -------------------------------------------------------------------------------- /src/theme/DocCardList/style.module.css: -------------------------------------------------------------------------------- 1 | .docCardFilterSelect { 2 | padding: 0.75rem; 3 | width: 100%; 4 | margin-bottom: 1rem; 5 | font-size: var(--ifm-font-size-base); 6 | border-radius: 5px; 7 | } 8 | 9 | .docCardFilterSearch { 10 | padding: 0.74rem; 11 | width: 100%; 12 | margin-bottom: 1rem; 13 | font-size: var(--ifm-font-size-base); 14 | border-radius: 5px; 15 | } 16 | -------------------------------------------------------------------------------- /src/theme/DocItem/Footer/styles.module.css: -------------------------------------------------------------------------------- 1 | .lastUpdated { 2 | margin-top: 0.2rem; 3 | font-style: italic; 4 | font-size: smaller; 5 | } 6 | 7 | @media (min-width: 997px) { 8 | .lastUpdated { 9 | text-align: right; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/theme/Root.tsx: -------------------------------------------------------------------------------- 1 | import React, { PropsWithChildren } from "react"; 2 | import { futurenet, sandbox, standalone, testnet } from "@soroban-react/chains"; 3 | import { SorobanReactProvider } from "@soroban-react/core"; 4 | import { freighter } from "@soroban-react/freighter"; 5 | import { ChainMetadata, Connector } from "@soroban-react/types"; 6 | import { ToastContainer } from "react-toastify"; 7 | import UserChallengesContextProvider from "../store/UserChallengesContextProvider"; 8 | import "react-toastify/dist/ReactToastify.css"; 9 | import "./style.module.css"; 10 | 11 | const chains: ChainMetadata[] = [sandbox, futurenet, testnet, standalone]; 12 | const connectors: Connector[] = [freighter()]; 13 | 14 | export default function Root({ children }: PropsWithChildren) { 15 | return ( 16 | 22 | 23 | 24 | {children} 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /src/theme/style.module.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --toastify-toast-width: 400px; 3 | } -------------------------------------------------------------------------------- /src/utils/get-active-challenge.ts: -------------------------------------------------------------------------------- 1 | import { ChallengeInfo } from "../interfaces/challenge"; 2 | 3 | export const getActiveChallenge = ( 4 | data: ChallengeInfo[], 5 | challengeId: number, 6 | ): ChallengeInfo | undefined => { 7 | return data.find((item: ChallengeInfo) => item.id === challengeId); 8 | }; 9 | -------------------------------------------------------------------------------- /src/utils/get-contract-balance.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Contract, 3 | scValToBigInt, 4 | TransactionBuilder, 5 | TimeoutInfinite, 6 | Address, 7 | SorobanRpc 8 | } from "@stellar/stellar-sdk"; 9 | import { FUTURENET_DETAILS } from "../contants"; 10 | 11 | const XLM_DECIMALS = 7; 12 | 13 | const BASE_FEE = "100"; 14 | const RPC_URLS: { [key: string]: string } = { 15 | FUTURENET: "https://rpc-futurenet.stellar.org/", 16 | }; 17 | const server = new SorobanRpc.Server(RPC_URLS[FUTURENET_DETAILS.network]); 18 | 19 | function formatAmount( 20 | undivided: bigint, 21 | decimals?: number = XLM_DECIMALS, 22 | ): string { 23 | const n = 24 | undivided.valueOf() < BigInt(Number.MAX_SAFE_INTEGER) 25 | ? Number(undivided) / 10 ** decimals 26 | : undivided.valueOf() / 10n ** BigInt(decimals); 27 | return String(n); 28 | } 29 | 30 | export const getContractBalance = async ( 31 | contractId: string, 32 | address: string, 33 | ): Promise => { 34 | const account = await server.getAccount(address); 35 | const contract = new Contract(contractId); 36 | const params = [new Address(address).toScVal()]; 37 | 38 | const transaction = new TransactionBuilder(account, { 39 | fee: BASE_FEE, 40 | networkPassphrase: FUTURENET_DETAILS.networkPassphrase, 41 | }) 42 | .addOperation(contract.call("balance", ...params)) 43 | .setTimeout(TimeoutInfinite) 44 | .build(); 45 | 46 | const response = await server.simulateTransaction(transaction); 47 | if (!SorobanRpc.Api.isSimulationSuccess(response)) { 48 | throw response; 49 | } 50 | 51 | const balanceStr = formatAmount(scValToBigInt(response.result!.retval)); 52 | return +balanceStr; 53 | }; 54 | -------------------------------------------------------------------------------- /static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/.nojekyll -------------------------------------------------------------------------------- /static/diagrams/environment-concepts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/diagrams/environment-concepts.png -------------------------------------------------------------------------------- /static/icons/icon-avatar-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /static/icons/icon-avatar-10.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/icons/icon-avatar-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /static/icons/icon-avatar-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /static/icons/icon-avatar-5.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /static/icons/icon-avatar-6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /static/icons/icon-avatar-9.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/icons/icon-copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /static/icons/icon-ranking.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/icons/icon-star-yellow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/icons/icon-star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /static/icons/smiley-face-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /static/icons/smiley-face-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/icons/thumbs-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/thumbs-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/add_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/add_token.png -------------------------------------------------------------------------------- /static/img/added_balance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/added_balance.png -------------------------------------------------------------------------------- /static/img/approveTokenMint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/approveTokenMint.png -------------------------------------------------------------------------------- /static/img/approveTxn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/approveTxn.png -------------------------------------------------------------------------------- /static/img/aucb_balance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/aucb_balance.png -------------------------------------------------------------------------------- /static/img/back100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/back100.png -------------------------------------------------------------------------------- /static/img/backedResult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/backedResult.png -------------------------------------------------------------------------------- /static/img/balance_rcvr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/balance_rcvr.png -------------------------------------------------------------------------------- /static/img/choose_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/choose_token.png -------------------------------------------------------------------------------- /static/img/confirm_mint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/confirm_mint.png -------------------------------------------------------------------------------- /static/img/confirm_pmt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/confirm_pmt.png -------------------------------------------------------------------------------- /static/img/connect_freighter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/connect_freighter.png -------------------------------------------------------------------------------- /static/img/connect_freighter_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/connect_freighter_example.png -------------------------------------------------------------------------------- /static/img/connect_wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/connect_wallet.png -------------------------------------------------------------------------------- /static/img/counter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/counter.png -------------------------------------------------------------------------------- /static/img/dashboard-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/dashboard-bg.png -------------------------------------------------------------------------------- /static/img/deploy-counter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/deploy-counter.png -------------------------------------------------------------------------------- /static/img/deployed-contracts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/deployed-contracts.png -------------------------------------------------------------------------------- /static/img/deployedDApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/deployedDApp.png -------------------------------------------------------------------------------- /static/img/deposit50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/deposit50.png -------------------------------------------------------------------------------- /static/img/docusaurus-social-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/docusaurus-social-card.jpg -------------------------------------------------------------------------------- /static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/docusaurus.png -------------------------------------------------------------------------------- /static/img/dt_acct_bal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/dt_acct_bal.png -------------------------------------------------------------------------------- /static/img/end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/end.png -------------------------------------------------------------------------------- /static/img/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/example.png -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/favicon.ico -------------------------------------------------------------------------------- /static/img/freighter_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/freighter_settings.png -------------------------------------------------------------------------------- /static/img/futurenetDeployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/futurenetDeployment.png -------------------------------------------------------------------------------- /static/img/gear_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/gear_icon.png -------------------------------------------------------------------------------- /static/img/hex2str.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/hex2str.png -------------------------------------------------------------------------------- /static/img/increment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/increment.png -------------------------------------------------------------------------------- /static/img/input_token_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/input_token_id.png -------------------------------------------------------------------------------- /static/img/landing/designed-for-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/group-245.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/img/landing/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/img/landing/icon3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/img/landing/icon4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/img/landing/icon6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/image-11.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/image-111@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/landing/image-111@3x.png -------------------------------------------------------------------------------- /static/img/landing/image-1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/landing/image-1@2x.png -------------------------------------------------------------------------------- /static/img/landing/image-23.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/image-231@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/landing/image-231@3x.png -------------------------------------------------------------------------------- /static/img/landing/image-39@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/landing/image-39@2x.png -------------------------------------------------------------------------------- /static/img/landing/image-4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/landing/image-4@2x.png -------------------------------------------------------------------------------- /static/img/landing/image-54.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/twitter-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector-6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector-7.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector-8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/vector4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/img/landing/youtube-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /static/img/leaderboard-placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/leaderboard-placeholder.png -------------------------------------------------------------------------------- /static/img/manage_assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/manage_assets.png -------------------------------------------------------------------------------- /static/img/meta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/meta.png -------------------------------------------------------------------------------- /static/img/mintToken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/mintToken.png -------------------------------------------------------------------------------- /static/img/mint_amt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/mint_amt.png -------------------------------------------------------------------------------- /static/img/mint_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/mint_token.png -------------------------------------------------------------------------------- /static/img/mint_token_landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/mint_token_landing.png -------------------------------------------------------------------------------- /static/img/mint_tokens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/mint_tokens.png -------------------------------------------------------------------------------- /static/img/mint_tx_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/mint_tx_result.png -------------------------------------------------------------------------------- /static/img/new_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/new_token.png -------------------------------------------------------------------------------- /static/img/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/next.png -------------------------------------------------------------------------------- /static/img/oracle_approve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_approve.png -------------------------------------------------------------------------------- /static/img/oracle_balance_contract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_balance_contract.png -------------------------------------------------------------------------------- /static/img/oracle_balance_user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_balance_user.png -------------------------------------------------------------------------------- /static/img/oracle_calculate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_calculate.png -------------------------------------------------------------------------------- /static/img/oracle_connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_connect.png -------------------------------------------------------------------------------- /static/img/oracle_deployed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_deployed.png -------------------------------------------------------------------------------- /static/img/oracle_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_home.png -------------------------------------------------------------------------------- /static/img/oracle_mint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_mint.png -------------------------------------------------------------------------------- /static/img/oracle_mintBal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/oracle_mintBal.png -------------------------------------------------------------------------------- /static/img/payment_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/payment_settings.png -------------------------------------------------------------------------------- /static/img/pmt_dest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/pmt_dest.png -------------------------------------------------------------------------------- /static/img/preferences_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/preferences_menu.png -------------------------------------------------------------------------------- /static/img/select_token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/select_token.png -------------------------------------------------------------------------------- /static/img/sign_tx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/sign_tx.png -------------------------------------------------------------------------------- /static/img/soroban-fav-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/soroban-fav-icon.png -------------------------------------------------------------------------------- /static/img/soroban_fees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/soroban_fees.png -------------------------------------------------------------------------------- /static/img/stellar-logo-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/stellar-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/img/submit_mint_tx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/submit_mint_tx.png -------------------------------------------------------------------------------- /static/img/submit_pmt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/submit_pmt.png -------------------------------------------------------------------------------- /static/img/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/success.png -------------------------------------------------------------------------------- /static/img/swap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/swap.png -------------------------------------------------------------------------------- /static/img/swapComplete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/swapComplete.png -------------------------------------------------------------------------------- /static/img/timeline-drk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/timeline-drk.png -------------------------------------------------------------------------------- /static/img/timeline-lgt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/timeline-lgt.png -------------------------------------------------------------------------------- /static/img/token_to_mint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/token_to_mint.png -------------------------------------------------------------------------------- /static/img/tutorial/docsVersionDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/tutorial/docsVersionDropdown.png -------------------------------------------------------------------------------- /static/img/tutorial/localeDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/tutorial/localeDropdown.png -------------------------------------------------------------------------------- /static/img/tx_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/tx_settings.png -------------------------------------------------------------------------------- /static/img/updatedBalance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/updatedBalance.png -------------------------------------------------------------------------------- /static/img/updatedBalances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/updatedBalances.png -------------------------------------------------------------------------------- /static/img/updatedBalances50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/updatedBalances50.png -------------------------------------------------------------------------------- /static/img/vault-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/vault-project.png -------------------------------------------------------------------------------- /static/img/wallet_connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/wallet_connected.png -------------------------------------------------------------------------------- /static/img/wdraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stellar-deprecated/soroban-docs/058c77a1f4af65ace75dc4bd902b027a32339ee5/static/img/wdraw.png -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | # Algolia-Crawler-Verif: 14A6F6C8BF9C907E 2 | 3 | User-agent: * 4 | Allow: / 5 | Sitemap: https://soroban.stellar.org/sitemap.xml -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "baseUrl": "./src", 5 | "jsx": "react", 6 | "moduleResolution": "NodeNext" 7 | }, 8 | "exclude": ["node_modules", "**/node_modules/*"], 9 | "extends": "@stellar/tsconfig" 10 | } 11 | --------------------------------------------------------------------------------