This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use scrypto::prelude::*; | |
| #[blueprint] | |
| #[events(RecursiveEvent)] | |
| mod hello { | |
| struct Hello { | |
| // Define what resources and data will be managed by Hello components | |
| sample_vault: Vault, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Bid = s.struct({ | |
| amount: s.decimal(), | |
| bidder: s.address(), | |
| timestamp: s.instant(), | |
| transaction_hash: s.array(s.number()), | |
| }); | |
| const Auction = s.struct({ | |
| id: s.number(), | |
| start_timestamp: s.instant(), | |
| end_timestamp: s.instant(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Type3 = s.tuple([]); | |
| const Node = s.struct({ | |
| key: s.number(), | |
| value: Type3, | |
| left_child: s.option(s.number()), | |
| right_child: s.option(s.number()), | |
| parent: s.option(s.number()), | |
| next: s.option(s.number()), | |
| prev: s.option(s.number()), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use sbor::{LocalTypeId, Schema, TypeKind, TypeMetadata}; | |
| use scrypto::prelude::{ | |
| scrypto_decode, ScryptoCustomSchema, ScryptoCustomTypeKind, | |
| }; | |
| fn print_type_structure( | |
| schema: &Schema<ScryptoCustomSchema>, | |
| type_name: &str, | |
| indent_size: usize, | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (** This file demonstrates a basic example of polymorphism in OCaml, where we | |
| are interested in: | |
| - Creating an interface with some generic functionality, which could in | |
| practice be | |
| - a data layer for an application that has different implementations (In-memory, SQL, etc.) | |
| - a network layer with different implementations (HTTP, gRPC, etc.) | |
| But in our case, it's multiple ways of getting a fact about cats. | |
| - Creating different implementations of this interface, which may be | |
| instantiated in distinct ways, for example one implementation may not need |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts"> | |
| import { | |
| GatewayApiClient, | |
| RadixNetwork, | |
| type NetworkConfigurationResponse, | |
| type StateEntityDetailsVaultResponseItem, | |
| } from "@radixdlt/babylon-gateway-api-sdk"; | |
| // Initialize the Gateway client | |
| const gatewayApi = GatewayApiClient.initialize({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use radix_engine_common::network::NetworkDefinition; | |
| use radix_engine_common::{ | |
| data::scrypto::model::NonFungibleLocalId, | |
| types::{ComponentAddress, ResourceAddress}, | |
| ScryptoSbor, | |
| }; | |
| use radix_event_stream::encodings::encode_bech32m; | |
| use radix_event_stream::error::EventHandlerError; | |
| use radix_event_stream::sources::gateway::GatewayTransactionStream; | |
| use radix_event_stream::{anyhow, macros::event_handler}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import psycopg2 | |
| import pandas as pd | |
| import numpy as np | |
| def execute_query(): | |
| try: | |
| # Establish a connection to the database | |
| conn = psycopg2.connect( | |
| dbname="radix_ledger", | |
| user="radix", |