├── stai ├── py.typed ├── clvm │ ├── __init__.py │ └── singleton.py ├── cmds │ ├── __init__.py │ ├── units.py │ ├── plotters.py │ ├── plotnft.py │ └── start.py ├── daemon │ └── __init__.py ├── farmer │ └── __init__.py ├── pools │ └── __init__.py ├── rpc │ └── __init__.py ├── seeder │ └── __init__.py ├── server │ └── __init__.py ├── ssl │ └── __init__.py ├── types │ ├── __init__.py │ ├── blockchain_format │ │ ├── __init__.py │ │ ├── pool_target.py │ │ └── sized_bytes.py │ ├── coin_solution.py │ ├── mempool_inclusion_status.py │ ├── condition_with_args.py │ ├── end_of_slot_bundle.py │ └── block_protocol.py ├── util │ ├── __init__.py │ ├── hash.py │ ├── chunks.py │ ├── make_test_constants.py │ ├── log_exceptions.py │ ├── safe_cancel_task.py │ ├── default_root.py │ ├── pip_import.py │ ├── recursive_replace.py │ └── setproctitle.py ├── wallet │ ├── __init__.py │ ├── util │ │ ├── __init__.py │ │ └── transaction_type.py │ ├── puzzles │ │ ├── __init__.py │ │ ├── prefarm │ │ │ └── __init__.py │ │ ├── lock.inner.puzzle.clvm.hex │ │ ├── create-lock-puzzlehash.clvm.hex.sha256tree │ │ ├── p2_conditions.clvm.hex │ │ ├── test_generator_deserialize.clvm.hex │ │ ├── decompress_puzzle.clvm.hex │ │ ├── calculate_synthetic_public_key.clvm.hex │ │ ├── create-lock-puzzlehash.clvm.hex │ │ ├── p2_conditions.clvm │ │ ├── cat_v2.clvm.hex.sha256tree │ │ ├── rl.clvm.hex.sha256tree │ │ ├── condition_codes.clvm.hex │ │ ├── delegated_tail.clvm.hex.sha256tree │ │ ├── did_innerpuz.clvm.hex.sha256tree │ │ ├── genesis_by_coin_id.clvm.hex.sha256tree │ │ ├── lock.inner.puzzle.clvm │ │ ├── nft_ownership_layer.clvm.hex.sha256tree │ │ ├── p2_conditions.clvm.hex.sha256tree │ │ ├── p2_puzzle_hash.clvm.hex.sha256tree │ │ ├── p2_singleton.clvm.hex.sha256tree │ │ ├── rl_aggregation.clvm.hex.sha256tree │ │ ├── block_program_zero.clvm.hex.sha256tree │ │ ├── decompress_puzzle.clvm.hex.sha256tree │ │ ├── genesis_by_puzzle_hash.clvm.hex.sha256tree │ │ ├── lock.inner.puzzle.clvm.hex.sha256tree │ │ ├── nft_state_layer.clvm.hex.sha256tree │ │ ├── p2_delegated_puzzle.clvm.hex.sha256tree │ │ ├── settlement_payments.clvm.hex.sha256tree │ │ ├── sha256tree_module.clvm.hex.sha256tree │ │ ├── singleton_launcher.clvm.hex.sha256tree │ │ ├── singleton_top_layer.clvm.hex.sha256tree │ │ ├── everything_with_signature.clvm.hex.sha256tree │ │ ├── nft_metadata_updater.clvm.hex.sha256tree │ │ ├── p2_delegated_conditions.clvm.hex.sha256tree │ │ ├── pool_member_innerpuz.clvm.hex.sha256tree │ │ ├── rom_bootstrap_generator.clvm.hex.sha256tree │ │ ├── singleton_top_layer_v1_1.clvm.hex.sha256tree │ │ ├── stailisp_deserialisation.clvm.hex.sha256tree │ │ ├── decompress_coin_spend_entry.clvm.hex.sha256tree │ │ ├── everything_with_signature.clvm.hex │ │ ├── generator_for_single_coin.clvm.hex.sha256tree │ │ ├── genesis_by_coin_id.clvm.hex │ │ ├── nft_metadata_updater_default.clvm.hex.sha256tree │ │ ├── p2_m_of_n_delegate_direct.clvm.hex.sha256tree │ │ ├── pool_waitingroom_innerpuz.clvm.hex.sha256tree │ │ ├── test_generator_deserialize.clvm.hex.sha256tree │ │ ├── calculate_synthetic_public_key.clvm.hex.sha256tree │ │ ├── nft_metadata_updater_updateable.clvm.hex.sha256tree │ │ ├── p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree │ │ ├── decompress_coin_spend_entry_with_prefix.clvm.hex.sha256tree │ │ ├── p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree │ │ ├── test_multiple_generator_input_arguments.clvm.hex.sha256tree │ │ ├── test_generator_deserialize.clvm │ │ ├── decompress_coin_spend_entry.clvm.hex │ │ ├── genesis_by_puzzle_hash.clvm.hex │ │ ├── nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree │ │ ├── decompress_coin_spend_entry_with_prefix.clvm.hex │ │ ├── decompress_puzzle.clvm │ │ ├── rl_aggregation.clvm.hex │ │ ├── calculate_synthetic_public_key.clvm │ │ ├── generator_loader.py │ │ ├── cat_loader.py │ │ ├── sha256tree_module.clvm.hex │ │ ├── index_lock.clvm.hex │ │ ├── rom_bootstrap_generator.py │ │ ├── decompress_coin_spend_entry.clvm │ │ ├── p2_delegated_conditions.clvm.hex │ │ ├── p2_puzzle_hash.clvm.hex │ │ ├── p2_delegated_puzzle.clvm.hex │ │ ├── sha256tree.clib │ │ ├── decompress_coin_spend_entry_with_prefix.clvm │ │ ├── block_program_zero.clvm.hex │ │ ├── singleton_launcher.clvm.hex │ │ ├── delegated_tail.clvm.hex │ │ ├── utility_macros.clib │ │ ├── sha256tree_module.clvm │ │ ├── everything_with_signature.clvm │ │ ├── nft_metadata_updater_updateable.clvm.hex │ │ ├── p2_delegated_puzzle_or_hidden_puzzle.clvm.hex │ │ ├── test_multiple_generator_input_arguments.clvm.hex │ │ ├── p2_delegated_conditions.clvm │ │ ├── nft_metadata_updater_default.clvm.hex │ │ ├── p2_puzzle_hash.clvm │ │ ├── settlement_payments.clvm.hex │ │ ├── singleton_launcher.clvm │ │ ├── p2_delegated_puzzle.clvm │ │ ├── p2_delegated_conditions.py │ │ ├── recompile-all.sh │ │ └── create-lock-puzzlehash.clvm │ ├── rl_wallet │ │ └── __init__.py │ ├── settings │ │ ├── __init__.py │ │ └── default_settings.py │ ├── trading │ │ ├── __init__.py │ │ └── trade_status.py │ ├── cat_wallet │ │ ├── __init__.py │ │ └── cat_constants.py │ ├── did_wallet │ │ └── __init__.py │ ├── nft_wallet │ │ └── __init__.py │ └── transaction_sorting.py ├── consensus │ ├── __init__.py │ ├── network_type.py │ ├── condition_costs.py │ └── cost_calculator.py ├── full_node │ ├── __init__.py │ └── signage_point.py ├── harvester │ └── __init__.py ├── introducer │ └── __init__.py ├── plot_sync │ ├── __init__.py │ └── util.py ├── plotters │ └── __init__.py ├── plotting │ └── __init__.py ├── protocols │ ├── __init__.py │ └── protocol_timing.py ├── simulator │ ├── __init__.py │ ├── simulator_protocol.py │ └── simulator_constants.py ├── timelord │ ├── __init__.py │ └── types.py └── __init__.py ├── tests ├── __init__.py ├── clvm │ ├── __init__.py │ └── config.py ├── core │ ├── __init__.py │ ├── cmds │ │ ├── __init__.py │ │ └── config.py │ ├── ssl │ │ ├── __init__.py │ │ └── config.py │ ├── util │ │ ├── __init__.py │ │ └── config.py │ ├── consensus │ │ ├── __init__.py │ │ └── config.py │ ├── daemon │ │ ├── __init__.py │ │ └── config.py │ ├── full_node │ │ ├── __init__.py │ │ ├── dos │ │ │ ├── __init__.py │ │ │ └── config.py │ │ ├── full_sync │ │ │ ├── __init__.py │ │ │ └── config.py │ │ ├── stores │ │ │ ├── __init__.py │ │ │ └── config.py │ │ └── config.py │ ├── server │ │ ├── __init__.py │ │ └── config.py │ ├── custom_types │ │ ├── __init__.py │ │ └── config.py │ ├── config.py │ └── test_setproctitle.py ├── pools │ ├── __init__.py │ └── config.py ├── tools │ ├── __init__.py │ ├── config.py │ ├── test-blockchain-db.sqlite │ └── test_full_sync.py ├── util │ ├── __init__.py │ ├── config.py │ ├── protocol_messages_bytes-v1.0 │ ├── temp_file.py │ └── rpc.py ├── blockchain │ ├── __init__.py │ └── config.py ├── generator │ ├── __init__.py │ └── config.py ├── plot_sync │ ├── __init__.py │ └── config.py ├── plotting │ ├── __init__.py │ ├── config.py │ └── util.py ├── simulation │ ├── __init__.py │ └── config.py ├── wallet │ ├── __init__.py │ ├── rpc │ │ ├── __init__.py │ │ └── config.py │ ├── sync │ │ ├── __init__.py │ │ └── config.py │ ├── cat_wallet │ │ ├── __init__.py │ │ └── config.py │ ├── did_wallet │ │ ├── __init__.py │ │ └── config.py │ ├── nft_wallet │ │ ├── __init__.py │ │ └── config.py │ ├── rl_wallet │ │ └── __init__.py │ ├── simple_sync │ │ ├── __init__.py │ │ └── config.py │ └── config.py ├── weight_proof │ ├── __init__.py │ └── config.py ├── farmer_harvester │ ├── __init__.py │ └── config.py ├── runner_templates │ ├── __init__.py │ ├── install-timelord.include.yml │ └── check-resource-usage.include.yml └── testconfig.py ├── tools └── __init__.py ├── benchmarks ├── __init__.py ├── clvm_generator.bin └── jsonify.py ├── mozilla-ca ├── __init__.py └── README.md ├── stai-blockchain-gui ├── .npmrc ├── packages │ ├── core │ │ ├── src │ │ │ ├── utils │ │ │ │ ├── getUnit │ │ │ │ ├── sleep.ts │ │ │ │ ├── isWindows.ts │ │ │ │ ├── getPoolInfo.ts │ │ │ │ ├── useColorModeValue.ts │ │ │ │ ├── catToMojo.ts │ │ │ │ ├── mojoToCAT.ts │ │ │ │ ├── mojoToStai.ts │ │ │ │ ├── staiToMojo.ts │ │ │ │ ├── mojoToCATLocaleString.ts │ │ │ │ ├── mojoToStaiLocaleString.ts │ │ │ │ ├── activateLocale.ts │ │ │ │ ├── normalizePoolState.ts │ │ │ │ ├── blockHeightToTimestamp.ts │ │ │ │ ├── removeOldPoints.ts │ │ │ │ ├── validAddress.ts │ │ │ │ └── getPercentPointsSuccessfull.ts │ │ │ ├── components │ │ │ │ ├── CurrencyCode │ │ │ │ │ ├── CurrencyCode.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── Back │ │ │ │ │ └── index.ts │ │ │ │ ├── Fee │ │ │ │ │ └── index.ts │ │ │ │ ├── Fonts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── ionicons.eot │ │ │ │ │ ├── ionicons.ttf │ │ │ │ │ ├── ionicons.woff │ │ │ │ │ ├── Roboto-Light.ttf │ │ │ │ │ ├── ionicons.woff2 │ │ │ │ │ ├── Roboto-Medium.ttf │ │ │ │ │ ├── Roboto-Regular.ttf │ │ │ │ │ └── Fonts.tsx │ │ │ │ ├── Log │ │ │ │ │ └── index.ts │ │ │ │ ├── Card │ │ │ │ │ └── index.ts │ │ │ │ ├── Flex │ │ │ │ │ └── index.ts │ │ │ │ ├── Form │ │ │ │ │ └── index.ts │ │ │ │ ├── Link │ │ │ │ │ └── index.ts │ │ │ │ ├── Logo │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Logo.tsx │ │ │ │ ├── More │ │ │ │ │ └── index.ts │ │ │ │ ├── Spacer │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Spacer.tsx │ │ │ │ ├── Address │ │ │ │ │ └── index.ts │ │ │ │ ├── CardHero │ │ │ │ │ └── index.ts │ │ │ │ ├── CardSimple │ │ │ │ │ └── index.ts │ │ │ │ ├── CardStep │ │ │ │ │ └── index.ts │ │ │ │ ├── Checkbox │ │ │ │ │ └── index.ts │ │ │ │ ├── Dropzone │ │ │ │ │ └── index.ts │ │ │ │ ├── Heading │ │ │ │ │ └── index.ts │ │ │ │ ├── LayoutHero │ │ │ │ │ └── index.ts │ │ │ │ ├── LayoutMain │ │ │ │ │ └── index.ts │ │ │ │ ├── Loading │ │ │ │ │ └── index.ts │ │ │ │ ├── Select │ │ │ │ │ └── index.ts │ │ │ │ ├── Spinner │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Spinner.tsx │ │ │ │ ├── Suspender │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Suspender.tsx │ │ │ │ ├── Tooltip │ │ │ │ │ └── index.ts │ │ │ │ ├── Accordion │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Accordion.tsx │ │ │ │ ├── CardListItem │ │ │ │ │ └── index.ts │ │ │ │ ├── GuestRoute │ │ │ │ │ └── index.ts │ │ │ │ ├── IconButton │ │ │ │ │ ├── index.ts │ │ │ │ │ └── IconButton.tsx │ │ │ │ ├── Indicator │ │ │ │ │ └── index.ts │ │ │ │ ├── InputBase │ │ │ │ │ └── index.ts │ │ │ │ ├── LayoutLoading │ │ │ │ │ └── index.ts │ │ │ │ ├── RadioGroup │ │ │ │ │ └── index.ts │ │ │ │ ├── UnitFormat │ │ │ │ │ └── index.ts │ │ │ │ ├── AlertDialog │ │ │ │ │ └── index.ts │ │ │ │ ├── AspectRatio │ │ │ │ │ └── index.ts │ │ │ │ ├── Autocomplete │ │ │ │ │ └── index.ts │ │ │ │ ├── ButtonLoading │ │ │ │ │ └── index.ts │ │ │ │ ├── CardKeyValue │ │ │ │ │ └── index.ts │ │ │ │ ├── ConfirmDialog │ │ │ │ │ └── index.ts │ │ │ │ ├── DialogActions │ │ │ │ │ ├── index.ts │ │ │ │ │ └── DialogActions.tsx │ │ │ │ ├── ErrorBoundary │ │ │ │ │ └── index.ts │ │ │ │ ├── FormatBytes │ │ │ │ │ └── index.ts │ │ │ │ ├── IconMessage │ │ │ │ │ └── index.ts │ │ │ │ ├── LocaleToggle │ │ │ │ │ └── index.ts │ │ │ │ ├── Persist │ │ │ │ │ └── index.ts │ │ │ │ ├── PrivateRoute │ │ │ │ │ └── index.ts │ │ │ │ ├── SideBarItem │ │ │ │ │ └── index.ts │ │ │ │ ├── ThemeProvider │ │ │ │ │ └── index.ts │ │ │ │ ├── TooltipIcon │ │ │ │ │ └── index.ts │ │ │ │ ├── AdvancedOptions │ │ │ │ │ └── index.ts │ │ │ │ ├── ButtonSelected │ │ │ │ │ └── index.ts │ │ │ │ ├── CopyToClipboard │ │ │ │ │ └── index.ts │ │ │ │ ├── DarkModeToggle │ │ │ │ │ ├── index.ts │ │ │ │ │ └── DarkModeToggle.tsx │ │ │ │ ├── FormBackButton │ │ │ │ │ └── index.ts │ │ │ │ ├── LoadingOverlay │ │ │ │ │ └── index.ts │ │ │ │ ├── Mode │ │ │ │ │ └── index.ts │ │ │ │ ├── SandboxedIframe │ │ │ │ │ └── index.ts │ │ │ │ ├── StateTypography │ │ │ │ │ ├── index.ts │ │ │ │ │ └── StateTypography.tsx │ │ │ │ ├── TextFieldNumber │ │ │ │ │ └── index.ts │ │ │ │ ├── ToolbarSpacing │ │ │ │ │ ├── index.ts │ │ │ │ │ └── ToolbarSpacing.tsx │ │ │ │ ├── Truncate │ │ │ │ │ └── index.ts │ │ │ │ ├── FormatLargeNumber │ │ │ │ │ └── index.ts │ │ │ │ ├── TooltipTypography │ │ │ │ │ └── index.ts │ │ │ │ ├── LocaleProvider │ │ │ │ │ └── index.ts │ │ │ │ ├── FormatConnectionStatus │ │ │ │ │ └── index.ts │ │ │ │ ├── Amount │ │ │ │ │ └── index.ts │ │ │ │ ├── Button │ │ │ │ │ └── index.ts │ │ │ │ ├── ModalDialogs │ │ │ │ │ ├── ModalDialogsContext.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── TextField │ │ │ │ │ └── index.ts │ │ │ │ ├── Table │ │ │ │ │ └── index.ts │ │ │ │ ├── LayoutDashboard │ │ │ │ │ └── index.ts │ │ │ │ ├── StateIndicator │ │ │ │ │ ├── index.ts │ │ │ │ │ └── StateIndicatorDot.tsx │ │ │ │ ├── Settings │ │ │ │ │ ├── index.ts │ │ │ │ │ └── SettingsLabel.tsx │ │ │ │ └── Dropdown │ │ │ │ │ └── index.ts │ │ │ ├── screens │ │ │ │ ├── SelectKey │ │ │ │ │ └── index.ts │ │ │ │ └── index.ts │ │ │ ├── errors │ │ │ │ ├── index.ts │ │ │ │ └── FileSizeError.ts │ │ │ ├── theme │ │ │ │ ├── index.ts │ │ │ │ ├── light.ts │ │ │ │ └── dark.ts │ │ │ ├── hooks │ │ │ │ ├── useShowDebugInformation.ts │ │ │ │ ├── useSkipMigration.ts │ │ │ │ ├── useCurrencyCode.ts │ │ │ │ ├── useOpenExternal.ts │ │ │ │ ├── useTrans.ts │ │ │ │ ├── usePersist.ts │ │ │ │ ├── useLocale.ts │ │ │ │ ├── useMode.ts │ │ │ │ ├── useAppVersion.ts │ │ │ │ └── useShowError.tsx │ │ │ ├── constants │ │ │ │ ├── Mode.ts │ │ │ │ ├── Unit.ts │ │ │ │ ├── State.ts │ │ │ │ ├── StateColor.ts │ │ │ │ ├── UnitValue.ts │ │ │ │ ├── UnitFractionDigits.ts │ │ │ │ ├── UnitAliases.ts │ │ │ │ └── index.ts │ │ │ ├── locales │ │ │ │ └── README.md │ │ │ └── index.ts │ │ └── .gitignore │ ├── gui │ │ ├── .env.example │ │ ├── src │ │ │ ├── components │ │ │ │ ├── nfts │ │ │ │ │ ├── NFTTitle.tsx │ │ │ │ │ └── NFTs.tsx │ │ │ │ ├── fullNode │ │ │ │ │ └── index.ts │ │ │ │ ├── offers │ │ │ │ │ ├── OfferAsset.ts │ │ │ │ │ ├── OfferLocalStorage.ts │ │ │ │ │ ├── NFTOfferExchangeType.ts │ │ │ │ │ ├── OfferEditorRowData.ts │ │ │ │ │ ├── OfferRowData.tsx │ │ │ │ │ └── OfferState.ts │ │ │ │ ├── pool │ │ │ │ │ └── PoolHeader.tsx │ │ │ │ ├── app │ │ │ │ │ └── App.tsx │ │ │ │ ├── settings │ │ │ │ │ └── SettingsGeneral.tsx │ │ │ │ ├── plot │ │ │ │ │ ├── queue │ │ │ │ │ │ └── PlotQueueSize.tsx │ │ │ │ │ └── card │ │ │ │ │ │ └── PlotCardTotalHarvesters.tsx │ │ │ │ └── farm │ │ │ │ │ └── card │ │ │ │ │ └── FarmCardPlotCount.tsx │ │ │ ├── react-app-env.d.ts │ │ │ ├── config │ │ │ │ ├── env.ts │ │ │ │ └── config.js │ │ │ ├── types │ │ │ │ ├── Program.ts │ │ │ │ ├── Point.ts │ │ │ │ ├── G2Element.ts │ │ │ │ ├── Fingerprint.ts │ │ │ │ ├── Peak.ts │ │ │ │ ├── ProofsOfSpace.ts │ │ │ │ ├── NFTSelection.tsx │ │ │ │ ├── PlotNFTExternal.ts │ │ │ │ ├── CoinSolution.ts │ │ │ │ ├── Challenge.ts │ │ │ │ ├── FarmingInfo.ts │ │ │ │ ├── SpendBundle.ts │ │ │ │ ├── Block.ts │ │ │ │ ├── SignagePoint.ts │ │ │ │ ├── UnconfirmedPlotNFT.ts │ │ │ │ ├── InitialTargetState.ts │ │ │ │ ├── Coin.ts │ │ │ │ ├── FoliageTransactionBlock.ts │ │ │ │ ├── PoolInfo.ts │ │ │ │ ├── Plot.ts │ │ │ │ ├── PlotNFT.ts │ │ │ │ ├── PlotQueueItem.ts │ │ │ │ ├── Connection.ts │ │ │ │ ├── WalletBalance.ts │ │ │ │ └── Foliage.ts │ │ │ ├── fonts.d.ts │ │ │ ├── util │ │ │ │ ├── plot_sizes.js │ │ │ │ ├── sleep.ts │ │ │ │ ├── isLocalhost.ts │ │ │ │ ├── isWindows.ts │ │ │ │ ├── download.ts │ │ │ │ ├── isRankingAttribute.ts │ │ │ │ ├── wallet_types.js │ │ │ │ ├── getPoolInfo.ts │ │ │ │ ├── mergeArrayItem.ts │ │ │ │ ├── computeHash.ts │ │ │ │ ├── blockHeightToTimestamp.ts │ │ │ │ ├── normalizePoolState.ts │ │ │ │ ├── untildify.ts │ │ │ │ ├── isContentHashValid.ts │ │ │ │ ├── normalizeUrl.ts │ │ │ │ ├── removeOldPoints.ts │ │ │ │ ├── getWalletSyncingStatus.ts │ │ │ │ ├── getDescriptiveError.ts │ │ │ │ ├── getPercentPointsSuccessfull.ts │ │ │ │ └── manageDaemonLifetime.ts │ │ │ ├── assets │ │ │ │ ├── img │ │ │ │ │ ├── stai.ico │ │ │ │ │ ├── stai.png │ │ │ │ │ ├── stai.icns │ │ │ │ │ ├── full_logo.png │ │ │ │ │ ├── stai64x64.png │ │ │ │ │ └── stai_circle.png │ │ │ │ └── fonts │ │ │ │ │ ├── ionicons.eot │ │ │ │ │ ├── ionicons.ttf │ │ │ │ │ ├── ionicons.woff │ │ │ │ │ ├── Roboto-Light.ttf │ │ │ │ │ ├── ionicons.woff2 │ │ │ │ │ ├── Roboto-Medium.ttf │ │ │ │ │ └── Roboto-Regular.ttf │ │ │ ├── electron │ │ │ │ └── preload.js │ │ │ ├── constants │ │ │ │ ├── PlotterName.ts │ │ │ │ ├── FullNodeState.ts │ │ │ │ ├── plotLocalStorage.ts │ │ │ │ ├── PlotStatus.ts │ │ │ │ ├── PlotNFTState.ts │ │ │ │ ├── SyncingStatus.ts │ │ │ │ ├── TransactionType.ts │ │ │ │ ├── FarmerStatus.ts │ │ │ │ └── ModeServices.ts │ │ │ ├── polyfill.ts │ │ │ ├── hooks │ │ │ │ ├── useNFTHash.ts │ │ │ │ ├── useOpenExternal.ts │ │ │ │ ├── useIsMainnet.tsx │ │ │ │ └── useSelectFile.tsx │ │ │ └── index.tsx │ │ ├── .prettierrc.js │ │ ├── windows.json │ │ ├── staiblockchain.provisionprofile │ │ ├── remote.md │ │ ├── .editorconfig │ │ └── entitlements.mac.plist │ ├── icons │ │ ├── .gitignore │ │ └── src │ │ │ ├── Farm.tsx │ │ │ ├── Keys.tsx │ │ │ ├── Plot.tsx │ │ │ ├── Pool.tsx │ │ │ ├── Trade.tsx │ │ │ ├── Plots.tsx │ │ │ ├── Tokens.tsx │ │ │ ├── Wallet.tsx │ │ │ ├── Farming.tsx │ │ │ ├── FullNode.tsx │ │ │ ├── Link.tsx │ │ │ ├── PlotHero.tsx │ │ │ ├── Pooling.tsx │ │ │ ├── Settings.tsx │ │ │ ├── images │ │ │ ├── NFTs.svg │ │ │ └── NFTsSmall.svg │ │ │ ├── Stai.tsx │ │ │ ├── NFTs.tsx │ │ │ └── Offers.tsx │ ├── api │ │ ├── .gitignore │ │ ├── src │ │ │ ├── @types │ │ │ │ ├── BlockHeader.ts │ │ │ │ ├── BlockRecord.ts │ │ │ │ ├── BlockchainState.ts │ │ │ │ ├── Program.ts │ │ │ │ ├── BlockchainConnection.ts │ │ │ │ ├── Point.ts │ │ │ │ ├── G2Element.ts │ │ │ │ ├── Fingerprint.ts │ │ │ │ ├── Peak.ts │ │ │ │ ├── CATToken.ts │ │ │ │ ├── ProofsOfSpace.ts │ │ │ │ ├── PlotNFTExternal.ts │ │ │ │ ├── OfferCoinOfInterest.ts │ │ │ │ ├── CoinSolution.ts │ │ │ │ ├── NFTAttribute.ts │ │ │ │ ├── Challenge.ts │ │ │ │ ├── FarmingInfo.ts │ │ │ │ ├── Block.ts │ │ │ │ ├── SpendBundle.ts │ │ │ │ ├── SignagePoint.ts │ │ │ │ ├── UnconfirmedPlotNFT.ts │ │ │ │ ├── MessageInterface.ts │ │ │ │ ├── InitialTargetState.ts │ │ │ │ ├── FoliageTransactionBlock.ts │ │ │ │ ├── PoolInfo.ts │ │ │ │ ├── Coin.ts │ │ │ │ ├── Plot.ts │ │ │ │ ├── PlotNFT.ts │ │ │ │ ├── PlotQueueItem.ts │ │ │ │ ├── Connection.ts │ │ │ │ ├── WalletBalance.ts │ │ │ │ ├── Foliage.ts │ │ │ │ └── OfferTradeRecord.ts │ │ │ ├── utils │ │ │ │ ├── sleep.ts │ │ │ │ ├── ErrorData.ts │ │ │ │ ├── index.ts │ │ │ │ ├── toSnakeCase.ts │ │ │ │ ├── toCamelCase.ts │ │ │ │ └── toSafeNumber.ts │ │ │ ├── constants │ │ │ │ ├── PlotterName.ts │ │ │ │ ├── PassphrasePromptReason.ts │ │ │ │ ├── ConnectionState.ts │ │ │ │ ├── SyncingStatus.ts │ │ │ │ ├── TransactionType.ts │ │ │ │ ├── WalletType.ts │ │ │ │ ├── ServiceName.ts │ │ │ │ ├── defaultPlotter.ts │ │ │ │ ├── ServiceConnectionName.ts │ │ │ │ └── ServiceHumanName.ts │ │ │ ├── index.ts │ │ │ ├── wallets │ │ │ │ ├── index.ts │ │ │ │ └── Pool.ts │ │ │ └── services │ │ │ │ ├── index.ts │ │ │ │ └── Events.ts │ │ ├── .npmignore │ │ └── .babelrc │ ├── api-react │ │ ├── .gitignore │ │ ├── src │ │ │ ├── slices │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── hooks │ │ │ │ ├── useForceUpdate.ts │ │ │ │ ├── useLogout.ts │ │ │ │ ├── useGetHarvesterConnectionsQuery.ts │ │ │ │ ├── useGetFarmerFullNodeConnectionsQuery.ts │ │ │ │ └── useGetNFTWallets.ts │ │ │ ├── api.ts │ │ │ └── utils │ │ │ │ ├── normalizePoolState.ts │ │ │ │ └── removeOldPoints.ts │ │ ├── .npmignore │ │ └── .babelrc │ └── wallets │ │ └── src │ │ ├── constants │ │ └── index.ts │ │ ├── index.ts │ │ ├── locales │ │ └── README.md │ │ ├── utils │ │ ├── index.ts │ │ ├── getWalletPrimaryTitle.ts │ │ ├── getWalletSyncingStatus.ts │ │ └── isCATWalletPresent.ts │ │ ├── hooks │ │ ├── index.ts │ │ ├── useIsWalletSynced.ts │ │ └── useWalletState.ts │ │ └── components │ │ └── hero │ │ └── WalletHero.tsx ├── lerna.json ├── README.md ├── src │ └── locales │ │ └── README.md └── crowdin.yml ├── .github ├── linters │ ├── .python-black │ ├── .flake8 │ └── .isort.cfg └── ISSUE_TEMPLATE │ ├── config.yml │ └── bug_report.md ├── .flake8 ├── lgtm.yml ├── run-py-tests.sh ├── .coveragerc ├── INSTALL.md └── pyproject.toml /stai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /benchmarks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mozilla-ca/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/clvm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/cmds/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/daemon/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/farmer/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/pools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/rpc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/seeder/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/server/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/ssl/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/types/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/clvm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/pools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/consensus/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/full_node/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/harvester/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/introducer/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/plot_sync/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/plotters/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/plotting/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/protocols/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/simulator/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/timelord/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/blockchain/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/cmds/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/ssl/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/util/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/generator/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plot_sync/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/plotting/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/simulation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/rpc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/rl_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/trading/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/consensus/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/daemon/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/full_node/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/server/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/sync/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/weight_proof/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mozilla-ca/README.md: -------------------------------------------------------------------------------- 1 | # mozilla-ca 2 | -------------------------------------------------------------------------------- /stai/wallet/cat_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/did_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/nft_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/custom_types/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/full_node/dos/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/farmer_harvester/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/runner_templates/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/cat_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/did_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/nft_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/rl_wallet/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/wallet/simple_sync/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/types/blockchain_format/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/prefarm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/full_node/full_sync/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/full_node/stores/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/tools/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | -------------------------------------------------------------------------------- /tests/core/cmds/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | -------------------------------------------------------------------------------- /tests/generator/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/.npmrc: -------------------------------------------------------------------------------- 1 | legacy-peer-deps=true 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/getUnit: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/core/consensus/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | -------------------------------------------------------------------------------- /tests/core/custom_types/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/lock.inner.puzzle.clvm.hex: -------------------------------------------------------------------------------- 1 | ff01ff8080 -------------------------------------------------------------------------------- /stai/wallet/puzzles/create-lock-puzzlehash.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_conditions.clvm.hex: -------------------------------------------------------------------------------- 1 | ff04ffff0101ff0280 -------------------------------------------------------------------------------- /tests/util/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | job_timeout = 60 3 | -------------------------------------------------------------------------------- /tests/wallet/rpc/config.py: -------------------------------------------------------------------------------- 1 | checkout_blocks_and_plots = True 2 | -------------------------------------------------------------------------------- /.github/linters/.python-black: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line_length = 120 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/.env.example: -------------------------------------------------------------------------------- 1 | LOCAL_TEST=true 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/nfts/NFTTitle.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /tests/core/server/config.py: -------------------------------------------------------------------------------- 1 | checkout_blocks_and_plots = True 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .env -------------------------------------------------------------------------------- /stai/wallet/cat_wallet/cat_constants.py: -------------------------------------------------------------------------------- 1 | 2 | DEFAULT_CATS = { 3 | } 4 | -------------------------------------------------------------------------------- /tests/farmer_harvester/config.py: -------------------------------------------------------------------------------- 1 | checkout_blocks_and_plots = True 2 | -------------------------------------------------------------------------------- /tests/wallet/nft_wallet/config.py: -------------------------------------------------------------------------------- 1 | checkout_blocks_and_plots = True 2 | -------------------------------------------------------------------------------- /tests/wallet/simple_sync/config.py: -------------------------------------------------------------------------------- 1 | checkout_blocks_and_plots = True 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CurrencyCode/CurrencyCode.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/clvm/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | checkout_blocks_and_plots = False 3 | -------------------------------------------------------------------------------- /tests/core/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /tests/core/full_node/dos/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | job_timeout = 60 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .env -------------------------------------------------------------------------------- /stai/wallet/puzzles/test_generator_deserialize.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ff02ffff04ff0bff808080 -------------------------------------------------------------------------------- /tests/core/ssl/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /tests/core/util/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /tests/plot_sync/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/slices/index.ts: -------------------------------------------------------------------------------- 1 | export * as api from './api'; -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_puzzle.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ff02ffff04ffff0eff05ff0bff1780ff808080 -------------------------------------------------------------------------------- /tests/wallet/sync/config.py: -------------------------------------------------------------------------------- 1 | job_timeout = 60 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /tests/weight_proof/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/calculate_synthetic_public_key.clvm.hex: -------------------------------------------------------------------------------- 1 | ff1dff02ffff1effff0bff02ff05808080 -------------------------------------------------------------------------------- /tests/core/daemon/config.py: -------------------------------------------------------------------------------- 1 | install_timelord = True 2 | checkout_blocks_and_plots = True 3 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | exclude = ./typings/**/* 4 | ignore = E203,W503 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/BlockHeader.ts: -------------------------------------------------------------------------------- 1 | export default interface BlockHeader {} -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/BlockRecord.ts: -------------------------------------------------------------------------------- 1 | export default interface BlockRecord {} -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Back/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Back'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fee/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Fee'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Fonts'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Log/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Log'; 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/create-lock-puzzlehash.clvm.hex: -------------------------------------------------------------------------------- 1 | can't compile ("my-id"), unknown operator 2 | -------------------------------------------------------------------------------- /tests/pools/config.py: -------------------------------------------------------------------------------- 1 | parallel = 2 2 | job_timeout = 60 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Card/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Card'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Flex/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Flex'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Form/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Form'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Link/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Link'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Logo/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Logo'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/More/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './More'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Spacer/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Spacer'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/screens/SelectKey/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './SelectKey'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/BlockchainState.ts: -------------------------------------------------------------------------------- 1 | export default interface BlockchainState {} -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Address/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Address'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CardHero/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CardHero'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CardSimple/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CardSimple'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CardStep/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CardStep'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Checkbox/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Checkbox'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Dropzone/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Dropzone'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Heading/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Heading'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LayoutHero/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './LayoutHero'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LayoutMain/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './LayoutMain'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Loading/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Loading'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Select/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Select'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Spinner/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Spinner'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Suspender/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Suspender'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Tooltip/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Tooltip'; 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_conditions.clvm: -------------------------------------------------------------------------------- 1 | (mod (conditions) 2 | (qq (q . (unquote conditions))) 3 | ) 4 | -------------------------------------------------------------------------------- /tests/blockchain/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | job_timeout = 60 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Program.ts: -------------------------------------------------------------------------------- 1 | type Program = {}; 2 | 3 | export default Program; 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Accordion/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Accordion'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CardListItem/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CardListItem'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CurrencyCode/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CurrencyCode'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/GuestRoute/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './GuestRoute'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/IconButton/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './IconButton'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Indicator/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Indicator'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/InputBase/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './InputBase'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LayoutLoading/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './LayoutLoading'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/RadioGroup/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './RadioGroup'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/UnitFormat/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './UnitFormat'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/config/env.ts: -------------------------------------------------------------------------------- 1 | import dotenv from 'dotenv'; 2 | 3 | dotenv.config(); 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Program.ts: -------------------------------------------------------------------------------- 1 | type Program = {}; 2 | 3 | export default Program; 4 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/cat_v2.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 37bef360ee858133b69d595a906dc45d01af50379dad515eb9518abb7c1d2a7a -------------------------------------------------------------------------------- /stai/wallet/puzzles/rl.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | f663796a8c522b85bd9472cbea2bf7f138e8351e8e4032706fc0539e87f94faf 2 | -------------------------------------------------------------------------------- /tests/plotting/config.py: -------------------------------------------------------------------------------- 1 | parallel = True 2 | install_timelord = False 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /tests/simulation/config.py: -------------------------------------------------------------------------------- 1 | job_timeout = 60 2 | install_timelord = True 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /.github/linters/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | exclude = ./typings/**/* 4 | ignore = E203,W503 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "1.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/BlockchainConnection.ts: -------------------------------------------------------------------------------- 1 | export default interface BlockchainConnection {} -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Point.ts: -------------------------------------------------------------------------------- 1 | type Point = [number, number]; 2 | 3 | export default Point; 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/AlertDialog/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './AlertDialog'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/AspectRatio/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './AspectRatio'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Autocomplete/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Autocomplete'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ButtonLoading/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ButtonLoading'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CardKeyValue/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CardKeyValue'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ConfirmDialog/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ConfirmDialog'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/DialogActions/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './DialogActions'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ErrorBoundary/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ErrorBoundary'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/FormatBytes/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './FormatBytes'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/IconMessage/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './IconMessage'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LocaleToggle/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './LocaleToggle'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Persist/index.ts: -------------------------------------------------------------------------------- 1 | export { default, PersistContext } from './Persist'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/PrivateRoute/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './PrivateRoute'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/SideBarItem/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './SideBarItem'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ThemeProvider/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ThemeProvider'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/TooltipIcon/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './TooltipIcon'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/errors/index.ts: -------------------------------------------------------------------------------- 1 | export { default as FileSizeError } from './FileSizeError'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Point.ts: -------------------------------------------------------------------------------- 1 | type Point = [number, number]; 2 | 3 | export default Point; 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | export { default as WalletName } from './WalletName'; 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/condition_codes.clvm.hex: -------------------------------------------------------------------------------- 1 | can't compile ("defconstant" "AGG_SIG_UNSAFE" 49), unknown operator 2 | -------------------------------------------------------------------------------- /tests/core/full_node/full_sync/config.py: -------------------------------------------------------------------------------- 1 | job_timeout = 60 2 | parallel = True 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /tests/wallet/cat_wallet/config.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa: E501 2 | job_timeout = 50 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /tests/wallet/did_wallet/config.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa: E501 2 | job_timeout = 50 3 | checkout_blocks_and_plots = True 4 | -------------------------------------------------------------------------------- /benchmarks/clvm_generator.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/benchmarks/clvm_generator.bin -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/G2Element.ts: -------------------------------------------------------------------------------- 1 | type G2Element = string; 2 | 3 | export default G2Element; 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/AdvancedOptions/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './AdvancedOptions'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ButtonSelected/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ButtonSelected'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/CopyToClipboard/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './CopyToClipboard'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/DarkModeToggle/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './DarkModeToggle'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/FormBackButton/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './FormBackButton'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LoadingOverlay/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './LoadingOverlay'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Mode/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ModeProvider } from './ModeProvider'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/SandboxedIframe/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './SandboxedIframe'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/StateTypography/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './StateTypography'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/TextFieldNumber/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './TextFieldNumber'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ToolbarSpacing/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ToolbarSpacing'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Truncate/index.ts: -------------------------------------------------------------------------------- 1 | export { default, truncateValue } from './Truncate'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/screens/index.ts: -------------------------------------------------------------------------------- 1 | export { default as SelectKey } from './SelectKey/SelectKey'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/G2Element.ts: -------------------------------------------------------------------------------- 1 | type G2Element = string; 2 | 3 | export default G2Element; 4 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/delegated_tail.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 999c3696e167f8a79d938adc11feba3a3dcb39ccff69a426d570706e7b8ec399 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/did_innerpuz.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 33143d2bef64f14036742673afd158126b94284b4530a28c354fac202b0c910e 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/genesis_by_coin_id.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 493afb89eed93ab86741b2aa61b8f5de495d33ff9b781dfc8919e602b2afa150 -------------------------------------------------------------------------------- /stai/wallet/puzzles/lock.inner.puzzle.clvm: -------------------------------------------------------------------------------- 1 | ; a trivial puzzle used as the core of a lock puzzle 2 | (mod args (q ())) 3 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_ownership_layer.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | c5abea79afaa001b5427dfa0c8cf42ca6f38f5841b78f9b3c252733eb2de2726 -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_conditions.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 1c77d7d5efde60a7a1d2d27db6d746bc8e568aea1ef8586ca967a0d60b83cc36 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_puzzle_hash.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 13e29a62b42cd2ef72a79e4bacdc59733ca6310d65af83d349360d36ec622363 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_singleton.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 40f828d8dd55603f4ff9fbf6b73271e904e69406982f4fbefae2c8dcceaf9834 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/rl_aggregation.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 007400187f63927ee023a7172bb88f14d49aaa4beb790ecaf7dde7c1a79b6481 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Fingerprint.ts: -------------------------------------------------------------------------------- 1 | type Fingerprint = number; 2 | 3 | export default Fingerprint; 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/FormatLargeNumber/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './FormatLargeNumber'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/TooltipTypography/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './TooltipTypography'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Fingerprint.ts: -------------------------------------------------------------------------------- 1 | type Fingerprint = number; 2 | 3 | export default Fingerprint; 4 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/block_program_zero.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | f0a38c8efe58895ae527c65c37f700a4238504691b83990e5dd91bd8b3c30eae 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_puzzle.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | fe94c58f1117afe315e0450daca1c62460ec1a1c439cd4018d79967a5d7d1370 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | de5a6e06d41518be97ff6365694f4f89475dda773dede267caa33da63b434e36 -------------------------------------------------------------------------------- /stai/wallet/puzzles/lock.inner.puzzle.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | f3a579254623f8094e07af862df2e45c9db5592b4105d34a256dd6c498416288 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_state_layer.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | a04d9f57764f54a43e4030befb4d80026e870519aaa66334aef8304f5d0393c2 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_puzzle.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 542cde70d1102cd1b763220990873efc8ab15625ded7eae22cc11e21ef2e2f7c 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/settlement_payments.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | bae24162efbd568f89bc7a340798a6118df0189eb9e3f8697bcea27af99f8f79 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/sha256tree_module.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | eb4ead6576048c9d730b5ced00646c7fdd390649cfdf48a00de1590cdd8ee18f 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/singleton_launcher.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | eff07522495060c066f66f32acc2a77e3a3e737aca8baea4d1a64ea4cdc13da9 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/singleton_top_layer.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 24e044101e57b3d8c908b8a38ad57848afd29d3eecc439dba45f4412df4954fd 2 | -------------------------------------------------------------------------------- /tests/wallet/config.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa: E501 2 | job_timeout = 40 3 | parallel = True 4 | checkout_blocks_and_plots = True 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LocaleProvider/index.ts: -------------------------------------------------------------------------------- 1 | export { default, LocaleContext } from './LocaleProvider'; -------------------------------------------------------------------------------- /stai/wallet/puzzles/everything_with_signature.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 1720d13250a7c16988eaf530331cefa9dd57a76b2c82236bec8bbbff91499b89 -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_metadata_updater.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 3df9de54667a96f32eba322635f14d3474edadf23f396ba5a3e2e077a89a682a 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_conditions.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 0ff94726f1a8dea5c3f70d3121945190778d3b2b3fcda3735a1f290977e98341 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/pool_member_innerpuz.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | a8490702e333ddd831a3ac9c22d0fa26d2bfeaf2d33608deb22f0e0123eb0494 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/rom_bootstrap_generator.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 161bade1f822dcd62ab712ebaf30f3922a301e48a639e4295c5685f8bece7bd9 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 7faa3253bfddd1e0decb0906b2dc6247bbc4cf608f58345d173adb63e8b47c9f 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/stailisp_deserialisation.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 94ec19077f9a34e0b11ad2456af0170f4cc03f11230ca42e3f82e6e644ac4f5d 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/FormatConnectionStatus/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './FormatConnectionStatus'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/fonts.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.woff'; 2 | declare module '*.woff2'; 3 | declare module '*.ttf'; 4 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_coin_spend_entry.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 9d98ed08770d31be4bd1bde4705dab388db5e7e9c349f5a76fc3c347aa3a0b79 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/everything_with_signature.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ff02ffff04ff05ffff04ff5fff80808080ff8080ffff04ffff0132ff018080 -------------------------------------------------------------------------------- /stai/wallet/puzzles/generator_for_single_coin.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 9eb0d58814fff6aec8e9eb9522c08a68d8f004bf1506e6c98388758beee2f80e 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/genesis_by_coin_id.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff03ff2fffff01ff0880ffff01ff02ffff03ffff09ff2dff0280ff80ffff01ff088080ff018080ff0180 -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_metadata_updater_default.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | fe8a4b4e27a2e29a4d3fc7ce9d527adbcaccbab6ada3903ccf3ba9a769d2d78b 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 0f199d5263ac1a62b077c159404a71abd3f9691cc57520bf1d4c5cb501504457 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | a317541a765bf8375e1c6e7c13503d0d2cbf56cacad5182befe947e78e2c0307 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/test_generator_deserialize.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 52add794fc76e89512e4a063c383418bda084c8a78c74055abe80179e4a7832c 2 | -------------------------------------------------------------------------------- /tests/tools/test-blockchain-db.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/tests/tools/test-blockchain-db.sqlite -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/theme/index.ts: -------------------------------------------------------------------------------- 1 | export { default as dark } from './dark'; 2 | export { default as light } from './light'; -------------------------------------------------------------------------------- /stai/consensus/network_type.py: -------------------------------------------------------------------------------- 1 | from enum import IntEnum 2 | 3 | 4 | class NetworkType(IntEnum): 5 | MAINNET = 0 6 | TESTNET = 1 7 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/calculate_synthetic_public_key.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 624c5d5704d0decadfc0503e71bbffb6cdfe45025bce7cf3e6864d1eafe8f65e 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 0b1ffba1601777c06b78ab38636e9624f2f8da73be9b36e0ce17c8d8ef3bad9f 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | adb656e0211e2ab4f42069a4c5efc80dc907e7062be08bf1628c8e5b6d94d25b 2 | -------------------------------------------------------------------------------- /tests/util/protocol_messages_bytes-v1.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/tests/util/protocol_messages_bytes-v1.0 -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 92aa4bc8060a8836355a1884075141b4791ce1b67ae6092bb166b2845954bc89 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | e9aaa49f45bad5c889b86ee3341550c155cfdd10c3a6757de618d20612fffd52 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 156dafbddc3e1d3bfe1f2a84e48e5e46b287b8358bf65c3c091c93e855fbfc5b 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Peak.ts: -------------------------------------------------------------------------------- 1 | type Peak = { 2 | height: number; 3 | timestamp: number; 4 | }; 5 | 6 | export default Peak; 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Amount/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Amount'; 2 | export type { AmountProps } from './Amount'; 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Button/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Button'; 2 | export type { ButtonProps } from './Button'; 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | trailingComma: 'all', 4 | printWidth: 80 5 | }; 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Peak.ts: -------------------------------------------------------------------------------- 1 | type Peak = { 2 | height: number; 3 | timestamp: number; 4 | }; 5 | 6 | export default Peak; 7 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/test_generator_deserialize.clvm: -------------------------------------------------------------------------------- 1 | (mod (deserializer generator_list reserved_arg) 2 | (a deserializer (list reserved_arg)) 3 | ) 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/errors/FileSizeError.ts: -------------------------------------------------------------------------------- 1 | export default class FileSizeError extends Error { 2 | code = 'FILE_SIZE_ERROR'; 3 | } 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useShowDebugInformation.ts: -------------------------------------------------------------------------------- 1 | export default function useShowDebugInformation(): boolean { 2 | return true; 3 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/fullNode/index.ts: -------------------------------------------------------------------------------- 1 | export { recordMeasurement, resetSyncSpeedHeader } from './FullNodeSyncSpeedHeader'; 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/Mode.ts: -------------------------------------------------------------------------------- 1 | enum Mode { 2 | WALLET = 'wallet', 3 | FARMING = 'farming', 4 | } 5 | 6 | export default Mode; 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/plot_sizes.js: -------------------------------------------------------------------------------- 1 | export function calculateSizeFromK(k) { 2 | return Math.floor(780 * k * Math.pow(2, k - 10)); 3 | } 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/windows.json: -------------------------------------------------------------------------------- 1 | { 2 | "dest": "dist/installers/", 3 | "icon": "src/assets/img/stai.ico", 4 | "tags": ["Blockchain"] 5 | } 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ModalDialogs/ModalDialogsContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | export default createContext(); -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/TextField/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './TextField'; 2 | export type { TextFieldProps } from './TextField'; 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/Unit.ts: -------------------------------------------------------------------------------- 1 | enum Unit { 2 | STAI = 'stai', 3 | MOJO = 'mojo', 4 | CAT = 'cat', 5 | } 6 | 7 | export default Unit; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/sleep.ts: -------------------------------------------------------------------------------- 1 | export default function sleep(ms: number) { 2 | return new Promise((resolve) => setTimeout(resolve, ms)); 3 | } 4 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_coin_spend_entry.clvm.hex: -------------------------------------------------------------------------------- 1 | ff04ff4fffff04ffff02ff05ffff04ff02ffff04ff0bffff04ff82012fffff04ff17ff808080808080ffff04ff82014fff8201af808080 -------------------------------------------------------------------------------- /stai/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff03ff2fffff01ff0880ffff01ff02ffff03ffff09ffff0bff82013fff02ff8202bf80ff2d80ff80ffff01ff088080ff018080ff0180 -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree: -------------------------------------------------------------------------------- 1 | 025dee0fb1e9fa110302a7e9bfb6e381ca09618e2778b0184fa5c6b275cfce1f 2 | -------------------------------------------------------------------------------- /tests/core/full_node/config.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa: E501 2 | parallel = True 3 | job_timeout = 50 4 | check_resource_usage = True 5 | checkout_blocks_and_plots = True 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/README.md: -------------------------------------------------------------------------------- 1 | # stai-blockchain 2 | 3 | This is the GUI for stai-blockchain. It is built into distribution packages in the stai-blockchain repository. 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/utils/sleep.ts: -------------------------------------------------------------------------------- 1 | export default function sleep(ms: number) { 2 | return new Promise((resolve) => setTimeout(resolve, ms)); 3 | } 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Table/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Table'; 2 | export { default as TableControlled } from './TableControlled'; 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/sleep.ts: -------------------------------------------------------------------------------- 1 | export default function sleep(ms: number) { 2 | return new Promise((resolve) => setTimeout(resolve, ms)); 3 | } 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/img/stai.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/img/stai.ico -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/img/stai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/img/stai.png -------------------------------------------------------------------------------- /tests/core/full_node/stores/config.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa: E501 2 | parallel = True 3 | job_timeout = 40 4 | check_resource_usage = True 5 | checkout_blocks_and_plots = True 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/img/stai.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/img/stai.icns -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/isLocalhost.ts: -------------------------------------------------------------------------------- 1 | export default function isLocalhost(ip: string): boolean { 2 | return ip === '::1' || ip === '127.0.0.1'; 3 | } 4 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex: -------------------------------------------------------------------------------- 1 | ff04ff47ffff04ffff02ff05ffff04ff02ffff04ff0bffff04ff8197ffff01ff84ff0180808080808080ffff04ff81a7ff81d7808080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/CATToken.ts: -------------------------------------------------------------------------------- 1 | type CATToken = { 2 | assetId: string; 3 | name: string; 4 | symbol: string; 5 | }; 6 | 7 | export default CATToken; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/ProofsOfSpace.ts: -------------------------------------------------------------------------------- 1 | type ProofsOfSpace = { 2 | [key: string]: [string, ProofsOfSpace][]; 3 | }; 4 | 5 | export default ProofsOfSpace; 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/img/full_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/img/full_logo.png -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/img/stai64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/img/stai64x64.png -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/electron/preload.js: -------------------------------------------------------------------------------- 1 | const { ipcRenderer,shell } = require('electron'); 2 | 3 | window.ipcRenderer = ipcRenderer; 4 | window.shell = shell; 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/ProofsOfSpace.ts: -------------------------------------------------------------------------------- 1 | type ProofsOfSpace = { 2 | [key: string]: [string, ProofsOfSpace][]; 3 | }; 4 | 5 | export default ProofsOfSpace; 6 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_puzzle.clvm: -------------------------------------------------------------------------------- 1 | (mod (deserialize puzzle_prefix pubkey suffix) 2 | 3 | (a deserialize (list (concat puzzle_prefix pubkey suffix))) 4 | 5 | ) 6 | 7 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/rl_aggregation.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ff06ffff04ff0bff808080ffff04ffff04ff04ffff04ffff0bffff0bff17ff05ff2f80ff0b80ff808080ff808080ffff04ffff01ff3d46ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/.npmignore: -------------------------------------------------------------------------------- 1 | coverage 2 | node_modules 3 | .DS_Store 4 | package-lock.json 5 | tsconfig.json 6 | .babelrc 7 | rollup.config.js 8 | .env 9 | src 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/State.ts: -------------------------------------------------------------------------------- 1 | enum State { 2 | SUCCESS = 'SUCCESS', 3 | WARNING = 'WARNING', 4 | ERROR = 'ERROR', 5 | } 6 | 7 | export default State; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/theme/light.ts: -------------------------------------------------------------------------------- 1 | import { createTheme } from '@mui/material/styles'; 2 | import theme from './default'; 3 | 4 | export default createTheme(theme); 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/isWindows.ts: -------------------------------------------------------------------------------- 1 | import os from 'os'; 2 | 3 | const platform = os.platform(); 4 | 5 | export default platform && platform.startsWith('win'); 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.eot -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.woff -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/img/stai_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/img/stai_circle.png -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/isWindows.ts: -------------------------------------------------------------------------------- 1 | import os from 'os'; 2 | 3 | const platform = os.platform(); 4 | 5 | export default platform && platform.startsWith('win'); 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/LayoutDashboard/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './LayoutDashboard'; 2 | export { default as LayoutDashboardSub } from './LayoutDashboardSub'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/StateIndicator/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './StateIndicator'; 2 | export { default as StateIndicatorDot } from './StateIndicatorDot'; 3 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/ionicons.woff2 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/staiblockchain.provisionprofile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/staiblockchain.provisionprofile -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/.npmignore: -------------------------------------------------------------------------------- 1 | coverage 2 | node_modules 3 | .DS_Store 4 | package-lock.json 5 | tsconfig.json 6 | .babelrc 7 | rollup.config.js 8 | .env 9 | src 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.eot -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.woff -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/assets/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/gui/src/assets/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/offers/OfferAsset.ts: -------------------------------------------------------------------------------- 1 | enum OfferAsset { 2 | STAI = 'STAI', 3 | TOKEN = 'TOKEN', 4 | NFT = 'NFT', 5 | } 6 | 7 | export default OfferAsset; 8 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/calculate_synthetic_public_key.clvm: -------------------------------------------------------------------------------- 1 | (mod 2 | (public_key hidden_puzzle_hash) 3 | 4 | (point_add public_key (pubkey_for_exp (sha256 public_key hidden_puzzle_hash))) 5 | ) 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/ionicons.woff2 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ModalDialogs/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './ModalDialogs'; 2 | 3 | export { default as ModalDialogsProvider } from './ModalDialogsProvider'; 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/NFTSelection.tsx: -------------------------------------------------------------------------------- 1 | import type NFTInfo from '@stai/api'; 2 | 3 | type NFTSelection = { 4 | items: NFTInfo[]; 5 | }; 6 | 7 | export default NFTSelection; 8 | -------------------------------------------------------------------------------- /stai/types/coin_solution.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | from .coin_spend import CoinSpend as CoinSolution # noqa lgtm[py/unused-import] 4 | 5 | 6 | warnings.warn("`CoinSolution` is now `CoinSpend`") 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/PlotterName.ts: -------------------------------------------------------------------------------- 1 | enum PlotterName { 2 | BLADEBIT = 'bladebit', 3 | CHIAPOS = 'chiapos', 4 | MADMAX = 'madmax', 5 | } 6 | 7 | export default PlotterName; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/STATION-I/stai-blockchain/HEAD/stai-blockchain-gui/packages/core/src/components/Fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/StateColor.ts: -------------------------------------------------------------------------------- 1 | enum StateColor { 2 | SUCCESS = '#94BD0B', 3 | WARNING = '#f57c00', 4 | ERROR = '#F44336', 5 | } 6 | 7 | export default StateColor; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/PlotterName.ts: -------------------------------------------------------------------------------- 1 | enum PlotterName { 2 | BLADEBIT = 'bladebit', 3 | CHIAPOS = 'chiapos', 4 | MADMAX = 'madmax', 5 | } 6 | 7 | export default PlotterName; 8 | -------------------------------------------------------------------------------- /tests/runner_templates/install-timelord.include.yml: -------------------------------------------------------------------------------- 1 | - name: Install timelord 2 | run: | 3 | . ./activate 4 | sh install-timelord.sh -n 5 | ./vdf_bench square_asm 400000 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/env", 4 | "@babel/typescript" 5 | ], 6 | "plugins": [ 7 | "@babel/plugin-transform-runtime" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/FullNodeState.ts: -------------------------------------------------------------------------------- 1 | enum FullNodeState { 2 | SYNCHING = 'SYNCHING', 3 | ERROR = 'ERROR', 4 | SYNCED = 'SYNCED', 5 | } 6 | 7 | export default FullNodeState; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | export * from './constants'; 3 | export * from './hooks'; 4 | export * from './utils'; 5 | export * as locales from './locales'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/env", 4 | "@babel/typescript" 5 | ], 6 | "plugins": [ 7 | "@babel/plugin-transform-runtime" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/polyfill.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/stable'; 2 | import 'regenerator-runtime/runtime'; 3 | import { polyfill } from 'es6-promise'; 4 | import 'isomorphic-fetch'; 5 | 6 | polyfill(); 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/PlotNFTExternal.ts: -------------------------------------------------------------------------------- 1 | import type PoolState from './PoolState'; 2 | 3 | type PlotNFTExternal = { 4 | pool_state: PoolState; 5 | }; 6 | 7 | export default PlotNFTExternal; 8 | -------------------------------------------------------------------------------- /lgtm.yml: -------------------------------------------------------------------------------- 1 | path_classifiers: 2 | test: 3 | - exclude: / 4 | benchmark: 5 | - exclude: / 6 | 7 | extraction: 8 | javascript: 9 | index: 10 | include: 11 | - stai-blockchain-gui 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/PlotNFTExternal.ts: -------------------------------------------------------------------------------- 1 | import type PoolState from './PoolState'; 2 | 3 | type PlotNFTExternal = { 4 | pool_state: PoolState; 5 | }; 6 | 7 | export default PlotNFTExternal; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/offers/OfferLocalStorage.ts: -------------------------------------------------------------------------------- 1 | enum OfferLocalStorageKeys { 2 | SUPPRESS_SHARE_ON_CREATE = 'suppressShareOnCreate', 3 | } 4 | 5 | export default OfferLocalStorageKeys; 6 | -------------------------------------------------------------------------------- /run-py-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | 5 | python3 -m venv venv 6 | # shellcheck disable=SC1091 7 | . ./activate 8 | pip3 install ".[dev]" 9 | mypy --install-types 10 | 11 | py.test ./tests -s -v 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hooks'; 2 | export { store, createStore, useAppDispatch, useTypedSelector } from './store'; 3 | export * from './services'; 4 | export * from './slices'; 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Settings/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Settings'; 2 | export { default as SettingsApp } from './SettingsApp'; 3 | export { default as SettingsLabel } from './SettingsLabel'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Spacer/Spacer.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Flex from '../Flex'; 3 | 4 | export default function Spacer() { 5 | return ( 6 | 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/offers/NFTOfferExchangeType.ts: -------------------------------------------------------------------------------- 1 | enum NFTOfferExchangeType { 2 | NFTForSTAI = 'nft_for_stai', 3 | STAIForNFT = 'stai_for_nft', 4 | } 5 | 6 | export default NFTOfferExchangeType; 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/plotLocalStorage.ts: -------------------------------------------------------------------------------- 1 | enum PlotLocalStorageKeys { 2 | TMPDIR = 'tmpdir', 3 | TMP2DIR= 'tmp2dir', 4 | FINALDIR = 'finaldir', 5 | } 6 | 7 | export default PlotLocalStorageKeys; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/OfferCoinOfInterest.ts: -------------------------------------------------------------------------------- 1 | 2 | type OfferCoinOfInterest = { 3 | amount: number; 4 | parentCoinInfo: string; 5 | puzzleHash: string; 6 | }; 7 | 8 | export default OfferCoinOfInterest; 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/PassphrasePromptReason.ts: -------------------------------------------------------------------------------- 1 | enum PassphrasePromptReason { 2 | KEYRING_LOCKED = 'KEYRING_LOCKED', 3 | DELETING_KEY = 'DELETING_KEY', 4 | } 5 | 6 | export default PassphrasePromptReason; 7 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/generator_loader.py: -------------------------------------------------------------------------------- 1 | from stai.wallet.puzzles.load_clvm import load_serialized_clvm 2 | 3 | GENERATOR_FOR_SINGLE_COIN_MOD = load_serialized_clvm("generator_for_single_coin.clvm", package_or_requirement=__name__) 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/ConnectionState.ts: -------------------------------------------------------------------------------- 1 | enum ConnectionState { 2 | CONNECTED = 'CONNECTED', 3 | CONNECTING = 'CONNECTING', 4 | DISCONNECTED = 'DISCONNECTED', 5 | }; 6 | 7 | export default ConnectionState; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Client'; 2 | export * from './services'; 3 | export * from './wallets'; 4 | export * from './constants'; 5 | export * from './utils'; 6 | export * from './@types'; 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/PlotStatus.ts: -------------------------------------------------------------------------------- 1 | enum PlotStatus { 2 | SUBMITTED = 'SUBMITTED', 3 | RUNNING = 'RUNNING', 4 | REMOVING = 'REMOVING', 5 | FINISHED = 'FINISHED', 6 | } 7 | 8 | export default PlotStatus; 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Dropdown/index.ts: -------------------------------------------------------------------------------- 1 | export { default } from './Dropdown'; 2 | export { default as DropdownActions } from './DropdownActions'; 3 | export { default as DropdownIconButton } from './DropdownIconButton'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/config/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | multipleWallets: process.env.MULTIPLE_WALLETS === 'true', 3 | local_test: process.env.LOCAL_TEST === 'true', 4 | backup_host: 'https://backup.STATION-I.de', 5 | }; 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/PlotNFTState.ts: -------------------------------------------------------------------------------- 1 | // PoolSingletonState 2 | 3 | enum PlotNFTState { 4 | SELF_POOLING = 1, 5 | LEAVING_POOL = 2, 6 | FARMING_TO_POOL = 3, 7 | } 8 | 9 | export default PlotNFTState; 10 | -------------------------------------------------------------------------------- /stai/protocols/protocol_timing.py: -------------------------------------------------------------------------------- 1 | # These settings should not be end-user configurable 2 | INVALID_PROTOCOL_BAN_SECONDS = 10 3 | API_EXCEPTION_BAN_SECONDS = 10 4 | INTERNAL_PROTOCOL_ERROR_BAN_SECONDS = 10 # Don't flap if our client is at fault 5 | -------------------------------------------------------------------------------- /tests/core/test_setproctitle.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | from stai.util.setproctitle import setproctitle 4 | 5 | 6 | class TestSetProcTitle(unittest.TestCase): 7 | def test_does_not_crash(self): 8 | setproctitle("stai test title") 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/SyncingStatus.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | enum SyncingStatus { 3 | SYNCING = 'SYNCING', 4 | SYNCED = 'SYNCED', 5 | NOT_SYNCED = 'NOT_SYNCED', 6 | }; 7 | 8 | export default SyncingStatus; 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/UnitValue.ts: -------------------------------------------------------------------------------- 1 | import Unit from './Unit'; 2 | 3 | const UnitValue = { 4 | [Unit.STAI]: 1, 5 | [Unit.MOJO]: 1 / 1e9, 6 | [Unit.CAT]: 1 / 1e9, 7 | }; 8 | 9 | export default UnitValue; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/SyncingStatus.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | enum SyncingStatus { 3 | SYNCING = 'SYNCING', 4 | SYNCED = 'SYNCED', 5 | NOT_SYNCED = 'NOT_SYNCED', 6 | } 7 | 8 | export default SyncingStatus; 9 | -------------------------------------------------------------------------------- /stai/consensus/condition_costs.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ConditionCost(Enum): 5 | # Condition Costs 6 | AGG_SIG = 1200000 # the cost of one G1 subgroup check + aggregated signature validation 7 | CREATE_COIN = 1800000 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/utils/ErrorData.ts: -------------------------------------------------------------------------------- 1 | export default class ErrorData extends Error { 2 | data: any; 3 | 4 | constructor(message: string, data: any) { 5 | super(message); 6 | 7 | this.data = data; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/remote.md: -------------------------------------------------------------------------------- 1 | # Connecting the UI to a Remote Daemon 2 | 3 | _This instructional how-to has been updated and [moved to the wiki](https://github.com/Chia-Network/chia-blockchain/wiki/Connecting-the-UI-to-a-remote-daemon)._ 4 | -------------------------------------------------------------------------------- /stai/wallet/trading/trade_status.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class TradeStatus(Enum): 5 | PENDING_ACCEPT = 0 6 | PENDING_CONFIRM = 1 7 | PENDING_CANCEL = 2 8 | CANCELLED = 3 9 | CONFIRMED = 4 10 | FAILED = 5 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/hooks/useForceUpdate.ts: -------------------------------------------------------------------------------- 1 | import { useReducer } from 'react'; 2 | 3 | export default function useForceUpdate() { 4 | const [_ignored, forceUpdate] = useReducer((x) => x + 1, 0); 5 | 6 | return forceUpdate; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | max_line_length = 80 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/download.ts: -------------------------------------------------------------------------------- 1 | export default async function download(url: string): Promise { 2 | const ipcRenderer = (window as any).ipcRenderer; 3 | 4 | return ipcRenderer?.invoke('download', { 5 | url, 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/src/locales/README.md: -------------------------------------------------------------------------------- 1 | # Localization 2 | 3 | Thanks for helping to translate the GUI for stai-blockchain. 4 | 5 | Please head over to our [Crowdin project](https://crowdin.com/project/stai-blockchain/) and add/edit translations there. 6 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/cat_loader.py: -------------------------------------------------------------------------------- 1 | from stai.wallet.puzzles.load_clvm import load_clvm 2 | 3 | CAT_MOD = load_clvm("cat_v2.clvm", package_or_requirement=__name__) 4 | LOCK_INNER_PUZZLE = load_clvm("lock.inner.puzzle.clvm", package_or_requirement=__name__) 5 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/CoinSolution.ts: -------------------------------------------------------------------------------- 1 | import type Coin from './Coin'; 2 | import type Program from './Program'; 3 | 4 | type CoinSolution = { 5 | coin: Coin; 6 | solution: Program; 7 | }; 8 | 9 | export default CoinSolution; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/UnitFractionDigits.ts: -------------------------------------------------------------------------------- 1 | import Unit from './Unit'; 2 | 3 | const UnitFractionDigits = { 4 | [Unit.STAI]: 9, 5 | [Unit.MOJO]: 0, 6 | [Unit.CAT]: 3, 7 | }; 8 | 9 | export default UnitFractionDigits; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/CoinSolution.ts: -------------------------------------------------------------------------------- 1 | import type Coin from './Coin'; 2 | import type Program from './Program'; 3 | 4 | type CoinSolution = { 5 | coin: Coin; 6 | solution: Program; 7 | }; 8 | 9 | export default CoinSolution; 10 | -------------------------------------------------------------------------------- /stai/clvm/singleton.py: -------------------------------------------------------------------------------- 1 | from stai.wallet.puzzles.load_clvm import load_clvm 2 | 3 | P2_SINGLETON_MOD = load_clvm("p2_singleton.clvm") 4 | SINGLETON_TOP_LAYER_MOD = load_clvm("singleton_top_layer.clvm") 5 | SINGLETON_LAUNCHER = load_clvm("singleton_launcher.clvm") 6 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/sha256tree_module.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff02ff02ffff04ff02ffff04ff05ff80808080ffff04ffff01ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff02ffff04ff02ffff04ff09ff80808080ffff02ff02ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/NFTAttribute.ts: -------------------------------------------------------------------------------- 1 | type NFTAttribute = { 2 | name?: string; 3 | value?: string | number; 4 | trait_type?: string; 5 | min_value?: number; 6 | max_value?: number; 7 | }; 8 | 9 | export default NFTAttribute; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/wallets/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CAT } from './CAT'; 2 | export { default as DID } from './DID'; 3 | export { default as NFT } from './NFT'; 4 | export { default as Pool } from './Pool'; 5 | export { default as RL } from './RL'; 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/locales/README.md: -------------------------------------------------------------------------------- 1 | # Localization 2 | 3 | Thanks for helping to translate the GUI for stai-blockchain. 4 | 5 | Please head over to our [Crowdin project](https://crowdin.com/project/stai-blockchain/) and add/edit translations there. 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/locales/README.md: -------------------------------------------------------------------------------- 1 | # Localization 2 | 3 | Thanks for helping to translate the GUI for stai-blockchain. 4 | 5 | Please head over to our [Crowdin project](https://crowdin.com/project/stai-blockchain/) and add/edit translations there. 6 | -------------------------------------------------------------------------------- /stai/wallet/util/transaction_type.py: -------------------------------------------------------------------------------- 1 | from enum import IntEnum 2 | 3 | 4 | class TransactionType(IntEnum): 5 | INCOMING_TX = 0 6 | OUTGOING_TX = 1 7 | COINBASE_REWARD = 2 8 | FEE_REWARD = 3 9 | INCOMING_TRADE = 4 10 | OUTGOING_TRADE = 5 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Challenge.ts: -------------------------------------------------------------------------------- 1 | type Challenge = { 2 | challenge: string; 3 | difficulty: number; 4 | height: number; 5 | estimates: number[]; 6 | weight: number; 7 | timestamp?: number; 8 | }; 9 | 10 | export default Challenge; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Challenge.ts: -------------------------------------------------------------------------------- 1 | type Challenge = { 2 | challenge: string; 3 | difficulty: number; 4 | height: number; 5 | estimates: number[]; 6 | weight: number; 7 | timestamp?: number; 8 | }; 9 | 10 | export default Challenge; 11 | -------------------------------------------------------------------------------- /stai/util/hash.py: -------------------------------------------------------------------------------- 1 | import blspy 2 | 3 | from stai.types.blockchain_format.sized_bytes import bytes32 4 | 5 | 6 | def std_hash(b) -> bytes32: 7 | """ 8 | The standard hash used in many places. 9 | """ 10 | return bytes32(blspy.Util.hash256(bytes(b))) 11 | -------------------------------------------------------------------------------- /stai/wallet/settings/default_settings.py: -------------------------------------------------------------------------------- 1 | from stai.wallet.settings.settings_objects import BackupInitialized 2 | 3 | default_backup_initialized = BackupInitialized(False, False, False, True) 4 | 5 | default_settings = {BackupInitialized.__name__: default_backup_initialized} 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export { default as getWalletPrimaryTitle } from './getWalletPrimaryTitle'; 2 | export { default as getWalletSyncingStatus } from './getWalletSyncingStatus'; 3 | export { default as isCATWalletPresent } from './isCATWalletPresent'; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/TransactionType.ts: -------------------------------------------------------------------------------- 1 | enum TransactionType { 2 | INCOMING = 0, 3 | OUTGOING = 1, 4 | COINBASE_REWARD = 2, 5 | FEE_REWARD = 3, 6 | INCOMING_TRADE = 4, 7 | OUTGOING_TRADE = 5, 8 | }; 9 | 10 | export default TransactionType; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/IconButton/IconButton.tsx: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import { IconButton } from '@mui/material'; 3 | 4 | const StyledIconButton = styled(IconButton)` 5 | padding: 0.2rem; 6 | `; 7 | 8 | export default StyledIconButton; 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/TransactionType.ts: -------------------------------------------------------------------------------- 1 | enum TransactionType { 2 | INCOMING = 0, 3 | OUTGOING = 1, 4 | COINBASE_REWARD = 2, 5 | FEE_REWARD = 3, 6 | INCOMING_TRADE = 4, 7 | OUTGOING_TRADE = 5, 8 | } 9 | 10 | export default TransactionType; 11 | -------------------------------------------------------------------------------- /stai/types/mempool_inclusion_status.py: -------------------------------------------------------------------------------- 1 | from enum import IntEnum 2 | 3 | 4 | class MempoolInclusionStatus(IntEnum): 5 | SUCCESS = 1 # Transaction added to mempool 6 | PENDING = 2 # Transaction not yet added to mempool 7 | FAILED = 3 # Transaction was invalid and dropped 8 | -------------------------------------------------------------------------------- /stai/util/chunks.py: -------------------------------------------------------------------------------- 1 | from typing import Iterator, List, TypeVar 2 | 3 | T = TypeVar("T") 4 | 5 | 6 | def chunks(in_list: List[T], size: int) -> Iterator[List[T]]: 7 | size = max(1, size) 8 | for i in range(0, len(in_list), size): 9 | yield in_list[i : i + size] 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/FarmingInfo.ts: -------------------------------------------------------------------------------- 1 | type FarmingInfo = { 2 | challengeHash: string; 3 | signagePoint: string; 4 | timestamp: number; 5 | passedFilter: number; 6 | proofs: number; 7 | totalPlots: number; 8 | }; 9 | 10 | export default FarmingInfo; 11 | 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | export * from './constants'; 3 | export * from './utils'; 4 | export * from './hooks'; 5 | export * from './theme'; 6 | export * from './screens'; 7 | export * as locales from './locales'; 8 | export * from './errors'; 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/FarmingInfo.ts: -------------------------------------------------------------------------------- 1 | type FarmingInfo = { 2 | challenge_hash: string; 3 | signage_point: string; 4 | timestamp: number; 5 | passed_filter: number; 6 | proofs: number; 7 | total_plots: number; 8 | }; 9 | 10 | export default FarmingInfo; 11 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/index_lock.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ffff013effff04ffff02ff02ffff04ff02ffff04ff05ff80808080ff808080ff8080ffff04ffff01ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff02ffff04ff02ffff04ff09ff80808080ffff02ff02ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Block.ts: -------------------------------------------------------------------------------- 1 | import type FoliageTransactionBlock from './FoliageTransactionBlock'; 2 | import type Foliage from './Foliage'; 3 | 4 | type Block = { 5 | foliage_transaction_block: FoliageTransactionBlock; 6 | foliage: Foliage; 7 | }; 8 | 9 | export default Block; -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/DialogActions/DialogActions.tsx: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import { DialogActions } from '@mui/material'; 3 | 4 | export default styled(DialogActions)` 5 | padding: ${({ theme }) => `${theme.spacing(2)} ${theme.spacing(3)}`}; 6 | `; 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/getPoolInfo.ts: -------------------------------------------------------------------------------- 1 | import type { PoolInfo } from '@stai/api'; 2 | 3 | export default async function getPoolInfo(poolUrl: string): PoolInfo { 4 | const url = `${poolUrl}/pool_info`; 5 | const response = await fetch(url); 6 | return response.json(); 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/FarmerStatus.ts: -------------------------------------------------------------------------------- 1 | enum FarmerStatus { 2 | FARMING = 'FARMING', 3 | SYNCHING = 'SYNCHING', 4 | NOT_AVAILABLE = 'NOT_AVAILABLE', 5 | NOT_CONNECTED = 'NOT_CONNECTED', 6 | NOT_RUNNING = 'NOT_RUNNING', 7 | } 8 | 9 | export default FarmerStatus; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/SpendBundle.ts: -------------------------------------------------------------------------------- 1 | import type CoinSolution from './CoinSolution'; 2 | import type G2Element from './G2Element'; 3 | 4 | type SpendBundle = { 5 | coin_solutions: CoinSolution[]; 6 | aggregated_signature: G2Element; 7 | }; 8 | 9 | export default SpendBundle; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/SpendBundle.ts: -------------------------------------------------------------------------------- 1 | import type CoinSolution from './CoinSolution'; 2 | import type G2Element from './G2Element'; 3 | 4 | type SpendBundle = { 5 | coin_solutions: CoinSolution[]; 6 | aggregated_signature: G2Element; 7 | }; 8 | 9 | export default SpendBundle; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/pool/PoolHeader.tsx: -------------------------------------------------------------------------------- 1 | import { createTeleporter } from 'react-teleporter'; 2 | 3 | const PoolHeaderTeleporter = createTeleporter(); 4 | 5 | export const PoolHeaderSource = PoolHeaderTeleporter.Source; 6 | 7 | export const PoolHeaderTarget = PoolHeaderTeleporter.Target; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Block.ts: -------------------------------------------------------------------------------- 1 | import type FoliageTransactionBlock from './FoliageTransactionBlock'; 2 | import type Foliage from './Foliage'; 3 | 4 | type Block = { 5 | foliage_transaction_block: FoliageTransactionBlock; 6 | foliage: Foliage; 7 | }; 8 | 9 | export default Block; 10 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/rom_bootstrap_generator.py: -------------------------------------------------------------------------------- 1 | from stai.types.blockchain_format.program import SerializedProgram 2 | 3 | from .load_clvm import load_clvm 4 | 5 | MOD = SerializedProgram.from_bytes(load_clvm("rom_bootstrap_generator.clvm").as_bin()) 6 | 7 | 8 | def get_generator(): 9 | return MOD 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/SignagePoint.ts: -------------------------------------------------------------------------------- 1 | type SignagePoint = { 2 | challenge_hash: string; 3 | challenge_chain_sp: string; 4 | reward_chain_sp: string; 5 | difficulty: number; 6 | sub_slot_iters: number; 7 | signage_point_index: number; 8 | }; 9 | 10 | export default SignagePoint; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useSkipMigration.ts: -------------------------------------------------------------------------------- 1 | import useLocalStorage from './useLocalStorage'; 2 | 3 | export default function useSkipMigration(): [boolean, (skip: boolean) => void] { 4 | const [skip, setSkip] = useLocalStorage('skipMigration', false); 5 | 6 | return [skip, setSkip]; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/SignagePoint.ts: -------------------------------------------------------------------------------- 1 | type SignagePoint = { 2 | challenge_hash: string; 3 | challenge_chain_sp: string; 4 | reward_chain_sp: string; 5 | difficulty: number; 6 | sub_slot_iters: number; 7 | signage_point_index: number; 8 | }; 9 | 10 | export default SignagePoint; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/UnconfirmedPlotNFT.ts: -------------------------------------------------------------------------------- 1 | import PlotNFTState from '../constants/PlotNFTState'; 2 | 3 | type UnconfirmedPlotNFT = { 4 | fingerprint: string; 5 | transactionId: string; 6 | state: PlotNFTState; 7 | poolUrl?: string; 8 | }; 9 | 10 | export default UnconfirmedPlotNFT; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Farm.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import FarmIcon from './images/farm.svg'; 4 | 5 | export default function Farm(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Keys.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import KeysIcon from './images/keys.svg'; 4 | 5 | export default function Keys(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Plot.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import PlotIcon from './images/plot.svg'; 4 | 5 | export default function Plot(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Pool.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import FarmIcon from './images/pool.svg'; 4 | 5 | export default function Farm(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_coin_spend_entry.clvm: -------------------------------------------------------------------------------- 1 | (mod (deserialize decompress_puzzle puzzle_prefix suffix cse) 2 | 3 | ; decompress a single compressed standard transaction 4 | (c (f cse) (c (a decompress_puzzle (list deserialize puzzle_prefix (f (f (r cse))) suffix)) (c (f (r (f cse))) (r (f (r cse)))))) 5 | ) 6 | -------------------------------------------------------------------------------- /tests/runner_templates/check-resource-usage.include.yml: -------------------------------------------------------------------------------- 1 | - name: Check resource usage 2 | run: | 3 | sqlite3 -readonly -separator " " .pymon "select item,cpu_usage,total_time,mem_usage from TEST_METRICS order by mem_usage desc;" >metrics.out 4 | ./tests/check_pytest_monitor_output.py ; 7 | } 8 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_conditions.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff0bff80808080ff80808080ff0b80ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 2 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_puzzle_hash.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff02ffff03ffff09ff05ffff02ff02ffff04ff02ffff04ff0bff8080808080ffff01ff02ff0bff1780ffff01ff088080ff0180ffff04ffff01ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff02ffff04ff02ffff04ff09ff80808080ffff02ff02ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/MessageInterface.ts: -------------------------------------------------------------------------------- 1 | import ServiceName from "../constants/ServiceName"; 2 | 3 | export default interface MessageInterface { 4 | command: string; 5 | data: Object; 6 | origin: ServiceName; 7 | destination: ServiceName; 8 | ack: boolean; 9 | requestId?: string; 10 | } 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/StateIndicator/StateIndicatorDot.tsx: -------------------------------------------------------------------------------- 1 | import styled from 'styled-components'; 2 | import { FiberManualRecord as FiberManualRecordIcon } from '@mui/icons-material'; 3 | 4 | export default styled(FiberManualRecordIcon)` 5 | font-size: 1rem; 6 | color: ${({ color }) => color}; 7 | `; 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Plots.tsx: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react'; 3 | import { SvgIcon, SvgIconProps } from '@mui/material'; 4 | import PlotsIcon from './images/Plots.svg'; 5 | 6 | export default function Plots(props: SvgIconProps) { 7 | return ; 8 | } 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Tokens.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import TokensIcon from './images/Tokens.svg'; 4 | 5 | export default function Tokens(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Wallet.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import WalletIcon from './images/wallet.svg'; 4 | 5 | export default function Wallet(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_puzzle.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff0bff80808080ff80808080ffff02ff0bff178080ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Farming.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import FarmingIcon from './images/Farming.svg'; 4 | 5 | export default function Farming(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch=True 3 | relative_files=True 4 | source= 5 | stai 6 | tests 7 | concurrency=multiprocessing 8 | parallel=True 9 | 10 | [report] 11 | precision = 1 12 | exclude_lines = 13 | pragma: no cover 14 | abc\.abstractmethod 15 | typing\.overload 16 | ^\s*\.\.\.\s*$ 17 | if typing.TYPE_CHECKING: 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/isRankingAttribute.ts: -------------------------------------------------------------------------------- 1 | import type { NFTAttribute } from '@stai/api'; 2 | 3 | export default function isRankingAttribute(attribute: NFTAttribute) { 4 | if ('max_value' in attribute && typeof attribute.max_value === 'number') { 5 | return true; 6 | } 7 | 8 | return false; 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/FullNode.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import FullNodeIcon from './images/FullNode.svg'; 4 | 5 | export default function FullNode(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Link.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import LinkSmallIcon from './images/LinkSmall.svg'; 4 | 5 | export default function LinkSmall(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/PlotHero.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import PlotHeroIcon from './images/PlotHero.svg'; 4 | 5 | export default function PlotHero(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Pooling.tsx: -------------------------------------------------------------------------------- 1 | 2 | import React from 'react'; 3 | import { SvgIcon, SvgIconProps } from '@mui/material'; 4 | import PoolingIcon from './images/Pooling.svg'; 5 | 6 | export default function Pooling(props: SvgIconProps) { 7 | return ; 8 | } 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Settings.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import SettingsIcon from './images/settings.svg'; 4 | 5 | export default function Settings(props: SvgIconProps) { 6 | return ; 7 | } 8 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/sha256tree.clib: -------------------------------------------------------------------------------- 1 | ( 2 | ;; hash a tree 3 | ;; This is used to calculate a puzzle hash given a puzzle program. 4 | (defun sha256tree 5 | (TREE) 6 | (if (l TREE) 7 | (sha256 2 (sha256tree (f TREE)) (sha256tree (r TREE))) 8 | (sha256 1 TREE) 9 | ) 10 | ) 11 | ) -------------------------------------------------------------------------------- /tests/util/temp_file.py: -------------------------------------------------------------------------------- 1 | import contextlib 2 | import tempfile 3 | from pathlib import Path 4 | from typing import Iterator 5 | 6 | 7 | @contextlib.contextmanager 8 | def TempFile() -> Iterator[Path]: 9 | path = Path(tempfile.NamedTemporaryFile().name) 10 | yield path 11 | if path.exists(): 12 | path.unlink() 13 | -------------------------------------------------------------------------------- /stai/cmds/units.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | # The rest of the codebase uses mojos everywhere. 4 | # Only use these units for user facing interfaces. 5 | units: Dict[str, int] = { 6 | "stai": 10 ** 9, # 1 stai (STAI) is 1,000,000,000 mojo (1 billion) 7 | "mojo": 1, 8 | "cat": 10 ** 3, # 1 CAT is 1000 CAT mojos 9 | } 10 | -------------------------------------------------------------------------------- /tests/plotting/util.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | from typing import List 3 | 4 | from tests.block_tools import get_plot_dir 5 | 6 | 7 | def get_test_plots(sub_dir: str = "") -> List[Path]: 8 | path = get_plot_dir() 9 | if sub_dir != "": 10 | path = path / sub_dir 11 | return list(sorted(path.glob("*.plot"))) 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/api.ts: -------------------------------------------------------------------------------- 1 | import { createApi } from '@reduxjs/toolkit/query/react'; 2 | import staiLazyBaseQuery from './staiLazyBaseQuery'; 3 | 4 | export const baseQuery = staiLazyBaseQuery({}); 5 | 6 | export default createApi({ 7 | reducerPath: 'staiApi', 8 | baseQuery, 9 | endpoints: () => ({}), 10 | }); 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/useColorModeValue.ts: -------------------------------------------------------------------------------- 1 | export default function useColorModeValue(theme, color: string): string { 2 | const isDark = theme.palette.mode === 'dark'; 3 | 4 | const value = isDark 5 | ? theme.palette[color].dark 6 | : theme.palette[color].light; 7 | 8 | return value ?? theme.palette[color].main; 9 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/entitlements.mac.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.allow-unsigned-executable-memory 6 | 7 | 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/offers/OfferEditorRowData.ts: -------------------------------------------------------------------------------- 1 | import type BigNumber from 'bignumber.js'; 2 | import OfferRowData from './OfferRowData'; 3 | 4 | type OfferEditorRowData = OfferRowData & { 5 | spendableBalance: BigNumber; 6 | spendableBalanceString?: string; 7 | }; 8 | 9 | export default OfferEditorRowData; 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/hooks/useNFTHash.ts: -------------------------------------------------------------------------------- 1 | import type NFTInfo from '@stai/api'; 2 | import useVerifyURIHash from './useVerifyURIHash'; 3 | 4 | export default function useNFTHash(nft: NFTInfo) { 5 | const { dataHash, dataUris } = nft; 6 | const uri = dataUris?.[0]; 7 | 8 | return useVerifyURIHash(uri, dataHash); 9 | } 10 | -------------------------------------------------------------------------------- /stai/util/make_test_constants.py: -------------------------------------------------------------------------------- 1 | from typing import Dict 2 | 3 | from stai.consensus.constants import ConsensusConstants 4 | from stai.consensus.default_constants import DEFAULT_CONSTANTS 5 | 6 | 7 | def make_test_constants(test_constants_overrides: Dict) -> ConsensusConstants: 8 | return DEFAULT_CONSTANTS.replace(**test_constants_overrides) 9 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm: -------------------------------------------------------------------------------- 1 | (mod (deserialize decompress_puzzle puzzle_prefix cse) 2 | 3 | ; decompress a single compressed standard transaction 4 | 5 | (c (f (f cse)) (c (a decompress_puzzle (list deserialize puzzle_prefix (f (f (r cse))) (q . 0xff018080))) (c (f (r (f cse))) (r (f (r cse)))))) 6 | 7 | ) 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/offers/OfferRowData.tsx: -------------------------------------------------------------------------------- 1 | import type BigNumber from 'bignumber.js'; 2 | import { type WalletType } from '@stai/api'; 3 | 4 | type OfferRowData = { 5 | amount: string; 6 | assetWalletId: number; // 0 if no selection made 7 | walletType: WalletType; 8 | }; 9 | 10 | export default OfferRowData; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/offers/OfferState.ts: -------------------------------------------------------------------------------- 1 | 2 | enum OfferState { 3 | PENDING_ACCEPT = 'PENDING_ACCEPT', 4 | PENDING_CONFIRM = 'PENDING_CONFIRM', 5 | PENDING_CANCEL = 'PENDING_CANCEL', 6 | CANCELLED = 'CANCELLED', 7 | CONFIRMED = 'CONFIRMED', 8 | FAILED = 'FAILED', 9 | }; 10 | 11 | export default OfferState; 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/InitialTargetState.ts: -------------------------------------------------------------------------------- 1 | type InitialTargetState = 2 | | { 3 | state: 'SELF_POOLING'; 4 | } 5 | | { 6 | state: 'FARMING_TO_POOL'; 7 | pool_url: string; 8 | relative_lock_height: number; 9 | target_puzzle_hash: string; 10 | }; 11 | 12 | export default InitialTargetState; 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/InitialTargetState.ts: -------------------------------------------------------------------------------- 1 | type InitialTargetState = 2 | | { 3 | state: 'SELF_POOLING'; 4 | } 5 | | { 6 | state: 'FARMING_TO_POOL'; 7 | pool_url: string; 8 | relative_lock_height: number; 9 | target_puzzle_hash: string; 10 | }; 11 | 12 | export default InitialTargetState; 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Mode } from './Mode'; 2 | export { default as State } from './State'; 3 | export { default as StateColor } from './StateColor'; 4 | export { default as Unit } from './Unit'; 5 | export { default as UnitAliases } from './UnitAliases'; 6 | export { default as UnitValue } from './UnitValue'; 7 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/catToMojo.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | import Unit from '../constants/Unit'; 3 | import staiFormatter from './staiFormatter'; 4 | 5 | export default function catToMojo(cat: string | number | BigNumber): BigNumber { 6 | return staiFormatter(cat, Unit.CAT) 7 | .to(Unit.MOJO) 8 | .toBigNumber(); 9 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/mojoToCAT.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | import Unit from '../constants/Unit'; 3 | import staiFormatter from './staiFormatter'; 4 | 5 | export default function mojoToCAT(mojo: string | number | BigNumber): BigNumber { 6 | return staiFormatter(mojo, Unit.MOJO) 7 | .to(Unit.CAT) 8 | .toBigNumber(); 9 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Coin.ts: -------------------------------------------------------------------------------- 1 | import { WalletType } from '@stai/api'; 2 | 3 | type Coin = { 4 | confirmed_block_index: number; 5 | spent_block_index: number; 6 | spent: boolean; 7 | coinbase: boolean; 8 | wallet_type: WalletType; 9 | wallet_id: number; 10 | parent_coin_info: string; 11 | }; 12 | 13 | export default Coin; 14 | -------------------------------------------------------------------------------- /stai/__init__.py: -------------------------------------------------------------------------------- 1 | from pkg_resources import DistributionNotFound, get_distribution, resource_filename 2 | 3 | try: 4 | __version__ = get_distribution("stai-blockchain").version 5 | except DistributionNotFound: 6 | # package is not installed 7 | __version__ = "unknown" 8 | 9 | PYINSTALLER_SPEC_PATH = resource_filename("stai", "pyinstaller.spec") 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/FoliageTransactionBlock.ts: -------------------------------------------------------------------------------- 1 | type FoliageTransactionBlock = { 2 | additions_root: string; 3 | filter_hash: string; 4 | height: number; 5 | prev_block_hash: string; 6 | removals_root: string; 7 | timestamp: string; 8 | transactions_info_hash: string; 9 | }; 10 | 11 | export default FoliageTransactionBlock; 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/mojoToStai.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | import Unit from '../constants/Unit'; 3 | import staiFormatter from './staiFormatter'; 4 | 5 | export default function mojoToStai(mojo: string | number | BigNumber): BigNumber { 6 | return staiFormatter(mojo, Unit.MOJO) 7 | .to(Unit.STAI) 8 | .toBigNumber(); 9 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/staiToMojo.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | import Unit from '../constants/Unit'; 3 | import staiFormatter from './staiFormatter'; 4 | 5 | export default function staiToMojo(stai: string | number | BigNumber): BigNumber { 6 | return staiFormatter(stai, Unit.STAI) 7 | .to(Unit.MOJO) 8 | .toBigNumber(); 9 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/FoliageTransactionBlock.ts: -------------------------------------------------------------------------------- 1 | type FoliageTransactionBlock = { 2 | additions_root: string; 3 | filter_hash: string; 4 | height: number; 5 | prev_block_hash: string; 6 | removals_root: string; 7 | timestamp: string; 8 | transactions_info_hash: string; 9 | }; 10 | 11 | export default FoliageTransactionBlock; 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/PoolInfo.ts: -------------------------------------------------------------------------------- 1 | type PoolInfo = { 2 | name: string; 3 | description: string; 4 | pool_url: string; 5 | fee: string; 6 | logo_url: string; 7 | minimum_difficulty: number; 8 | protocol_version: string; 9 | relative_lock_height: number; 10 | target_puzzle_hash: string; 11 | }; 12 | 13 | export default PoolInfo; 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/PoolInfo.ts: -------------------------------------------------------------------------------- 1 | type PoolInfo = { 2 | name: string; 3 | description: string; 4 | pool_url: string; 5 | fee: string; 6 | logo_url: string; 7 | minimum_difficulty: number; 8 | protocol_version: string; 9 | relative_lock_height: number; 10 | target_puzzle_hash: string; 11 | }; 12 | 13 | export default PoolInfo; 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/wallet_types.js: -------------------------------------------------------------------------------- 1 | export const STANDARD_WALLET = 0; 2 | export const RATE_LIMITED = 1; 3 | export const ATOMIC_SWAP = 2; 4 | export const AUTHORIZED_PAYEE = 3; 5 | export const MULTI_SIG = 4; 6 | export const CUSTODY = 5; 7 | export const COLOURED_COIN = 6; 8 | export const RECOVERABLE = 7; 9 | export const DECENTRALIZED_ID = 8; 10 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/block_program_zero.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff02ff02ffff04ff02ffff04ff05ffff04ff0bffff04ff5fffff04ff81bfffff04ffff0cff82027fff17ff2f80ff8080808080808080ff8080ffff04ffff01ff02ffff03ff17ffff01ff04ffff02ff0bffff04ff2fffff04ff05ffff04ff5fffff04ff27ff808080808080ffff02ff02ffff04ff02ffff04ff05ffff04ff0bffff04ff37ffff04ff2fffff04ff5fff808080808080808080ff8080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Coin.ts: -------------------------------------------------------------------------------- 1 | import type WalletType from '../constants/WalletType'; 2 | 3 | type Coin = { 4 | confirmed_block_index: number; 5 | spent_block_index: number; 6 | spent: boolean; 7 | coinbase: boolean; 8 | wallet_type: WalletType; 9 | wallet_id: number; 10 | parent_coin_info: string; 11 | }; 12 | 13 | export default Coin; 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export { default as defaultsForPlotter } from './defaultsForPlotter'; 2 | export { default as english } from './english'; 3 | export { default as optionsForPlotter } from './optionsForPlotter'; 4 | export { default as toCamelCase } from './toCamelCase'; 5 | export { default as toBech32m, fromBech32m, decodeBech32m } from './toBech32m'; 6 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/singleton_launcher.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ff04ffff04ff05ffff04ff0bff80808080ffff04ffff04ff0affff04ffff02ff0effff04ff02ffff04ffff04ff05ffff04ff0bffff04ff17ff80808080ff80808080ff808080ff808080ffff04ffff01ff33ff3cff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff0effff04ff02ffff04ff09ff80808080ffff02ff0effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Plot.ts: -------------------------------------------------------------------------------- 1 | type Plot = { 2 | plot_id: string; 3 | filename: string; 4 | file_size: number; 5 | size: number; 6 | local_sk: string; 7 | farmer_public_key: string; 8 | plot_public_key: string; 9 | pool_public_key: string; 10 | pool_contract_puzzle_hash: string; 11 | duplicates?: Plot[]; 12 | }; 13 | 14 | export default Plot; 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/PlotNFT.ts: -------------------------------------------------------------------------------- 1 | import type PoolState from './PoolState'; 2 | import type PoolWalletStatus from './PoolWalletStatus'; 3 | import type WalletBalance from './WalletBalance'; 4 | 5 | type PlotNFT = { 6 | pool_state: PoolState; 7 | wallet_balance: WalletBalance; 8 | pool_wallet_status: PoolWalletStatus; 9 | }; 10 | 11 | export default PlotNFT; 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Fonts/Fonts.tsx: -------------------------------------------------------------------------------- 1 | import { createGlobalStyle } from 'styled-components'; 2 | import '@fontsource/roboto/700.css'; 3 | import '@fontsource/roboto/500.css'; 4 | import '@fontsource/roboto/400.css'; 5 | import '@fontsource/roboto/300.css'; 6 | 7 | export default createGlobalStyle` 8 | body { 9 | font-family: "Roboto"; 10 | } 11 | `; 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Plot.ts: -------------------------------------------------------------------------------- 1 | type Plot = { 2 | plot_id: string; 3 | filename: string; 4 | file_size: number; 5 | size: number; 6 | local_sk: string; 7 | farmer_public_key: string; 8 | plot_public_key: string; 9 | pool_public_key: string; 10 | pool_contract_puzzle_hash: string; 11 | duplicates?: Plot[]; 12 | }; 13 | 14 | export default Plot; 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/PlotNFT.ts: -------------------------------------------------------------------------------- 1 | import type PoolState from './PoolState'; 2 | import type PoolWalletStatus from './PoolWalletStatus'; 3 | import type WalletBalance from './WalletBalance'; 4 | 5 | type PlotNFT = { 6 | pool_state: PoolState; 7 | wallet_balance: WalletBalance; 8 | pool_wallet_status: PoolWalletStatus; 9 | }; 10 | 11 | export default PlotNFT; 12 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/delegated_tail.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff82027fff80808080ff80808080ffff02ff82027fffff04ff0bffff04ff17ffff04ff2fffff04ff5fffff04ff81bfff82057f80808080808080ffff04ffff01ff31ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/hooks/useLogout.ts: -------------------------------------------------------------------------------- 1 | import { walletApi } from '../services/wallet'; 2 | import { useAppDispatch } from '../store'; 3 | 4 | export default function useLogout() { 5 | const dispatch = useAppDispatch(); 6 | 7 | async function handleLogout() { 8 | return dispatch(walletApi.util.resetApiState()); 9 | } 10 | 11 | return handleLogout; 12 | } 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/PlotQueueItem.ts: -------------------------------------------------------------------------------- 1 | import PlotStatus from '../constants/PlotStatus'; 2 | 3 | type PlotQueueItem = { 4 | id: string; 5 | queue: string; 6 | size: number; 7 | parallel: boolean; 8 | delay: number; 9 | state: PlotStatus; 10 | error?: string; 11 | log?: string; 12 | progress?: number; 13 | }; 14 | 15 | export default PlotQueueItem; 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/PlotQueueItem.ts: -------------------------------------------------------------------------------- 1 | import PlotStatus from '../constants/PlotStatus'; 2 | 3 | type PlotQueueItem = { 4 | id: string; 5 | queue: string; 6 | size: number; 7 | parallel: boolean; 8 | delay: number; 9 | state: PlotStatus; 10 | error?: string; 11 | log?: string; 12 | progress?: number; 13 | }; 14 | 15 | export default PlotQueueItem; 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/getPoolInfo.ts: -------------------------------------------------------------------------------- 1 | import type { PoolInfo } from '@stai/api'; 2 | import { toCamelCase } from '@stai/api'; 3 | 4 | export default async function getPoolInfo(poolUrl: string): PoolInfo { 5 | const url = `${poolUrl}/pool_info`; 6 | const response = await fetch(url); 7 | const data = await response.json(); 8 | 9 | return toCamelCase(data); 10 | } 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export { default as useIsWalletSynced } from './useIsWalletSynced'; 2 | export { default as useWallet } from './useWallet'; 3 | export { default as useWalletHumanValue } from './useWalletHumanValue'; 4 | export { default as useWalletState } from './useWalletState'; 5 | export { default as useWalletTransactions } from './useWalletTransactions'; 6 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/hooks/useIsWalletSynced.ts: -------------------------------------------------------------------------------- 1 | import { SyncingStatus } from '@stai/api'; 2 | import useWalletState from './useWalletState'; 3 | 4 | export default function useIsWalletSynced(): boolean { 5 | const { state, isLoading } = useWalletState(); 6 | const isWalletSynced = !isLoading && state === SyncingStatus.SYNCED; 7 | 8 | return isWalletSynced; 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/app/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ModeProvider, Persist } from '@stai/core'; 3 | import AppRouter from './AppRouter'; 4 | 5 | export default function App() { 6 | return ( 7 | 8 | 9 | 10 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/utils/getWalletPrimaryTitle.ts: -------------------------------------------------------------------------------- 1 | import { WalletType } from '@stai/api'; 2 | import type { Wallet } from '@stai/api'; 3 | 4 | export default function getWalletPrimaryTitle(wallet: Wallet): string { 5 | switch (wallet.type) { 6 | case WalletType.STANDARD_WALLET: 7 | return 'STAI'; 8 | default: 9 | return wallet.name; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/utility_macros.clib: -------------------------------------------------------------------------------- 1 | ( 2 | (defmacro assert items 3 | (if (r items) 4 | (list if (f items) (c assert (r items)) (q . (x))) 5 | (f items) 6 | ) 7 | ) 8 | 9 | (defmacro and ARGS 10 | (if ARGS 11 | (qq (if (unquote (f ARGS)) 12 | (unquote (c and (r ARGS))) 13 | () 14 | )) 15 | 1) 16 | ) 17 | ) -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/WalletType.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line 2 | enum WalletType { 3 | STANDARD_WALLET = 0, 4 | RATE_LIMITED = 1, 5 | ATOMIC_SWAP = 2, 6 | AUTHORIZED_PAYEE = 3, 7 | MULTI_SIG = 4, 8 | CUSTODY = 5, 9 | CAT = 6, 10 | RECOVERABLE = 7, 11 | DECENTRALIZED_ID = 8, 12 | POOLING_WALLET = 9, 13 | NFT = 10, 14 | } 15 | 16 | export default WalletType; 17 | -------------------------------------------------------------------------------- /stai/util/log_exceptions.py: -------------------------------------------------------------------------------- 1 | from contextlib import contextmanager 2 | import logging 3 | import traceback 4 | 5 | 6 | @contextmanager 7 | def log_exceptions(log: logging.Logger, *, consume: bool = False): 8 | try: 9 | yield 10 | except Exception as e: 11 | log.error(f"Caught Exception: {e}. Traceback: {traceback.format_exc()}") 12 | if not consume: 13 | raise 14 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/sha256tree_module.clvm: -------------------------------------------------------------------------------- 1 | ( 2 | mod (program) 3 | 4 | ;; hash a tree 5 | ;; This is used to calculate a puzzle hash given a puzzle program. 6 | (defun sha256tree 7 | (TREE) 8 | (if (l TREE) 9 | (sha256 2 (sha256tree (f TREE)) (sha256tree (r TREE))) 10 | (sha256 1 TREE) 11 | ) 12 | ) 13 | 14 | (sha256tree program) 15 | ) -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/utils/toSnakeCase.ts: -------------------------------------------------------------------------------- 1 | import { snakeCase, transform, isArray, isObject } from 'lodash'; 2 | 3 | export default function toSnakeCase(object: Object): Object { 4 | return transform(object, (acc, value, key, target) => { 5 | const newKey = isArray(target) ? key : snakeCase(key); 6 | 7 | acc[newKey] = isObject(value) ? toSnakeCase(value) : value; 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useCurrencyCode.ts: -------------------------------------------------------------------------------- 1 | import { useGetNetworkInfoQuery } from '@stai/api-react'; 2 | 3 | export default function useCurrencyCode(): string | undefined { 4 | const { data: networkInfo, isLoading } = useGetNetworkInfoQuery(); 5 | 6 | if (isLoading || !networkInfo) { 7 | return undefined; 8 | } 9 | 10 | return networkInfo.networkPrefix.toUpperCase(); 11 | } 12 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/mojoToCATLocaleString.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | import Unit from '../constants/Unit'; 3 | import staiFormatter from './staiFormatter'; 4 | 5 | export default function mojoToCATLocaleString(mojo: string | number | BigNumber, locale?: string) { 6 | return staiFormatter(mojo, Unit.MOJO) 7 | .to(Unit.CAT) 8 | .toLocaleString(locale); 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/mojoToStaiLocaleString.ts: -------------------------------------------------------------------------------- 1 | import BigNumber from 'bignumber.js'; 2 | import Unit from '../constants/Unit'; 3 | import staiFormatter from './staiFormatter'; 4 | 5 | export default function mojoToStaiLocaleString(mojo: string | number | BigNumber, locale?: string) { 6 | return staiFormatter(mojo, Unit.MOJO) 7 | .to(Unit.STAI) 8 | .toLocaleString(locale); 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/settings/SettingsGeneral.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Grid } from '@mui/material'; 3 | import SettingsPanel from './SettingsPanel'; 4 | 5 | export default function SettingsGeneral() { 6 | return ( 7 | 8 | 9 | 10 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/mergeArrayItem.ts: -------------------------------------------------------------------------------- 1 | export default function mergeArrayItem( 2 | array: T[] | undefined, 3 | identity: (item: T) => boolean, 4 | object: Partial, 5 | ): T[] { 6 | return array?.map((item) => { 7 | if (identity(item)) { 8 | return { 9 | ...item, 10 | ...object, 11 | }; 12 | } 13 | 14 | return item; 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Install instructions have been moved to the [INSTALL](https://github.com/STATION-I/stai-blockchain/wiki/Install-STAI) section of the repository [Wiki](https://github.com/STATION-I/stai-blockchain/wiki). 4 | 5 | After installing, follow the remaining instructions in the 6 | [Quick Start Guide](https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide) 7 | to run the software. 8 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Connection.ts: -------------------------------------------------------------------------------- 1 | type Connection = { 2 | bytes_read: number; 3 | bytes_written: number; 4 | creation_time: number; 5 | last_message_time: number; 6 | local_host: string; 7 | local_port: number; 8 | node_id: string; 9 | peer_host: string; 10 | peer_port: number; 11 | peer_server_port: number; 12 | type: number; 13 | }; 14 | 15 | export default Connection; 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/images/NFTs.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Connection.ts: -------------------------------------------------------------------------------- 1 | type Connection = { 2 | bytes_read: number; 3 | bytes_written: number; 4 | creation_time: number; 5 | last_message_time: number; 6 | local_host: string; 7 | local_port: number; 8 | node_id: string; 9 | peer_host: string; 10 | peer_port: number; 11 | peer_server_port: number; 12 | type: number; 13 | }; 14 | 15 | export default Connection; 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/computeHash.ts: -------------------------------------------------------------------------------- 1 | import crypto from 'crypto'; 2 | 3 | export default function computeHash( 4 | content: string, 5 | options: { hash?: string; encoding?: string }, 6 | ): string { 7 | const { hash, encoding } = options; 8 | return crypto 9 | .createHash(hash ?? 'sha256') 10 | .update(content, (encoding ?? 'binary') as crypto.Encoding) 11 | .digest('hex'); 12 | } 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/utils/getWalletSyncingStatus.ts: -------------------------------------------------------------------------------- 1 | import { SyncingStatus } from '@stai/api'; 2 | 3 | export default function getWalletSyncingStatus(walletState) { 4 | const { syncing, synced } = walletState; 5 | 6 | if (syncing) { 7 | return SyncingStatus.SYNCING; 8 | } else if (synced) { 9 | return SyncingStatus.SYNCED; 10 | } 11 | 12 | return SyncingStatus.NOT_SYNCED; 13 | } 14 | -------------------------------------------------------------------------------- /stai/util/safe_cancel_task.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import logging 3 | from typing import Optional 4 | 5 | 6 | def cancel_task_safe(task: Optional[asyncio.Task], log: Optional[logging.Logger] = None): 7 | if task is not None: 8 | try: 9 | task.cancel() 10 | except Exception as e: 11 | if log is not None: 12 | log.error(f"Error while canceling task.{e} {task}") 13 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/everything_with_signature.clvm: -------------------------------------------------------------------------------- 1 | ; This is a "limitations_program" for use with cat.clvm. 2 | (mod ( 3 | PUBKEY 4 | Truths 5 | parent_is_cat 6 | lineage_proof 7 | delta 8 | inner_conditions 9 | _ 10 | ) 11 | 12 | (include condition_codes.clvm) 13 | 14 | (list (list AGG_SIG_ME PUBKEY delta)) ; Careful with a delta of zero, the bytecode is 80 not 00 15 | ) -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/hooks/useOpenExternal.ts: -------------------------------------------------------------------------------- 1 | import isElectron from 'is-electron'; 2 | 3 | export default function useOpenExternal(): (url: string) => void { 4 | function handleOpen(url: string) { 5 | if (isElectron()) { 6 | // @ts-ignore 7 | window.shell.openExternal(url); 8 | return; 9 | } 10 | 11 | window.open(url, '_blank'); 12 | } 13 | 14 | return handleOpen; 15 | } 16 | -------------------------------------------------------------------------------- /stai/timelord/types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class Chain(Enum): 5 | CHALLENGE_CHAIN = 1 6 | REWARD_CHAIN = 2 7 | INFUSED_CHALLENGE_CHAIN = 3 8 | BLUEBOX = 4 9 | 10 | 11 | class IterationType(Enum): 12 | SIGNAGE_POINT = 1 13 | INFUSION_POINT = 2 14 | END_OF_SUBSLOT = 3 15 | 16 | 17 | class StateType(Enum): 18 | PEAK = 1 19 | END_OF_SUB_SLOT = 2 20 | FIRST_SUB_SLOT = 3 21 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useOpenExternal.ts: -------------------------------------------------------------------------------- 1 | import isElectron from 'is-electron'; 2 | 3 | export default function useOpenExternal(): (url: string) => void { 4 | function handleOpen(url: string) { 5 | if (isElectron()) { 6 | // @ts-ignore 7 | window.shell.openExternal(url); 8 | return; 9 | } 10 | 11 | window.open(url, '_blank'); 12 | } 13 | 14 | return handleOpen; 15 | } 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/blockHeightToTimestamp.ts: -------------------------------------------------------------------------------- 1 | import type Peak from '../types/Peak'; 2 | 3 | const BLOCK_DURATION_SECONDS = (24 * 60 * 60) / 4608; 4 | 5 | export default function blockHeightToTimestamp( 6 | height: number, 7 | peak: Peak, 8 | ): number { 9 | const diff = peak.height - height; 10 | const seconds = diff * BLOCK_DURATION_SECONDS; 11 | 12 | return peak.timestamp - seconds; 13 | } 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/images/NFTsSmall.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /stai/util/default_root.py: -------------------------------------------------------------------------------- 1 | import os 2 | from pathlib import Path 3 | 4 | DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("STAI_ROOT", "~/.stai/mainnet"))).resolve() 5 | STANDALONE_ROOT_PATH = Path( 6 | os.path.expanduser(os.getenv("STAI_STANDALONE_WALLET_ROOT", "~/.stai/standalone_wallet")) 7 | ).resolve() 8 | 9 | DEFAULT_KEYS_ROOT_PATH = Path(os.path.expanduser(os.getenv("STAI_KEYS_ROOT", "~/.stai_keys"))).resolve() 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/WalletBalance.ts: -------------------------------------------------------------------------------- 1 | type WalletBalance = { 2 | walletId: number; 3 | confirmedWalletBalance: number; 4 | max_send_amount: number; 5 | pending_change: number; 6 | pending_coin_removal_count: number; 7 | spendable_balance: number; 8 | unconfirmed_wallet_balance: number; 9 | unspent_coin_count: number; 10 | balance_pending: number; 11 | }; 12 | 13 | export default WalletBalance; 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/utils/toCamelCase.ts: -------------------------------------------------------------------------------- 1 | import { camelCase, transform, isArray, isObject } from 'lodash'; 2 | 3 | export default function toCamelCase(object: Object): Object { 4 | return transform(object, (acc, value, key, target) => { 5 | const newKey = isArray(target) || key.indexOf('_') === -1 ? key : camelCase(key); 6 | 7 | acc[newKey] = isObject(value) ? toCamelCase(value) : value; 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useTrans.ts: -------------------------------------------------------------------------------- 1 | import { useCallback } from "react"; 2 | import { useLingui } from "@lingui/react"; 3 | 4 | export default function useTrans() { 5 | const { i18n } = useLingui(); 6 | 7 | const handleTranslate = useCallback((messageId: string, values?: Object, options?: Object) => { 8 | return i18n._(messageId, values, options); 9 | }, [i18n]); 10 | 11 | return handleTranslate; 12 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/activateLocale.ts: -------------------------------------------------------------------------------- 1 | import type { I18n } from '@lingui/core'; 2 | import moment from 'moment'; 3 | 4 | export default function activateLocale(i18n: I18n, locale: string) { 5 | i18n.activate(locale); 6 | moment.locale([locale, 'en']); 7 | 8 | // @ts-ignore 9 | if (typeof window !== 'undefined' && window.ipcRenderer) { 10 | window.ipcRenderer.invoke('setLocale', locale); 11 | } 12 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/index.tsx: -------------------------------------------------------------------------------- 1 | import './polyfill'; 2 | import './config/env'; 3 | import React from 'react'; 4 | import ReactDOM from 'react-dom'; 5 | import './config/env'; 6 | import App from './components/app/App'; 7 | 8 | // we need to use additional root for hot reloading 9 | function Root() { 10 | return ( 11 | 12 | ); 13 | } 14 | 15 | ReactDOM.render(, document.querySelector('#root')); 16 | -------------------------------------------------------------------------------- /stai/types/blockchain_format/pool_target.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from stai.types.blockchain_format.sized_bytes import bytes32 4 | from stai.util.ints import uint32 5 | from stai.util.streamable import Streamable, streamable 6 | 7 | 8 | @streamable 9 | @dataclass(frozen=True) 10 | class PoolTarget(Streamable): 11 | puzzle_hash: bytes32 12 | max_height: uint32 # A max height of 0 means it is valid forever 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/WalletBalance.ts: -------------------------------------------------------------------------------- 1 | type WalletBalance = { 2 | wallet_id: number; 3 | confirmed_wallet_balance: number; 4 | max_send_amount: number; 5 | pending_change: number; 6 | pending_coin_removal_count: number; 7 | spendable_balance: number; 8 | unconfirmed_wallet_balance: number; 9 | unspent_coin_count: number; 10 | balance_pending: number; 11 | }; 12 | 13 | export default WalletBalance; 14 | -------------------------------------------------------------------------------- /stai/cmds/plotters.py: -------------------------------------------------------------------------------- 1 | import click 2 | from stai.plotters.plotters import call_plotters 3 | 4 | 5 | @click.command( 6 | "plotters", 7 | short_help="Advanced plotting options", 8 | context_settings={"ignore_unknown_options": True}, 9 | add_help_option=False, 10 | ) 11 | @click.pass_context 12 | @click.argument("args", nargs=-1) 13 | def plotters_cmd(ctx: click.Context, args): 14 | call_plotters(ctx.obj["root_path"], args) 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/services/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Daemon } from './Daemon'; 2 | export { default as Events } from './Events'; 3 | export { default as Farmer } from './Farmer'; 4 | export { default as FullNode } from './FullNode'; 5 | export { default as Harvester } from './Harvester'; 6 | export { default as Plotter } from './Plotter'; 7 | export { default as Service } from './Service'; 8 | export { default as Wallet } from './Wallet'; 9 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/usePersist.ts: -------------------------------------------------------------------------------- 1 | export default function usePersist(baseNamespace: string): (namespace?: string) => string { 2 | if (!baseNamespace) { 3 | throw new Error('baseNamespace is required'); 4 | } 5 | 6 | function handleGenerateNamespace(namespace?: string): string { 7 | return namespace ? `${baseNamespace}.${namespace}` : baseNamespace; 8 | } 9 | 10 | return handleGenerateNamespace; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/hooks/useIsMainnet.tsx: -------------------------------------------------------------------------------- 1 | import { useGetNetworkInfoQuery } from '@stai/api-react'; 2 | 3 | export default function useIsMainnet(): boolean | undefined { 4 | const { data: networkInfo, isLoading } = useGetNetworkInfoQuery(); 5 | const networkPrefix = networkInfo?.networkPrefix; 6 | 7 | if (!networkPrefix) { 8 | return undefined; 9 | } 10 | 11 | return networkPrefix.toLowerCase() === 'stai'; 12 | } 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/utils/normalizePoolState.ts: -------------------------------------------------------------------------------- 1 | import PoolState from '../types/PoolState'; 2 | import removeOldPoints from './removeOldPoints'; 3 | 4 | export default function normalizePoolState(poolState: PoolState): PoolState { 5 | return { 6 | ...poolState, 7 | pointsAcknowledged24h: removeOldPoints(poolState.pointsAcknowledged24h), 8 | pointsFound24h: removeOldPoints(poolState.pointsFound24h), 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/normalizePoolState.ts: -------------------------------------------------------------------------------- 1 | import type { PoolState } from '@stai/api'; 2 | import removeOldPoints from './removeOldPoints'; 3 | 4 | export default function normalizePoolState(poolState: PoolState): PoolState { 5 | return { 6 | ...poolState, 7 | points_acknowledged_24h: removeOldPoints(poolState.points_acknowledged_24h), 8 | points_found_24h: removeOldPoints(poolState.points_found_24h), 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/normalizePoolState.ts: -------------------------------------------------------------------------------- 1 | import PoolState from '../types/PoolState'; 2 | import removeOldPoints from './removeOldPoints'; 3 | 4 | export default function normalizePoolState(poolState: PoolState): PoolState { 5 | return { 6 | ...poolState, 7 | points_acknowledged_24h: removeOldPoints(poolState.points_acknowledged_24h), 8 | points_found_24h: removeOldPoints(poolState.points_found_24h), 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/untildify.ts: -------------------------------------------------------------------------------- 1 | import os from 'os'; 2 | 3 | const homeDirectory = os.homedir(); 4 | 5 | export default function untildify(pathWithTilde: string): string { 6 | if (typeof pathWithTilde !== 'string') { 7 | throw new TypeError(`Expected a string, got ${typeof pathWithTilde}`); 8 | } 9 | 10 | return homeDirectory 11 | ? pathWithTilde.replace(/^~(?=$|\/|\\)/, homeDirectory) 12 | : pathWithTilde; 13 | } 14 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ffff02ffff03ff27ffff01ff02ff02ffff04ff02ffff04ff05ffff04ff27ff8080808080ffff010580ff0180ffff04ffff02ffff03ffff09ffff0dff5780ffff012080ffff0157ffff010b80ff0180ff808080ffff01ff808080ffff04ffff01ff02ffff03ff05ffff01ff02ffff03ffff09ff11ffff017580ffff01ff04ffff04ffff0175ffff04ff0bff198080ff0d80ffff01ff04ff09ffff02ff02ffff04ff02ffff04ff0dffff04ff0bff80808080808080ff0180ff8080ff0180ff018080 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/ServiceName.ts: -------------------------------------------------------------------------------- 1 | enum ServiceName { 2 | WALLET = 'stai_wallet', 3 | FULL_NODE = 'stai_full_node', 4 | FARMER = 'stai_farmer', 5 | HARVESTER = 'stai_harvester', 6 | SIMULATOR = 'stai_full_node_simulator', 7 | DAEMON = 'daemon', 8 | PLOTTER = 'stai_plotter', 9 | TIMELORD = 'stai_timelord', 10 | INTRODUCER = 'stai_introducer', 11 | EVENTS = 'wallet_ui', 12 | }; 13 | 14 | export default ServiceName; 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/defaultPlotter.ts: -------------------------------------------------------------------------------- 1 | import PlotterName from './PlotterName'; 2 | import optionsForPlotter from '../utils/optionsForPlotter'; 3 | import defaultsForPlotter from '../utils/defaultsForPlotter'; 4 | 5 | export default { 6 | displayName: 'Chia Proof of Space', 7 | options: optionsForPlotter(PlotterName.CHIAPOS), 8 | defaults: defaultsForPlotter(PlotterName.CHIAPOS), 9 | installInfo: { installed: true }, 10 | }; 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/services/Events.ts: -------------------------------------------------------------------------------- 1 | import Client from '../Client'; 2 | import Service from './Service'; 3 | import type { Options } from './Service'; 4 | import ServiceName from '../constants/ServiceName'; 5 | 6 | export default class Events extends Service { 7 | constructor(client: Client, options?: Options) { 8 | super(ServiceName.EVENTS, client, { 9 | skipAddService: true, 10 | ...options, 11 | }); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/ToolbarSpacing/ToolbarSpacing.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { makeStyles, Theme, createStyles } from '@mui/styles'; 3 | 4 | const useStyles = makeStyles((theme: Theme) => 5 | createStyles({ 6 | toolbar: theme.mixins.toolbar, 7 | }), 8 | ); 9 | 10 | export default function ToolbarSpacing() { 11 | const classes = useStyles(); 12 | 13 | return
; 14 | } 15 | -------------------------------------------------------------------------------- /stai/wallet/transaction_sorting.py: -------------------------------------------------------------------------------- 1 | import enum 2 | 3 | 4 | class SortKey(enum.Enum): 5 | CONFIRMED_AT_HEIGHT = "order by confirmed_at_height {ASC}" 6 | RELEVANCE = "order by confirmed {ASC}, confirmed_at_height {DESC}, created_at_time {DESC}" 7 | 8 | def ascending(self) -> str: 9 | return self.value.format(ASC="ASC", DESC="DESC") 10 | 11 | def descending(self) -> str: 12 | return self.value.format(ASC="DESC", DESC="ASC") 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/wallets/Pool.ts: -------------------------------------------------------------------------------- 1 | import Wallet from '../services/Wallet'; 2 | 3 | export default class PoolWallet extends Wallet { 4 | async createNewWallet( 5 | initialTargetState: Object, 6 | fee: string, 7 | host: string = this.client.backupHost, 8 | ) { 9 | return super.createNewWallet('pool_wallet', { 10 | mode: 'new', 11 | fee, 12 | host, 13 | initialTargetState, 14 | }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Suspender/Suspender.tsx: -------------------------------------------------------------------------------- 1 | import { useRef, useMemo, useEffect } from 'react'; 2 | 3 | export default function Suspender() { 4 | const resolve = useRef<() => void>(); 5 | const promise = useMemo(() => new Promise((res) => { 6 | resolve.current = res; 7 | }), []); 8 | 9 | useEffect(() => { 10 | return () => { 11 | resolve.current?.(); 12 | }; 13 | }); 14 | 15 | throw promise; 16 | } 17 | -------------------------------------------------------------------------------- /stai/full_node/signage_point.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Optional 3 | 4 | from stai.types.blockchain_format.vdf import VDFInfo, VDFProof 5 | from stai.util.streamable import Streamable, streamable 6 | 7 | 8 | @streamable 9 | @dataclass(frozen=True) 10 | class SignagePoint(Streamable): 11 | cc_vdf: Optional[VDFInfo] 12 | cc_proof: Optional[VDFProof] 13 | rc_vdf: Optional[VDFInfo] 14 | rc_proof: Optional[VDFProof] 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/utils/isCATWalletPresent.ts: -------------------------------------------------------------------------------- 1 | import type { Wallet, CATToken } from '@stai/api'; 2 | import { WalletType } from '@stai/api'; 3 | 4 | export default function isCATWalletPresent(wallets: Wallet[], token: CATToken): boolean { 5 | return !!wallets?.find((wallet) => { 6 | if (wallet.type === WalletType.CAT && wallet.meta?.assetId === token.assetId) { 7 | return true; 8 | } 9 | 10 | return false; 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Settings/SettingsLabel.tsx: -------------------------------------------------------------------------------- 1 | import React, { type ReactNode } from 'react'; 2 | import { Typography } from '@mui/material'; 3 | 4 | export type SettingsLabelProps = { 5 | children?: ReactNode; 6 | }; 7 | 8 | export default function SettingsLabel(props: SettingsLabelProps) { 9 | const { children } = props; 10 | 11 | return ( 12 | 13 | {children} 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/theme/dark.ts: -------------------------------------------------------------------------------- 1 | import { createTheme } from '@mui/material/styles'; 2 | import { deepmerge } from '@mui/utils'; 3 | import theme from './default'; 4 | 5 | export default createTheme(deepmerge(theme, { 6 | palette: { 7 | background: { 8 | default: '#212121', 9 | paper: '#333333', 10 | }, 11 | secondary: { 12 | main: '#ffffff', 13 | contrastText: '#000000', 14 | }, 15 | mode: 'dark', 16 | }, 17 | })); 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/utils/toSafeNumber.ts: -------------------------------------------------------------------------------- 1 | import { transform } from 'lodash'; 2 | import BigNumber from 'bignumber.js'; 3 | 4 | export default function toSafeNumber(object: Object): Object { 5 | return transform(object, (acc, value, key) => { 6 | if (value instanceof BigNumber && value.isInteger() && value.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)) { 7 | acc[key] = value.toNumber(); 8 | } else { 9 | acc[key] = value; 10 | } 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/blockHeightToTimestamp.ts: -------------------------------------------------------------------------------- 1 | import type { Transaction } from '@stai/api'; 2 | 3 | const BLOCK_DURATION_SECONDS = (24 * 60 * 60) / 4608; 4 | 5 | export default function blockHeightToTimestamp( 6 | height: number, 7 | peakTransaction: Transaction, 8 | ): number { 9 | const diff = peakTransaction.confirmedAtHeight - height; 10 | const seconds = diff * BLOCK_DURATION_SECONDS; 11 | 12 | return peakTransaction.createdAtTime - seconds; 13 | } 14 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/isContentHashValid.ts: -------------------------------------------------------------------------------- 1 | import computeHash from './computeHash'; 2 | 3 | export default function isContentHashValid( 4 | content: string, 5 | hash: string, 6 | encoding?: string, 7 | ): boolean { 8 | const computedHash = computeHash(content, { encoding }); 9 | let otherHash = hash.toLowerCase(); 10 | if (otherHash.startsWith('0x')) { 11 | otherHash = otherHash.substring(2); 12 | } 13 | return computedHash === otherHash; 14 | } 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/normalizeUrl.ts: -------------------------------------------------------------------------------- 1 | import normalize from 'normalize-url'; 2 | 3 | export default function normalizeUrl(url: string): string { 4 | return normalize(url, { 5 | defaultProtocol: 'https:', 6 | stripAuthentication: false, 7 | stripTextFragment: false, 8 | stripWWW: false, 9 | removeQueryParameters: false, 10 | removeTrailingSlash: false, 11 | removeSingleSlash: false, 12 | sortQueryParameters: false, 13 | }); 14 | } 15 | -------------------------------------------------------------------------------- /stai/util/pip_import.py: -------------------------------------------------------------------------------- 1 | "Import a package and install it with PIP if it doesn't exist." 2 | 3 | import subprocess 4 | import sys 5 | 6 | 7 | def pip_import(module, pypi_name=None): 8 | """ 9 | Return None if we can't import or install it. 10 | """ 11 | try: 12 | return __import__(module) 13 | except ImportError: 14 | pass 15 | 16 | subprocess.call([sys.executable, "-m", "pip", "install", pypi_name or module]) 17 | return __import__(module) 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Logo/Logo.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components'; 3 | import { Box, BoxProps } from '@mui/material'; 4 | import { Stai } from '@stai/icons'; 5 | 6 | const StyledStai = styled(Stai)` 7 | max-width: 100%; 8 | width: auto; 9 | height: auto; 10 | `; 11 | 12 | export default function Logo(props: BoxProps) { 13 | return ( 14 | 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /stai/util/recursive_replace.py: -------------------------------------------------------------------------------- 1 | from dataclasses import replace 2 | from typing import Any 3 | 4 | 5 | def recursive_replace(root_obj: Any, replace_str: str, replace_with: Any) -> Any: 6 | split_str = replace_str.split(".") 7 | if len(split_str) == 1: 8 | return replace(root_obj, **{split_str[0]: replace_with}) 9 | sub_obj = recursive_replace(getattr(root_obj, split_str[0]), ".".join(split_str[1:]), replace_with) 10 | return replace(root_obj, **{split_str[0]: sub_obj}) 11 | -------------------------------------------------------------------------------- /.github/linters/.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | profile= 3 | 4 | ; vertical hanging indent mode also used in black configuration 5 | multi_line_output = 3 6 | 7 | ; necessary because black expect the trailing comma 8 | include_trailing_comma = true 9 | 10 | ; black compatibility 11 | force_grid_wrap = 0 12 | 13 | ; black compatibility 14 | use_parentheses = True 15 | 16 | ; black compatibility 17 | ensure_newline_before_comments = True 18 | 19 | ; we chose 120 as line length 20 | line_length = 120 21 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useLocale.ts: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react'; 2 | import { LocaleContext } from '../components/LocaleProvider'; 3 | 4 | export default function useLocale(): [string, (locale: string) => void] { 5 | const localeContext = useContext(LocaleContext); 6 | 7 | if (!localeContext) { 8 | throw new Error('You need to use LocaleProvider.'); 9 | } 10 | 11 | const { locale, setLocale } = localeContext; 12 | 13 | return [locale, setLocale]; 14 | } 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/removeOldPoints.ts: -------------------------------------------------------------------------------- 1 | import type { Point } from '@stai/api'; 2 | 3 | const DAY_SECONDS = 60 * 60 * 24; 4 | 5 | export default function removeOldPoints( 6 | points: Point[], 7 | second: number = DAY_SECONDS, 8 | ): Point[] { 9 | const current = Date.now() / 1000; 10 | const dayBefore = current - second; 11 | 12 | return points?.filter((point) => { 13 | const [timestamp] = point; 14 | 15 | return timestamp >= dayBefore; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/constants/ModeServices.ts: -------------------------------------------------------------------------------- 1 | import { ServiceName } from '@stai/api'; 2 | import { Mode } from '@stai/core'; 3 | 4 | export default { 5 | [Mode.WALLET]: [ 6 | ServiceName.WALLET, 7 | ], 8 | [Mode.FARMING]: [ 9 | ServiceName.WALLET, 10 | ServiceName.FULL_NODE, 11 | ServiceName.FARMER, 12 | ServiceName.HARVESTER, 13 | ], 14 | }; 15 | 16 | export const SimulatorServices = [ 17 | ServiceName.WALLET, 18 | ServiceName.SIMULATOR, 19 | ]; 20 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/removeOldPoints.ts: -------------------------------------------------------------------------------- 1 | import type Point from '../types/Point'; 2 | 3 | const DAY_SECONDS = 60 * 60 * 24; 4 | 5 | export default function removeOldPoints( 6 | points: Point[], 7 | second: number = DAY_SECONDS, 8 | ): Point[] { 9 | const current = Date.now() / 1000; 10 | const dayBefore = current - second; 11 | 12 | return points?.filter((point) => { 13 | const [timestamp] = point; 14 | 15 | return timestamp >= dayBefore; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=4.1.2"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.setuptools_scm] 6 | fallback_version = "unknown-no-.git-directory" 7 | local_scheme = "no-local-version" 8 | 9 | [tool.black] 10 | line-length = 120 11 | target-version = ['py37', 'py38', 'py39'] 12 | include = ''' 13 | ^/( 14 | [^/]*.py 15 | | (benchmarks|build_scripts|stai|tests|tools)/.*\.pyi? 16 | )$ 17 | ''' 18 | exclude = '' 19 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/utils/removeOldPoints.ts: -------------------------------------------------------------------------------- 1 | import type { Point } from '@stai/api'; 2 | 3 | const DAY_SECONDS = 60 * 60 * 24; 4 | 5 | export default function removeOldPoints( 6 | points: Point[], 7 | second: number = DAY_SECONDS, 8 | ): Point[] { 9 | const current = Date.now() / 1000; 10 | const dayBefore = current - second; 11 | 12 | return points?.filter((point) => { 13 | const [timestamp] = point; 14 | 15 | return timestamp >= dayBefore; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/components/hero/WalletHero.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Routes, Route } from 'react-router-dom'; 3 | import WalletHeroWallets from './WalletHeroWallets'; 4 | import WalletHeroAdd from './WalletHeroAdd'; 5 | 6 | export default function Wallets() { 7 | return ( 8 | 9 | } /> 10 | } /> 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Stai.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import StaiIcon from './images/stai.svg'; 4 | import StaiIconDarkTheme from './images/staidarktheme.svg'; 5 | import { useDarkMode } from '@stai/core'; 6 | 7 | export default function Keys(props: SvgIconProps) { 8 | const { isDarkMode } = useDarkMode(); 9 | return ; 10 | } 11 | -------------------------------------------------------------------------------- /tests/testconfig.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import TYPE_CHECKING, List, Union 4 | 5 | if TYPE_CHECKING: 6 | from typing_extensions import Literal 7 | 8 | # Github actions template config. 9 | oses = ["ubuntu", "macos"] 10 | 11 | # Defaults are conservative. 12 | parallel: Union[bool, int, Literal["auto"]] = False 13 | checkout_blocks_and_plots = False 14 | install_timelord = False 15 | check_resource_usage = False 16 | job_timeout = 30 17 | custom_vars: List[str] = [] 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useMode.ts: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react'; 2 | import { ModeContext } from '../components/Mode/ModeProvider'; 3 | import type Mode from '../constants/Mode'; 4 | 5 | export default function useMode(): [Mode, (newMode: Mode) => void] { 6 | const context = useContext(ModeContext); 7 | if (!context) { 8 | throw new Error('useMode must be used within a ModeProvider'); 9 | } 10 | 11 | const { mode, setMode } = context; 12 | return [mode, setMode]; 13 | } 14 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff02ff04ffff04ff02ffff04ff05ffff04ff0bffff04ff82017fffff04ff8202ffffff04ffff02ff06ffff04ff02ffff04ff8205ffffff04ff17ffff04ff2fffff04ff5fffff04ff81bfff8080808080808080ff8080808080808080ff8080ffff04ffff01ffff02ffff03ff17ffff01ff04ffff02ff0bffff04ff2fffff04ff05ffff04ff5fffff04ff27ff808080808080ffff02ff04ffff04ff02ffff04ff05ffff04ff0bffff04ff37ffff04ff2fffff04ff5fff808080808080808080ff8080ff0180ff0effff0cff09ff0bff1780ffff0cff15ff2fff5f8080ff018080 -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Accordion/Accordion.tsx: -------------------------------------------------------------------------------- 1 | import React, { ReactNode } from 'react'; 2 | import { Collapse } from '@mui/material'; 3 | 4 | type Props = { 5 | children?: ReactNode; 6 | expanded?: boolean; 7 | }; 8 | 9 | export default function Accordion(props: Props) { 10 | const { expanded, children } = props; 11 | 12 | return {children}; 13 | } 14 | 15 | Accordion.defaultProps = { 16 | children: undefined, 17 | expanded: false, 18 | }; 19 | -------------------------------------------------------------------------------- /stai/types/blockchain_format/sized_bytes.py: -------------------------------------------------------------------------------- 1 | from stai.util.byte_types import SizedBytes 2 | 3 | 4 | class bytes4(SizedBytes): 5 | _size = 4 6 | 7 | 8 | class bytes8(SizedBytes): 9 | _size = 8 10 | 11 | 12 | class bytes32(SizedBytes): 13 | _size = 32 14 | 15 | 16 | class bytes48(SizedBytes): 17 | _size = 48 18 | 19 | 20 | class bytes96(SizedBytes): 21 | _size = 96 22 | 23 | 24 | class bytes100(SizedBytes): 25 | _size = 100 26 | 27 | 28 | class bytes480(SizedBytes): 29 | _size = 480 30 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_conditions.clvm: -------------------------------------------------------------------------------- 1 | (mod 2 | (public_key conditions) 3 | 4 | (include condition_codes.clvm) 5 | 6 | ;; hash a tree 7 | ;; This is used to calculate a puzzle hash given a puzzle program. 8 | (defun sha256tree1 9 | (TREE) 10 | (if (l TREE) 11 | (sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE))) 12 | (sha256 1 TREE) 13 | ) 14 | ) 15 | 16 | (c (list AGG_SIG_ME public_key (sha256tree1 conditions)) conditions) 17 | 18 | ) 19 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/NFTs.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import NFTsIcon from './images/NFTs.svg'; 4 | import NFTsSmallIcon from './images/NFTsSmall.svg'; 5 | 6 | export function NFTsSmall(props: SvgIconProps) { 7 | return ; 8 | } 9 | 10 | export default function NFTs(props: SvgIconProps) { 11 | return ; 12 | } 13 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/nft_metadata_updater_default.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff04ffff04ffff02ffff03ffff22ff27ff3780ffff01ff02ffff03ffff21ffff09ff27ffff01826d7580ffff09ff27ffff01826c7580ffff09ff27ffff01758080ffff01ff02ff02ffff04ff02ffff04ff05ffff04ff27ffff04ff37ff808080808080ffff010580ff0180ffff010580ff0180ffff04ff0bff808080ffff01ff808080ffff04ffff01ff02ffff03ff05ffff01ff02ffff03ffff09ff11ff0b80ffff01ff04ffff04ff0bffff04ff17ff198080ff0d80ffff01ff04ff09ffff02ff02ffff04ff02ffff04ff0dffff04ff0bffff04ff17ff8080808080808080ff0180ff8080ff0180ff018080 2 | -------------------------------------------------------------------------------- /stai-blockchain-gui/crowdin.yml: -------------------------------------------------------------------------------- 1 | files: 2 | - source: /packages/core/src/locales/en-US/*.po 3 | translation: /packages/core/src/locales/%locale%/messages.po 4 | - source: /packages/gui/src/locales/en-US/*.po 5 | translation: /packages/gui/src/locales/%locale%/messages.po 6 | - source: /packages/wallet/src/locales/en-US/*.po 7 | translation: /packages/wallet/src/locales/%locale%/messages.po 8 | - source: /packages/wallets/src/locales/en-US/*.po 9 | translation: /packages/wallets/src/locales/%locale%/messages.po 10 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/validAddress.ts: -------------------------------------------------------------------------------- 1 | import { decodeBech32m } from '@stai/api'; 2 | 3 | export default function validAddress(address: string, allowedPrefixes?: string[]) { 4 | const response = decodeBech32m(address); 5 | const prefix = response.prefix.toLowerCase(); 6 | 7 | if (allowedPrefixes && !allowedPrefixes.includes(prefix)) { 8 | throw new Error(`Invalid address: ${address}. Valid addresses must contain one of the following prefixes: ${allowedPrefixes.join(', ')}`); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/getWalletSyncingStatus.ts: -------------------------------------------------------------------------------- 1 | import type { IncomingState } from '../modules/incoming'; 2 | import SyncingStatus from '../constants/SyncingStatus'; 3 | 4 | export default function getWalletSyncingStatus(walletState: IncomingState) { 5 | const { 6 | status: { syncing, synced }, 7 | } = walletState; 8 | 9 | if (syncing) { 10 | return SyncingStatus.SYNCING; 11 | } else if (synced) { 12 | return SyncingStatus.SYNCED; 13 | } 14 | 15 | return SyncingStatus.NOT_SYNCED; 16 | } 17 | -------------------------------------------------------------------------------- /stai/cmds/plotnft.py: -------------------------------------------------------------------------------- 1 | from decimal import Decimal 2 | from typing import Optional 3 | 4 | import click 5 | 6 | 7 | MAX_CMDLINE_FEE = Decimal(0.5) 8 | 9 | 10 | def validate_fee(ctx, param, value): 11 | try: 12 | fee = Decimal(value) 13 | except ValueError: 14 | raise click.BadParameter("Fee must be decimal dotted value in STAI (e.g. 0.00005)") 15 | if fee < 0 or fee > MAX_CMDLINE_FEE: 16 | raise click.BadParameter(f"Fee must be in the range 0 to {MAX_CMDLINE_FEE}") 17 | return value 18 | 19 | 20 | -------------------------------------------------------------------------------- /tests/util/rpc.py: -------------------------------------------------------------------------------- 1 | async def validate_get_routes(client, api): 2 | routes_client = (await client.fetch("get_routes", {}))["routes"] 3 | assert len(routes_client) > 0 4 | routes_api = list(api.get_routes().keys()) 5 | routes_server = [ 6 | "/get_connections", 7 | "/open_connection", 8 | "/close_connection", 9 | "/stop_node", 10 | "/get_routes", 11 | ] 12 | assert len(routes_api) > 0 13 | for route in routes_api + routes_server: 14 | assert route in routes_client 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/ServiceConnectionName.ts: -------------------------------------------------------------------------------- 1 | import ServiceName from "./ServiceName"; 2 | import ServiceHumanName from "./ServiceHumanName"; 3 | 4 | export default { 5 | 1: ServiceHumanName[ServiceName.FULL_NODE], 6 | 2: ServiceHumanName[ServiceName.HARVESTER], 7 | 3: ServiceHumanName[ServiceName.FARMER], 8 | 4: ServiceHumanName[ServiceName.TIMELORD], 9 | 5: ServiceHumanName[ServiceName.INTRODUCER], 10 | 6: ServiceHumanName[ServiceName.WALLET], 11 | 7: ServiceHumanName[ServiceName.PLOTTER], 12 | }; 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/icons/src/Offers.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SvgIcon, SvgIconProps } from '@mui/material'; 3 | import OffersIcon from './images/Offers.svg'; 4 | import OffersSmallIcon from './images/OffersSmall.svg'; 5 | 6 | export function OffersSmall(props: SvgIconProps) { 7 | return ; 8 | } 9 | 10 | export default function Offers(props: SvgIconProps) { 11 | return ; 12 | } 13 | -------------------------------------------------------------------------------- /stai/simulator/simulator_protocol.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from stai.types.blockchain_format.sized_bytes import bytes32 4 | from stai.util.ints import uint32 5 | from stai.util.streamable import Streamable, streamable 6 | 7 | 8 | @streamable 9 | @dataclass(frozen=True) 10 | class FarmNewBlockProtocol(Streamable): 11 | puzzle_hash: bytes32 12 | 13 | 14 | @streamable 15 | @dataclass(frozen=True) 16 | class ReorgProtocol(Streamable): 17 | old_index: uint32 18 | new_index: uint32 19 | puzzle_hash: bytes32 20 | -------------------------------------------------------------------------------- /stai/util/setproctitle.py: -------------------------------------------------------------------------------- 1 | try: 2 | import setproctitle as pysetproctitle 3 | 4 | no_setproctitle = False 5 | except Exception: 6 | no_setproctitle = True 7 | 8 | 9 | def setproctitle(ps_name: str) -> None: 10 | if no_setproctitle is False: 11 | pysetproctitle.setproctitle(ps_name) 12 | 13 | 14 | def getproctitle() -> str: 15 | if no_setproctitle is False: 16 | # TODO: add type hints to setproctitle 17 | return pysetproctitle.getproctitle() # type: ignore[no-any-return] 18 | 19 | return "" 20 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_puzzle_hash.clvm: -------------------------------------------------------------------------------- 1 | (mod 2 | (inner_puzzle_hash inner_puzzle inner_puzzle_solution) 3 | 4 | ;; hash a tree 5 | ;; This is used to calculate a puzzle hash given a puzzle program. 6 | (defun sha256tree1 7 | (TREE) 8 | (if (l TREE) 9 | (sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE))) 10 | (sha256 1 TREE) 11 | ) 12 | ) 13 | 14 | (if (= inner_puzzle_hash (sha256tree1 inner_puzzle)) 15 | (a inner_puzzle inner_puzzle_solution) 16 | (x) 17 | ) 18 | ) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - about: Ask a question or request support here. 3 | name: Ask for Support 4 | url: 'https://github.com/STATION-I/stai-blockchain/issues/new?labels=help%20wanted' 5 | - about: Request a new feature or idea here. 6 | name: Make a Request 7 | url: 'https://github.com/STATION-I/stai-blockchain/issues/new?labels=enhancement' 8 | - about: Get support on the STAI Discord chat channels. 9 | name: Join the Discord Server 10 | url: 'https://discord.gg/stai-blockchain' 11 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/Foliage.ts: -------------------------------------------------------------------------------- 1 | type Foliage = { 2 | foliage_transaction_block_hash: string; 3 | foliage_block_data_signature: string; 4 | foliage_block_data: { 5 | extension_data: string; 6 | farmer_reward_puzzle_hash: string; 7 | pool_signature: string; 8 | pool_target: { 9 | max_height: number; 10 | puzzle_hash: string; 11 | }; 12 | unfinished_reward_block_hash: string; 13 | }; 14 | prev_block_hash: string; 15 | reward_block_hash: string; 16 | }; 17 | 18 | export default Foliage; 19 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/nfts/NFTs.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Routes, Route } from 'react-router-dom'; 3 | import NFTGallery from './gallery/NFTGallery'; 4 | import NFTDetail from './detail/NFTDetailV2'; 5 | 6 | /* ========================================================================== */ 7 | 8 | export default function NFTs() { 9 | return ( 10 | 11 | } /> 12 | } /> 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/types/Foliage.ts: -------------------------------------------------------------------------------- 1 | type Foliage = { 2 | foliage_transaction_block_hash: string; 3 | foliage_block_data_signature: string; 4 | foliage_block_data: { 5 | extension_data: string; 6 | farmer_reward_puzzle_hash: string; 7 | pool_signature: string; 8 | pool_target: { 9 | max_height: number; 10 | puzzle_hash: string; 11 | }; 12 | unfinished_reward_block_hash: string; 13 | }; 14 | prev_block_hash: string; 15 | reward_block_hash: string; 16 | }; 17 | 18 | export default Foliage; 19 | -------------------------------------------------------------------------------- /stai/simulator/simulator_constants.py: -------------------------------------------------------------------------------- 1 | if __name__ == "__main__": 2 | from tests.block_tools import create_block_tools, test_constants 3 | from tests.util.keyring import TempKeyring 4 | from stai.util.default_root import DEFAULT_ROOT_PATH 5 | 6 | with TempKeyring() as keychain: 7 | # TODO: mariano: fix this with new consensus 8 | bt = create_block_tools(root_path=DEFAULT_ROOT_PATH, keychain=keychain) 9 | new_genesis_block = bt.create_genesis_block(test_constants, b"0") 10 | 11 | print(bytes(new_genesis_block)) 12 | -------------------------------------------------------------------------------- /stai/types/condition_with_args.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import List 3 | 4 | from stai.types.condition_opcodes import ConditionOpcode 5 | from stai.util.streamable import Streamable, streamable 6 | 7 | 8 | @streamable 9 | @dataclass(frozen=True) 10 | class ConditionWithArgs(Streamable): 11 | """ 12 | This structure is used to store parsed CLVM conditions 13 | Conditions in CLVM have either format of (opcode, var1) or (opcode, var1, var2) 14 | """ 15 | 16 | opcode: ConditionOpcode 17 | vars: List[bytes] 18 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/constants/ServiceHumanName.ts: -------------------------------------------------------------------------------- 1 | import ServiceName from './ServiceName'; 2 | 3 | export default { 4 | [ServiceName.WALLET]: 'Wallet', 5 | [ServiceName.FULL_NODE]: 'Full Node', 6 | [ServiceName.FARMER]: 'Farmer', 7 | [ServiceName.HARVESTER]: 'Harvester', 8 | [ServiceName.SIMULATOR]: 'Full Node Simulator', 9 | [ServiceName.DAEMON]: 'Daemon', 10 | [ServiceName.PLOTTER]: 'Plotter', 11 | [ServiceName.TIMELORD]: 'Timelord', 12 | [ServiceName.INTRODUCER]: 'Introducer', 13 | [ServiceName.EVENTS]: 'Events', 14 | }; 15 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useAppVersion.ts: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from 'react'; 2 | 3 | export default function useAppVersion() { 4 | const [version, setVersion] = useState(undefined); 5 | 6 | async function getVersion() { 7 | const currentVersion = await window.ipcRenderer.invoke('getVersion'); 8 | setVersion(currentVersion); 9 | } 10 | 11 | useEffect(() => { 12 | getVersion(); 13 | }, []); 14 | 15 | return { 16 | version, 17 | isLoading: version === undefined, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/settlement_payments.clvm.hex: -------------------------------------------------------------------------------- 1 | ff02ffff01ff02ff0affff04ff02ffff04ff03ff80808080ffff04ffff01ffff333effff02ffff03ff05ffff01ff04ffff04ff0cffff04ffff02ff1effff04ff02ffff04ff09ff80808080ff808080ffff02ff16ffff04ff02ffff04ff19ffff04ffff02ff0affff04ff02ffff04ff0dff80808080ff808080808080ff8080ff0180ffff02ffff03ff05ffff01ff04ffff04ff08ff0980ffff02ff16ffff04ff02ffff04ff0dffff04ff0bff808080808080ffff010b80ff0180ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff1effff04ff02ffff04ff09ff80808080ffff02ff1effff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve. 4 | labels: bug 5 | --- 6 | 7 | Remember to: 8 | 9 | * Describe the problem (duh). 10 | * Check debug.log and post any errors you think are relevant. 11 | * Mention how you installed STAI (installer, source, Docker container, etc.). 12 | * Mention what platform you're running STAI on. For example: 13 | * Windows 10 Home 14 | * Windows Server 2022 15 | * Ubuntu Desktop 23.04 LTS 16 | * Ubuntu Server 22.04.3 LTS 17 | * Pop!_OS 22.04 LTS 18 | * KDE neon 5.27 -------------------------------------------------------------------------------- /stai/consensus/cost_calculator.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Optional 3 | 4 | from stai.types.spend_bundle_conditions import SpendBundleConditions 5 | from stai.util.ints import uint16, uint64 6 | from stai.util.streamable import Streamable, streamable 7 | 8 | 9 | @streamable 10 | @dataclass(frozen=True) 11 | class NPCResult(Streamable): 12 | error: Optional[uint16] 13 | conds: Optional[SpendBundleConditions] 14 | cost: uint64 # The total cost of the block, including CLVM cost, cost of 15 | # conditions and cost of bytes 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/hooks/useShowError.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Trans } from '@lingui/macro'; 3 | import AlertDialog from '../components/AlertDialog'; 4 | import useOpenDialog from "./useOpenDialog"; 5 | 6 | export default function useShowError() { 7 | const openDialog = useOpenDialog(); 8 | 9 | async function showError(error: Error) { 10 | return openDialog(( 11 | Error}> 12 | {error.message} 13 | 14 | )); 15 | } 16 | 17 | return showError; 18 | } 19 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/hooks/useGetHarvesterConnectionsQuery.ts: -------------------------------------------------------------------------------- 1 | import { useMemo } from 'react'; 2 | import { useGetFarmerConnectionsQuery } from '../services/farmer'; 3 | 4 | export default function useGetHarvesterConnectionsQuery() { 5 | const { data: connections, ...rest } = useGetFarmerConnectionsQuery({}, { 6 | pollingInterval: 10000, 7 | }); 8 | const data = useMemo(() => { 9 | return connections?.filter((connection) => connection.type === 2); 10 | }, [connections]); 11 | 12 | return { 13 | data, 14 | ...rest, 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/singleton_launcher.clvm: -------------------------------------------------------------------------------- 1 | (mod (singleton_full_puzzle_hash amount key_value_list) 2 | 3 | (include condition_codes.clvm) 4 | 5 | ; takes a lisp tree and returns the hash of it 6 | (defun sha256tree1 (TREE) 7 | (if (l TREE) 8 | (sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE))) 9 | (sha256 1 TREE) 10 | ) 11 | ) 12 | 13 | ; main 14 | (list (list CREATE_COIN singleton_full_puzzle_hash amount) 15 | (list CREATE_COIN_ANNOUNCEMENT (sha256tree1 (list singleton_full_puzzle_hash amount key_value_list)))) 16 | ) 17 | -------------------------------------------------------------------------------- /tests/tools/test_full_sync.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import asyncio 4 | import os 5 | from pathlib import Path 6 | 7 | import pytest 8 | 9 | from tools.test_full_sync import run_sync_test 10 | 11 | 12 | @pytest.mark.parametrize("keep_up", [True, False]) 13 | def test_full_sync_test(keep_up: bool): 14 | file_path = os.path.realpath(__file__) 15 | db_file = Path(file_path).parent / "test-blockchain-db.sqlite" 16 | asyncio.run( 17 | run_sync_test(db_file, db_version=2, profile=False, single_thread=False, test_constants=False, keep_up=keep_up) 18 | ) 19 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/hooks/useGetFarmerFullNodeConnectionsQuery.ts: -------------------------------------------------------------------------------- 1 | import { useMemo } from 'react'; 2 | import { useGetFarmerConnectionsQuery } from '../services/farmer'; 3 | 4 | export default function useGetFarmerFullNodeConnectionsQuery() { 5 | const { data: connections, ...rest } = useGetFarmerConnectionsQuery({}, { 6 | pollingInterval: 10000, 7 | }); 8 | const data = useMemo(() => { 9 | return connections?.filter((connection) => connection.type === 1); 10 | }, [connections]); 11 | 12 | return { 13 | data, 14 | ...rest, 15 | }; 16 | } -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api-react/src/hooks/useGetNFTWallets.ts: -------------------------------------------------------------------------------- 1 | import { useMemo } from 'react'; 2 | import { useGetWalletsQuery } from '../services'; 3 | import { Wallet, WalletType } from '@stai/api'; 4 | 5 | export default function useGetNFTWallets() { 6 | const { data, isLoading } = useGetWalletsQuery(); 7 | const nftWallets = useMemo(() => { 8 | if (!data || isLoading) { 9 | return []; 10 | } 11 | 12 | return data.filter((wallet: Wallet) => wallet.type === WalletType.NFT); 13 | }, [data]); 14 | 15 | return { wallets: nftWallets, isLoading }; 16 | } 17 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/Spinner/Spinner.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Backdrop, CircularProgress } from '@mui/material'; 3 | import styled from 'styled-components'; 4 | 5 | const StyledBackdrop = styled(Backdrop)` 6 | z-index: 2000; 7 | `; 8 | 9 | type Props = { 10 | show: boolean; 11 | }; 12 | 13 | export default function Spinner(props: Props) { 14 | const { show } = props; 15 | 16 | return ( 17 | 18 | 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/plot/queue/PlotQueueSize.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import plotSizes from '../../../constants/plotSizes'; 3 | import type PlotQueueItem from '../../../types/PlotQueueItem'; 4 | 5 | type Props = { 6 | queueItem: PlotQueueItem; 7 | }; 8 | 9 | export default function PlotQueueSize(props: Props) { 10 | const { 11 | queueItem: { size }, 12 | } = props; 13 | const item = plotSizes.find((item) => item.value === size); 14 | if (!item) { 15 | return null; 16 | } 17 | 18 | return <>{`K-${size}, ${item.label}`}; 19 | } 20 | -------------------------------------------------------------------------------- /stai/cmds/start.py: -------------------------------------------------------------------------------- 1 | import click 2 | 3 | from stai.util.service_groups import all_groups 4 | 5 | 6 | @click.command("start", short_help="Start service groups") 7 | @click.option("-r", "--restart", is_flag=True, type=bool, help="Restart running services") 8 | @click.argument("group", type=click.Choice(list(all_groups())), nargs=-1, required=True) 9 | @click.pass_context 10 | def start_cmd(ctx: click.Context, restart: bool, group: str) -> None: 11 | import asyncio 12 | from .start_funcs import async_start 13 | 14 | asyncio.run(async_start(ctx.obj["root_path"], group, restart)) 15 | -------------------------------------------------------------------------------- /benchmarks/jsonify.py: -------------------------------------------------------------------------------- 1 | import random 2 | from time import perf_counter 3 | 4 | from tests.util.test_full_block_utils import get_full_blocks 5 | 6 | random.seed(123456789) 7 | 8 | 9 | def main() -> None: 10 | total_time = 0.0 11 | counter = 0 12 | for block in get_full_blocks(): 13 | start = perf_counter() 14 | block.to_json_dict() 15 | end = perf_counter() 16 | total_time += end - start 17 | counter += 1 18 | 19 | print(f"total time: {total_time:0.2f}s ({counter} iterations)") 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/getDescriptiveError.ts: -------------------------------------------------------------------------------- 1 | import { t } from '@lingui/macro'; 2 | 3 | export default function getDescriptiveError(error: string): string { 4 | if (error == '13') { 5 | return t`[Error 13] Permission denied. You are trying to access a file/directory without having the necessary permissions. Most likely one of the plot folders in your config.yaml has an issue.`; 6 | } 7 | if (error == '22') { 8 | return t`[Error 22] File not found. Most likely one of the plot folders in your config.yaml has an issue.`; 9 | } 10 | 11 | return error; 12 | } 13 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/wallets/src/hooks/useWalletState.ts: -------------------------------------------------------------------------------- 1 | import { useGetSyncStatusQuery } from '@stai/api-react'; 2 | import { SyncingStatus } from '@stai/api'; 3 | import getWalletSyncingStatus from '../utils/getWalletSyncingStatus'; 4 | 5 | export default function useWalletState(): { 6 | isLoading: boolean; 7 | state?: SyncingStatus; 8 | } { 9 | const { data: walletState, isLoading } = useGetSyncStatusQuery({}, { 10 | pollingInterval: 10000, 11 | }); 12 | 13 | return { 14 | isLoading, 15 | state: walletState && getWalletSyncingStatus(walletState), 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_puzzle.clvm: -------------------------------------------------------------------------------- 1 | (mod 2 | 3 | (public_key delegated_puzzle delegated_puzzle_solution) 4 | 5 | (include condition_codes.clvm) 6 | 7 | ;; hash a tree 8 | ;; This is used to calculate a puzzle hash given a puzzle program. 9 | (defun sha256tree1 10 | (TREE) 11 | (if (l TREE) 12 | (sha256 2 (sha256tree1 (f TREE)) (sha256tree1 (r TREE))) 13 | (sha256 1 TREE) 14 | ) 15 | ) 16 | 17 | (c (list AGG_SIG_ME public_key (sha256tree1 delegated_puzzle)) 18 | (a delegated_puzzle delegated_puzzle_solution)) 19 | ) 20 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/api/src/@types/OfferTradeRecord.ts: -------------------------------------------------------------------------------- 1 | import type OfferCoinOfInterest from './OfferCoinOfInterest'; 2 | import type OfferSummaryRecord from './OfferSummaryRecord'; 3 | 4 | type OfferTradeRecord = { 5 | confirmed_at_index: number; 6 | accepted_at_time: number; 7 | created_at_time: number; 8 | is_my_offer: boolean; 9 | sent: number; 10 | coins_of_interest: OfferCoinOfInterest[]; 11 | trade_id: string; 12 | status: string; 13 | sent_to: any[]; 14 | summary: OfferSummaryRecord; 15 | offer_data?: string; 16 | }; 17 | 18 | export default OfferTradeRecord; 19 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/p2_delegated_conditions.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pay to delegated conditions 3 | 4 | In this puzzle program, the solution must be a signed list of conditions, which 5 | is returned literally. 6 | """ 7 | 8 | 9 | from stai.types.blockchain_format.program import Program 10 | 11 | from .load_clvm import load_clvm 12 | 13 | MOD = load_clvm("p2_delegated_conditions.clvm") 14 | 15 | 16 | def puzzle_for_pk(public_key: Program) -> Program: 17 | return MOD.curry(public_key) 18 | 19 | 20 | def solution_for_conditions(conditions: Program) -> Program: 21 | return conditions.to([conditions]) 22 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/recompile-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This hack is a quick way to recompile everything in this directory 4 | 5 | set -o errexit 6 | 7 | #BASE_DIR=`pwd | dirname` 8 | 9 | FILES=$(ls ./*.clvm) 10 | echo "$FILES" 11 | 12 | INCLUDE_DIR=$(pwd) 13 | 14 | for FILE in $FILES 15 | do 16 | echo "run -d -i $INCLUDE_DIR $FILE > $FILE.hex" 17 | # run -d -i $INCLUDE_DIR $FILE > $FILE.hex 18 | done 19 | 20 | for FILE in $FILES 21 | do 22 | echo "opd -H $FILE.hex | head -1 > $FILE.hex.sha256tree" 23 | done 24 | 25 | echo 26 | echo "Copy & paste the above to the shell to recompile" 27 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/farm/card/FarmCardPlotCount.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Trans } from '@lingui/macro'; 3 | import { FormatLargeNumber, CardSimple } from '@stai/core'; 4 | import { useGetTotalHarvestersSummaryQuery } from '@stai/api-react'; 5 | 6 | export default function FarmCardPlotCount() { 7 | const { plots, isLoading } = useGetTotalHarvestersSummaryQuery(); 8 | 9 | return ( 10 | Plot Count} 12 | value={} 13 | loading={isLoading} 14 | /> 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /stai/plot_sync/util.py: -------------------------------------------------------------------------------- 1 | from enum import IntEnum 2 | 3 | 4 | class Constants: 5 | message_timeout: int = 10 6 | 7 | 8 | class State(IntEnum): 9 | idle = 0 10 | loaded = 1 11 | removed = 2 12 | invalid = 3 13 | keys_missing = 4 14 | duplicates = 5 15 | done = 6 16 | 17 | 18 | class ErrorCodes(IntEnum): 19 | unknown = -1 20 | invalid_state = 0 21 | invalid_peer_id = 1 22 | invalid_identifier = 2 23 | invalid_last_sync_id = 3 24 | invalid_connection_type = 4 25 | plot_already_available = 5 26 | plot_not_available = 6 27 | sync_ids_match = 7 28 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/StateTypography/StateTypography.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import styled from 'styled-components'; 3 | import { Typography } from '@mui/material'; 4 | import State from '../../constants/State'; 5 | import StateColor from '../../constants/StateColor'; 6 | 7 | const Color = { 8 | [State.SUCCESS]: StateColor.SUCCESS, 9 | [State.WARNING]: StateColor.WARNING, 10 | [State.ERROR]: StateColor.ERROR, 11 | }; 12 | 13 | export default styled(({ state, ...rest }) => )` 14 | ${({ state }) => (state ? `color: ${Color[state]};` : '')} 15 | `; 16 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/hooks/useSelectFile.tsx: -------------------------------------------------------------------------------- 1 | import { useShowSaveDialog, useShowError } from '@stai/core'; 2 | 3 | export default function useSelectFile(): () => Promise { 4 | const showSaveDialog = useShowSaveDialog(); 5 | const showError = useShowError(); 6 | 7 | async function handleSelect(): Promise { 8 | try { 9 | const result = await showSaveDialog(); 10 | const { filePath } = result; 11 | 12 | return filePath; 13 | } catch (error: any) { 14 | showError(error); 15 | } 16 | } 17 | 18 | return handleSelect; 19 | } 20 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/components/DarkModeToggle/DarkModeToggle.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { IconButton } from '@mui/material'; 3 | import { Brightness4, Brightness7 } from '@mui/icons-material'; 4 | import useDarkMode from '../../hooks/useDarkMode'; 5 | 6 | export default function DarkModeToggle() { 7 | const { toggle, isDarkMode } = useDarkMode(); 8 | 9 | function handleClick() { 10 | toggle(); 11 | } 12 | 13 | return ( 14 | 15 | {isDarkMode ? : } 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/core/src/utils/getPercentPointsSuccessfull.ts: -------------------------------------------------------------------------------- 1 | import { sumBy } from 'lodash'; 2 | import type { Point } from '@stai/api'; 3 | 4 | function sumPoints(points: Point[]): number { 5 | return sumBy(points, (point) => point[1]) ?? 0; 6 | } 7 | 8 | export default function getPercentPointsSuccessfull( 9 | pointsAcknowledged: Point[], 10 | pointsFound: Point[], 11 | ): number { 12 | const acknowledged = sumPoints(pointsAcknowledged); 13 | const found = sumPoints(pointsFound); 14 | 15 | if (!acknowledged || !found) { 16 | return 0; 17 | } 18 | 19 | return acknowledged / found; 20 | } 21 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/getPercentPointsSuccessfull.ts: -------------------------------------------------------------------------------- 1 | import { sumBy } from 'lodash'; 2 | import type Point from '../types/Point'; 3 | 4 | function sumPoints(points: Point[]): number { 5 | return sumBy(points, (point) => point[1]) ?? 0; 6 | } 7 | 8 | export default function getPercentPointsSuccessfull( 9 | pointsAcknowledged: Point[], 10 | pointsFound: Point[], 11 | ): number { 12 | const acknowledged = sumPoints(pointsAcknowledged); 13 | const found = sumPoints(pointsFound); 14 | 15 | if (!acknowledged || !found) { 16 | return 0; 17 | } 18 | 19 | return acknowledged / found; 20 | } 21 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/util/manageDaemonLifetime.ts: -------------------------------------------------------------------------------- 1 | import { get } from 'lodash'; 2 | import { readConfigFile } from './loadConfig'; 3 | 4 | export default function manageDaemonLifetime(net?: string): boolean { 5 | try { 6 | const config = readConfigFile(net); 7 | const selfHostname = get(config, 'ui.daemon_host', 'localhost'); 8 | 9 | return selfHostname === 'localhost'; 10 | } catch (error: any) { 11 | if (error.code === 'ENOENT') { 12 | // configuration file does not exists, use default value 13 | return true; 14 | } else { 15 | throw error; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /stai/types/end_of_slot_bundle.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Optional 3 | 4 | from stai.types.blockchain_format.slots import ( 5 | ChallengeChainSubSlot, 6 | InfusedChallengeChainSubSlot, 7 | RewardChainSubSlot, 8 | SubSlotProofs, 9 | ) 10 | from stai.util.streamable import Streamable, streamable 11 | 12 | 13 | @streamable 14 | @dataclass(frozen=True) 15 | class EndOfSubSlotBundle(Streamable): 16 | challenge_chain: ChallengeChainSubSlot 17 | infused_challenge_chain: Optional[InfusedChallengeChainSubSlot] 18 | reward_chain: RewardChainSubSlot 19 | proofs: SubSlotProofs 20 | -------------------------------------------------------------------------------- /stai-blockchain-gui/packages/gui/src/components/plot/card/PlotCardTotalHarvesters.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Trans } from '@lingui/macro'; 3 | import { FormatLargeNumber, CardSimple } from '@stai/core'; 4 | import { useGetTotalHarvestersSummaryQuery } from '@stai/api-react'; 5 | 6 | export default function PlotCardTotalHarvesters() { 7 | const { harvesters, isLoading } = useGetTotalHarvestersSummaryQuery(); 8 | 9 | return ( 10 | Total Harvesters} 12 | value={} 13 | loading={isLoading} 14 | /> 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /stai/types/block_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import List, Optional 2 | 3 | from typing_extensions import Protocol 4 | 5 | from stai.types.blockchain_format.program import SerializedProgram 6 | from stai.types.blockchain_format.sized_bytes import bytes32 7 | from stai.util.ints import uint32 8 | 9 | 10 | class BlockInfo(Protocol): 11 | @property 12 | def prev_header_hash(self) -> bytes32: 13 | pass 14 | 15 | @property 16 | def transactions_generator(self) -> Optional[SerializedProgram]: 17 | pass 18 | 19 | @property 20 | def transactions_generator_ref_list(self) -> List[uint32]: 21 | pass 22 | -------------------------------------------------------------------------------- /stai/wallet/puzzles/create-lock-puzzlehash.clvm: -------------------------------------------------------------------------------- 1 | ; This puzzle evaluates to an empty list , which means no conditions need to be satisfied; 2 | ; The puzzle can never evaluate to my-id. 3 | ; my-id is there on a discarded branch of the tree as a signal to another piece of code 4 | ; that will be checking if a coin whose puzzle is of this form, was created or spent. 5 | ( 6 | (defun-inline create-lock-puzzlehash (my-id) 7 | (sha256tree (list r 8 | (list c 9 | (list q 10 | my-id) 11 | (q (q ())))))) 12 | ) --------------------------------------------------------------------------------