From 8e70500aeb600b6d078af835e1e2fa021c8076d0 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 26 Jan 2026 11:52:19 -0300 Subject: [PATCH 01/15] feat: add Tron substreams indexing package - Add substreams configuration for Tron payment indexing - Add protobuf definitions and schema - Add Rust implementation for payment extraction --- packages/substreams-tron/Cargo.toml | 26 +++ packages/substreams-tron/Makefile | 28 +++ packages/substreams-tron/README.md | 105 +++++++++ packages/substreams-tron/build.rs | 6 + packages/substreams-tron/package.json | 28 +++ packages/substreams-tron/proto/payments.proto | 44 ++++ packages/substreams-tron/schema.graphql | 40 ++++ packages/substreams-tron/src/lib.rs | 200 ++++++++++++++++++ packages/substreams-tron/src/pb/mod.rs | 9 + packages/substreams-tron/subgraph.yaml | 20 ++ packages/substreams-tron/substreams.yaml | 52 +++++ 11 files changed, 558 insertions(+) create mode 100644 packages/substreams-tron/Cargo.toml create mode 100644 packages/substreams-tron/Makefile create mode 100644 packages/substreams-tron/README.md create mode 100644 packages/substreams-tron/build.rs create mode 100644 packages/substreams-tron/package.json create mode 100644 packages/substreams-tron/proto/payments.proto create mode 100644 packages/substreams-tron/schema.graphql create mode 100644 packages/substreams-tron/src/lib.rs create mode 100644 packages/substreams-tron/src/pb/mod.rs create mode 100644 packages/substreams-tron/subgraph.yaml create mode 100644 packages/substreams-tron/substreams.yaml diff --git a/packages/substreams-tron/Cargo.toml b/packages/substreams-tron/Cargo.toml new file mode 100644 index 000000000..2255286e5 --- /dev/null +++ b/packages/substreams-tron/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "request-network-tron" +version = "0.1.0" +edition = "2021" +repository = "https://github.com/RequestNetwork/requestNetwork" +license = "MIT" +description = "Request Network TRON Substreams module for ERC20FeeProxy payment detection" + +[lib] +name = "request_network_tron" +crate-type = ["cdylib"] + +[dependencies] +substreams = "0.5" +substreams-tron = "0.1" +prost = "0.11" +prost-types = "0.11" +hex = "0.4" + +[build-dependencies] +prost-build = "0.11" + +[profile.release] +lto = true +opt-level = 's' +strip = "debuginfo" diff --git a/packages/substreams-tron/Makefile b/packages/substreams-tron/Makefile new file mode 100644 index 000000000..e9d1c034e --- /dev/null +++ b/packages/substreams-tron/Makefile @@ -0,0 +1,28 @@ +.PHONY: build +build: + cargo build --target wasm32-unknown-unknown --release + +.PHONY: protogen +protogen: + substreams protogen ./substreams.yaml --exclude-paths="sf/substreams,google" + +.PHONY: package +package: build + substreams pack ./substreams.yaml + +.PHONY: gui +gui: build + substreams gui ./substreams.yaml map_erc20_fee_proxy_payments -e tron.substreams.pinax.network:443 + +.PHONY: run +run: build + substreams run ./substreams.yaml map_erc20_fee_proxy_payments -e tron.substreams.pinax.network:443 --start-block 63208782 --stop-block +100 + +.PHONY: clean +clean: + cargo clean + rm -f *.spkg + +.PHONY: test +test: + cargo test diff --git a/packages/substreams-tron/README.md b/packages/substreams-tron/README.md new file mode 100644 index 000000000..4bd4c8925 --- /dev/null +++ b/packages/substreams-tron/README.md @@ -0,0 +1,105 @@ +# Request Network TRON Substreams + +This package contains a Substreams module for indexing ERC20FeeProxy payment events on the TRON blockchain. + +## Overview + +The module indexes `TransferWithReferenceAndFee` events from the deployed ERC20FeeProxy contracts: + +- **Mainnet**: `TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd` +- **Nile Testnet**: `THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs` + +## Prerequisites + +1. **Rust toolchain** with `wasm32-unknown-unknown` target: + + ```bash + rustup target add wasm32-unknown-unknown + ``` + +2. **Substreams CLI**: + + ```bash + brew install streamingfast/tap/substreams + ``` + +3. **bs58 crate** for Base58 encoding (included in dependencies) + +## Building + +```bash +# Build the WASM module +make build + +# Generate protobuf types +make protogen + +# Package for deployment +make package +``` + +## Running Locally + +```bash +# Run with GUI for debugging +make gui + +# Run and output to console +make run +``` + +## Deployment + +### Deploy as Substreams-powered Subgraph + +1. Build and package the Substreams module: + + ```bash + make package + ``` + +2. Deploy to The Graph: + ```bash + graph deploy --studio request-payments-tron + ``` + +### Subgraph Endpoints + +Once deployed, the subgraph will be available at: + +- **Mainnet**: `https://api.studio.thegraph.com/query/67444/request-payments-tron/version/latest` +- **Nile Testnet**: `https://api.studio.thegraph.com/query/67444/request-payments-tron-nile/version/latest` + +## Module Details + +### `map_erc20_fee_proxy_payments` + +Extracts payment events from TRON blocks: + +**Input**: `sf.tron.type.v1.Block` + +**Output**: `request.tron.v1.Payments` + +**Fields extracted**: + +- `token_address` - TRC20 token contract address +- `to` - Payment recipient +- `amount` - Payment amount +- `payment_reference` - Indexed payment reference (hex) +- `fee_amount` - Fee amount +- `fee_address` - Fee recipient +- `from` - Sender address +- `block` - Block number +- `timestamp` - Block timestamp (Unix seconds) +- `tx_hash` - Transaction hash +- `contract_address` - ERC20FeeProxy contract address + +## Testing + +```bash +make test +``` + +## License + +MIT diff --git a/packages/substreams-tron/build.rs b/packages/substreams-tron/build.rs new file mode 100644 index 000000000..2901ad56b --- /dev/null +++ b/packages/substreams-tron/build.rs @@ -0,0 +1,6 @@ +//! Build script for generating protobuf types + +fn main() -> Result<(), Box> { + prost_build::compile_protos(&["proto/payments.proto"], &["proto/"])?; + Ok(()) +} diff --git a/packages/substreams-tron/package.json b/packages/substreams-tron/package.json new file mode 100644 index 000000000..c9891ce4d --- /dev/null +++ b/packages/substreams-tron/package.json @@ -0,0 +1,28 @@ +{ + "name": "@requestnetwork/substreams-tron", + "version": "0.1.0", + "description": "Request Network TRON Substreams module for ERC20FeeProxy payment detection", + "private": true, + "scripts": { + "build": "make build", + "protogen": "make protogen", + "package": "make package", + "gui": "make gui", + "run": "make run", + "clean": "make clean", + "test": "make test" + }, + "keywords": [ + "request-network", + "tron", + "substreams", + "payment-detection" + ], + "author": "Request Network", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/RequestNetwork/requestNetwork.git", + "directory": "packages/substreams-tron" + } +} diff --git a/packages/substreams-tron/proto/payments.proto b/packages/substreams-tron/proto/payments.proto new file mode 100644 index 000000000..7b8348e5b --- /dev/null +++ b/packages/substreams-tron/proto/payments.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package request.tron.v1; + +// A single payment event from the ERC20FeeProxy contract +message Payment { + // The token contract address (TRC20) + string token_address = 1; + + // The recipient address + string to = 2; + + // The payment amount (as string to preserve precision) + string amount = 3; + + // The indexed payment reference (hex encoded) + string payment_reference = 4; + + // The fee amount (as string to preserve precision) + string fee_amount = 5; + + // The fee recipient address + string fee_address = 6; + + // The sender address (msg.sender) + string from = 7; + + // Block number where the event was emitted + uint64 block = 8; + + // Block timestamp (Unix timestamp in seconds) + uint64 timestamp = 9; + + // Transaction hash + string tx_hash = 10; + + // The proxy contract address that emitted the event + string contract_address = 11; +} + +// Collection of payment events +message Payments { + repeated Payment payments = 1; +} diff --git a/packages/substreams-tron/schema.graphql b/packages/substreams-tron/schema.graphql new file mode 100644 index 000000000..7d31e646a --- /dev/null +++ b/packages/substreams-tron/schema.graphql @@ -0,0 +1,40 @@ +# GraphQL schema for Request Network TRON payments +# This schema is used when deploying a Substreams-powered subgraph + +type Payment @entity { + "Unique identifier: txHash-logIndex" + id: ID! + + "The TRC20 token contract address" + tokenAddress: String! + + "The payment recipient address" + to: String! + + "The payment amount" + amount: BigInt! + + "The indexed payment reference (keccak256 hash)" + reference: Bytes! + + "The fee amount" + feeAmount: BigInt! + + "The fee recipient address" + feeAddress: String + + "The sender address" + from: String! + + "Block number" + block: Int! + + "Block timestamp (Unix seconds)" + timestamp: Int! + + "Transaction hash" + txHash: String! + + "The ERC20FeeProxy contract address" + contractAddress: String! +} diff --git a/packages/substreams-tron/src/lib.rs b/packages/substreams-tron/src/lib.rs new file mode 100644 index 000000000..44681b674 --- /dev/null +++ b/packages/substreams-tron/src/lib.rs @@ -0,0 +1,200 @@ +//! Request Network TRON Substreams Module +//! +//! This module indexes TransferWithReferenceAndFee events from the ERC20FeeProxy +//! contract deployed on TRON mainnet and Nile testnet. + +mod pb; + +use hex; +use pb::request::tron::v1::{Payment, Payments}; +use substreams::log; +use substreams_tron::pb::sf::tron::r#type::v1::Block; + +/// ERC20FeeProxy contract addresses +const MAINNET_PROXY_ADDRESS: &str = "TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd"; +const NILE_PROXY_ADDRESS: &str = "THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs"; + +/// TransferWithReferenceAndFee event signature (keccak256 hash of event signature) +/// Event: TransferWithReferenceAndFee(address,address,uint256,bytes indexed,uint256,address) +const TRANSFER_WITH_REF_AND_FEE_TOPIC: &str = + "e8e8ca0a945b88ee72ec3e1e5f1e9c8f2a0a1e8a"; + +/// Maps TRON blocks to extract ERC20FeeProxy payment events +#[substreams::handlers::map] +fn map_erc20_fee_proxy_payments(block: Block) -> Result { + let mut payments = Vec::new(); + let block_number = block.number; + let block_timestamp = block.header.as_ref().map(|h| h.timestamp).unwrap_or(0) / 1000; // Convert from ms to seconds + + for transaction in block.transactions.iter() { + let tx_hash = hex::encode(&transaction.txid); + + // Get the transaction result to access logs + if let Some(result) = &transaction.result { + for log_entry in result.logs.iter() { + // Check if this log is from one of our proxy contracts + let contract_address = base58_encode(&log_entry.address); + + if contract_address != MAINNET_PROXY_ADDRESS + && contract_address != NILE_PROXY_ADDRESS { + continue; + } + + // Check if this is a TransferWithReferenceAndFee event + // The first topic should be the event signature + if log_entry.topics.is_empty() { + continue; + } + + // Parse the event data + if let Some(payment) = parse_transfer_with_reference_and_fee( + &log_entry, + &contract_address, + &tx_hash, + block_number, + block_timestamp, + transaction, + ) { + payments.push(payment); + } + } + } + } + + Ok(Payments { payments }) +} + +/// Parses a TransferWithReferenceAndFee event from a log entry +fn parse_transfer_with_reference_and_fee( + log_entry: &substreams_tron::pb::sf::tron::r#type::v1::Log, + contract_address: &str, + tx_hash: &str, + block_number: u64, + block_timestamp: u64, + transaction: &substreams_tron::pb::sf::tron::r#type::v1::TransactionTrace, +) -> Option { + // Event: TransferWithReferenceAndFee(address tokenAddress, address to, uint256 amount, + // bytes indexed paymentReference, uint256 feeAmount, address feeAddress) + // + // Topics: + // [0] = Event signature hash + // [1] = paymentReference (indexed) + // + // Data (non-indexed parameters, ABI encoded): + // [0-31] = tokenAddress + // [32-63] = to + // [64-95] = amount + // [96-127] = feeAmount + // [128-159] = feeAddress + + if log_entry.topics.len() < 2 { + return None; + } + + let data = &log_entry.data; + if data.len() < 160 { + log::info!("Log data too short: {} bytes", data.len()); + return None; + } + + // Extract payment reference from indexed topic + let payment_reference = hex::encode(&log_entry.topics[1]); + + // Parse non-indexed parameters from data + let token_address = parse_address_from_data(data, 0)?; + let to = parse_address_from_data(data, 32)?; + let amount = parse_uint256_from_data(data, 64); + let fee_amount = parse_uint256_from_data(data, 96); + let fee_address = parse_address_from_data(data, 128)?; + + // Get the sender (from) address from the transaction + let from = transaction + .transaction + .as_ref() + .and_then(|tx| tx.raw_data.as_ref()) + .and_then(|raw| raw.contract.first()) + .and_then(|c| c.parameter.as_ref()) + .map(|p| extract_owner_address(p)) + .unwrap_or_default(); + + Some(Payment { + token_address, + to, + amount, + payment_reference, + fee_amount, + fee_address, + from, + block: block_number, + timestamp: block_timestamp, + tx_hash: tx_hash.to_string(), + contract_address: contract_address.to_string(), + }) +} + +/// Parses an address from ABI-encoded data at the given offset +fn parse_address_from_data(data: &[u8], offset: usize) -> Option { + if data.len() < offset + 32 { + return None; + } + // Address is the last 20 bytes of the 32-byte slot + let address_bytes = &data[offset + 12..offset + 32]; + Some(base58_encode(address_bytes)) +} + +/// Parses a uint256 from ABI-encoded data at the given offset +fn parse_uint256_from_data(data: &[u8], offset: usize) -> String { + if data.len() < offset + 32 { + return "0".to_string(); + } + let bytes = &data[offset..offset + 32]; + // Convert to decimal string, handling large numbers + let hex_str = hex::encode(bytes); + // Remove leading zeros and convert + let trimmed = hex_str.trim_start_matches('0'); + if trimmed.is_empty() { + "0".to_string() + } else { + // For simplicity, return as hex - the consumer can convert + format!("0x{}", hex_str) + } +} + +/// Extracts the owner address from a contract parameter +fn extract_owner_address(parameter: &prost_types::Any) -> String { + // The owner_address is typically at the beginning of the parameter value + if parameter.value.len() >= 21 { + base58_encode(¶meter.value[0..21]) + } else { + String::new() + } +} + +/// Encodes bytes to TRON Base58Check address format +fn base58_encode(bytes: &[u8]) -> String { + // TRON addresses use Base58Check encoding with 0x41 prefix for mainnet + // This is a simplified version - in production, use a proper Base58Check implementation + if bytes.len() == 20 { + // Add TRON mainnet prefix (0x41) + let mut prefixed = vec![0x41]; + prefixed.extend_from_slice(bytes); + bs58::encode(&prefixed).with_check().into_string() + } else if bytes.len() == 21 && bytes[0] == 0x41 { + bs58::encode(bytes).with_check().into_string() + } else { + bs58::encode(bytes).with_check().into_string() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_base58_encode() { + // Test with a known TRON address + let hex_addr = hex::decode("41a614f803b6fd780986a42c78ec9c7f77e6ded13c").unwrap(); + let encoded = base58_encode(&hex_addr); + assert!(encoded.starts_with('T')); + } +} diff --git a/packages/substreams-tron/src/pb/mod.rs b/packages/substreams-tron/src/pb/mod.rs new file mode 100644 index 000000000..6818fa100 --- /dev/null +++ b/packages/substreams-tron/src/pb/mod.rs @@ -0,0 +1,9 @@ +//! Generated protobuf types for Request Network TRON payments + +pub mod request { + pub mod tron { + pub mod v1 { + include!(concat!(env!("OUT_DIR"), "/request.tron.v1.rs")); + } + } +} diff --git a/packages/substreams-tron/subgraph.yaml b/packages/substreams-tron/subgraph.yaml new file mode 100644 index 000000000..8218f5851 --- /dev/null +++ b/packages/substreams-tron/subgraph.yaml @@ -0,0 +1,20 @@ +# Substreams-powered Subgraph configuration for TRON payments +specVersion: 1.0.0 +description: Request Network TRON ERC20FeeProxy payment events +repository: https://github.com/RequestNetwork/requestNetwork +schema: + file: ./schema.graphql + +dataSources: + - kind: substreams + name: TronPayments + network: tron + source: + package: + moduleName: map_erc20_fee_proxy_payments + file: ./request-network-tron-v0.1.0.spkg + mapping: + apiVersion: 0.0.7 + kind: substreams/graph-entities + file: ./src/mappings.ts + handler: handlePayments diff --git a/packages/substreams-tron/substreams.yaml b/packages/substreams-tron/substreams.yaml new file mode 100644 index 000000000..3fc7f3739 --- /dev/null +++ b/packages/substreams-tron/substreams.yaml @@ -0,0 +1,52 @@ +specVersion: v0.1.0 +package: + name: request_network_tron + version: v0.1.0 + url: https://github.com/RequestNetwork/requestNetwork + doc: | + Request Network TRON Substreams module for indexing ERC20FeeProxy payment events. + Indexes TransferWithReferenceAndFee events from the deployed ERC20FeeProxy contracts + on TRON mainnet and Nile testnet. + +imports: + tron: https://spkg.io/streamingfast/tron-foundational-v0.1.2.spkg + +protobuf: + files: + - payments.proto + importPaths: + - ./proto + +binaries: + default: + type: wasm/rust-v1 + file: ./target/wasm32-unknown-unknown/release/request_network_tron.wasm + +modules: + - name: map_erc20_fee_proxy_payments + kind: map + initialBlock: 63208782 # Nile testnet deployment block (use lower for both networks) + inputs: + - source: sf.tron.type.v1.Block + output: + type: proto:request.tron.v1.Payments + doc: | + Extracts TransferWithReferenceAndFee events from ERC20FeeProxy contracts. + Filters transactions to the known proxy contract addresses and parses + the event logs to extract payment details. + + - name: store_payments + kind: store + updatePolicy: set + valueType: proto:request.tron.v1.Payment + inputs: + - map: map_erc20_fee_proxy_payments + doc: | + Stores payment events indexed by payment reference for efficient querying. + +network: tron + +params: + map_erc20_fee_proxy_payments: | + mainnet_proxy_address=TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd + nile_proxy_address=THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs From 88f1995d9b31175cbdab2ee6e4d5194ec6ec7629 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 26 Jan 2026 22:47:53 -0300 Subject: [PATCH 02/15] fix: correct event signature hash and add validation in substreams - Fix truncated TRANSFER_WITH_REF_AND_FEE_TOPIC (was 40 chars, now 64 chars) - Add validation to check topics[0] matches expected event signature - Prevents parsing non-TransferWithReferenceAndFee events --- packages/substreams-tron/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/substreams-tron/src/lib.rs b/packages/substreams-tron/src/lib.rs index 44681b674..b797041e6 100644 --- a/packages/substreams-tron/src/lib.rs +++ b/packages/substreams-tron/src/lib.rs @@ -16,8 +16,9 @@ const NILE_PROXY_ADDRESS: &str = "THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs"; /// TransferWithReferenceAndFee event signature (keccak256 hash of event signature) /// Event: TransferWithReferenceAndFee(address,address,uint256,bytes indexed,uint256,address) +/// keccak256("TransferWithReferenceAndFee(address,address,uint256,bytes,uint256,address)") const TRANSFER_WITH_REF_AND_FEE_TOPIC: &str = - "e8e8ca0a945b88ee72ec3e1e5f1e9c8f2a0a1e8a"; + "9f16cbcc523c67a60c450e5ffe4f3b7b6dbe772e7abcadb2686ce029a9a0a2b6"; /// Maps TRON blocks to extract ERC20FeeProxy payment events #[substreams::handlers::map] @@ -46,6 +47,12 @@ fn map_erc20_fee_proxy_payments(block: Block) -> Result Date: Mon, 26 Jan 2026 23:08:09 -0300 Subject: [PATCH 03/15] fix: address PR review comments - Add hexAddress to deployment files (mainnet.json and nile.json) - Move tron/nile chain definitions from declarative to tron folder - Update DeclarativeChainName type to remove tron/nile - Use erc20FeeProxyArtifact.getDeploymentInformation() instead of hardcoded values - Rename tron-fee-proxy.ts to trc20-fee-proxy.ts for clarity - Make fee limit configurable in utils-tron.ts with defaults --- .../src/chains/declarative/data/nile.ts | 10 ---------- .../src/chains/declarative/data/tron.ts | 20 ------------------- packages/payment-processor/src/index.ts | 2 +- .../{tron-fee-proxy.ts => trc20-fee-proxy.ts} | 0 .../src/payment/utils-tron.ts | 14 +++++++++++-- ...-proxy.test.ts => trc20-fee-proxy.test.ts} | 0 .../deployments/tron/mainnet.json | 1 + .../deployments/tron/nile.json | 1 + 8 files changed, 15 insertions(+), 33 deletions(-) delete mode 100644 packages/currency/src/chains/declarative/data/nile.ts delete mode 100644 packages/currency/src/chains/declarative/data/tron.ts rename packages/payment-processor/src/payment/{tron-fee-proxy.ts => trc20-fee-proxy.ts} (100%) rename packages/payment-processor/test/payment/{tron-fee-proxy.test.ts => trc20-fee-proxy.test.ts} (100%) diff --git a/packages/currency/src/chains/declarative/data/nile.ts b/packages/currency/src/chains/declarative/data/nile.ts deleted file mode 100644 index e80c5f179..000000000 --- a/packages/currency/src/chains/declarative/data/nile.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const chainId = 'nile'; - -// Nile is Tron's test network -export const testnet = true; - -// Test tokens on Nile testnet -// Note: These are testnet token addresses, not mainnet -export const currencies = { - // Add testnet token addresses as needed -}; diff --git a/packages/currency/src/chains/declarative/data/tron.ts b/packages/currency/src/chains/declarative/data/tron.ts deleted file mode 100644 index 3ad0a105f..000000000 --- a/packages/currency/src/chains/declarative/data/tron.ts +++ /dev/null @@ -1,20 +0,0 @@ -export const chainId = 'tron'; - -// Tron mainnet configuration -export const testnet = false; - -// Common TRC20 tokens on Tron -export const currencies = { - // USDT-TRC20 - the most widely used stablecoin on Tron - TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t: { - name: 'Tether USD', - symbol: 'USDT', - decimals: 6, - }, - // USDC on Tron - TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8: { - name: 'USD Coin', - symbol: 'USDC', - decimals: 6, - }, -}; diff --git a/packages/payment-processor/src/index.ts b/packages/payment-processor/src/index.ts index 4e92546b5..68d2d772e 100644 --- a/packages/payment-processor/src/index.ts +++ b/packages/payment-processor/src/index.ts @@ -29,7 +29,7 @@ export * as Escrow from './payment/erc20-escrow-payment'; export * from './payment/prepared-transaction'; export * from './payment/utils-near'; export * from './payment/utils-tron'; -export * from './payment/tron-fee-proxy'; +export * from './payment/trc20-fee-proxy'; export * from './payment/single-request-forwarder'; export * from './payment/erc20-recurring-payment-proxy'; export * from './payment/erc20-commerce-escrow-wrapper'; diff --git a/packages/payment-processor/src/payment/tron-fee-proxy.ts b/packages/payment-processor/src/payment/trc20-fee-proxy.ts similarity index 100% rename from packages/payment-processor/src/payment/tron-fee-proxy.ts rename to packages/payment-processor/src/payment/trc20-fee-proxy.ts diff --git a/packages/payment-processor/src/payment/utils-tron.ts b/packages/payment-processor/src/payment/utils-tron.ts index f5fa56c19..6dc2c2a16 100644 --- a/packages/payment-processor/src/payment/utils-tron.ts +++ b/packages/payment-processor/src/payment/utils-tron.ts @@ -137,8 +137,15 @@ export const getTronAllowance = async ( } }; +/** Default fee limit for TRC20 approval (100 TRX in SUN) */ +export const DEFAULT_APPROVAL_FEE_LIMIT = 100_000_000; + +/** Default fee limit for TRC20 fee proxy payment (150 TRX in SUN) */ +export const DEFAULT_PAYMENT_FEE_LIMIT = 150_000_000; + /** * Approves the ERC20FeeProxy contract to spend TRC20 tokens + * @param feeLimit - Optional fee limit in SUN (1 TRX = 1,000,000 SUN). Defaults to 100 TRX. */ export const approveTrc20 = async ( tronWeb: TronWeb, @@ -146,13 +153,14 @@ export const approveTrc20 = async ( network: CurrencyTypes.TronChainName, amount: BigNumberish, callback?: ITronTransactionCallback, + feeLimit: number = DEFAULT_APPROVAL_FEE_LIMIT, ): Promise => { const proxyAddress = getERC20FeeProxyAddress(network); const contract = await tronWeb.contract(TRC20_ABI, tokenAddress); try { const result = await contract.approve(proxyAddress, amount.toString()).send({ - feeLimit: 100000000, // 100 TRX fee limit + feeLimit, shouldPollResponse: true, }); @@ -168,6 +176,7 @@ export const approveTrc20 = async ( /** * Processes a TRC20 fee proxy payment on Tron + * @param feeLimit - Optional fee limit in SUN (1 TRX = 1,000,000 SUN). Defaults to 150 TRX. */ export const processTronFeeProxyPayment = async ( tronWeb: TronWeb, @@ -179,6 +188,7 @@ export const processTronFeeProxyPayment = async ( feeAmount: BigNumberish, feeAddress: string, callback?: ITronTransactionCallback, + feeLimit: number = DEFAULT_PAYMENT_FEE_LIMIT, ): Promise => { // Validate addresses if (!isValidTronAddress(to)) { @@ -213,7 +223,7 @@ export const processTronFeeProxyPayment = async ( feeAddress, ) .send({ - feeLimit: 150000000, // 150 TRX fee limit for proxy call + feeLimit, shouldPollResponse: true, }); diff --git a/packages/payment-processor/test/payment/tron-fee-proxy.test.ts b/packages/payment-processor/test/payment/trc20-fee-proxy.test.ts similarity index 100% rename from packages/payment-processor/test/payment/tron-fee-proxy.test.ts rename to packages/payment-processor/test/payment/trc20-fee-proxy.test.ts diff --git a/packages/smart-contracts/deployments/tron/mainnet.json b/packages/smart-contracts/deployments/tron/mainnet.json index b77db46af..f1755f518 100644 --- a/packages/smart-contracts/deployments/tron/mainnet.json +++ b/packages/smart-contracts/deployments/tron/mainnet.json @@ -7,6 +7,7 @@ "contracts": { "ERC20FeeProxy": { "address": "TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd", + "hexAddress": "411b6ca35d39842cf8fbe49000653a1505412da659", "creationBlockNumber": 79216121 } } diff --git a/packages/smart-contracts/deployments/tron/nile.json b/packages/smart-contracts/deployments/tron/nile.json index 6107d03c1..77257b8bc 100644 --- a/packages/smart-contracts/deployments/tron/nile.json +++ b/packages/smart-contracts/deployments/tron/nile.json @@ -7,6 +7,7 @@ "contracts": { "ERC20FeeProxy": { "address": "THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs", + "hexAddress": "41508b3b4059c40bb3aac5da5ac006ccdd9c4dc957", "creationBlockNumber": 63208782 } } From be58fde643e26f5f303ac20b664d719d9d38fd99 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 26 Jan 2026 23:14:48 -0300 Subject: [PATCH 04/15] refactor: use params instead of hardcoded addresses in substreams - Remove hardcoded MAINNET_PROXY_ADDRESS and NILE_PROXY_ADDRESS constants - Add parse_proxy_addresses function to read addresses from params - Update substreams.yaml to pass params to the map module This allows the proxy addresses to be configured without recompiling. --- packages/substreams-tron/src/lib.rs | 31 ++++++++++++++++++------ packages/substreams-tron/substreams.yaml | 5 ++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/packages/substreams-tron/src/lib.rs b/packages/substreams-tron/src/lib.rs index b797041e6..eb88c348d 100644 --- a/packages/substreams-tron/src/lib.rs +++ b/packages/substreams-tron/src/lib.rs @@ -10,19 +10,37 @@ use pb::request::tron::v1::{Payment, Payments}; use substreams::log; use substreams_tron::pb::sf::tron::r#type::v1::Block; -/// ERC20FeeProxy contract addresses -const MAINNET_PROXY_ADDRESS: &str = "TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd"; -const NILE_PROXY_ADDRESS: &str = "THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs"; - /// TransferWithReferenceAndFee event signature (keccak256 hash of event signature) /// Event: TransferWithReferenceAndFee(address,address,uint256,bytes indexed,uint256,address) /// keccak256("TransferWithReferenceAndFee(address,address,uint256,bytes,uint256,address)") const TRANSFER_WITH_REF_AND_FEE_TOPIC: &str = "9f16cbcc523c67a60c450e5ffe4f3b7b6dbe772e7abcadb2686ce029a9a0a2b6"; +/// Parses proxy addresses from the params string +/// Expected format: "mainnet_proxy_address=ADDR1\nnile_proxy_address=ADDR2" +fn parse_proxy_addresses(params: &str) -> (String, String) { + let mut mainnet = String::new(); + let mut nile = String::new(); + + for line in params.lines() { + let parts: Vec<&str> = line.splitn(2, '=').collect(); + if parts.len() == 2 { + match parts[0].trim() { + "mainnet_proxy_address" => mainnet = parts[1].trim().to_string(), + "nile_proxy_address" => nile = parts[1].trim().to_string(), + _ => {} + } + } + } + + (mainnet, nile) +} + /// Maps TRON blocks to extract ERC20FeeProxy payment events #[substreams::handlers::map] -fn map_erc20_fee_proxy_payments(block: Block) -> Result { +fn map_erc20_fee_proxy_payments(params: String, block: Block) -> Result { + let (mainnet_proxy, nile_proxy) = parse_proxy_addresses(¶ms); + let mut payments = Vec::new(); let block_number = block.number; let block_timestamp = block.header.as_ref().map(|h| h.timestamp).unwrap_or(0) / 1000; // Convert from ms to seconds @@ -36,8 +54,7 @@ fn map_erc20_fee_proxy_payments(block: Block) -> Result + nile_proxy_address=
+ - name: store_payments kind: store updatePolicy: set From 065c477d4c96c08b69330bd589c426975e7af982 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 26 Jan 2026 23:18:56 -0300 Subject: [PATCH 05/15] fix: address remaining PR review comments Proto package directory mismatch: - Move payments.proto to proto/request/tron/v1/ to match package declaration - Update build.rs and substreams.yaml with new path Transaction success validation: - Add TronTransactionInfo interface - Add getTransactionInfo method to TronWeb interface - Add waitForTransactionConfirmation helper function - Add optional waitForConfirmation parameter to approveTrc20 and processTronFeeProxyPayment --- .../src/payment/utils-tron.ts | 98 +++++++++++++++++++ packages/substreams-tron/build.rs | 2 +- .../{ => request/tron/v1}/payments.proto | 0 packages/substreams-tron/substreams.yaml | 2 +- 4 files changed, 100 insertions(+), 2 deletions(-) rename packages/substreams-tron/proto/{ => request/tron/v1}/payments.proto (100%) diff --git a/packages/payment-processor/src/payment/utils-tron.ts b/packages/payment-processor/src/payment/utils-tron.ts index 6dc2c2a16..c35e143c3 100644 --- a/packages/payment-processor/src/payment/utils-tron.ts +++ b/packages/payment-processor/src/payment/utils-tron.ts @@ -14,6 +14,7 @@ export interface TronWeb { getBalance: (address: string) => Promise; sign: (transaction: unknown, privateKey?: string) => Promise; sendRawTransaction: (signedTransaction: unknown) => Promise; + getTransactionInfo: (txHash: string) => Promise; }; contract: ( abi: T, @@ -36,6 +37,24 @@ export interface TronWeb { fromSun: (amount: number) => number; } +/** + * Transaction info returned by getTransactionInfo + */ +export interface TronTransactionInfo { + id?: string; + blockNumber?: number; + blockTimeStamp?: number; + contractResult?: string[]; + receipt?: { + result?: string; + energy_usage?: number; + energy_usage_total?: number; + net_usage?: number; + }; + result?: string; + resMessage?: string; +} + // Generic contract instance type that provides method typing based on ABI export type TronContractInstance = { [K in ExtractFunctionNames]: (...args: unknown[]) => TronContractMethod; @@ -143,9 +162,75 @@ export const DEFAULT_APPROVAL_FEE_LIMIT = 100_000_000; /** Default fee limit for TRC20 fee proxy payment (150 TRX in SUN) */ export const DEFAULT_PAYMENT_FEE_LIMIT = 150_000_000; +/** Maximum retries when waiting for transaction confirmation */ +const MAX_CONFIRMATION_RETRIES = 10; + +/** Delay between retries in milliseconds */ +const CONFIRMATION_RETRY_DELAY = 3000; + +/** + * Waits for a transaction to be confirmed and validates its success + * @param tronWeb - TronWeb instance + * @param txHash - Transaction hash to validate + * @returns The transaction info if successful + * @throws Error if transaction failed or couldn't be confirmed + */ +export const waitForTransactionConfirmation = async ( + tronWeb: TronWeb, + txHash: string, +): Promise => { + for (let i = 0; i < MAX_CONFIRMATION_RETRIES; i++) { + try { + const txInfo = await tronWeb.trx.getTransactionInfo(txHash); + + // If we have receipt info, the transaction is confirmed + if (txInfo.receipt) { + // Check if the transaction was successful + if (txInfo.receipt.result && txInfo.receipt.result !== 'SUCCESS') { + const errorMsg = txInfo.resMessage + ? Buffer.from(txInfo.resMessage, 'hex').toString('utf8') + : `Transaction failed with result: ${txInfo.receipt.result}`; + throw new Error(errorMsg); + } + + // Check contractResult for revert + if (txInfo.contractResult && txInfo.contractResult.length > 0) { + const result = txInfo.contractResult[0]; + // Empty result or success + if ( + result === '' || + result === '0000000000000000000000000000000000000000000000000000000000000001' + ) { + return txInfo; + } + // Non-empty result that's not success could indicate an error + // But some contracts return data, so we check receipt.result primarily + } + + return txInfo; + } + + // Transaction not yet confirmed, wait and retry + await new Promise((resolve) => setTimeout(resolve, CONFIRMATION_RETRY_DELAY)); + } catch (error) { + // If it's our own error (from failed transaction), rethrow + if ((error as Error).message.includes('Transaction failed')) { + throw error; + } + // Otherwise, wait and retry (network error, tx not found yet, etc.) + await new Promise((resolve) => setTimeout(resolve, CONFIRMATION_RETRY_DELAY)); + } + } + + throw new Error( + `Transaction ${txHash} confirmation timeout after ${MAX_CONFIRMATION_RETRIES} retries`, + ); +}; + /** * Approves the ERC20FeeProxy contract to spend TRC20 tokens * @param feeLimit - Optional fee limit in SUN (1 TRX = 1,000,000 SUN). Defaults to 100 TRX. + * @param waitForConfirmation - If true, waits for transaction confirmation and validates success. Defaults to false. */ export const approveTrc20 = async ( tronWeb: TronWeb, @@ -154,6 +239,7 @@ export const approveTrc20 = async ( amount: BigNumberish, callback?: ITronTransactionCallback, feeLimit: number = DEFAULT_APPROVAL_FEE_LIMIT, + waitForConfirmation = false, ): Promise => { const proxyAddress = getERC20FeeProxyAddress(network); const contract = await tronWeb.contract(TRC20_ABI, tokenAddress); @@ -167,6 +253,11 @@ export const approveTrc20 = async ( const txHash = result.txid || result.transaction?.txID || ''; callback?.onHash?.(txHash); + if (waitForConfirmation && txHash) { + const txInfo = await waitForTransactionConfirmation(tronWeb, txHash); + callback?.onConfirmation?.(txInfo); + } + return txHash; } catch (error) { callback?.onError?.(error as Error); @@ -177,6 +268,7 @@ export const approveTrc20 = async ( /** * Processes a TRC20 fee proxy payment on Tron * @param feeLimit - Optional fee limit in SUN (1 TRX = 1,000,000 SUN). Defaults to 150 TRX. + * @param waitForConfirmation - If true, waits for transaction confirmation and validates success. Defaults to false. */ export const processTronFeeProxyPayment = async ( tronWeb: TronWeb, @@ -189,6 +281,7 @@ export const processTronFeeProxyPayment = async ( feeAddress: string, callback?: ITronTransactionCallback, feeLimit: number = DEFAULT_PAYMENT_FEE_LIMIT, + waitForConfirmation = false, ): Promise => { // Validate addresses if (!isValidTronAddress(to)) { @@ -230,6 +323,11 @@ export const processTronFeeProxyPayment = async ( const txHash = result.txid || result.transaction?.txID || ''; callback?.onHash?.(txHash); + if (waitForConfirmation && txHash) { + const txInfo = await waitForTransactionConfirmation(tronWeb, txHash); + callback?.onConfirmation?.(txInfo); + } + return txHash; } catch (error) { callback?.onError?.(error as Error); diff --git a/packages/substreams-tron/build.rs b/packages/substreams-tron/build.rs index 2901ad56b..01b9377b2 100644 --- a/packages/substreams-tron/build.rs +++ b/packages/substreams-tron/build.rs @@ -1,6 +1,6 @@ //! Build script for generating protobuf types fn main() -> Result<(), Box> { - prost_build::compile_protos(&["proto/payments.proto"], &["proto/"])?; + prost_build::compile_protos(&["proto/request/tron/v1/payments.proto"], &["proto/"])?; Ok(()) } diff --git a/packages/substreams-tron/proto/payments.proto b/packages/substreams-tron/proto/request/tron/v1/payments.proto similarity index 100% rename from packages/substreams-tron/proto/payments.proto rename to packages/substreams-tron/proto/request/tron/v1/payments.proto diff --git a/packages/substreams-tron/substreams.yaml b/packages/substreams-tron/substreams.yaml index 3a66ea706..2836a7fbe 100644 --- a/packages/substreams-tron/substreams.yaml +++ b/packages/substreams-tron/substreams.yaml @@ -13,7 +13,7 @@ imports: protobuf: files: - - payments.proto + - request/tron/v1/payments.proto importPaths: - ./proto From b95b479f66d761de8edb12bd005e3cbb5c74c75b Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 26 Jan 2026 23:24:51 -0300 Subject: [PATCH 06/15] fix: address substreams review comments - Add missing bs58 dependency to Cargo.toml - Fix subgraph.yaml to use correct substreams/graph-entities pattern - Remove store_payments module (no handler implemented) --- packages/substreams-tron/Cargo.toml | 1 + packages/substreams-tron/subgraph.yaml | 6 ++++-- packages/substreams-tron/substreams.yaml | 9 --------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/substreams-tron/Cargo.toml b/packages/substreams-tron/Cargo.toml index 2255286e5..966ea04cf 100644 --- a/packages/substreams-tron/Cargo.toml +++ b/packages/substreams-tron/Cargo.toml @@ -16,6 +16,7 @@ substreams-tron = "0.1" prost = "0.11" prost-types = "0.11" hex = "0.4" +bs58 = { version = "0.5", features = ["check"] } [build-dependencies] prost-build = "0.11" diff --git a/packages/substreams-tron/subgraph.yaml b/packages/substreams-tron/subgraph.yaml index 8218f5851..330331af5 100644 --- a/packages/substreams-tron/subgraph.yaml +++ b/packages/substreams-tron/subgraph.yaml @@ -1,4 +1,8 @@ # Substreams-powered Subgraph configuration for TRON payments +# Note: This is a template. To deploy: +# 1. Build the substreams: make build +# 2. Package it: substreams pack +# 3. Deploy to The Graph with this subgraph.yaml specVersion: 1.0.0 description: Request Network TRON ERC20FeeProxy payment events repository: https://github.com/RequestNetwork/requestNetwork @@ -16,5 +20,3 @@ dataSources: mapping: apiVersion: 0.0.7 kind: substreams/graph-entities - file: ./src/mappings.ts - handler: handlePayments diff --git a/packages/substreams-tron/substreams.yaml b/packages/substreams-tron/substreams.yaml index 2836a7fbe..f369a2ba9 100644 --- a/packages/substreams-tron/substreams.yaml +++ b/packages/substreams-tron/substreams.yaml @@ -40,15 +40,6 @@ modules: mainnet_proxy_address=
nile_proxy_address=
- - name: store_payments - kind: store - updatePolicy: set - valueType: proto:request.tron.v1.Payment - inputs: - - map: map_erc20_fee_proxy_payments - doc: | - Stores payment events indexed by payment reference for efficient querying. - network: tron params: From 8a649e32c67cf95daf0e76c91219fb16ac2a0c83 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 26 Jan 2026 23:44:03 -0300 Subject: [PATCH 07/15] feat: add CircleCI job for building substreams-tron Rust package - Add dedicated build-substreams-tron job with Rust 1.75 image - Install wasm32-unknown-unknown target for WebAssembly compilation - Add cargo caching for faster builds - Run tests as part of the CI job - Update package.json to skip lerna build (requires Rust toolchain) --- .circleci/config.yml | 33 +++++++++++++++++++++++++++ packages/substreams-tron/package.json | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 59a9cf22d..7c3ef59fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,8 @@ references: image: cimg/node:22.14 environment: NODE_OPTIONS: '--max-old-space-size=4096' + rust_image: &rust_image + image: cimg/rust:1.75 ipfs_image: &ipfs_image image: requestnetwork/request-ipfs:v0.13.0 ganache_image: &ganache_image @@ -262,6 +264,35 @@ jobs: name: 'Build toolbox' command: 'yarn workspace @requestnetwork/toolbox run build' + build-substreams-tron: + docker: + - *rust_image + working_directory: *working_directory + steps: + - checkout + - run: + name: 'Install wasm32 target' + command: rustup target add wasm32-unknown-unknown + - restore_cache: + name: Restore Cargo Cache + keys: + - cargo-cache-{{ checksum "packages/substreams-tron/Cargo.toml" }} + - cargo-cache- + - run: + name: 'Build substreams-tron' + command: make build + working_directory: ~/repo/packages/substreams-tron + - save_cache: + name: Save Cargo Cache + key: cargo-cache-{{ checksum "packages/substreams-tron/Cargo.toml" }} + paths: + - ~/.cargo + - packages/substreams-tron/target + - run: + name: 'Run tests' + command: make test + working_directory: ~/repo/packages/substreams-tron + test-nightly: docker: - *node_image @@ -333,6 +364,7 @@ workflows: build-and-test: jobs: - build + - build-substreams-tron - test-unit: requires: - build @@ -357,6 +389,7 @@ workflows: requires: - lint - build + - build-substreams-tron - test-unit - test-integration-with-smart-contracts - test-integration-with-request-node diff --git a/packages/substreams-tron/package.json b/packages/substreams-tron/package.json index c9891ce4d..1783888da 100644 --- a/packages/substreams-tron/package.json +++ b/packages/substreams-tron/package.json @@ -4,7 +4,8 @@ "description": "Request Network TRON Substreams module for ERC20FeeProxy payment detection", "private": true, "scripts": { - "build": "make build", + "build": "echo 'Substreams-tron requires Rust toolchain. Run make build directly or use CI.'", + "build:rust": "make build", "protogen": "make protogen", "package": "make package", "gui": "make gui", From 16c7e7de928ebe816d9d440cfd7b88578d0356fe Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 27 Jan 2026 05:52:17 -0300 Subject: [PATCH 08/15] fix: use pre-generated proto types instead of missing substreams-tron crate The substreams-tron crate doesn't exist on crates.io. Instead, we now include pre-generated protobuf types from the StreamingFast tron-foundational module. This includes: - sf.tron.type.v1 types (Block, Transaction, etc.) - protocol types (TransactionInfo, Log, Contract, etc.) - request.tron.v1 types (Payment, Payments) Also fixed type references in lib.rs to use the correct Transaction structure instead of the non-existent TransactionTrace. --- packages/substreams-tron/Cargo.toml | 11 +- packages/substreams-tron/build.rs | 6 - packages/substreams-tron/src/lib.rs | 27 +- packages/substreams-tron/src/pb/mod.rs | 23 +- packages/substreams-tron/src/pb/protocol.rs | 2824 +++++++++++++++++ .../substreams-tron/src/pb/request.tron.v1.rs | 49 + .../substreams-tron/src/pb/sf.tron.type.v1.rs | 127 + 7 files changed, 3040 insertions(+), 27 deletions(-) delete mode 100644 packages/substreams-tron/build.rs create mode 100644 packages/substreams-tron/src/pb/protocol.rs create mode 100644 packages/substreams-tron/src/pb/request.tron.v1.rs create mode 100644 packages/substreams-tron/src/pb/sf.tron.type.v1.rs diff --git a/packages/substreams-tron/Cargo.toml b/packages/substreams-tron/Cargo.toml index 966ea04cf..48f2190d8 100644 --- a/packages/substreams-tron/Cargo.toml +++ b/packages/substreams-tron/Cargo.toml @@ -12,14 +12,15 @@ crate-type = ["cdylib"] [dependencies] substreams = "0.5" -substreams-tron = "0.1" -prost = "0.11" -prost-types = "0.11" +prost = "0.12" +prost-types = "0.12" hex = "0.4" bs58 = { version = "0.5", features = ["check"] } +sha2 = "0.10" +anyhow = "1.0" -[build-dependencies] -prost-build = "0.11" +[target.wasm32-unknown-unknown.dependencies] +getrandom = { version = "0.2", features = ["custom"] } [profile.release] lto = true diff --git a/packages/substreams-tron/build.rs b/packages/substreams-tron/build.rs deleted file mode 100644 index 01b9377b2..000000000 --- a/packages/substreams-tron/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Build script for generating protobuf types - -fn main() -> Result<(), Box> { - prost_build::compile_protos(&["proto/request/tron/v1/payments.proto"], &["proto/"])?; - Ok(()) -} diff --git a/packages/substreams-tron/src/lib.rs b/packages/substreams-tron/src/lib.rs index eb88c348d..d9a023a13 100644 --- a/packages/substreams-tron/src/lib.rs +++ b/packages/substreams-tron/src/lib.rs @@ -6,9 +6,10 @@ mod pb; use hex; +use pb::protocol::transaction_info::Log; use pb::request::tron::v1::{Payment, Payments}; +use pb::sf::tron::r#type::v1::{Block, Transaction}; use substreams::log; -use substreams_tron::pb::sf::tron::r#type::v1::Block; /// TransferWithReferenceAndFee event signature (keccak256 hash of event signature) /// Event: TransferWithReferenceAndFee(address,address,uint256,bytes indexed,uint256,address) @@ -42,15 +43,15 @@ fn map_erc20_fee_proxy_payments(params: String, block: Block) -> Result Result Result Option { // Event: TransferWithReferenceAndFee(address tokenAddress, address to, uint256 amount, // bytes indexed paymentReference, uint256 feeAmount, address feeAddress) @@ -131,12 +132,10 @@ fn parse_transfer_with_reference_and_fee( let fee_amount = parse_uint256_from_data(data, 96); let fee_address = parse_address_from_data(data, 128)?; - // Get the sender (from) address from the transaction + // Get the sender (from) address from the transaction contracts let from = transaction - .transaction - .as_ref() - .and_then(|tx| tx.raw_data.as_ref()) - .and_then(|raw| raw.contract.first()) + .contracts + .first() .and_then(|c| c.parameter.as_ref()) .map(|p| extract_owner_address(p)) .unwrap_or_default(); diff --git a/packages/substreams-tron/src/pb/mod.rs b/packages/substreams-tron/src/pb/mod.rs index 6818fa100..d7bf3b70f 100644 --- a/packages/substreams-tron/src/pb/mod.rs +++ b/packages/substreams-tron/src/pb/mod.rs @@ -1,9 +1,28 @@ -//! Generated protobuf types for Request Network TRON payments +// @generated +// Protobuf types for Request Network TRON Substreams +// TRON protocol types from StreamingFast +pub mod protocol { + include!("protocol.rs"); +} + +pub mod sf { + pub mod tron { + pub mod r#type { + // @@ protoc_insertion_point(attribute:sf.tron.type.v1) + pub mod v1 { + include!("sf.tron.type.v1.rs"); + // @@ protoc_insertion_point(sf.tron.type.v1) + } + } + } +} + +// Request Network payment types pub mod request { pub mod tron { pub mod v1 { - include!(concat!(env!("OUT_DIR"), "/request.tron.v1.rs")); + include!("request.tron.v1.rs"); } } } diff --git a/packages/substreams-tron/src/pb/protocol.rs b/packages/substreams-tron/src/pb/protocol.rs new file mode 100644 index 000000000..c94724c9d --- /dev/null +++ b/packages/substreams-tron/src/pb/protocol.rs @@ -0,0 +1,2824 @@ +// @generated +// This file is @generated by prost-build. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Endpoint { + #[prost(bytes="vec", tag="1")] + pub address: ::prost::alloc::vec::Vec, + #[prost(int32, tag="2")] + pub port: i32, + #[prost(bytes="vec", tag="3")] + pub node_id: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PingMessage { + #[prost(message, optional, tag="1")] + pub from: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub to: ::core::option::Option, + #[prost(int32, tag="3")] + pub version: i32, + #[prost(int64, tag="4")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PongMessage { + #[prost(message, optional, tag="1")] + pub from: ::core::option::Option, + #[prost(int32, tag="2")] + pub echo: i32, + #[prost(int64, tag="3")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FindNeighbours { + #[prost(message, optional, tag="1")] + pub from: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub target_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Neighbours { + #[prost(message, optional, tag="1")] + pub from: ::core::option::Option, + #[prost(message, repeated, tag="2")] + pub neighbours: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct BackupMessage { + #[prost(bool, tag="1")] + pub flag: bool, + #[prost(int32, tag="2")] + pub priority: i32, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ResourceCode { + Bandwidth = 0, + Energy = 1, + TronPower = 2, +} +impl ResourceCode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ResourceCode::Bandwidth => "BANDWIDTH", + ResourceCode::Energy => "ENERGY", + ResourceCode::TronPower => "TRON_POWER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BANDWIDTH" => Some(Self::Bandwidth), + "ENERGY" => Some(Self::Energy), + "TRON_POWER" => Some(Self::TronPower), + _ => None, + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountId { + #[prost(bytes="vec", tag="1")] + pub name: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Vote { + #[prost(bytes="vec", tag="1")] + pub vote_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub vote_count: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Proposal { + #[prost(int64, tag="1")] + pub proposal_id: i64, + #[prost(bytes="vec", tag="2")] + pub proposer_address: ::prost::alloc::vec::Vec, + #[prost(map="int64, int64", tag="3")] + pub parameters: ::std::collections::HashMap, + #[prost(int64, tag="4")] + pub expiration_time: i64, + #[prost(int64, tag="5")] + pub create_time: i64, + #[prost(bytes="vec", repeated, tag="6")] + pub approvals: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(enumeration="proposal::State", tag="7")] + pub state: i32, +} +/// Nested message and enum types in `Proposal`. +pub mod proposal { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum State { + Pending = 0, + Disapproved = 1, + Approved = 2, + Canceled = 3, + } + impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::Pending => "PENDING", + State::Disapproved => "DISAPPROVED", + State::Approved => "APPROVED", + State::Canceled => "CANCELED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PENDING" => Some(Self::Pending), + "DISAPPROVED" => Some(Self::Disapproved), + "APPROVED" => Some(Self::Approved), + "CANCELED" => Some(Self::Canceled), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Exchange { + #[prost(int64, tag="1")] + pub exchange_id: i64, + #[prost(bytes="vec", tag="2")] + pub creator_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub create_time: i64, + #[prost(bytes="vec", tag="6")] + pub first_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="7")] + pub first_token_balance: i64, + #[prost(bytes="vec", tag="8")] + pub second_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="9")] + pub second_token_balance: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketOrder { + #[prost(bytes="vec", tag="1")] + pub order_id: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub create_time: i64, + #[prost(bytes="vec", tag="4")] + pub sell_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub sell_token_quantity: i64, + #[prost(bytes="vec", tag="6")] + pub buy_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="7")] + pub buy_token_quantity: i64, + #[prost(int64, tag="9")] + pub sell_token_quantity_remain: i64, + #[prost(int64, tag="10")] + pub sell_token_quantity_return: i64, + #[prost(enumeration="market_order::State", tag="11")] + pub state: i32, + #[prost(bytes="vec", tag="12")] + pub prev: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="13")] + pub next: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `MarketOrder`. +pub mod market_order { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum State { + Active = 0, + Inactive = 1, + Canceled = 2, + } + impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::Active => "ACTIVE", + State::Inactive => "INACTIVE", + State::Canceled => "CANCELED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ACTIVE" => Some(Self::Active), + "INACTIVE" => Some(Self::Inactive), + "CANCELED" => Some(Self::Canceled), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketOrderList { + #[prost(message, repeated, tag="1")] + pub orders: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketOrderPairList { + #[prost(message, repeated, tag="1")] + pub order_pair: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketOrderPair { + #[prost(bytes="vec", tag="1")] + pub sell_token_id: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub buy_token_id: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketAccountOrder { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub orders: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(int64, tag="3")] + pub count: i64, + #[prost(int64, tag="4")] + pub total_count: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MarketPrice { + #[prost(int64, tag="1")] + pub sell_token_quantity: i64, + #[prost(int64, tag="2")] + pub buy_token_quantity: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketPriceList { + #[prost(bytes="vec", tag="1")] + pub sell_token_id: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub buy_token_id: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="3")] + pub prices: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketOrderIdList { + #[prost(bytes="vec", tag="1")] + pub head: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub tail: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChainParameters { + #[prost(message, repeated, tag="1")] + pub chain_parameter: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `ChainParameters`. +pub mod chain_parameters { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ChainParameter { + #[prost(string, tag="1")] + pub key: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub value: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Account { + #[prost(bytes="vec", tag="1")] + pub account_name: ::prost::alloc::vec::Vec, + #[prost(enumeration="AccountType", tag="2")] + pub r#type: i32, + #[prost(bytes="vec", tag="3")] + pub address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub balance: i64, + #[prost(message, repeated, tag="5")] + pub votes: ::prost::alloc::vec::Vec, + #[prost(map="string, int64", tag="6")] + pub asset: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + #[prost(map="string, int64", tag="56")] + pub asset_v2: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + #[prost(message, repeated, tag="7")] + pub frozen: ::prost::alloc::vec::Vec, + #[prost(int64, tag="8")] + pub net_usage: i64, + #[prost(int64, tag="41")] + pub acquired_delegated_frozen_balance_for_bandwidth: i64, + #[prost(int64, tag="42")] + pub delegated_frozen_balance_for_bandwidth: i64, + #[prost(int64, tag="46")] + pub old_tron_power: i64, + #[prost(message, optional, tag="47")] + pub tron_power: ::core::option::Option, + #[prost(bool, tag="60")] + pub asset_optimized: bool, + #[prost(int64, tag="9")] + pub create_time: i64, + #[prost(int64, tag="10")] + pub latest_opration_time: i64, + #[prost(int64, tag="11")] + pub allowance: i64, + #[prost(int64, tag="12")] + pub latest_withdraw_time: i64, + #[prost(bytes="vec", tag="13")] + pub code: ::prost::alloc::vec::Vec, + #[prost(bool, tag="14")] + pub is_witness: bool, + #[prost(bool, tag="15")] + pub is_committee: bool, + #[prost(message, repeated, tag="16")] + pub frozen_supply: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="17")] + pub asset_issued_name: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="57")] + pub asset_issued_id: ::prost::alloc::vec::Vec, + #[prost(map="string, int64", tag="18")] + pub latest_asset_operation_time: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + #[prost(map="string, int64", tag="58")] + pub latest_asset_operation_time_v2: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + #[prost(int64, tag="19")] + pub free_net_usage: i64, + #[prost(map="string, int64", tag="20")] + pub free_asset_net_usage: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + #[prost(map="string, int64", tag="59")] + pub free_asset_net_usage_v2: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + #[prost(int64, tag="21")] + pub latest_consume_time: i64, + #[prost(int64, tag="22")] + pub latest_consume_free_time: i64, + #[prost(bytes="vec", tag="23")] + pub account_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="24")] + pub net_window_size: i64, + #[prost(bool, tag="25")] + pub net_window_optimized: bool, + #[prost(message, optional, tag="26")] + pub account_resource: ::core::option::Option, + #[prost(bytes="vec", tag="30")] + pub code_hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="31")] + pub owner_permission: ::core::option::Option, + #[prost(message, optional, tag="32")] + pub witness_permission: ::core::option::Option, + #[prost(message, repeated, tag="33")] + pub active_permission: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="34")] + pub frozen_v2: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="35")] + pub unfrozen_v2: ::prost::alloc::vec::Vec, + #[prost(int64, tag="36")] + pub delegated_frozen_v2_balance_for_bandwidth: i64, + #[prost(int64, tag="37")] + pub acquired_delegated_frozen_v2_balance_for_bandwidth: i64, +} +/// Nested message and enum types in `Account`. +pub mod account { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct Frozen { + #[prost(int64, tag="1")] + pub frozen_balance: i64, + #[prost(int64, tag="2")] + pub expire_time: i64, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct AccountResource { + #[prost(int64, tag="1")] + pub energy_usage: i64, + #[prost(message, optional, tag="2")] + pub frozen_balance_for_energy: ::core::option::Option, + #[prost(int64, tag="3")] + pub latest_consume_time_for_energy: i64, + #[prost(int64, tag="4")] + pub acquired_delegated_frozen_balance_for_energy: i64, + #[prost(int64, tag="5")] + pub delegated_frozen_balance_for_energy: i64, + #[prost(int64, tag="6")] + pub storage_limit: i64, + #[prost(int64, tag="7")] + pub storage_usage: i64, + #[prost(int64, tag="8")] + pub latest_exchange_storage_time: i64, + #[prost(int64, tag="9")] + pub energy_window_size: i64, + #[prost(int64, tag="10")] + pub delegated_frozen_v2_balance_for_energy: i64, + #[prost(int64, tag="11")] + pub acquired_delegated_frozen_v2_balance_for_energy: i64, + #[prost(bool, tag="12")] + pub energy_window_optimized: bool, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct FreezeV2 { + #[prost(enumeration="super::ResourceCode", tag="1")] + pub r#type: i32, + #[prost(int64, tag="2")] + pub amount: i64, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct UnFreezeV2 { + #[prost(enumeration="super::ResourceCode", tag="1")] + pub r#type: i32, + #[prost(int64, tag="3")] + pub unfreeze_amount: i64, + #[prost(int64, tag="4")] + pub unfreeze_expire_time: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Key { + #[prost(bytes="vec", tag="1")] + pub address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub weight: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DelegatedResource { + #[prost(bytes="vec", tag="1")] + pub from: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub to: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub frozen_balance_for_bandwidth: i64, + #[prost(int64, tag="4")] + pub frozen_balance_for_energy: i64, + #[prost(int64, tag="5")] + pub expire_time_for_bandwidth: i64, + #[prost(int64, tag="6")] + pub expire_time_for_energy: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Authority { + #[prost(message, optional, tag="1")] + pub account: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub permission_name: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Permission { + #[prost(enumeration="permission::PermissionType", tag="1")] + pub r#type: i32, + #[prost(int32, tag="2")] + pub id: i32, + #[prost(string, tag="3")] + pub permission_name: ::prost::alloc::string::String, + #[prost(int64, tag="4")] + pub threshold: i64, + #[prost(int32, tag="5")] + pub parent_id: i32, + #[prost(bytes="vec", tag="6")] + pub operations: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="7")] + pub keys: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `Permission`. +pub mod permission { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum PermissionType { + Owner = 0, + Witness = 1, + Active = 2, + } + impl PermissionType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PermissionType::Owner => "Owner", + PermissionType::Witness => "Witness", + PermissionType::Active => "Active", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Owner" => Some(Self::Owner), + "Witness" => Some(Self::Witness), + "Active" => Some(Self::Active), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Witness { + #[prost(bytes="vec", tag="1")] + pub address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub vote_count: i64, + #[prost(bytes="vec", tag="3")] + pub pub_key: ::prost::alloc::vec::Vec, + #[prost(string, tag="4")] + pub url: ::prost::alloc::string::String, + #[prost(int64, tag="5")] + pub total_produced: i64, + #[prost(int64, tag="6")] + pub total_missed: i64, + #[prost(int64, tag="7")] + pub latest_block_num: i64, + #[prost(int64, tag="8")] + pub latest_slot_num: i64, + #[prost(bool, tag="9")] + pub is_jobs: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Votes { + #[prost(bytes="vec", tag="1")] + pub address: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="2")] + pub old_votes: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="3")] + pub new_votes: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxOutput { + #[prost(int64, tag="1")] + pub value: i64, + #[prost(bytes="vec", tag="2")] + pub pub_key_hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxInput { + #[prost(message, optional, tag="1")] + pub raw_data: ::core::option::Option, + #[prost(bytes="vec", tag="4")] + pub signature: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `TXInput`. +pub mod tx_input { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Raw { + #[prost(bytes="vec", tag="1")] + pub tx_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub vout: i64, + #[prost(bytes="vec", tag="3")] + pub pub_key: ::prost::alloc::vec::Vec, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxOutputs { + #[prost(message, repeated, tag="1")] + pub outputs: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ResourceReceipt { + #[prost(int64, tag="1")] + pub energy_usage: i64, + #[prost(int64, tag="2")] + pub energy_fee: i64, + #[prost(int64, tag="3")] + pub origin_energy_usage: i64, + #[prost(int64, tag="4")] + pub energy_usage_total: i64, + #[prost(int64, tag="5")] + pub net_usage: i64, + #[prost(int64, tag="6")] + pub net_fee: i64, + #[prost(enumeration="transaction::result::ContractResult", tag="7")] + pub result: i32, + #[prost(int64, tag="8")] + pub energy_penalty_total: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketOrderDetail { + #[prost(bytes="vec", tag="1")] + pub maker_order_id: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub taker_order_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub fill_sell_quantity: i64, + #[prost(int64, tag="4")] + pub fill_buy_quantity: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Transaction { + #[prost(message, optional, tag="1")] + pub raw_data: ::core::option::Option, + #[prost(bytes="vec", repeated, tag="2")] + pub signature: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(message, repeated, tag="5")] + pub ret: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `Transaction`. +pub mod transaction { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Contract { + #[prost(enumeration="contract::ContractType", tag="1")] + pub r#type: i32, + #[prost(message, optional, tag="2")] + pub parameter: ::core::option::Option<::prost_types::Any>, + #[prost(bytes="vec", tag="3")] + pub provider: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="4")] + pub contract_name: ::prost::alloc::vec::Vec, + #[prost(int32, tag="5")] + pub permission_id: i32, + } + /// Nested message and enum types in `Contract`. + pub mod contract { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum ContractType { + AccountCreateContract = 0, + TransferContract = 1, + TransferAssetContract = 2, + VoteAssetContract = 3, + VoteWitnessContract = 4, + WitnessCreateContract = 5, + AssetIssueContract = 6, + WitnessUpdateContract = 8, + ParticipateAssetIssueContract = 9, + AccountUpdateContract = 10, + FreezeBalanceContract = 11, + UnfreezeBalanceContract = 12, + WithdrawBalanceContract = 13, + UnfreezeAssetContract = 14, + UpdateAssetContract = 15, + ProposalCreateContract = 16, + ProposalApproveContract = 17, + ProposalDeleteContract = 18, + SetAccountIdContract = 19, + CustomContract = 20, + CreateSmartContract = 30, + TriggerSmartContract = 31, + GetContract = 32, + UpdateSettingContract = 33, + ExchangeCreateContract = 41, + ExchangeInjectContract = 42, + ExchangeWithdrawContract = 43, + ExchangeTransactionContract = 44, + UpdateEnergyLimitContract = 45, + AccountPermissionUpdateContract = 46, + ClearAbiContract = 48, + UpdateBrokerageContract = 49, + ShieldedTransferContract = 51, + MarketSellAssetContract = 52, + MarketCancelOrderContract = 53, + FreezeBalanceV2Contract = 54, + UnfreezeBalanceV2Contract = 55, + WithdrawExpireUnfreezeContract = 56, + DelegateResourceContract = 57, + UnDelegateResourceContract = 58, + CancelAllUnfreezeV2Contract = 59, + } + impl ContractType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ContractType::AccountCreateContract => "AccountCreateContract", + ContractType::TransferContract => "TransferContract", + ContractType::TransferAssetContract => "TransferAssetContract", + ContractType::VoteAssetContract => "VoteAssetContract", + ContractType::VoteWitnessContract => "VoteWitnessContract", + ContractType::WitnessCreateContract => "WitnessCreateContract", + ContractType::AssetIssueContract => "AssetIssueContract", + ContractType::WitnessUpdateContract => "WitnessUpdateContract", + ContractType::ParticipateAssetIssueContract => "ParticipateAssetIssueContract", + ContractType::AccountUpdateContract => "AccountUpdateContract", + ContractType::FreezeBalanceContract => "FreezeBalanceContract", + ContractType::UnfreezeBalanceContract => "UnfreezeBalanceContract", + ContractType::WithdrawBalanceContract => "WithdrawBalanceContract", + ContractType::UnfreezeAssetContract => "UnfreezeAssetContract", + ContractType::UpdateAssetContract => "UpdateAssetContract", + ContractType::ProposalCreateContract => "ProposalCreateContract", + ContractType::ProposalApproveContract => "ProposalApproveContract", + ContractType::ProposalDeleteContract => "ProposalDeleteContract", + ContractType::SetAccountIdContract => "SetAccountIdContract", + ContractType::CustomContract => "CustomContract", + ContractType::CreateSmartContract => "CreateSmartContract", + ContractType::TriggerSmartContract => "TriggerSmartContract", + ContractType::GetContract => "GetContract", + ContractType::UpdateSettingContract => "UpdateSettingContract", + ContractType::ExchangeCreateContract => "ExchangeCreateContract", + ContractType::ExchangeInjectContract => "ExchangeInjectContract", + ContractType::ExchangeWithdrawContract => "ExchangeWithdrawContract", + ContractType::ExchangeTransactionContract => "ExchangeTransactionContract", + ContractType::UpdateEnergyLimitContract => "UpdateEnergyLimitContract", + ContractType::AccountPermissionUpdateContract => "AccountPermissionUpdateContract", + ContractType::ClearAbiContract => "ClearABIContract", + ContractType::UpdateBrokerageContract => "UpdateBrokerageContract", + ContractType::ShieldedTransferContract => "ShieldedTransferContract", + ContractType::MarketSellAssetContract => "MarketSellAssetContract", + ContractType::MarketCancelOrderContract => "MarketCancelOrderContract", + ContractType::FreezeBalanceV2Contract => "FreezeBalanceV2Contract", + ContractType::UnfreezeBalanceV2Contract => "UnfreezeBalanceV2Contract", + ContractType::WithdrawExpireUnfreezeContract => "WithdrawExpireUnfreezeContract", + ContractType::DelegateResourceContract => "DelegateResourceContract", + ContractType::UnDelegateResourceContract => "UnDelegateResourceContract", + ContractType::CancelAllUnfreezeV2Contract => "CancelAllUnfreezeV2Contract", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AccountCreateContract" => Some(Self::AccountCreateContract), + "TransferContract" => Some(Self::TransferContract), + "TransferAssetContract" => Some(Self::TransferAssetContract), + "VoteAssetContract" => Some(Self::VoteAssetContract), + "VoteWitnessContract" => Some(Self::VoteWitnessContract), + "WitnessCreateContract" => Some(Self::WitnessCreateContract), + "AssetIssueContract" => Some(Self::AssetIssueContract), + "WitnessUpdateContract" => Some(Self::WitnessUpdateContract), + "ParticipateAssetIssueContract" => Some(Self::ParticipateAssetIssueContract), + "AccountUpdateContract" => Some(Self::AccountUpdateContract), + "FreezeBalanceContract" => Some(Self::FreezeBalanceContract), + "UnfreezeBalanceContract" => Some(Self::UnfreezeBalanceContract), + "WithdrawBalanceContract" => Some(Self::WithdrawBalanceContract), + "UnfreezeAssetContract" => Some(Self::UnfreezeAssetContract), + "UpdateAssetContract" => Some(Self::UpdateAssetContract), + "ProposalCreateContract" => Some(Self::ProposalCreateContract), + "ProposalApproveContract" => Some(Self::ProposalApproveContract), + "ProposalDeleteContract" => Some(Self::ProposalDeleteContract), + "SetAccountIdContract" => Some(Self::SetAccountIdContract), + "CustomContract" => Some(Self::CustomContract), + "CreateSmartContract" => Some(Self::CreateSmartContract), + "TriggerSmartContract" => Some(Self::TriggerSmartContract), + "GetContract" => Some(Self::GetContract), + "UpdateSettingContract" => Some(Self::UpdateSettingContract), + "ExchangeCreateContract" => Some(Self::ExchangeCreateContract), + "ExchangeInjectContract" => Some(Self::ExchangeInjectContract), + "ExchangeWithdrawContract" => Some(Self::ExchangeWithdrawContract), + "ExchangeTransactionContract" => Some(Self::ExchangeTransactionContract), + "UpdateEnergyLimitContract" => Some(Self::UpdateEnergyLimitContract), + "AccountPermissionUpdateContract" => Some(Self::AccountPermissionUpdateContract), + "ClearABIContract" => Some(Self::ClearAbiContract), + "UpdateBrokerageContract" => Some(Self::UpdateBrokerageContract), + "ShieldedTransferContract" => Some(Self::ShieldedTransferContract), + "MarketSellAssetContract" => Some(Self::MarketSellAssetContract), + "MarketCancelOrderContract" => Some(Self::MarketCancelOrderContract), + "FreezeBalanceV2Contract" => Some(Self::FreezeBalanceV2Contract), + "UnfreezeBalanceV2Contract" => Some(Self::UnfreezeBalanceV2Contract), + "WithdrawExpireUnfreezeContract" => Some(Self::WithdrawExpireUnfreezeContract), + "DelegateResourceContract" => Some(Self::DelegateResourceContract), + "UnDelegateResourceContract" => Some(Self::UnDelegateResourceContract), + "CancelAllUnfreezeV2Contract" => Some(Self::CancelAllUnfreezeV2Contract), + _ => None, + } + } + } + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Result { + #[prost(int64, tag="1")] + pub fee: i64, + #[prost(enumeration="result::Code", tag="2")] + pub ret: i32, + #[prost(enumeration="result::ContractResult", tag="3")] + pub contract_ret: i32, + #[prost(string, tag="14")] + pub asset_issue_id: ::prost::alloc::string::String, + #[prost(int64, tag="15")] + pub withdraw_amount: i64, + #[prost(int64, tag="16")] + pub unfreeze_amount: i64, + #[prost(int64, tag="18")] + pub exchange_received_amount: i64, + #[prost(int64, tag="19")] + pub exchange_inject_another_amount: i64, + #[prost(int64, tag="20")] + pub exchange_withdraw_another_amount: i64, + #[prost(int64, tag="21")] + pub exchange_id: i64, + #[prost(int64, tag="22")] + pub shielded_transaction_fee: i64, + #[prost(bytes="vec", tag="25")] + pub order_id: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="26")] + pub order_details: ::prost::alloc::vec::Vec, + #[prost(int64, tag="27")] + pub withdraw_expire_amount: i64, + #[prost(map="string, int64", tag="28")] + pub cancel_unfreeze_v2_amount: ::std::collections::HashMap<::prost::alloc::string::String, i64>, + } + /// Nested message and enum types in `Result`. + pub mod result { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Code { + Sucess = 0, + Failed = 1, + } + impl Code { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Code::Sucess => "SUCESS", + Code::Failed => "FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SUCESS" => Some(Self::Sucess), + "FAILED" => Some(Self::Failed), + _ => None, + } + } + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum ContractResult { + Default = 0, + Success = 1, + Revert = 2, + BadJumpDestination = 3, + OutOfMemory = 4, + PrecompiledContract = 5, + StackTooSmall = 6, + StackTooLarge = 7, + IllegalOperation = 8, + StackOverflow = 9, + OutOfEnergy = 10, + OutOfTime = 11, + JvmStackOverFlow = 12, + Unknown = 13, + TransferFailed = 14, + InvalidCode = 15, + } + impl ContractResult { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ContractResult::Default => "DEFAULT", + ContractResult::Success => "SUCCESS", + ContractResult::Revert => "REVERT", + ContractResult::BadJumpDestination => "BAD_JUMP_DESTINATION", + ContractResult::OutOfMemory => "OUT_OF_MEMORY", + ContractResult::PrecompiledContract => "PRECOMPILED_CONTRACT", + ContractResult::StackTooSmall => "STACK_TOO_SMALL", + ContractResult::StackTooLarge => "STACK_TOO_LARGE", + ContractResult::IllegalOperation => "ILLEGAL_OPERATION", + ContractResult::StackOverflow => "STACK_OVERFLOW", + ContractResult::OutOfEnergy => "OUT_OF_ENERGY", + ContractResult::OutOfTime => "OUT_OF_TIME", + ContractResult::JvmStackOverFlow => "JVM_STACK_OVER_FLOW", + ContractResult::Unknown => "UNKNOWN", + ContractResult::TransferFailed => "TRANSFER_FAILED", + ContractResult::InvalidCode => "INVALID_CODE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DEFAULT" => Some(Self::Default), + "SUCCESS" => Some(Self::Success), + "REVERT" => Some(Self::Revert), + "BAD_JUMP_DESTINATION" => Some(Self::BadJumpDestination), + "OUT_OF_MEMORY" => Some(Self::OutOfMemory), + "PRECOMPILED_CONTRACT" => Some(Self::PrecompiledContract), + "STACK_TOO_SMALL" => Some(Self::StackTooSmall), + "STACK_TOO_LARGE" => Some(Self::StackTooLarge), + "ILLEGAL_OPERATION" => Some(Self::IllegalOperation), + "STACK_OVERFLOW" => Some(Self::StackOverflow), + "OUT_OF_ENERGY" => Some(Self::OutOfEnergy), + "OUT_OF_TIME" => Some(Self::OutOfTime), + "JVM_STACK_OVER_FLOW" => Some(Self::JvmStackOverFlow), + "UNKNOWN" => Some(Self::Unknown), + "TRANSFER_FAILED" => Some(Self::TransferFailed), + "INVALID_CODE" => Some(Self::InvalidCode), + _ => None, + } + } + } + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Raw { + #[prost(bytes="vec", tag="1")] + pub ref_block_bytes: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub ref_block_num: i64, + #[prost(bytes="vec", tag="4")] + pub ref_block_hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="8")] + pub expiration: i64, + #[prost(message, repeated, tag="9")] + pub auths: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="10")] + pub data: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="11")] + pub contract: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="12")] + pub scripts: ::prost::alloc::vec::Vec, + #[prost(int64, tag="14")] + pub timestamp: i64, + #[prost(int64, tag="18")] + pub fee_limit: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransactionInfo { + #[prost(bytes="vec", tag="1")] + pub id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub fee: i64, + #[prost(int64, tag="3")] + pub block_number: i64, + #[prost(int64, tag="4")] + pub block_time_stamp: i64, + #[prost(bytes="vec", repeated, tag="5")] + pub contract_result: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(bytes="vec", tag="6")] + pub contract_address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="7")] + pub receipt: ::core::option::Option, + #[prost(message, repeated, tag="8")] + pub log: ::prost::alloc::vec::Vec, + #[prost(enumeration="transaction_info::Code", tag="9")] + pub result: i32, + #[prost(bytes="vec", tag="10")] + pub res_message: ::prost::alloc::vec::Vec, + #[prost(string, tag="14")] + pub asset_issue_id: ::prost::alloc::string::String, + #[prost(int64, tag="15")] + pub withdraw_amount: i64, + #[prost(int64, tag="16")] + pub unfreeze_amount: i64, + #[prost(message, repeated, tag="17")] + pub internal_transactions: ::prost::alloc::vec::Vec, + #[prost(int64, tag="18")] + pub exchange_received_amount: i64, + #[prost(int64, tag="19")] + pub exchange_inject_another_amount: i64, + #[prost(int64, tag="20")] + pub exchange_withdraw_another_amount: i64, + #[prost(int64, tag="21")] + pub exchange_id: i64, + #[prost(int64, tag="22")] + pub shielded_transaction_fee: i64, + #[prost(bytes="vec", tag="25")] + pub order_id: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="26")] + pub order_details: ::prost::alloc::vec::Vec, + #[prost(int64, tag="27")] + pub packing_fee: i64, + #[prost(int64, tag="28")] + pub withdraw_expire_amount: i64, + #[prost(map="string, int64", tag="29")] + pub cancel_unfreeze_v2_amount: ::std::collections::HashMap<::prost::alloc::string::String, i64>, +} +/// Nested message and enum types in `TransactionInfo`. +pub mod transaction_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Log { + #[prost(bytes="vec", tag="1")] + pub address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub topics: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(bytes="vec", tag="3")] + pub data: ::prost::alloc::vec::Vec, + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Code { + Sucess = 0, + Failed = 1, + } + impl Code { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Code::Sucess => "SUCESS", + Code::Failed => "FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SUCESS" => Some(Self::Sucess), + "FAILED" => Some(Self::Failed), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransactionRet { + #[prost(int64, tag="1")] + pub block_number: i64, + #[prost(int64, tag="2")] + pub block_time_stamp: i64, + #[prost(message, repeated, tag="3")] + pub transactioninfo: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Transactions { + #[prost(message, repeated, tag="1")] + pub transactions: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockHeader { + #[prost(message, optional, tag="1")] + pub raw_data: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub witness_signature: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `BlockHeader`. +pub mod block_header { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Raw { + #[prost(int64, tag="1")] + pub timestamp: i64, + #[prost(bytes="vec", tag="2")] + pub tx_trie_root: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub parent_hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="7")] + pub number: i64, + #[prost(int64, tag="8")] + pub witness_id: i64, + #[prost(bytes="vec", tag="9")] + pub witness_address: ::prost::alloc::vec::Vec, + #[prost(int32, tag="10")] + pub version: i32, + #[prost(bytes="vec", tag="11")] + pub account_state_root: ::prost::alloc::vec::Vec, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Block { + #[prost(message, repeated, tag="1")] + pub transactions: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="2")] + pub block_header: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChainInventory { + #[prost(message, repeated, tag="1")] + pub ids: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub remain_num: i64, +} +/// Nested message and enum types in `ChainInventory`. +pub mod chain_inventory { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct BlockId { + #[prost(bytes="vec", tag="1")] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub number: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockInventory { + #[prost(message, repeated, tag="1")] + pub ids: ::prost::alloc::vec::Vec, + #[prost(enumeration="block_inventory::Type", tag="2")] + pub r#type: i32, +} +/// Nested message and enum types in `BlockInventory`. +pub mod block_inventory { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct BlockId { + #[prost(bytes="vec", tag="1")] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub number: i64, + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Type { + Sync = 0, + Advtise = 1, + Fetch = 2, + } + impl Type { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Type::Sync => "SYNC", + Type::Advtise => "ADVTISE", + Type::Fetch => "FETCH", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SYNC" => Some(Self::Sync), + "ADVTISE" => Some(Self::Advtise), + "FETCH" => Some(Self::Fetch), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Inventory { + #[prost(enumeration="inventory::InventoryType", tag="1")] + pub r#type: i32, + #[prost(bytes="vec", repeated, tag="2")] + pub ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// Nested message and enum types in `Inventory`. +pub mod inventory { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum InventoryType { + Trx = 0, + Block = 1, + } + impl InventoryType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + InventoryType::Trx => "TRX", + InventoryType::Block => "BLOCK", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TRX" => Some(Self::Trx), + "BLOCK" => Some(Self::Block), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Items { + #[prost(enumeration="items::ItemType", tag="1")] + pub r#type: i32, + #[prost(message, repeated, tag="2")] + pub blocks: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="3")] + pub block_headers: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="4")] + pub transactions: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `Items`. +pub mod items { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum ItemType { + Err = 0, + Trx = 1, + Block = 2, + Blockheader = 3, + } + impl ItemType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ItemType::Err => "ERR", + ItemType::Trx => "TRX", + ItemType::Block => "BLOCK", + ItemType::Blockheader => "BLOCKHEADER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ERR" => Some(Self::Err), + "TRX" => Some(Self::Trx), + "BLOCK" => Some(Self::Block), + "BLOCKHEADER" => Some(Self::Blockheader), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct DynamicProperties { + #[prost(int64, tag="1")] + pub last_solidity_block_num: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct DisconnectMessage { + #[prost(enumeration="ReasonCode", tag="1")] + pub reason: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HelloMessage { + #[prost(message, optional, tag="1")] + pub from: ::core::option::Option, + #[prost(int32, tag="2")] + pub version: i32, + #[prost(int64, tag="3")] + pub timestamp: i64, + #[prost(message, optional, tag="4")] + pub genesis_block_id: ::core::option::Option, + #[prost(message, optional, tag="5")] + pub solid_block_id: ::core::option::Option, + #[prost(message, optional, tag="6")] + pub head_block_id: ::core::option::Option, + #[prost(bytes="vec", tag="7")] + pub address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="8")] + pub signature: ::prost::alloc::vec::Vec, + #[prost(int32, tag="9")] + pub node_type: i32, + #[prost(int64, tag="10")] + pub lowest_block_num: i64, + #[prost(bytes="vec", tag="11")] + pub code_version: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `HelloMessage`. +pub mod hello_message { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct BlockId { + #[prost(bytes="vec", tag="1")] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub number: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InternalTransaction { + #[prost(bytes="vec", tag="1")] + pub hash: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub caller_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub transfer_to_address: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="4")] + pub call_value_info: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="5")] + pub note: ::prost::alloc::vec::Vec, + #[prost(bool, tag="6")] + pub rejected: bool, + #[prost(string, tag="7")] + pub extra: ::prost::alloc::string::String, +} +/// Nested message and enum types in `InternalTransaction`. +pub mod internal_transaction { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct CallValueInfo { + #[prost(int64, tag="1")] + pub call_value: i64, + #[prost(string, tag="2")] + pub token_id: ::prost::alloc::string::String, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DelegatedResourceAccountIndex { + #[prost(bytes="vec", tag="1")] + pub account: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub from_accounts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(bytes="vec", repeated, tag="3")] + pub to_accounts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(int64, tag="4")] + pub timestamp: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NodeInfo { + #[prost(int64, tag="1")] + pub begin_sync_num: i64, + #[prost(string, tag="2")] + pub block: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub solidity_block: ::prost::alloc::string::String, + #[prost(int32, tag="4")] + pub current_connect_count: i32, + #[prost(int32, tag="5")] + pub active_connect_count: i32, + #[prost(int32, tag="6")] + pub passive_connect_count: i32, + #[prost(int64, tag="7")] + pub total_flow: i64, + #[prost(message, repeated, tag="8")] + pub peer_info_list: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="9")] + pub config_node_info: ::core::option::Option, + #[prost(message, optional, tag="10")] + pub machine_info: ::core::option::Option, + #[prost(map="string, string", tag="11")] + pub cheat_witness_info_map: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, +} +/// Nested message and enum types in `NodeInfo`. +pub mod node_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct PeerInfo { + #[prost(string, tag="1")] + pub last_sync_block: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub remain_num: i64, + #[prost(int64, tag="3")] + pub last_block_update_time: i64, + #[prost(bool, tag="4")] + pub sync_flag: bool, + #[prost(int64, tag="5")] + pub head_block_time_we_both_have: i64, + #[prost(bool, tag="6")] + pub need_sync_from_peer: bool, + #[prost(bool, tag="7")] + pub need_sync_from_us: bool, + #[prost(string, tag="8")] + pub host: ::prost::alloc::string::String, + #[prost(int32, tag="9")] + pub port: i32, + #[prost(string, tag="10")] + pub node_id: ::prost::alloc::string::String, + #[prost(int64, tag="11")] + pub connect_time: i64, + #[prost(double, tag="12")] + pub avg_latency: f64, + #[prost(int32, tag="13")] + pub sync_to_fetch_size: i32, + #[prost(int64, tag="14")] + pub sync_to_fetch_size_peek_num: i64, + #[prost(int32, tag="15")] + pub sync_block_requested_size: i32, + #[prost(int64, tag="16")] + pub un_fetch_syn_num: i64, + #[prost(int32, tag="17")] + pub block_in_porc_size: i32, + #[prost(string, tag="18")] + pub head_block_we_both_have: ::prost::alloc::string::String, + #[prost(bool, tag="19")] + pub is_active: bool, + #[prost(int32, tag="20")] + pub score: i32, + #[prost(int32, tag="21")] + pub node_count: i32, + #[prost(int64, tag="22")] + pub in_flow: i64, + #[prost(int32, tag="23")] + pub disconnect_times: i32, + #[prost(string, tag="24")] + pub local_disconnect_reason: ::prost::alloc::string::String, + #[prost(string, tag="25")] + pub remote_disconnect_reason: ::prost::alloc::string::String, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ConfigNodeInfo { + #[prost(string, tag="1")] + pub code_version: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub p2p_version: ::prost::alloc::string::String, + #[prost(int32, tag="3")] + pub listen_port: i32, + #[prost(bool, tag="4")] + pub discover_enable: bool, + #[prost(int32, tag="5")] + pub active_node_size: i32, + #[prost(int32, tag="6")] + pub passive_node_size: i32, + #[prost(int32, tag="7")] + pub send_node_size: i32, + #[prost(int32, tag="8")] + pub max_connect_count: i32, + #[prost(int32, tag="9")] + pub same_ip_max_connect_count: i32, + #[prost(int32, tag="10")] + pub backup_listen_port: i32, + #[prost(int32, tag="11")] + pub backup_member_size: i32, + #[prost(int32, tag="12")] + pub backup_priority: i32, + #[prost(int32, tag="13")] + pub db_version: i32, + #[prost(int32, tag="14")] + pub min_participation_rate: i32, + #[prost(bool, tag="15")] + pub support_constant: bool, + #[prost(double, tag="16")] + pub min_time_ratio: f64, + #[prost(double, tag="17")] + pub max_time_ratio: f64, + #[prost(int64, tag="18")] + pub allow_creation_of_contracts: i64, + #[prost(int64, tag="19")] + pub allow_adaptive_energy: i64, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MachineInfo { + #[prost(int32, tag="1")] + pub thread_count: i32, + #[prost(int32, tag="2")] + pub dead_lock_thread_count: i32, + #[prost(int32, tag="3")] + pub cpu_count: i32, + #[prost(int64, tag="4")] + pub total_memory: i64, + #[prost(int64, tag="5")] + pub free_memory: i64, + #[prost(double, tag="6")] + pub cpu_rate: f64, + #[prost(string, tag="7")] + pub java_version: ::prost::alloc::string::String, + #[prost(string, tag="8")] + pub os_name: ::prost::alloc::string::String, + #[prost(int64, tag="9")] + pub jvm_total_memory: i64, + #[prost(int64, tag="10")] + pub jvm_free_memory: i64, + #[prost(double, tag="11")] + pub process_cpu_rate: f64, + #[prost(message, repeated, tag="12")] + pub memory_desc_info_list: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="13")] + pub dead_lock_thread_info_list: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `MachineInfo`. + pub mod machine_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct MemoryDescInfo { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub init_size: i64, + #[prost(int64, tag="3")] + pub use_size: i64, + #[prost(int64, tag="4")] + pub max_size: i64, + #[prost(double, tag="5")] + pub use_rate: f64, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct DeadLockThreadInfo { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag="2")] + pub lock_name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub lock_owner: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub state: ::prost::alloc::string::String, + #[prost(int64, tag="5")] + pub block_time: i64, + #[prost(int64, tag="6")] + pub wait_time: i64, + #[prost(string, tag="7")] + pub stack_trace: ::prost::alloc::string::String, + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetricsInfo { + #[prost(int64, tag="1")] + pub interval: i64, + #[prost(message, optional, tag="2")] + pub node: ::core::option::Option, + #[prost(message, optional, tag="3")] + pub blockchain: ::core::option::Option, + #[prost(message, optional, tag="4")] + pub net: ::core::option::Option, +} +/// Nested message and enum types in `MetricsInfo`. +pub mod metrics_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct NodeInfo { + #[prost(string, tag="1")] + pub ip: ::prost::alloc::string::String, + #[prost(int32, tag="2")] + pub node_type: i32, + #[prost(string, tag="3")] + pub version: ::prost::alloc::string::String, + #[prost(int32, tag="4")] + pub backup_status: i32, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct BlockChainInfo { + #[prost(int64, tag="1")] + pub head_block_num: i64, + #[prost(int64, tag="2")] + pub head_block_timestamp: i64, + #[prost(string, tag="3")] + pub head_block_hash: ::prost::alloc::string::String, + #[prost(int32, tag="4")] + pub fork_count: i32, + #[prost(int32, tag="5")] + pub fail_fork_count: i32, + #[prost(message, optional, tag="6")] + pub block_process_time: ::core::option::Option, + #[prost(message, optional, tag="7")] + pub tps: ::core::option::Option, + #[prost(int32, tag="8")] + pub transaction_cache_size: i32, + #[prost(message, optional, tag="9")] + pub missed_transaction: ::core::option::Option, + #[prost(message, repeated, tag="10")] + pub witnesses: ::prost::alloc::vec::Vec, + #[prost(int64, tag="11")] + pub fail_process_block_num: i64, + #[prost(string, tag="12")] + pub fail_process_block_reason: ::prost::alloc::string::String, + #[prost(message, repeated, tag="13")] + pub dup_witness: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `BlockChainInfo`. + pub mod block_chain_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Witness { + #[prost(string, tag="1")] + pub address: ::prost::alloc::string::String, + #[prost(int32, tag="2")] + pub version: i32, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct DupWitness { + #[prost(string, tag="1")] + pub address: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub block_num: i64, + #[prost(int32, tag="3")] + pub count: i32, + } + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct RateInfo { + #[prost(int64, tag="1")] + pub count: i64, + #[prost(double, tag="2")] + pub mean_rate: f64, + #[prost(double, tag="3")] + pub one_minute_rate: f64, + #[prost(double, tag="4")] + pub five_minute_rate: f64, + #[prost(double, tag="5")] + pub fifteen_minute_rate: f64, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct NetInfo { + #[prost(int32, tag="1")] + pub error_proto_count: i32, + #[prost(message, optional, tag="2")] + pub api: ::core::option::Option, + #[prost(int32, tag="3")] + pub connection_count: i32, + #[prost(int32, tag="4")] + pub valid_connection_count: i32, + #[prost(message, optional, tag="5")] + pub tcp_in_traffic: ::core::option::Option, + #[prost(message, optional, tag="6")] + pub tcp_out_traffic: ::core::option::Option, + #[prost(int32, tag="7")] + pub disconnection_count: i32, + #[prost(message, repeated, tag="8")] + pub disconnection_detail: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="9")] + pub udp_in_traffic: ::core::option::Option, + #[prost(message, optional, tag="10")] + pub udp_out_traffic: ::core::option::Option, + #[prost(message, optional, tag="11")] + pub latency: ::core::option::Option, + } + /// Nested message and enum types in `NetInfo`. + pub mod net_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ApiInfo { + #[prost(message, optional, tag="1")] + pub qps: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub fail_qps: ::core::option::Option, + #[prost(message, optional, tag="3")] + pub out_traffic: ::core::option::Option, + #[prost(message, repeated, tag="4")] + pub detail: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `ApiInfo`. + pub mod api_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct ApiDetailInfo { + #[prost(string, tag="1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag="2")] + pub qps: ::core::option::Option, + #[prost(message, optional, tag="3")] + pub fail_qps: ::core::option::Option, + #[prost(message, optional, tag="4")] + pub out_traffic: ::core::option::Option, + } + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct DisconnectionDetailInfo { + #[prost(string, tag="1")] + pub reason: ::prost::alloc::string::String, + #[prost(int32, tag="2")] + pub count: i32, + } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct LatencyInfo { + #[prost(int32, tag="1")] + pub top99: i32, + #[prost(int32, tag="2")] + pub top95: i32, + #[prost(int32, tag="3")] + pub top75: i32, + #[prost(int32, tag="4")] + pub total_count: i32, + #[prost(int32, tag="5")] + pub delay1_s: i32, + #[prost(int32, tag="6")] + pub delay2_s: i32, + #[prost(int32, tag="7")] + pub delay3_s: i32, + #[prost(message, repeated, tag="8")] + pub detail: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `LatencyInfo`. + pub mod latency_info { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct LatencyDetailInfo { + #[prost(string, tag="1")] + pub witness: ::prost::alloc::string::String, + #[prost(int32, tag="2")] + pub top99: i32, + #[prost(int32, tag="3")] + pub top95: i32, + #[prost(int32, tag="4")] + pub top75: i32, + #[prost(int32, tag="5")] + pub count: i32, + #[prost(int32, tag="6")] + pub delay1_s: i32, + #[prost(int32, tag="7")] + pub delay2_s: i32, + #[prost(int32, tag="8")] + pub delay3_s: i32, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PbftMessage { + #[prost(message, optional, tag="1")] + pub raw_data: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub signature: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `PBFTMessage`. +pub mod pbft_message { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Raw { + #[prost(enumeration="MsgType", tag="1")] + pub msg_type: i32, + #[prost(enumeration="DataType", tag="2")] + pub data_type: i32, + #[prost(int64, tag="3")] + pub view_n: i64, + #[prost(int64, tag="4")] + pub epoch: i64, + #[prost(bytes="vec", tag="5")] + pub data: ::prost::alloc::vec::Vec, + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum MsgType { + ViewChange = 0, + Request = 1, + Preprepare = 2, + Prepare = 3, + Commit = 4, + } + impl MsgType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + MsgType::ViewChange => "VIEW_CHANGE", + MsgType::Request => "REQUEST", + MsgType::Preprepare => "PREPREPARE", + MsgType::Prepare => "PREPARE", + MsgType::Commit => "COMMIT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VIEW_CHANGE" => Some(Self::ViewChange), + "REQUEST" => Some(Self::Request), + "PREPREPARE" => Some(Self::Preprepare), + "PREPARE" => Some(Self::Prepare), + "COMMIT" => Some(Self::Commit), + _ => None, + } + } + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum DataType { + Block = 0, + Srl = 1, + } + impl DataType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DataType::Block => "BLOCK", + DataType::Srl => "SRL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BLOCK" => Some(Self::Block), + "SRL" => Some(Self::Srl), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PbftCommitResult { + #[prost(bytes="vec", tag="1")] + pub data: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub signature: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Srl { + #[prost(bytes="vec", repeated, tag="1")] + pub sr_address: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum AccountType { + Normal = 0, + AssetIssue = 1, + Contract = 2, +} +impl AccountType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + AccountType::Normal => "Normal", + AccountType::AssetIssue => "AssetIssue", + AccountType::Contract => "Contract", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Normal" => Some(Self::Normal), + "AssetIssue" => Some(Self::AssetIssue), + "Contract" => Some(Self::Contract), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ReasonCode { + Requested = 0, + BadProtocol = 2, + TooManyPeers = 4, + DuplicatePeer = 5, + IncompatibleProtocol = 6, + RandomElimination = 7, + PeerQuiting = 8, + UnexpectedIdentity = 9, + LocalIdentity = 10, + PingTimeout = 11, + UserReason = 16, + Reset = 17, + SyncFail = 18, + FetchFail = 19, + BadTx = 20, + BadBlock = 21, + Forked = 22, + Unlinkable = 23, + IncompatibleVersion = 24, + IncompatibleChain = 25, + TimeOut = 32, + ConnectFail = 33, + TooManyPeersWithSameIp = 34, + LightNodeSyncFail = 35, + BelowThanMe = 36, + NotWitness = 37, + NoSuchMessage = 38, + Unknown = 255, +} +impl ReasonCode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ReasonCode::Requested => "REQUESTED", + ReasonCode::BadProtocol => "BAD_PROTOCOL", + ReasonCode::TooManyPeers => "TOO_MANY_PEERS", + ReasonCode::DuplicatePeer => "DUPLICATE_PEER", + ReasonCode::IncompatibleProtocol => "INCOMPATIBLE_PROTOCOL", + ReasonCode::RandomElimination => "RANDOM_ELIMINATION", + ReasonCode::PeerQuiting => "PEER_QUITING", + ReasonCode::UnexpectedIdentity => "UNEXPECTED_IDENTITY", + ReasonCode::LocalIdentity => "LOCAL_IDENTITY", + ReasonCode::PingTimeout => "PING_TIMEOUT", + ReasonCode::UserReason => "USER_REASON", + ReasonCode::Reset => "RESET", + ReasonCode::SyncFail => "SYNC_FAIL", + ReasonCode::FetchFail => "FETCH_FAIL", + ReasonCode::BadTx => "BAD_TX", + ReasonCode::BadBlock => "BAD_BLOCK", + ReasonCode::Forked => "FORKED", + ReasonCode::Unlinkable => "UNLINKABLE", + ReasonCode::IncompatibleVersion => "INCOMPATIBLE_VERSION", + ReasonCode::IncompatibleChain => "INCOMPATIBLE_CHAIN", + ReasonCode::TimeOut => "TIME_OUT", + ReasonCode::ConnectFail => "CONNECT_FAIL", + ReasonCode::TooManyPeersWithSameIp => "TOO_MANY_PEERS_WITH_SAME_IP", + ReasonCode::LightNodeSyncFail => "LIGHT_NODE_SYNC_FAIL", + ReasonCode::BelowThanMe => "BELOW_THAN_ME", + ReasonCode::NotWitness => "NOT_WITNESS", + ReasonCode::NoSuchMessage => "NO_SUCH_MESSAGE", + ReasonCode::Unknown => "UNKNOWN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REQUESTED" => Some(Self::Requested), + "BAD_PROTOCOL" => Some(Self::BadProtocol), + "TOO_MANY_PEERS" => Some(Self::TooManyPeers), + "DUPLICATE_PEER" => Some(Self::DuplicatePeer), + "INCOMPATIBLE_PROTOCOL" => Some(Self::IncompatibleProtocol), + "RANDOM_ELIMINATION" => Some(Self::RandomElimination), + "PEER_QUITING" => Some(Self::PeerQuiting), + "UNEXPECTED_IDENTITY" => Some(Self::UnexpectedIdentity), + "LOCAL_IDENTITY" => Some(Self::LocalIdentity), + "PING_TIMEOUT" => Some(Self::PingTimeout), + "USER_REASON" => Some(Self::UserReason), + "RESET" => Some(Self::Reset), + "SYNC_FAIL" => Some(Self::SyncFail), + "FETCH_FAIL" => Some(Self::FetchFail), + "BAD_TX" => Some(Self::BadTx), + "BAD_BLOCK" => Some(Self::BadBlock), + "FORKED" => Some(Self::Forked), + "UNLINKABLE" => Some(Self::Unlinkable), + "INCOMPATIBLE_VERSION" => Some(Self::IncompatibleVersion), + "INCOMPATIBLE_CHAIN" => Some(Self::IncompatibleChain), + "TIME_OUT" => Some(Self::TimeOut), + "CONNECT_FAIL" => Some(Self::ConnectFail), + "TOO_MANY_PEERS_WITH_SAME_IP" => Some(Self::TooManyPeersWithSameIp), + "LIGHT_NODE_SYNC_FAIL" => Some(Self::LightNodeSyncFail), + "BELOW_THAN_ME" => Some(Self::BelowThanMe), + "NOT_WITNESS" => Some(Self::NotWitness), + "NO_SUCH_MESSAGE" => Some(Self::NoSuchMessage), + "UNKNOWN" => Some(Self::Unknown), + _ => None, + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AssetIssueContract { + #[prost(string, tag="41")] + pub id: ::prost::alloc::string::String, + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub name: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub abbr: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub total_supply: i64, + #[prost(message, repeated, tag="5")] + pub frozen_supply: ::prost::alloc::vec::Vec, + #[prost(int32, tag="6")] + pub trx_num: i32, + #[prost(int32, tag="7")] + pub precision: i32, + #[prost(int32, tag="8")] + pub num: i32, + #[prost(int64, tag="9")] + pub start_time: i64, + #[prost(int64, tag="10")] + pub end_time: i64, + #[prost(int64, tag="11")] + pub order: i64, + #[prost(int32, tag="16")] + pub vote_score: i32, + #[prost(bytes="vec", tag="20")] + pub description: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="21")] + pub url: ::prost::alloc::vec::Vec, + #[prost(int64, tag="22")] + pub free_asset_net_limit: i64, + #[prost(int64, tag="23")] + pub public_free_asset_net_limit: i64, + #[prost(int64, tag="24")] + pub public_free_asset_net_usage: i64, + #[prost(int64, tag="25")] + pub public_latest_free_net_time: i64, +} +/// Nested message and enum types in `AssetIssueContract`. +pub mod asset_issue_contract { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] + pub struct FrozenSupply { + #[prost(int64, tag="1")] + pub frozen_amount: i64, + #[prost(int64, tag="2")] + pub frozen_days: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransferAssetContract { + #[prost(bytes="vec", tag="1")] + pub asset_name: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub to_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub amount: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UnfreezeAssetContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateAssetContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub description: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub url: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub new_limit: i64, + #[prost(int64, tag="5")] + pub new_public_limit: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ParticipateAssetIssueContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub to_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub asset_name: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub amount: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExchangeCreateContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub first_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub first_token_balance: i64, + #[prost(bytes="vec", tag="4")] + pub second_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub second_token_balance: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExchangeInjectContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub exchange_id: i64, + #[prost(bytes="vec", tag="3")] + pub token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub quant: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExchangeWithdrawContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub exchange_id: i64, + #[prost(bytes="vec", tag="3")] + pub token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub quant: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ExchangeTransactionContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub exchange_id: i64, + #[prost(bytes="vec", tag="3")] + pub token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="4")] + pub quant: i64, + #[prost(int64, tag="5")] + pub expected: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketSellAssetContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub sell_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub sell_token_quantity: i64, + #[prost(bytes="vec", tag="4")] + pub buy_token_id: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub buy_token_quantity: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MarketCancelOrderContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub order_id: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountCreateContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub account_address: ::prost::alloc::vec::Vec, + #[prost(enumeration="AccountType", tag="3")] + pub r#type: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountUpdateContract { + #[prost(bytes="vec", tag="1")] + pub account_name: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub owner_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetAccountIdContract { + #[prost(bytes="vec", tag="1")] + pub account_id: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub owner_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountPermissionUpdateContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="2")] + pub owner: ::core::option::Option, + #[prost(message, optional, tag="3")] + pub witness: ::core::option::Option, + #[prost(message, repeated, tag="4")] + pub actives: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BuyStorageBytesContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub bytes: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BuyStorageContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub quant: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SellStorageContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub storage_bytes: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateBrokerageContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int32, tag="2")] + pub brokerage: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthenticationPath { + #[prost(bool, repeated, tag="1")] + pub value: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MerklePath { + #[prost(message, repeated, tag="1")] + pub authentication_paths: ::prost::alloc::vec::Vec, + #[prost(bool, repeated, tag="2")] + pub index: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub rt: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OutputPoint { + #[prost(bytes="vec", tag="1")] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int32, tag="2")] + pub index: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OutputPointInfo { + #[prost(message, repeated, tag="1")] + pub out_points: ::prost::alloc::vec::Vec, + #[prost(int32, tag="2")] + pub block_num: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PedersenHash { + #[prost(bytes="vec", tag="1")] + pub content: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IncrementalMerkleTree { + #[prost(message, optional, tag="1")] + pub left: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub right: ::core::option::Option, + #[prost(message, repeated, tag="3")] + pub parents: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IncrementalMerkleVoucher { + #[prost(message, optional, tag="1")] + pub tree: ::core::option::Option, + #[prost(message, repeated, tag="2")] + pub filled: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="3")] + pub cursor: ::core::option::Option, + #[prost(int64, tag="4")] + pub cursor_depth: i64, + #[prost(bytes="vec", tag="5")] + pub rt: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="10")] + pub output_point: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IncrementalMerkleVoucherInfo { + #[prost(message, repeated, tag="1")] + pub vouchers: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub paths: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SpendDescription { + #[prost(bytes="vec", tag="1")] + pub value_commitment: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub anchor: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub nullifier: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="4")] + pub rk: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="5")] + pub zkproof: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="6")] + pub spend_authority_signature: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ReceiveDescription { + #[prost(bytes="vec", tag="1")] + pub value_commitment: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub note_commitment: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub epk: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="4")] + pub c_enc: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="5")] + pub c_out: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="6")] + pub zkproof: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ShieldedTransferContract { + #[prost(bytes="vec", tag="1")] + pub transparent_from_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub from_amount: i64, + #[prost(message, repeated, tag="3")] + pub spend_description: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="4")] + pub receive_description: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="5")] + pub binding_signature: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="6")] + pub transparent_to_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="7")] + pub to_amount: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InventoryItems { + #[prost(int32, tag="1")] + pub r#type: i32, + #[prost(bytes="vec", repeated, tag="2")] + pub items: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FreezeBalanceContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub frozen_balance: i64, + #[prost(int64, tag="3")] + pub frozen_duration: i64, + #[prost(enumeration="ResourceCode", tag="10")] + pub resource: i32, + #[prost(bytes="vec", tag="15")] + pub receiver_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UnfreezeBalanceContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(enumeration="ResourceCode", tag="10")] + pub resource: i32, + #[prost(bytes="vec", tag="15")] + pub receiver_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WithdrawBalanceContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransferContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub to_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub amount: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransactionBalanceTrace { + #[prost(bytes="vec", tag="1")] + pub transaction_identifier: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="2")] + pub operation: ::prost::alloc::vec::Vec, + #[prost(string, tag="3")] + pub r#type: ::prost::alloc::string::String, + #[prost(string, tag="4")] + pub status: ::prost::alloc::string::String, +} +/// Nested message and enum types in `TransactionBalanceTrace`. +pub mod transaction_balance_trace { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Operation { + #[prost(int64, tag="1")] + pub operation_identifier: i64, + #[prost(bytes="vec", tag="2")] + pub address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub amount: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockBalanceTrace { + #[prost(message, optional, tag="1")] + pub block_identifier: ::core::option::Option, + #[prost(int64, tag="2")] + pub timestamp: i64, + #[prost(message, repeated, tag="3")] + pub transaction_balance_trace: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `BlockBalanceTrace`. +pub mod block_balance_trace { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct BlockIdentifier { + #[prost(bytes="vec", tag="1")] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub number: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct AccountTrace { + #[prost(int64, tag="1")] + pub balance: i64, + #[prost(int64, tag="99")] + pub placeholder: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountIdentifier { + #[prost(bytes="vec", tag="1")] + pub address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountBalanceRequest { + #[prost(message, optional, tag="1")] + pub account_identifier: ::core::option::Option, + #[prost(message, optional, tag="2")] + pub block_identifier: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountBalanceResponse { + #[prost(int64, tag="1")] + pub balance: i64, + #[prost(message, optional, tag="2")] + pub block_identifier: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FreezeBalanceV2Contract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub frozen_balance: i64, + #[prost(enumeration="ResourceCode", tag="3")] + pub resource: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UnfreezeBalanceV2Contract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub unfreeze_balance: i64, + #[prost(enumeration="ResourceCode", tag="3")] + pub resource: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WithdrawExpireUnfreezeContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DelegateResourceContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(enumeration="ResourceCode", tag="2")] + pub resource: i32, + #[prost(int64, tag="3")] + pub balance: i64, + #[prost(bytes="vec", tag="4")] + pub receiver_address: ::prost::alloc::vec::Vec, + #[prost(bool, tag="5")] + pub lock: bool, + #[prost(int64, tag="6")] + pub lock_period: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UnDelegateResourceContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(enumeration="ResourceCode", tag="2")] + pub resource: i32, + #[prost(int64, tag="3")] + pub balance: i64, + #[prost(bytes="vec", tag="4")] + pub receiver_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CancelAllUnfreezeV2Contract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SmartContract { + #[prost(bytes="vec", tag="1")] + pub origin_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub contract_address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="3")] + pub abi: ::core::option::Option, + #[prost(bytes="vec", tag="4")] + pub bytecode: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub call_value: i64, + #[prost(int64, tag="6")] + pub consume_user_resource_percent: i64, + #[prost(string, tag="7")] + pub name: ::prost::alloc::string::String, + #[prost(int64, tag="8")] + pub origin_energy_limit: i64, + #[prost(bytes="vec", tag="9")] + pub code_hash: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="10")] + pub trx_hash: ::prost::alloc::vec::Vec, + #[prost(int32, tag="11")] + pub version: i32, +} +/// Nested message and enum types in `SmartContract`. +pub mod smart_contract { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Abi { + #[prost(message, repeated, tag="1")] + pub entrys: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `ABI`. + pub mod abi { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Entry { + #[prost(bool, tag="1")] + pub anonymous: bool, + #[prost(bool, tag="2")] + pub constant: bool, + #[prost(string, tag="3")] + pub name: ::prost::alloc::string::String, + #[prost(message, repeated, tag="4")] + pub inputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="5")] + pub outputs: ::prost::alloc::vec::Vec, + #[prost(enumeration="entry::EntryType", tag="6")] + pub r#type: i32, + #[prost(bool, tag="7")] + pub payable: bool, + #[prost(enumeration="entry::StateMutabilityType", tag="8")] + pub state_mutability: i32, + } + /// Nested message and enum types in `Entry`. + pub mod entry { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Param { + #[prost(bool, tag="1")] + pub indexed: bool, + #[prost(string, tag="2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag="3")] + pub r#type: ::prost::alloc::string::String, + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum EntryType { + UnknownEntryType = 0, + Constructor = 1, + Function = 2, + Event = 3, + Fallback = 4, + Receive = 5, + Error = 6, + } + impl EntryType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + EntryType::UnknownEntryType => "UnknownEntryType", + EntryType::Constructor => "Constructor", + EntryType::Function => "Function", + EntryType::Event => "Event", + EntryType::Fallback => "Fallback", + EntryType::Receive => "Receive", + EntryType::Error => "Error", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UnknownEntryType" => Some(Self::UnknownEntryType), + "Constructor" => Some(Self::Constructor), + "Function" => Some(Self::Function), + "Event" => Some(Self::Event), + "Fallback" => Some(Self::Fallback), + "Receive" => Some(Self::Receive), + "Error" => Some(Self::Error), + _ => None, + } + } + } + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum StateMutabilityType { + UnknownMutabilityType = 0, + Pure = 1, + View = 2, + Nonpayable = 3, + Payable = 4, + } + impl StateMutabilityType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + StateMutabilityType::UnknownMutabilityType => "UnknownMutabilityType", + StateMutabilityType::Pure => "Pure", + StateMutabilityType::View => "View", + StateMutabilityType::Nonpayable => "Nonpayable", + StateMutabilityType::Payable => "Payable", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UnknownMutabilityType" => Some(Self::UnknownMutabilityType), + "Pure" => Some(Self::Pure), + "View" => Some(Self::View), + "Nonpayable" => Some(Self::Nonpayable), + "Payable" => Some(Self::Payable), + _ => None, + } + } + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct ContractState { + #[prost(int64, tag="1")] + pub energy_usage: i64, + #[prost(int64, tag="2")] + pub energy_factor: i64, + #[prost(int64, tag="3")] + pub update_cycle: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CreateSmartContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="2")] + pub new_contract: ::core::option::Option, + #[prost(int64, tag="3")] + pub call_token_value: i64, + #[prost(int64, tag="4")] + pub token_id: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TriggerSmartContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub contract_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub call_value: i64, + #[prost(bytes="vec", tag="4")] + pub data: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub call_token_value: i64, + #[prost(int64, tag="6")] + pub token_id: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClearAbiContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub contract_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateSettingContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub contract_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub consume_user_resource_percent: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpdateEnergyLimitContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub contract_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="3")] + pub origin_energy_limit: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SmartContractDataWrapper { + #[prost(message, optional, tag="1")] + pub smart_contract: ::core::option::Option, + #[prost(bytes="vec", tag="2")] + pub runtimecode: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="3")] + pub contract_state: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WitnessCreateContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="2")] + pub url: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WitnessUpdateContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="12")] + pub update_url: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VoteWitnessContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag="2")] + pub votes: ::prost::alloc::vec::Vec, + #[prost(bool, tag="3")] + pub support: bool, +} +/// Nested message and enum types in `VoteWitnessContract`. +pub mod vote_witness_contract { + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] + pub struct Vote { + #[prost(bytes="vec", tag="1")] + pub vote_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub vote_count: i64, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProposalApproveContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub proposal_id: i64, + #[prost(bool, tag="3")] + pub is_add_approval: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProposalCreateContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(map="int64, int64", tag="2")] + pub parameters: ::std::collections::HashMap, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProposalDeleteContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag="2")] + pub proposal_id: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VoteAssetContract { + #[prost(bytes="vec", tag="1")] + pub owner_address: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub vote_address: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(bool, tag="3")] + pub support: bool, + #[prost(int32, tag="5")] + pub count: i32, +} +// @@protoc_insertion_point(module) diff --git a/packages/substreams-tron/src/pb/request.tron.v1.rs b/packages/substreams-tron/src/pb/request.tron.v1.rs new file mode 100644 index 000000000..0aa07b513 --- /dev/null +++ b/packages/substreams-tron/src/pb/request.tron.v1.rs @@ -0,0 +1,49 @@ +// @generated +// This file is @generated by prost-build + +/// A single payment event from the ERC20FeeProxy contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Payment { + /// The token contract address (TRC20) + #[prost(string, tag = "1")] + pub token_address: ::prost::alloc::string::String, + /// The recipient address + #[prost(string, tag = "2")] + pub to: ::prost::alloc::string::String, + /// The payment amount (as string to preserve precision) + #[prost(string, tag = "3")] + pub amount: ::prost::alloc::string::String, + /// The indexed payment reference (hex encoded) + #[prost(string, tag = "4")] + pub payment_reference: ::prost::alloc::string::String, + /// The fee amount (as string to preserve precision) + #[prost(string, tag = "5")] + pub fee_amount: ::prost::alloc::string::String, + /// The fee recipient address + #[prost(string, tag = "6")] + pub fee_address: ::prost::alloc::string::String, + /// The sender address (msg.sender) + #[prost(string, tag = "7")] + pub from: ::prost::alloc::string::String, + /// Block number where the event was emitted + #[prost(uint64, tag = "8")] + pub block: u64, + /// Block timestamp (Unix timestamp in seconds) + #[prost(uint64, tag = "9")] + pub timestamp: u64, + /// Transaction hash + #[prost(string, tag = "10")] + pub tx_hash: ::prost::alloc::string::String, + /// The proxy contract address that emitted the event + #[prost(string, tag = "11")] + pub contract_address: ::prost::alloc::string::String, +} + +/// Collection of payment events +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Payments { + #[prost(message, repeated, tag = "1")] + pub payments: ::prost::alloc::vec::Vec, +} diff --git a/packages/substreams-tron/src/pb/sf.tron.type.v1.rs b/packages/substreams-tron/src/pb/sf.tron.type.v1.rs new file mode 100644 index 000000000..6cef6a28e --- /dev/null +++ b/packages/substreams-tron/src/pb/sf.tron.type.v1.rs @@ -0,0 +1,127 @@ +// @generated +// This file is @generated by prost-build. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Block { + #[prost(bytes="vec", tag="1")] + pub id: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag="2")] + pub header: ::core::option::Option, + #[prost(message, repeated, tag="3")] + pub transactions: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockHeader { + #[prost(uint64, tag="1")] + pub number: u64, + #[prost(bytes="vec", tag="2")] + pub tx_trie_root: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="3")] + pub witness_address: ::prost::alloc::vec::Vec, + #[prost(uint64, tag="4")] + pub parent_number: u64, + #[prost(bytes="vec", tag="5")] + pub parent_hash: ::prost::alloc::vec::Vec, + #[prost(uint32, tag="6")] + pub version: u32, + #[prost(int64, tag="7")] + pub timestamp: i64, + #[prost(bytes="vec", tag="8")] + pub witness_signature: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Transaction { + #[prost(bytes="vec", tag="1")] + pub txid: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", repeated, tag="2")] + pub signature: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(bytes="vec", tag="3")] + pub ref_block_bytes: ::prost::alloc::vec::Vec, + #[prost(bytes="vec", tag="4")] + pub ref_block_hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag="5")] + pub expiration: i64, + #[prost(int64, tag="6")] + pub timestamp: i64, + #[prost(bytes="vec", repeated, tag="7")] + pub contract_result: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(bool, tag="8")] + pub result: bool, + #[prost(enumeration="ResponseCode", tag="9")] + pub code: i32, + #[prost(bytes="vec", tag="10")] + pub message: ::prost::alloc::vec::Vec, + #[prost(int64, tag="11")] + pub energy_used: i64, + #[prost(int64, tag="12")] + pub energy_penalty: i64, + #[prost(message, optional, tag="13")] + pub info: ::core::option::Option, + #[prost(message, repeated, tag="14")] + pub contracts: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ResponseCode { + Success = 0, + Sigerror = 1, + ContractValidateError = 2, + ContractExeError = 3, + BandwithError = 4, + DupTransactionError = 5, + TaposError = 6, + TooBigTransactionError = 7, + TransactionExpirationError = 8, + ServerBusy = 9, + NoConnection = 10, + NotEnoughEffectiveConnection = 11, + BlockUnsolidified = 12, + OtherError = 20, +} +impl ResponseCode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ResponseCode::Success => "SUCCESS", + ResponseCode::Sigerror => "SIGERROR", + ResponseCode::ContractValidateError => "CONTRACT_VALIDATE_ERROR", + ResponseCode::ContractExeError => "CONTRACT_EXE_ERROR", + ResponseCode::BandwithError => "BANDWITH_ERROR", + ResponseCode::DupTransactionError => "DUP_TRANSACTION_ERROR", + ResponseCode::TaposError => "TAPOS_ERROR", + ResponseCode::TooBigTransactionError => "TOO_BIG_TRANSACTION_ERROR", + ResponseCode::TransactionExpirationError => "TRANSACTION_EXPIRATION_ERROR", + ResponseCode::ServerBusy => "SERVER_BUSY", + ResponseCode::NoConnection => "NO_CONNECTION", + ResponseCode::NotEnoughEffectiveConnection => "NOT_ENOUGH_EFFECTIVE_CONNECTION", + ResponseCode::BlockUnsolidified => "BLOCK_UNSOLIDIFIED", + ResponseCode::OtherError => "OTHER_ERROR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SUCCESS" => Some(Self::Success), + "SIGERROR" => Some(Self::Sigerror), + "CONTRACT_VALIDATE_ERROR" => Some(Self::ContractValidateError), + "CONTRACT_EXE_ERROR" => Some(Self::ContractExeError), + "BANDWITH_ERROR" => Some(Self::BandwithError), + "DUP_TRANSACTION_ERROR" => Some(Self::DupTransactionError), + "TAPOS_ERROR" => Some(Self::TaposError), + "TOO_BIG_TRANSACTION_ERROR" => Some(Self::TooBigTransactionError), + "TRANSACTION_EXPIRATION_ERROR" => Some(Self::TransactionExpirationError), + "SERVER_BUSY" => Some(Self::ServerBusy), + "NO_CONNECTION" => Some(Self::NoConnection), + "NOT_ENOUGH_EFFECTIVE_CONNECTION" => Some(Self::NotEnoughEffectiveConnection), + "BLOCK_UNSOLIDIFIED" => Some(Self::BlockUnsolidified), + "OTHER_ERROR" => Some(Self::OtherError), + _ => None, + } + } +} +// @@protoc_insertion_point(module) From 7af2f2aa69d5b48b61b6c9ce64a5a7a567ce9df8 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 27 Jan 2026 06:20:33 -0300 Subject: [PATCH 09/15] fix: update Rust version to 1.85 for edition 2024 support The home crate v0.5.12 requires Rust edition 2024 which was stabilized in Rust 1.85. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c3ef59fc..32b150f37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ references: environment: NODE_OPTIONS: '--max-old-space-size=4096' rust_image: &rust_image - image: cimg/rust:1.75 + image: cimg/rust:1.85 ipfs_image: &ipfs_image image: requestnetwork/request-ipfs:v0.13.0 ganache_image: &ganache_image From 16edb59e2690a618ab037918a79bfd3af2686aeb Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 27 Jan 2026 06:28:11 -0300 Subject: [PATCH 10/15] fix: downgrade prost to 0.11 to match substreams dependency substreams v0.5.22 uses prost v0.11.9, so we need to use the same version to avoid trait incompatibility errors. --- packages/substreams-tron/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/substreams-tron/Cargo.toml b/packages/substreams-tron/Cargo.toml index 48f2190d8..8a5ab4ecf 100644 --- a/packages/substreams-tron/Cargo.toml +++ b/packages/substreams-tron/Cargo.toml @@ -12,8 +12,8 @@ crate-type = ["cdylib"] [dependencies] substreams = "0.5" -prost = "0.12" -prost-types = "0.12" +prost = "0.11" +prost-types = "0.11" hex = "0.4" bs58 = { version = "0.5", features = ["check"] } sha2 = "0.10" From 11723530c8850fc9d44885a9daa8f9a83f86192c Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 27 Jan 2026 06:42:08 -0300 Subject: [PATCH 11/15] fix: update package.json to comply with npmPkgJsonLint rules - Add engines, bugs, and homepage fields - Add period at end of description - Reorder properties with description after private --- packages/substreams-tron/package.json | 35 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/packages/substreams-tron/package.json b/packages/substreams-tron/package.json index 1783888da..cf79f1e61 100644 --- a/packages/substreams-tron/package.json +++ b/packages/substreams-tron/package.json @@ -1,29 +1,36 @@ { "name": "@requestnetwork/substreams-tron", "version": "0.1.0", - "description": "Request Network TRON Substreams module for ERC20FeeProxy payment detection", "private": true, - "scripts": { - "build": "echo 'Substreams-tron requires Rust toolchain. Run make build directly or use CI.'", - "build:rust": "make build", - "protogen": "make protogen", - "package": "make package", - "gui": "make gui", - "run": "make run", - "clean": "make clean", - "test": "make test" - }, + "description": "Request Network TRON Substreams module for ERC20FeeProxy payment detection.", "keywords": [ "request-network", "tron", "substreams", "payment-detection" ], - "author": "Request Network", - "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/RequestNetwork/requestNetwork.git", + "url": "git+https://github.com/RequestNetwork/requestNetwork.git", "directory": "packages/substreams-tron" + }, + "homepage": "https://github.com/RequestNetwork/requestNetwork/tree/master/packages/substreams-tron#readme", + "bugs": { + "url": "https://github.com/RequestNetwork/requestNetwork/issues" + }, + "license": "MIT", + "author": "Request Network", + "engines": { + "node": ">=22.0.0" + }, + "scripts": { + "build": "echo 'Substreams-tron requires Rust toolchain. Run make build directly or use CI.'", + "build:rust": "make build", + "protogen": "make protogen", + "package": "make package", + "gui": "make gui", + "run": "make run", + "clean": "make clean", + "test": "make test" } } From 7ed38e179350ae33af2d1cc88ad9b8e203dc16aa Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 27 Jan 2026 06:57:36 -0300 Subject: [PATCH 12/15] fix: skip Rust tests in Node.js test environment The substreams-tron tests require Rust/cargo which is only available in the dedicated build-substreams-tron CI job, not the general Node.js test environment. --- packages/substreams-tron/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/substreams-tron/package.json b/packages/substreams-tron/package.json index cf79f1e61..8f12c87bd 100644 --- a/packages/substreams-tron/package.json +++ b/packages/substreams-tron/package.json @@ -31,6 +31,6 @@ "gui": "make gui", "run": "make run", "clean": "make clean", - "test": "make test" + "test": "echo 'Substreams-tron tests require Rust toolchain. Run make test directly or use CI.'" } } From 6e9d00f2941ba775013879fa411f11d10e00eb34 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Wed, 28 Jan 2026 11:26:09 -0300 Subject: [PATCH 13/15] fix: correct import path in trc20-fee-proxy test The test was importing from 'tron-fee-proxy' but the source file is named 'trc20-fee-proxy.ts'. --- packages/payment-processor/test/payment/trc20-fee-proxy.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/payment-processor/test/payment/trc20-fee-proxy.test.ts b/packages/payment-processor/test/payment/trc20-fee-proxy.test.ts index a3a3e3d70..1e4b2914b 100644 --- a/packages/payment-processor/test/payment/trc20-fee-proxy.test.ts +++ b/packages/payment-processor/test/payment/trc20-fee-proxy.test.ts @@ -9,7 +9,7 @@ import { hasSufficientTronAllowance, hasSufficientTronBalance, getTronPaymentInfo, -} from '../../src/payment/tron-fee-proxy'; +} from '../../src/payment/trc20-fee-proxy'; import { BigNumber } from 'ethers'; /* eslint-disable @typescript-eslint/no-unused-expressions */ From e9e81e3c3a4acdff2003cbb73fde9d68edfc7d43 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Wed, 28 Jan 2026 22:20:32 -0300 Subject: [PATCH 14/15] refactor: move substreams-tron to payments-substream repo - Remove packages/substreams-tron (moved to payments-substream/tron) - Remove build-substreams-tron job from CircleCI config - Update graphql.config.yml to use local schema - Substreams now maintained in separate repo for cleaner separation --- .circleci/config.yml | 33 - .../thegraph/queries/tron/graphql.config.yml | 4 +- packages/substreams-tron/Cargo.toml | 28 - packages/substreams-tron/Makefile | 28 - packages/substreams-tron/README.md | 105 - packages/substreams-tron/package.json | 36 - .../proto/request/tron/v1/payments.proto | 44 - packages/substreams-tron/schema.graphql | 40 - packages/substreams-tron/src/lib.rs | 223 -- packages/substreams-tron/src/pb/mod.rs | 28 - packages/substreams-tron/src/pb/protocol.rs | 2824 ----------------- .../substreams-tron/src/pb/request.tron.v1.rs | 49 - .../substreams-tron/src/pb/sf.tron.type.v1.rs | 127 - packages/substreams-tron/subgraph.yaml | 22 - packages/substreams-tron/substreams.yaml | 48 - 15 files changed, 2 insertions(+), 3637 deletions(-) delete mode 100644 packages/substreams-tron/Cargo.toml delete mode 100644 packages/substreams-tron/Makefile delete mode 100644 packages/substreams-tron/README.md delete mode 100644 packages/substreams-tron/package.json delete mode 100644 packages/substreams-tron/proto/request/tron/v1/payments.proto delete mode 100644 packages/substreams-tron/schema.graphql delete mode 100644 packages/substreams-tron/src/lib.rs delete mode 100644 packages/substreams-tron/src/pb/mod.rs delete mode 100644 packages/substreams-tron/src/pb/protocol.rs delete mode 100644 packages/substreams-tron/src/pb/request.tron.v1.rs delete mode 100644 packages/substreams-tron/src/pb/sf.tron.type.v1.rs delete mode 100644 packages/substreams-tron/subgraph.yaml delete mode 100644 packages/substreams-tron/substreams.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 32b150f37..59a9cf22d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,8 +6,6 @@ references: image: cimg/node:22.14 environment: NODE_OPTIONS: '--max-old-space-size=4096' - rust_image: &rust_image - image: cimg/rust:1.85 ipfs_image: &ipfs_image image: requestnetwork/request-ipfs:v0.13.0 ganache_image: &ganache_image @@ -264,35 +262,6 @@ jobs: name: 'Build toolbox' command: 'yarn workspace @requestnetwork/toolbox run build' - build-substreams-tron: - docker: - - *rust_image - working_directory: *working_directory - steps: - - checkout - - run: - name: 'Install wasm32 target' - command: rustup target add wasm32-unknown-unknown - - restore_cache: - name: Restore Cargo Cache - keys: - - cargo-cache-{{ checksum "packages/substreams-tron/Cargo.toml" }} - - cargo-cache- - - run: - name: 'Build substreams-tron' - command: make build - working_directory: ~/repo/packages/substreams-tron - - save_cache: - name: Save Cargo Cache - key: cargo-cache-{{ checksum "packages/substreams-tron/Cargo.toml" }} - paths: - - ~/.cargo - - packages/substreams-tron/target - - run: - name: 'Run tests' - command: make test - working_directory: ~/repo/packages/substreams-tron - test-nightly: docker: - *node_image @@ -364,7 +333,6 @@ workflows: build-and-test: jobs: - build - - build-substreams-tron - test-unit: requires: - build @@ -389,7 +357,6 @@ workflows: requires: - lint - build - - build-substreams-tron - test-unit - test-integration-with-smart-contracts - test-integration-with-request-node diff --git a/packages/payment-detection/src/thegraph/queries/tron/graphql.config.yml b/packages/payment-detection/src/thegraph/queries/tron/graphql.config.yml index f731d57f3..205b553d3 100644 --- a/packages/payment-detection/src/thegraph/queries/tron/graphql.config.yml +++ b/packages/payment-detection/src/thegraph/queries/tron/graphql.config.yml @@ -1,2 +1,2 @@ -# Using local schema until the subgraph is deployed to The Graph Studio -schema: ../../../../../substreams-tron/schema.graphql +# Local schema for TRON payment queries +schema: ./schema.graphql diff --git a/packages/substreams-tron/Cargo.toml b/packages/substreams-tron/Cargo.toml deleted file mode 100644 index 8a5ab4ecf..000000000 --- a/packages/substreams-tron/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "request-network-tron" -version = "0.1.0" -edition = "2021" -repository = "https://github.com/RequestNetwork/requestNetwork" -license = "MIT" -description = "Request Network TRON Substreams module for ERC20FeeProxy payment detection" - -[lib] -name = "request_network_tron" -crate-type = ["cdylib"] - -[dependencies] -substreams = "0.5" -prost = "0.11" -prost-types = "0.11" -hex = "0.4" -bs58 = { version = "0.5", features = ["check"] } -sha2 = "0.10" -anyhow = "1.0" - -[target.wasm32-unknown-unknown.dependencies] -getrandom = { version = "0.2", features = ["custom"] } - -[profile.release] -lto = true -opt-level = 's' -strip = "debuginfo" diff --git a/packages/substreams-tron/Makefile b/packages/substreams-tron/Makefile deleted file mode 100644 index e9d1c034e..000000000 --- a/packages/substreams-tron/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -.PHONY: build -build: - cargo build --target wasm32-unknown-unknown --release - -.PHONY: protogen -protogen: - substreams protogen ./substreams.yaml --exclude-paths="sf/substreams,google" - -.PHONY: package -package: build - substreams pack ./substreams.yaml - -.PHONY: gui -gui: build - substreams gui ./substreams.yaml map_erc20_fee_proxy_payments -e tron.substreams.pinax.network:443 - -.PHONY: run -run: build - substreams run ./substreams.yaml map_erc20_fee_proxy_payments -e tron.substreams.pinax.network:443 --start-block 63208782 --stop-block +100 - -.PHONY: clean -clean: - cargo clean - rm -f *.spkg - -.PHONY: test -test: - cargo test diff --git a/packages/substreams-tron/README.md b/packages/substreams-tron/README.md deleted file mode 100644 index 4bd4c8925..000000000 --- a/packages/substreams-tron/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# Request Network TRON Substreams - -This package contains a Substreams module for indexing ERC20FeeProxy payment events on the TRON blockchain. - -## Overview - -The module indexes `TransferWithReferenceAndFee` events from the deployed ERC20FeeProxy contracts: - -- **Mainnet**: `TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd` -- **Nile Testnet**: `THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs` - -## Prerequisites - -1. **Rust toolchain** with `wasm32-unknown-unknown` target: - - ```bash - rustup target add wasm32-unknown-unknown - ``` - -2. **Substreams CLI**: - - ```bash - brew install streamingfast/tap/substreams - ``` - -3. **bs58 crate** for Base58 encoding (included in dependencies) - -## Building - -```bash -# Build the WASM module -make build - -# Generate protobuf types -make protogen - -# Package for deployment -make package -``` - -## Running Locally - -```bash -# Run with GUI for debugging -make gui - -# Run and output to console -make run -``` - -## Deployment - -### Deploy as Substreams-powered Subgraph - -1. Build and package the Substreams module: - - ```bash - make package - ``` - -2. Deploy to The Graph: - ```bash - graph deploy --studio request-payments-tron - ``` - -### Subgraph Endpoints - -Once deployed, the subgraph will be available at: - -- **Mainnet**: `https://api.studio.thegraph.com/query/67444/request-payments-tron/version/latest` -- **Nile Testnet**: `https://api.studio.thegraph.com/query/67444/request-payments-tron-nile/version/latest` - -## Module Details - -### `map_erc20_fee_proxy_payments` - -Extracts payment events from TRON blocks: - -**Input**: `sf.tron.type.v1.Block` - -**Output**: `request.tron.v1.Payments` - -**Fields extracted**: - -- `token_address` - TRC20 token contract address -- `to` - Payment recipient -- `amount` - Payment amount -- `payment_reference` - Indexed payment reference (hex) -- `fee_amount` - Fee amount -- `fee_address` - Fee recipient -- `from` - Sender address -- `block` - Block number -- `timestamp` - Block timestamp (Unix seconds) -- `tx_hash` - Transaction hash -- `contract_address` - ERC20FeeProxy contract address - -## Testing - -```bash -make test -``` - -## License - -MIT diff --git a/packages/substreams-tron/package.json b/packages/substreams-tron/package.json deleted file mode 100644 index 8f12c87bd..000000000 --- a/packages/substreams-tron/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@requestnetwork/substreams-tron", - "version": "0.1.0", - "private": true, - "description": "Request Network TRON Substreams module for ERC20FeeProxy payment detection.", - "keywords": [ - "request-network", - "tron", - "substreams", - "payment-detection" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/RequestNetwork/requestNetwork.git", - "directory": "packages/substreams-tron" - }, - "homepage": "https://github.com/RequestNetwork/requestNetwork/tree/master/packages/substreams-tron#readme", - "bugs": { - "url": "https://github.com/RequestNetwork/requestNetwork/issues" - }, - "license": "MIT", - "author": "Request Network", - "engines": { - "node": ">=22.0.0" - }, - "scripts": { - "build": "echo 'Substreams-tron requires Rust toolchain. Run make build directly or use CI.'", - "build:rust": "make build", - "protogen": "make protogen", - "package": "make package", - "gui": "make gui", - "run": "make run", - "clean": "make clean", - "test": "echo 'Substreams-tron tests require Rust toolchain. Run make test directly or use CI.'" - } -} diff --git a/packages/substreams-tron/proto/request/tron/v1/payments.proto b/packages/substreams-tron/proto/request/tron/v1/payments.proto deleted file mode 100644 index 7b8348e5b..000000000 --- a/packages/substreams-tron/proto/request/tron/v1/payments.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package request.tron.v1; - -// A single payment event from the ERC20FeeProxy contract -message Payment { - // The token contract address (TRC20) - string token_address = 1; - - // The recipient address - string to = 2; - - // The payment amount (as string to preserve precision) - string amount = 3; - - // The indexed payment reference (hex encoded) - string payment_reference = 4; - - // The fee amount (as string to preserve precision) - string fee_amount = 5; - - // The fee recipient address - string fee_address = 6; - - // The sender address (msg.sender) - string from = 7; - - // Block number where the event was emitted - uint64 block = 8; - - // Block timestamp (Unix timestamp in seconds) - uint64 timestamp = 9; - - // Transaction hash - string tx_hash = 10; - - // The proxy contract address that emitted the event - string contract_address = 11; -} - -// Collection of payment events -message Payments { - repeated Payment payments = 1; -} diff --git a/packages/substreams-tron/schema.graphql b/packages/substreams-tron/schema.graphql deleted file mode 100644 index 7d31e646a..000000000 --- a/packages/substreams-tron/schema.graphql +++ /dev/null @@ -1,40 +0,0 @@ -# GraphQL schema for Request Network TRON payments -# This schema is used when deploying a Substreams-powered subgraph - -type Payment @entity { - "Unique identifier: txHash-logIndex" - id: ID! - - "The TRC20 token contract address" - tokenAddress: String! - - "The payment recipient address" - to: String! - - "The payment amount" - amount: BigInt! - - "The indexed payment reference (keccak256 hash)" - reference: Bytes! - - "The fee amount" - feeAmount: BigInt! - - "The fee recipient address" - feeAddress: String - - "The sender address" - from: String! - - "Block number" - block: Int! - - "Block timestamp (Unix seconds)" - timestamp: Int! - - "Transaction hash" - txHash: String! - - "The ERC20FeeProxy contract address" - contractAddress: String! -} diff --git a/packages/substreams-tron/src/lib.rs b/packages/substreams-tron/src/lib.rs deleted file mode 100644 index d9a023a13..000000000 --- a/packages/substreams-tron/src/lib.rs +++ /dev/null @@ -1,223 +0,0 @@ -//! Request Network TRON Substreams Module -//! -//! This module indexes TransferWithReferenceAndFee events from the ERC20FeeProxy -//! contract deployed on TRON mainnet and Nile testnet. - -mod pb; - -use hex; -use pb::protocol::transaction_info::Log; -use pb::request::tron::v1::{Payment, Payments}; -use pb::sf::tron::r#type::v1::{Block, Transaction}; -use substreams::log; - -/// TransferWithReferenceAndFee event signature (keccak256 hash of event signature) -/// Event: TransferWithReferenceAndFee(address,address,uint256,bytes indexed,uint256,address) -/// keccak256("TransferWithReferenceAndFee(address,address,uint256,bytes,uint256,address)") -const TRANSFER_WITH_REF_AND_FEE_TOPIC: &str = - "9f16cbcc523c67a60c450e5ffe4f3b7b6dbe772e7abcadb2686ce029a9a0a2b6"; - -/// Parses proxy addresses from the params string -/// Expected format: "mainnet_proxy_address=ADDR1\nnile_proxy_address=ADDR2" -fn parse_proxy_addresses(params: &str) -> (String, String) { - let mut mainnet = String::new(); - let mut nile = String::new(); - - for line in params.lines() { - let parts: Vec<&str> = line.splitn(2, '=').collect(); - if parts.len() == 2 { - match parts[0].trim() { - "mainnet_proxy_address" => mainnet = parts[1].trim().to_string(), - "nile_proxy_address" => nile = parts[1].trim().to_string(), - _ => {} - } - } - } - - (mainnet, nile) -} - -/// Maps TRON blocks to extract ERC20FeeProxy payment events -#[substreams::handlers::map] -fn map_erc20_fee_proxy_payments(params: String, block: Block) -> Result { - let (mainnet_proxy, nile_proxy) = parse_proxy_addresses(¶ms); - - let mut payments = Vec::new(); - let block_number = block.header.as_ref().map(|h| h.number).unwrap_or(0); - let block_timestamp = block.header.as_ref().map(|h| h.timestamp).unwrap_or(0) as u64 / 1000; // Convert from ms to seconds - - for transaction in block.transactions.iter() { - let tx_hash = hex::encode(&transaction.txid); - - // Get the transaction info to access logs - if let Some(info) = &transaction.info { - for log_entry in info.log.iter() { - // Check if this log is from one of our proxy contracts - let contract_address = base58_encode(&log_entry.address); - - if contract_address != mainnet_proxy && contract_address != nile_proxy { - continue; - } - - // Check if this is a TransferWithReferenceAndFee event - // The first topic should be the event signature - if log_entry.topics.is_empty() { - continue; - } - - // Validate the event signature matches TransferWithReferenceAndFee - let topic0 = hex::encode(&log_entry.topics[0]); - if topic0 != TRANSFER_WITH_REF_AND_FEE_TOPIC { - continue; - } - - // Parse the event data - if let Some(payment) = parse_transfer_with_reference_and_fee( - log_entry, - &contract_address, - &tx_hash, - block_number, - block_timestamp, - transaction, - ) { - payments.push(payment); - } - } - } - } - - Ok(Payments { payments }) -} - -/// Parses a TransferWithReferenceAndFee event from a log entry -fn parse_transfer_with_reference_and_fee( - log_entry: &Log, - contract_address: &str, - tx_hash: &str, - block_number: u64, - block_timestamp: u64, - transaction: &Transaction, -) -> Option { - // Event: TransferWithReferenceAndFee(address tokenAddress, address to, uint256 amount, - // bytes indexed paymentReference, uint256 feeAmount, address feeAddress) - // - // Topics: - // [0] = Event signature hash - // [1] = paymentReference (indexed) - // - // Data (non-indexed parameters, ABI encoded): - // [0-31] = tokenAddress - // [32-63] = to - // [64-95] = amount - // [96-127] = feeAmount - // [128-159] = feeAddress - - if log_entry.topics.len() < 2 { - return None; - } - - let data = &log_entry.data; - if data.len() < 160 { - log::info!("Log data too short: {} bytes", data.len()); - return None; - } - - // Extract payment reference from indexed topic - let payment_reference = hex::encode(&log_entry.topics[1]); - - // Parse non-indexed parameters from data - let token_address = parse_address_from_data(data, 0)?; - let to = parse_address_from_data(data, 32)?; - let amount = parse_uint256_from_data(data, 64); - let fee_amount = parse_uint256_from_data(data, 96); - let fee_address = parse_address_from_data(data, 128)?; - - // Get the sender (from) address from the transaction contracts - let from = transaction - .contracts - .first() - .and_then(|c| c.parameter.as_ref()) - .map(|p| extract_owner_address(p)) - .unwrap_or_default(); - - Some(Payment { - token_address, - to, - amount, - payment_reference, - fee_amount, - fee_address, - from, - block: block_number, - timestamp: block_timestamp, - tx_hash: tx_hash.to_string(), - contract_address: contract_address.to_string(), - }) -} - -/// Parses an address from ABI-encoded data at the given offset -fn parse_address_from_data(data: &[u8], offset: usize) -> Option { - if data.len() < offset + 32 { - return None; - } - // Address is the last 20 bytes of the 32-byte slot - let address_bytes = &data[offset + 12..offset + 32]; - Some(base58_encode(address_bytes)) -} - -/// Parses a uint256 from ABI-encoded data at the given offset -fn parse_uint256_from_data(data: &[u8], offset: usize) -> String { - if data.len() < offset + 32 { - return "0".to_string(); - } - let bytes = &data[offset..offset + 32]; - // Convert to decimal string, handling large numbers - let hex_str = hex::encode(bytes); - // Remove leading zeros and convert - let trimmed = hex_str.trim_start_matches('0'); - if trimmed.is_empty() { - "0".to_string() - } else { - // For simplicity, return as hex - the consumer can convert - format!("0x{}", hex_str) - } -} - -/// Extracts the owner address from a contract parameter -fn extract_owner_address(parameter: &prost_types::Any) -> String { - // The owner_address is typically at the beginning of the parameter value - if parameter.value.len() >= 21 { - base58_encode(¶meter.value[0..21]) - } else { - String::new() - } -} - -/// Encodes bytes to TRON Base58Check address format -fn base58_encode(bytes: &[u8]) -> String { - // TRON addresses use Base58Check encoding with 0x41 prefix for mainnet - // This is a simplified version - in production, use a proper Base58Check implementation - if bytes.len() == 20 { - // Add TRON mainnet prefix (0x41) - let mut prefixed = vec![0x41]; - prefixed.extend_from_slice(bytes); - bs58::encode(&prefixed).with_check().into_string() - } else if bytes.len() == 21 && bytes[0] == 0x41 { - bs58::encode(bytes).with_check().into_string() - } else { - bs58::encode(bytes).with_check().into_string() - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_base58_encode() { - // Test with a known TRON address - let hex_addr = hex::decode("41a614f803b6fd780986a42c78ec9c7f77e6ded13c").unwrap(); - let encoded = base58_encode(&hex_addr); - assert!(encoded.starts_with('T')); - } -} diff --git a/packages/substreams-tron/src/pb/mod.rs b/packages/substreams-tron/src/pb/mod.rs deleted file mode 100644 index d7bf3b70f..000000000 --- a/packages/substreams-tron/src/pb/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -// @generated -// Protobuf types for Request Network TRON Substreams - -// TRON protocol types from StreamingFast -pub mod protocol { - include!("protocol.rs"); -} - -pub mod sf { - pub mod tron { - pub mod r#type { - // @@ protoc_insertion_point(attribute:sf.tron.type.v1) - pub mod v1 { - include!("sf.tron.type.v1.rs"); - // @@ protoc_insertion_point(sf.tron.type.v1) - } - } - } -} - -// Request Network payment types -pub mod request { - pub mod tron { - pub mod v1 { - include!("request.tron.v1.rs"); - } - } -} diff --git a/packages/substreams-tron/src/pb/protocol.rs b/packages/substreams-tron/src/pb/protocol.rs deleted file mode 100644 index c94724c9d..000000000 --- a/packages/substreams-tron/src/pb/protocol.rs +++ /dev/null @@ -1,2824 +0,0 @@ -// @generated -// This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Endpoint { - #[prost(bytes="vec", tag="1")] - pub address: ::prost::alloc::vec::Vec, - #[prost(int32, tag="2")] - pub port: i32, - #[prost(bytes="vec", tag="3")] - pub node_id: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PingMessage { - #[prost(message, optional, tag="1")] - pub from: ::core::option::Option, - #[prost(message, optional, tag="2")] - pub to: ::core::option::Option, - #[prost(int32, tag="3")] - pub version: i32, - #[prost(int64, tag="4")] - pub timestamp: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PongMessage { - #[prost(message, optional, tag="1")] - pub from: ::core::option::Option, - #[prost(int32, tag="2")] - pub echo: i32, - #[prost(int64, tag="3")] - pub timestamp: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FindNeighbours { - #[prost(message, optional, tag="1")] - pub from: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub target_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub timestamp: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Neighbours { - #[prost(message, optional, tag="1")] - pub from: ::core::option::Option, - #[prost(message, repeated, tag="2")] - pub neighbours: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub timestamp: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct BackupMessage { - #[prost(bool, tag="1")] - pub flag: bool, - #[prost(int32, tag="2")] - pub priority: i32, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ResourceCode { - Bandwidth = 0, - Energy = 1, - TronPower = 2, -} -impl ResourceCode { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ResourceCode::Bandwidth => "BANDWIDTH", - ResourceCode::Energy => "ENERGY", - ResourceCode::TronPower => "TRON_POWER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BANDWIDTH" => Some(Self::Bandwidth), - "ENERGY" => Some(Self::Energy), - "TRON_POWER" => Some(Self::TronPower), - _ => None, - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountId { - #[prost(bytes="vec", tag="1")] - pub name: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Vote { - #[prost(bytes="vec", tag="1")] - pub vote_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub vote_count: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Proposal { - #[prost(int64, tag="1")] - pub proposal_id: i64, - #[prost(bytes="vec", tag="2")] - pub proposer_address: ::prost::alloc::vec::Vec, - #[prost(map="int64, int64", tag="3")] - pub parameters: ::std::collections::HashMap, - #[prost(int64, tag="4")] - pub expiration_time: i64, - #[prost(int64, tag="5")] - pub create_time: i64, - #[prost(bytes="vec", repeated, tag="6")] - pub approvals: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(enumeration="proposal::State", tag="7")] - pub state: i32, -} -/// Nested message and enum types in `Proposal`. -pub mod proposal { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum State { - Pending = 0, - Disapproved = 1, - Approved = 2, - Canceled = 3, - } - impl State { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - State::Pending => "PENDING", - State::Disapproved => "DISAPPROVED", - State::Approved => "APPROVED", - State::Canceled => "CANCELED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "PENDING" => Some(Self::Pending), - "DISAPPROVED" => Some(Self::Disapproved), - "APPROVED" => Some(Self::Approved), - "CANCELED" => Some(Self::Canceled), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Exchange { - #[prost(int64, tag="1")] - pub exchange_id: i64, - #[prost(bytes="vec", tag="2")] - pub creator_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub create_time: i64, - #[prost(bytes="vec", tag="6")] - pub first_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="7")] - pub first_token_balance: i64, - #[prost(bytes="vec", tag="8")] - pub second_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="9")] - pub second_token_balance: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketOrder { - #[prost(bytes="vec", tag="1")] - pub order_id: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub create_time: i64, - #[prost(bytes="vec", tag="4")] - pub sell_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub sell_token_quantity: i64, - #[prost(bytes="vec", tag="6")] - pub buy_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="7")] - pub buy_token_quantity: i64, - #[prost(int64, tag="9")] - pub sell_token_quantity_remain: i64, - #[prost(int64, tag="10")] - pub sell_token_quantity_return: i64, - #[prost(enumeration="market_order::State", tag="11")] - pub state: i32, - #[prost(bytes="vec", tag="12")] - pub prev: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="13")] - pub next: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `MarketOrder`. -pub mod market_order { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum State { - Active = 0, - Inactive = 1, - Canceled = 2, - } - impl State { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - State::Active => "ACTIVE", - State::Inactive => "INACTIVE", - State::Canceled => "CANCELED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ACTIVE" => Some(Self::Active), - "INACTIVE" => Some(Self::Inactive), - "CANCELED" => Some(Self::Canceled), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketOrderList { - #[prost(message, repeated, tag="1")] - pub orders: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketOrderPairList { - #[prost(message, repeated, tag="1")] - pub order_pair: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketOrderPair { - #[prost(bytes="vec", tag="1")] - pub sell_token_id: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub buy_token_id: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketAccountOrder { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub orders: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(int64, tag="3")] - pub count: i64, - #[prost(int64, tag="4")] - pub total_count: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct MarketPrice { - #[prost(int64, tag="1")] - pub sell_token_quantity: i64, - #[prost(int64, tag="2")] - pub buy_token_quantity: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketPriceList { - #[prost(bytes="vec", tag="1")] - pub sell_token_id: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub buy_token_id: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="3")] - pub prices: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketOrderIdList { - #[prost(bytes="vec", tag="1")] - pub head: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub tail: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChainParameters { - #[prost(message, repeated, tag="1")] - pub chain_parameter: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `ChainParameters`. -pub mod chain_parameters { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct ChainParameter { - #[prost(string, tag="1")] - pub key: ::prost::alloc::string::String, - #[prost(int64, tag="2")] - pub value: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Account { - #[prost(bytes="vec", tag="1")] - pub account_name: ::prost::alloc::vec::Vec, - #[prost(enumeration="AccountType", tag="2")] - pub r#type: i32, - #[prost(bytes="vec", tag="3")] - pub address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub balance: i64, - #[prost(message, repeated, tag="5")] - pub votes: ::prost::alloc::vec::Vec, - #[prost(map="string, int64", tag="6")] - pub asset: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - #[prost(map="string, int64", tag="56")] - pub asset_v2: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - #[prost(message, repeated, tag="7")] - pub frozen: ::prost::alloc::vec::Vec, - #[prost(int64, tag="8")] - pub net_usage: i64, - #[prost(int64, tag="41")] - pub acquired_delegated_frozen_balance_for_bandwidth: i64, - #[prost(int64, tag="42")] - pub delegated_frozen_balance_for_bandwidth: i64, - #[prost(int64, tag="46")] - pub old_tron_power: i64, - #[prost(message, optional, tag="47")] - pub tron_power: ::core::option::Option, - #[prost(bool, tag="60")] - pub asset_optimized: bool, - #[prost(int64, tag="9")] - pub create_time: i64, - #[prost(int64, tag="10")] - pub latest_opration_time: i64, - #[prost(int64, tag="11")] - pub allowance: i64, - #[prost(int64, tag="12")] - pub latest_withdraw_time: i64, - #[prost(bytes="vec", tag="13")] - pub code: ::prost::alloc::vec::Vec, - #[prost(bool, tag="14")] - pub is_witness: bool, - #[prost(bool, tag="15")] - pub is_committee: bool, - #[prost(message, repeated, tag="16")] - pub frozen_supply: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="17")] - pub asset_issued_name: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="57")] - pub asset_issued_id: ::prost::alloc::vec::Vec, - #[prost(map="string, int64", tag="18")] - pub latest_asset_operation_time: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - #[prost(map="string, int64", tag="58")] - pub latest_asset_operation_time_v2: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - #[prost(int64, tag="19")] - pub free_net_usage: i64, - #[prost(map="string, int64", tag="20")] - pub free_asset_net_usage: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - #[prost(map="string, int64", tag="59")] - pub free_asset_net_usage_v2: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - #[prost(int64, tag="21")] - pub latest_consume_time: i64, - #[prost(int64, tag="22")] - pub latest_consume_free_time: i64, - #[prost(bytes="vec", tag="23")] - pub account_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="24")] - pub net_window_size: i64, - #[prost(bool, tag="25")] - pub net_window_optimized: bool, - #[prost(message, optional, tag="26")] - pub account_resource: ::core::option::Option, - #[prost(bytes="vec", tag="30")] - pub code_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="31")] - pub owner_permission: ::core::option::Option, - #[prost(message, optional, tag="32")] - pub witness_permission: ::core::option::Option, - #[prost(message, repeated, tag="33")] - pub active_permission: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="34")] - pub frozen_v2: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="35")] - pub unfrozen_v2: ::prost::alloc::vec::Vec, - #[prost(int64, tag="36")] - pub delegated_frozen_v2_balance_for_bandwidth: i64, - #[prost(int64, tag="37")] - pub acquired_delegated_frozen_v2_balance_for_bandwidth: i64, -} -/// Nested message and enum types in `Account`. -pub mod account { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct Frozen { - #[prost(int64, tag="1")] - pub frozen_balance: i64, - #[prost(int64, tag="2")] - pub expire_time: i64, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct AccountResource { - #[prost(int64, tag="1")] - pub energy_usage: i64, - #[prost(message, optional, tag="2")] - pub frozen_balance_for_energy: ::core::option::Option, - #[prost(int64, tag="3")] - pub latest_consume_time_for_energy: i64, - #[prost(int64, tag="4")] - pub acquired_delegated_frozen_balance_for_energy: i64, - #[prost(int64, tag="5")] - pub delegated_frozen_balance_for_energy: i64, - #[prost(int64, tag="6")] - pub storage_limit: i64, - #[prost(int64, tag="7")] - pub storage_usage: i64, - #[prost(int64, tag="8")] - pub latest_exchange_storage_time: i64, - #[prost(int64, tag="9")] - pub energy_window_size: i64, - #[prost(int64, tag="10")] - pub delegated_frozen_v2_balance_for_energy: i64, - #[prost(int64, tag="11")] - pub acquired_delegated_frozen_v2_balance_for_energy: i64, - #[prost(bool, tag="12")] - pub energy_window_optimized: bool, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct FreezeV2 { - #[prost(enumeration="super::ResourceCode", tag="1")] - pub r#type: i32, - #[prost(int64, tag="2")] - pub amount: i64, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct UnFreezeV2 { - #[prost(enumeration="super::ResourceCode", tag="1")] - pub r#type: i32, - #[prost(int64, tag="3")] - pub unfreeze_amount: i64, - #[prost(int64, tag="4")] - pub unfreeze_expire_time: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Key { - #[prost(bytes="vec", tag="1")] - pub address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub weight: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelegatedResource { - #[prost(bytes="vec", tag="1")] - pub from: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub to: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub frozen_balance_for_bandwidth: i64, - #[prost(int64, tag="4")] - pub frozen_balance_for_energy: i64, - #[prost(int64, tag="5")] - pub expire_time_for_bandwidth: i64, - #[prost(int64, tag="6")] - pub expire_time_for_energy: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Authority { - #[prost(message, optional, tag="1")] - pub account: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub permission_name: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Permission { - #[prost(enumeration="permission::PermissionType", tag="1")] - pub r#type: i32, - #[prost(int32, tag="2")] - pub id: i32, - #[prost(string, tag="3")] - pub permission_name: ::prost::alloc::string::String, - #[prost(int64, tag="4")] - pub threshold: i64, - #[prost(int32, tag="5")] - pub parent_id: i32, - #[prost(bytes="vec", tag="6")] - pub operations: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="7")] - pub keys: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `Permission`. -pub mod permission { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum PermissionType { - Owner = 0, - Witness = 1, - Active = 2, - } - impl PermissionType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - PermissionType::Owner => "Owner", - PermissionType::Witness => "Witness", - PermissionType::Active => "Active", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Owner" => Some(Self::Owner), - "Witness" => Some(Self::Witness), - "Active" => Some(Self::Active), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Witness { - #[prost(bytes="vec", tag="1")] - pub address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub vote_count: i64, - #[prost(bytes="vec", tag="3")] - pub pub_key: ::prost::alloc::vec::Vec, - #[prost(string, tag="4")] - pub url: ::prost::alloc::string::String, - #[prost(int64, tag="5")] - pub total_produced: i64, - #[prost(int64, tag="6")] - pub total_missed: i64, - #[prost(int64, tag="7")] - pub latest_block_num: i64, - #[prost(int64, tag="8")] - pub latest_slot_num: i64, - #[prost(bool, tag="9")] - pub is_jobs: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Votes { - #[prost(bytes="vec", tag="1")] - pub address: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="2")] - pub old_votes: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="3")] - pub new_votes: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxOutput { - #[prost(int64, tag="1")] - pub value: i64, - #[prost(bytes="vec", tag="2")] - pub pub_key_hash: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxInput { - #[prost(message, optional, tag="1")] - pub raw_data: ::core::option::Option, - #[prost(bytes="vec", tag="4")] - pub signature: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `TXInput`. -pub mod tx_input { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Raw { - #[prost(bytes="vec", tag="1")] - pub tx_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub vout: i64, - #[prost(bytes="vec", tag="3")] - pub pub_key: ::prost::alloc::vec::Vec, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TxOutputs { - #[prost(message, repeated, tag="1")] - pub outputs: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ResourceReceipt { - #[prost(int64, tag="1")] - pub energy_usage: i64, - #[prost(int64, tag="2")] - pub energy_fee: i64, - #[prost(int64, tag="3")] - pub origin_energy_usage: i64, - #[prost(int64, tag="4")] - pub energy_usage_total: i64, - #[prost(int64, tag="5")] - pub net_usage: i64, - #[prost(int64, tag="6")] - pub net_fee: i64, - #[prost(enumeration="transaction::result::ContractResult", tag="7")] - pub result: i32, - #[prost(int64, tag="8")] - pub energy_penalty_total: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketOrderDetail { - #[prost(bytes="vec", tag="1")] - pub maker_order_id: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub taker_order_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub fill_sell_quantity: i64, - #[prost(int64, tag="4")] - pub fill_buy_quantity: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Transaction { - #[prost(message, optional, tag="1")] - pub raw_data: ::core::option::Option, - #[prost(bytes="vec", repeated, tag="2")] - pub signature: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(message, repeated, tag="5")] - pub ret: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `Transaction`. -pub mod transaction { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Contract { - #[prost(enumeration="contract::ContractType", tag="1")] - pub r#type: i32, - #[prost(message, optional, tag="2")] - pub parameter: ::core::option::Option<::prost_types::Any>, - #[prost(bytes="vec", tag="3")] - pub provider: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="4")] - pub contract_name: ::prost::alloc::vec::Vec, - #[prost(int32, tag="5")] - pub permission_id: i32, - } - /// Nested message and enum types in `Contract`. - pub mod contract { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum ContractType { - AccountCreateContract = 0, - TransferContract = 1, - TransferAssetContract = 2, - VoteAssetContract = 3, - VoteWitnessContract = 4, - WitnessCreateContract = 5, - AssetIssueContract = 6, - WitnessUpdateContract = 8, - ParticipateAssetIssueContract = 9, - AccountUpdateContract = 10, - FreezeBalanceContract = 11, - UnfreezeBalanceContract = 12, - WithdrawBalanceContract = 13, - UnfreezeAssetContract = 14, - UpdateAssetContract = 15, - ProposalCreateContract = 16, - ProposalApproveContract = 17, - ProposalDeleteContract = 18, - SetAccountIdContract = 19, - CustomContract = 20, - CreateSmartContract = 30, - TriggerSmartContract = 31, - GetContract = 32, - UpdateSettingContract = 33, - ExchangeCreateContract = 41, - ExchangeInjectContract = 42, - ExchangeWithdrawContract = 43, - ExchangeTransactionContract = 44, - UpdateEnergyLimitContract = 45, - AccountPermissionUpdateContract = 46, - ClearAbiContract = 48, - UpdateBrokerageContract = 49, - ShieldedTransferContract = 51, - MarketSellAssetContract = 52, - MarketCancelOrderContract = 53, - FreezeBalanceV2Contract = 54, - UnfreezeBalanceV2Contract = 55, - WithdrawExpireUnfreezeContract = 56, - DelegateResourceContract = 57, - UnDelegateResourceContract = 58, - CancelAllUnfreezeV2Contract = 59, - } - impl ContractType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ContractType::AccountCreateContract => "AccountCreateContract", - ContractType::TransferContract => "TransferContract", - ContractType::TransferAssetContract => "TransferAssetContract", - ContractType::VoteAssetContract => "VoteAssetContract", - ContractType::VoteWitnessContract => "VoteWitnessContract", - ContractType::WitnessCreateContract => "WitnessCreateContract", - ContractType::AssetIssueContract => "AssetIssueContract", - ContractType::WitnessUpdateContract => "WitnessUpdateContract", - ContractType::ParticipateAssetIssueContract => "ParticipateAssetIssueContract", - ContractType::AccountUpdateContract => "AccountUpdateContract", - ContractType::FreezeBalanceContract => "FreezeBalanceContract", - ContractType::UnfreezeBalanceContract => "UnfreezeBalanceContract", - ContractType::WithdrawBalanceContract => "WithdrawBalanceContract", - ContractType::UnfreezeAssetContract => "UnfreezeAssetContract", - ContractType::UpdateAssetContract => "UpdateAssetContract", - ContractType::ProposalCreateContract => "ProposalCreateContract", - ContractType::ProposalApproveContract => "ProposalApproveContract", - ContractType::ProposalDeleteContract => "ProposalDeleteContract", - ContractType::SetAccountIdContract => "SetAccountIdContract", - ContractType::CustomContract => "CustomContract", - ContractType::CreateSmartContract => "CreateSmartContract", - ContractType::TriggerSmartContract => "TriggerSmartContract", - ContractType::GetContract => "GetContract", - ContractType::UpdateSettingContract => "UpdateSettingContract", - ContractType::ExchangeCreateContract => "ExchangeCreateContract", - ContractType::ExchangeInjectContract => "ExchangeInjectContract", - ContractType::ExchangeWithdrawContract => "ExchangeWithdrawContract", - ContractType::ExchangeTransactionContract => "ExchangeTransactionContract", - ContractType::UpdateEnergyLimitContract => "UpdateEnergyLimitContract", - ContractType::AccountPermissionUpdateContract => "AccountPermissionUpdateContract", - ContractType::ClearAbiContract => "ClearABIContract", - ContractType::UpdateBrokerageContract => "UpdateBrokerageContract", - ContractType::ShieldedTransferContract => "ShieldedTransferContract", - ContractType::MarketSellAssetContract => "MarketSellAssetContract", - ContractType::MarketCancelOrderContract => "MarketCancelOrderContract", - ContractType::FreezeBalanceV2Contract => "FreezeBalanceV2Contract", - ContractType::UnfreezeBalanceV2Contract => "UnfreezeBalanceV2Contract", - ContractType::WithdrawExpireUnfreezeContract => "WithdrawExpireUnfreezeContract", - ContractType::DelegateResourceContract => "DelegateResourceContract", - ContractType::UnDelegateResourceContract => "UnDelegateResourceContract", - ContractType::CancelAllUnfreezeV2Contract => "CancelAllUnfreezeV2Contract", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "AccountCreateContract" => Some(Self::AccountCreateContract), - "TransferContract" => Some(Self::TransferContract), - "TransferAssetContract" => Some(Self::TransferAssetContract), - "VoteAssetContract" => Some(Self::VoteAssetContract), - "VoteWitnessContract" => Some(Self::VoteWitnessContract), - "WitnessCreateContract" => Some(Self::WitnessCreateContract), - "AssetIssueContract" => Some(Self::AssetIssueContract), - "WitnessUpdateContract" => Some(Self::WitnessUpdateContract), - "ParticipateAssetIssueContract" => Some(Self::ParticipateAssetIssueContract), - "AccountUpdateContract" => Some(Self::AccountUpdateContract), - "FreezeBalanceContract" => Some(Self::FreezeBalanceContract), - "UnfreezeBalanceContract" => Some(Self::UnfreezeBalanceContract), - "WithdrawBalanceContract" => Some(Self::WithdrawBalanceContract), - "UnfreezeAssetContract" => Some(Self::UnfreezeAssetContract), - "UpdateAssetContract" => Some(Self::UpdateAssetContract), - "ProposalCreateContract" => Some(Self::ProposalCreateContract), - "ProposalApproveContract" => Some(Self::ProposalApproveContract), - "ProposalDeleteContract" => Some(Self::ProposalDeleteContract), - "SetAccountIdContract" => Some(Self::SetAccountIdContract), - "CustomContract" => Some(Self::CustomContract), - "CreateSmartContract" => Some(Self::CreateSmartContract), - "TriggerSmartContract" => Some(Self::TriggerSmartContract), - "GetContract" => Some(Self::GetContract), - "UpdateSettingContract" => Some(Self::UpdateSettingContract), - "ExchangeCreateContract" => Some(Self::ExchangeCreateContract), - "ExchangeInjectContract" => Some(Self::ExchangeInjectContract), - "ExchangeWithdrawContract" => Some(Self::ExchangeWithdrawContract), - "ExchangeTransactionContract" => Some(Self::ExchangeTransactionContract), - "UpdateEnergyLimitContract" => Some(Self::UpdateEnergyLimitContract), - "AccountPermissionUpdateContract" => Some(Self::AccountPermissionUpdateContract), - "ClearABIContract" => Some(Self::ClearAbiContract), - "UpdateBrokerageContract" => Some(Self::UpdateBrokerageContract), - "ShieldedTransferContract" => Some(Self::ShieldedTransferContract), - "MarketSellAssetContract" => Some(Self::MarketSellAssetContract), - "MarketCancelOrderContract" => Some(Self::MarketCancelOrderContract), - "FreezeBalanceV2Contract" => Some(Self::FreezeBalanceV2Contract), - "UnfreezeBalanceV2Contract" => Some(Self::UnfreezeBalanceV2Contract), - "WithdrawExpireUnfreezeContract" => Some(Self::WithdrawExpireUnfreezeContract), - "DelegateResourceContract" => Some(Self::DelegateResourceContract), - "UnDelegateResourceContract" => Some(Self::UnDelegateResourceContract), - "CancelAllUnfreezeV2Contract" => Some(Self::CancelAllUnfreezeV2Contract), - _ => None, - } - } - } - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Result { - #[prost(int64, tag="1")] - pub fee: i64, - #[prost(enumeration="result::Code", tag="2")] - pub ret: i32, - #[prost(enumeration="result::ContractResult", tag="3")] - pub contract_ret: i32, - #[prost(string, tag="14")] - pub asset_issue_id: ::prost::alloc::string::String, - #[prost(int64, tag="15")] - pub withdraw_amount: i64, - #[prost(int64, tag="16")] - pub unfreeze_amount: i64, - #[prost(int64, tag="18")] - pub exchange_received_amount: i64, - #[prost(int64, tag="19")] - pub exchange_inject_another_amount: i64, - #[prost(int64, tag="20")] - pub exchange_withdraw_another_amount: i64, - #[prost(int64, tag="21")] - pub exchange_id: i64, - #[prost(int64, tag="22")] - pub shielded_transaction_fee: i64, - #[prost(bytes="vec", tag="25")] - pub order_id: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="26")] - pub order_details: ::prost::alloc::vec::Vec, - #[prost(int64, tag="27")] - pub withdraw_expire_amount: i64, - #[prost(map="string, int64", tag="28")] - pub cancel_unfreeze_v2_amount: ::std::collections::HashMap<::prost::alloc::string::String, i64>, - } - /// Nested message and enum types in `Result`. - pub mod result { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum Code { - Sucess = 0, - Failed = 1, - } - impl Code { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Code::Sucess => "SUCESS", - Code::Failed => "FAILED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SUCESS" => Some(Self::Sucess), - "FAILED" => Some(Self::Failed), - _ => None, - } - } - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum ContractResult { - Default = 0, - Success = 1, - Revert = 2, - BadJumpDestination = 3, - OutOfMemory = 4, - PrecompiledContract = 5, - StackTooSmall = 6, - StackTooLarge = 7, - IllegalOperation = 8, - StackOverflow = 9, - OutOfEnergy = 10, - OutOfTime = 11, - JvmStackOverFlow = 12, - Unknown = 13, - TransferFailed = 14, - InvalidCode = 15, - } - impl ContractResult { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ContractResult::Default => "DEFAULT", - ContractResult::Success => "SUCCESS", - ContractResult::Revert => "REVERT", - ContractResult::BadJumpDestination => "BAD_JUMP_DESTINATION", - ContractResult::OutOfMemory => "OUT_OF_MEMORY", - ContractResult::PrecompiledContract => "PRECOMPILED_CONTRACT", - ContractResult::StackTooSmall => "STACK_TOO_SMALL", - ContractResult::StackTooLarge => "STACK_TOO_LARGE", - ContractResult::IllegalOperation => "ILLEGAL_OPERATION", - ContractResult::StackOverflow => "STACK_OVERFLOW", - ContractResult::OutOfEnergy => "OUT_OF_ENERGY", - ContractResult::OutOfTime => "OUT_OF_TIME", - ContractResult::JvmStackOverFlow => "JVM_STACK_OVER_FLOW", - ContractResult::Unknown => "UNKNOWN", - ContractResult::TransferFailed => "TRANSFER_FAILED", - ContractResult::InvalidCode => "INVALID_CODE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "DEFAULT" => Some(Self::Default), - "SUCCESS" => Some(Self::Success), - "REVERT" => Some(Self::Revert), - "BAD_JUMP_DESTINATION" => Some(Self::BadJumpDestination), - "OUT_OF_MEMORY" => Some(Self::OutOfMemory), - "PRECOMPILED_CONTRACT" => Some(Self::PrecompiledContract), - "STACK_TOO_SMALL" => Some(Self::StackTooSmall), - "STACK_TOO_LARGE" => Some(Self::StackTooLarge), - "ILLEGAL_OPERATION" => Some(Self::IllegalOperation), - "STACK_OVERFLOW" => Some(Self::StackOverflow), - "OUT_OF_ENERGY" => Some(Self::OutOfEnergy), - "OUT_OF_TIME" => Some(Self::OutOfTime), - "JVM_STACK_OVER_FLOW" => Some(Self::JvmStackOverFlow), - "UNKNOWN" => Some(Self::Unknown), - "TRANSFER_FAILED" => Some(Self::TransferFailed), - "INVALID_CODE" => Some(Self::InvalidCode), - _ => None, - } - } - } - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Raw { - #[prost(bytes="vec", tag="1")] - pub ref_block_bytes: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub ref_block_num: i64, - #[prost(bytes="vec", tag="4")] - pub ref_block_hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="8")] - pub expiration: i64, - #[prost(message, repeated, tag="9")] - pub auths: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="10")] - pub data: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="11")] - pub contract: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="12")] - pub scripts: ::prost::alloc::vec::Vec, - #[prost(int64, tag="14")] - pub timestamp: i64, - #[prost(int64, tag="18")] - pub fee_limit: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransactionInfo { - #[prost(bytes="vec", tag="1")] - pub id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub fee: i64, - #[prost(int64, tag="3")] - pub block_number: i64, - #[prost(int64, tag="4")] - pub block_time_stamp: i64, - #[prost(bytes="vec", repeated, tag="5")] - pub contract_result: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(bytes="vec", tag="6")] - pub contract_address: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="7")] - pub receipt: ::core::option::Option, - #[prost(message, repeated, tag="8")] - pub log: ::prost::alloc::vec::Vec, - #[prost(enumeration="transaction_info::Code", tag="9")] - pub result: i32, - #[prost(bytes="vec", tag="10")] - pub res_message: ::prost::alloc::vec::Vec, - #[prost(string, tag="14")] - pub asset_issue_id: ::prost::alloc::string::String, - #[prost(int64, tag="15")] - pub withdraw_amount: i64, - #[prost(int64, tag="16")] - pub unfreeze_amount: i64, - #[prost(message, repeated, tag="17")] - pub internal_transactions: ::prost::alloc::vec::Vec, - #[prost(int64, tag="18")] - pub exchange_received_amount: i64, - #[prost(int64, tag="19")] - pub exchange_inject_another_amount: i64, - #[prost(int64, tag="20")] - pub exchange_withdraw_another_amount: i64, - #[prost(int64, tag="21")] - pub exchange_id: i64, - #[prost(int64, tag="22")] - pub shielded_transaction_fee: i64, - #[prost(bytes="vec", tag="25")] - pub order_id: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="26")] - pub order_details: ::prost::alloc::vec::Vec, - #[prost(int64, tag="27")] - pub packing_fee: i64, - #[prost(int64, tag="28")] - pub withdraw_expire_amount: i64, - #[prost(map="string, int64", tag="29")] - pub cancel_unfreeze_v2_amount: ::std::collections::HashMap<::prost::alloc::string::String, i64>, -} -/// Nested message and enum types in `TransactionInfo`. -pub mod transaction_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Log { - #[prost(bytes="vec", tag="1")] - pub address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub topics: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(bytes="vec", tag="3")] - pub data: ::prost::alloc::vec::Vec, - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum Code { - Sucess = 0, - Failed = 1, - } - impl Code { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Code::Sucess => "SUCESS", - Code::Failed => "FAILED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SUCESS" => Some(Self::Sucess), - "FAILED" => Some(Self::Failed), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransactionRet { - #[prost(int64, tag="1")] - pub block_number: i64, - #[prost(int64, tag="2")] - pub block_time_stamp: i64, - #[prost(message, repeated, tag="3")] - pub transactioninfo: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Transactions { - #[prost(message, repeated, tag="1")] - pub transactions: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockHeader { - #[prost(message, optional, tag="1")] - pub raw_data: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub witness_signature: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `BlockHeader`. -pub mod block_header { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Raw { - #[prost(int64, tag="1")] - pub timestamp: i64, - #[prost(bytes="vec", tag="2")] - pub tx_trie_root: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub parent_hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="7")] - pub number: i64, - #[prost(int64, tag="8")] - pub witness_id: i64, - #[prost(bytes="vec", tag="9")] - pub witness_address: ::prost::alloc::vec::Vec, - #[prost(int32, tag="10")] - pub version: i32, - #[prost(bytes="vec", tag="11")] - pub account_state_root: ::prost::alloc::vec::Vec, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Block { - #[prost(message, repeated, tag="1")] - pub transactions: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] - pub block_header: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChainInventory { - #[prost(message, repeated, tag="1")] - pub ids: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub remain_num: i64, -} -/// Nested message and enum types in `ChainInventory`. -pub mod chain_inventory { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct BlockId { - #[prost(bytes="vec", tag="1")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub number: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockInventory { - #[prost(message, repeated, tag="1")] - pub ids: ::prost::alloc::vec::Vec, - #[prost(enumeration="block_inventory::Type", tag="2")] - pub r#type: i32, -} -/// Nested message and enum types in `BlockInventory`. -pub mod block_inventory { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct BlockId { - #[prost(bytes="vec", tag="1")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub number: i64, - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum Type { - Sync = 0, - Advtise = 1, - Fetch = 2, - } - impl Type { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Type::Sync => "SYNC", - Type::Advtise => "ADVTISE", - Type::Fetch => "FETCH", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SYNC" => Some(Self::Sync), - "ADVTISE" => Some(Self::Advtise), - "FETCH" => Some(Self::Fetch), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Inventory { - #[prost(enumeration="inventory::InventoryType", tag="1")] - pub r#type: i32, - #[prost(bytes="vec", repeated, tag="2")] - pub ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -/// Nested message and enum types in `Inventory`. -pub mod inventory { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum InventoryType { - Trx = 0, - Block = 1, - } - impl InventoryType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - InventoryType::Trx => "TRX", - InventoryType::Block => "BLOCK", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "TRX" => Some(Self::Trx), - "BLOCK" => Some(Self::Block), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Items { - #[prost(enumeration="items::ItemType", tag="1")] - pub r#type: i32, - #[prost(message, repeated, tag="2")] - pub blocks: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="3")] - pub block_headers: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="4")] - pub transactions: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `Items`. -pub mod items { - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum ItemType { - Err = 0, - Trx = 1, - Block = 2, - Blockheader = 3, - } - impl ItemType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ItemType::Err => "ERR", - ItemType::Trx => "TRX", - ItemType::Block => "BLOCK", - ItemType::Blockheader => "BLOCKHEADER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ERR" => Some(Self::Err), - "TRX" => Some(Self::Trx), - "BLOCK" => Some(Self::Block), - "BLOCKHEADER" => Some(Self::Blockheader), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct DynamicProperties { - #[prost(int64, tag="1")] - pub last_solidity_block_num: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct DisconnectMessage { - #[prost(enumeration="ReasonCode", tag="1")] - pub reason: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HelloMessage { - #[prost(message, optional, tag="1")] - pub from: ::core::option::Option, - #[prost(int32, tag="2")] - pub version: i32, - #[prost(int64, tag="3")] - pub timestamp: i64, - #[prost(message, optional, tag="4")] - pub genesis_block_id: ::core::option::Option, - #[prost(message, optional, tag="5")] - pub solid_block_id: ::core::option::Option, - #[prost(message, optional, tag="6")] - pub head_block_id: ::core::option::Option, - #[prost(bytes="vec", tag="7")] - pub address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="8")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(int32, tag="9")] - pub node_type: i32, - #[prost(int64, tag="10")] - pub lowest_block_num: i64, - #[prost(bytes="vec", tag="11")] - pub code_version: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `HelloMessage`. -pub mod hello_message { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct BlockId { - #[prost(bytes="vec", tag="1")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub number: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InternalTransaction { - #[prost(bytes="vec", tag="1")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub caller_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub transfer_to_address: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="4")] - pub call_value_info: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="5")] - pub note: ::prost::alloc::vec::Vec, - #[prost(bool, tag="6")] - pub rejected: bool, - #[prost(string, tag="7")] - pub extra: ::prost::alloc::string::String, -} -/// Nested message and enum types in `InternalTransaction`. -pub mod internal_transaction { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct CallValueInfo { - #[prost(int64, tag="1")] - pub call_value: i64, - #[prost(string, tag="2")] - pub token_id: ::prost::alloc::string::String, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelegatedResourceAccountIndex { - #[prost(bytes="vec", tag="1")] - pub account: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub from_accounts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(bytes="vec", repeated, tag="3")] - pub to_accounts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(int64, tag="4")] - pub timestamp: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NodeInfo { - #[prost(int64, tag="1")] - pub begin_sync_num: i64, - #[prost(string, tag="2")] - pub block: ::prost::alloc::string::String, - #[prost(string, tag="3")] - pub solidity_block: ::prost::alloc::string::String, - #[prost(int32, tag="4")] - pub current_connect_count: i32, - #[prost(int32, tag="5")] - pub active_connect_count: i32, - #[prost(int32, tag="6")] - pub passive_connect_count: i32, - #[prost(int64, tag="7")] - pub total_flow: i64, - #[prost(message, repeated, tag="8")] - pub peer_info_list: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="9")] - pub config_node_info: ::core::option::Option, - #[prost(message, optional, tag="10")] - pub machine_info: ::core::option::Option, - #[prost(map="string, string", tag="11")] - pub cheat_witness_info_map: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, -} -/// Nested message and enum types in `NodeInfo`. -pub mod node_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct PeerInfo { - #[prost(string, tag="1")] - pub last_sync_block: ::prost::alloc::string::String, - #[prost(int64, tag="2")] - pub remain_num: i64, - #[prost(int64, tag="3")] - pub last_block_update_time: i64, - #[prost(bool, tag="4")] - pub sync_flag: bool, - #[prost(int64, tag="5")] - pub head_block_time_we_both_have: i64, - #[prost(bool, tag="6")] - pub need_sync_from_peer: bool, - #[prost(bool, tag="7")] - pub need_sync_from_us: bool, - #[prost(string, tag="8")] - pub host: ::prost::alloc::string::String, - #[prost(int32, tag="9")] - pub port: i32, - #[prost(string, tag="10")] - pub node_id: ::prost::alloc::string::String, - #[prost(int64, tag="11")] - pub connect_time: i64, - #[prost(double, tag="12")] - pub avg_latency: f64, - #[prost(int32, tag="13")] - pub sync_to_fetch_size: i32, - #[prost(int64, tag="14")] - pub sync_to_fetch_size_peek_num: i64, - #[prost(int32, tag="15")] - pub sync_block_requested_size: i32, - #[prost(int64, tag="16")] - pub un_fetch_syn_num: i64, - #[prost(int32, tag="17")] - pub block_in_porc_size: i32, - #[prost(string, tag="18")] - pub head_block_we_both_have: ::prost::alloc::string::String, - #[prost(bool, tag="19")] - pub is_active: bool, - #[prost(int32, tag="20")] - pub score: i32, - #[prost(int32, tag="21")] - pub node_count: i32, - #[prost(int64, tag="22")] - pub in_flow: i64, - #[prost(int32, tag="23")] - pub disconnect_times: i32, - #[prost(string, tag="24")] - pub local_disconnect_reason: ::prost::alloc::string::String, - #[prost(string, tag="25")] - pub remote_disconnect_reason: ::prost::alloc::string::String, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct ConfigNodeInfo { - #[prost(string, tag="1")] - pub code_version: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub p2p_version: ::prost::alloc::string::String, - #[prost(int32, tag="3")] - pub listen_port: i32, - #[prost(bool, tag="4")] - pub discover_enable: bool, - #[prost(int32, tag="5")] - pub active_node_size: i32, - #[prost(int32, tag="6")] - pub passive_node_size: i32, - #[prost(int32, tag="7")] - pub send_node_size: i32, - #[prost(int32, tag="8")] - pub max_connect_count: i32, - #[prost(int32, tag="9")] - pub same_ip_max_connect_count: i32, - #[prost(int32, tag="10")] - pub backup_listen_port: i32, - #[prost(int32, tag="11")] - pub backup_member_size: i32, - #[prost(int32, tag="12")] - pub backup_priority: i32, - #[prost(int32, tag="13")] - pub db_version: i32, - #[prost(int32, tag="14")] - pub min_participation_rate: i32, - #[prost(bool, tag="15")] - pub support_constant: bool, - #[prost(double, tag="16")] - pub min_time_ratio: f64, - #[prost(double, tag="17")] - pub max_time_ratio: f64, - #[prost(int64, tag="18")] - pub allow_creation_of_contracts: i64, - #[prost(int64, tag="19")] - pub allow_adaptive_energy: i64, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct MachineInfo { - #[prost(int32, tag="1")] - pub thread_count: i32, - #[prost(int32, tag="2")] - pub dead_lock_thread_count: i32, - #[prost(int32, tag="3")] - pub cpu_count: i32, - #[prost(int64, tag="4")] - pub total_memory: i64, - #[prost(int64, tag="5")] - pub free_memory: i64, - #[prost(double, tag="6")] - pub cpu_rate: f64, - #[prost(string, tag="7")] - pub java_version: ::prost::alloc::string::String, - #[prost(string, tag="8")] - pub os_name: ::prost::alloc::string::String, - #[prost(int64, tag="9")] - pub jvm_total_memory: i64, - #[prost(int64, tag="10")] - pub jvm_free_memory: i64, - #[prost(double, tag="11")] - pub process_cpu_rate: f64, - #[prost(message, repeated, tag="12")] - pub memory_desc_info_list: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="13")] - pub dead_lock_thread_info_list: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `MachineInfo`. - pub mod machine_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct MemoryDescInfo { - #[prost(string, tag="1")] - pub name: ::prost::alloc::string::String, - #[prost(int64, tag="2")] - pub init_size: i64, - #[prost(int64, tag="3")] - pub use_size: i64, - #[prost(int64, tag="4")] - pub max_size: i64, - #[prost(double, tag="5")] - pub use_rate: f64, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct DeadLockThreadInfo { - #[prost(string, tag="1")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag="2")] - pub lock_name: ::prost::alloc::string::String, - #[prost(string, tag="3")] - pub lock_owner: ::prost::alloc::string::String, - #[prost(string, tag="4")] - pub state: ::prost::alloc::string::String, - #[prost(int64, tag="5")] - pub block_time: i64, - #[prost(int64, tag="6")] - pub wait_time: i64, - #[prost(string, tag="7")] - pub stack_trace: ::prost::alloc::string::String, - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MetricsInfo { - #[prost(int64, tag="1")] - pub interval: i64, - #[prost(message, optional, tag="2")] - pub node: ::core::option::Option, - #[prost(message, optional, tag="3")] - pub blockchain: ::core::option::Option, - #[prost(message, optional, tag="4")] - pub net: ::core::option::Option, -} -/// Nested message and enum types in `MetricsInfo`. -pub mod metrics_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct NodeInfo { - #[prost(string, tag="1")] - pub ip: ::prost::alloc::string::String, - #[prost(int32, tag="2")] - pub node_type: i32, - #[prost(string, tag="3")] - pub version: ::prost::alloc::string::String, - #[prost(int32, tag="4")] - pub backup_status: i32, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct BlockChainInfo { - #[prost(int64, tag="1")] - pub head_block_num: i64, - #[prost(int64, tag="2")] - pub head_block_timestamp: i64, - #[prost(string, tag="3")] - pub head_block_hash: ::prost::alloc::string::String, - #[prost(int32, tag="4")] - pub fork_count: i32, - #[prost(int32, tag="5")] - pub fail_fork_count: i32, - #[prost(message, optional, tag="6")] - pub block_process_time: ::core::option::Option, - #[prost(message, optional, tag="7")] - pub tps: ::core::option::Option, - #[prost(int32, tag="8")] - pub transaction_cache_size: i32, - #[prost(message, optional, tag="9")] - pub missed_transaction: ::core::option::Option, - #[prost(message, repeated, tag="10")] - pub witnesses: ::prost::alloc::vec::Vec, - #[prost(int64, tag="11")] - pub fail_process_block_num: i64, - #[prost(string, tag="12")] - pub fail_process_block_reason: ::prost::alloc::string::String, - #[prost(message, repeated, tag="13")] - pub dup_witness: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `BlockChainInfo`. - pub mod block_chain_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Witness { - #[prost(string, tag="1")] - pub address: ::prost::alloc::string::String, - #[prost(int32, tag="2")] - pub version: i32, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct DupWitness { - #[prost(string, tag="1")] - pub address: ::prost::alloc::string::String, - #[prost(int64, tag="2")] - pub block_num: i64, - #[prost(int32, tag="3")] - pub count: i32, - } - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct RateInfo { - #[prost(int64, tag="1")] - pub count: i64, - #[prost(double, tag="2")] - pub mean_rate: f64, - #[prost(double, tag="3")] - pub one_minute_rate: f64, - #[prost(double, tag="4")] - pub five_minute_rate: f64, - #[prost(double, tag="5")] - pub fifteen_minute_rate: f64, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct NetInfo { - #[prost(int32, tag="1")] - pub error_proto_count: i32, - #[prost(message, optional, tag="2")] - pub api: ::core::option::Option, - #[prost(int32, tag="3")] - pub connection_count: i32, - #[prost(int32, tag="4")] - pub valid_connection_count: i32, - #[prost(message, optional, tag="5")] - pub tcp_in_traffic: ::core::option::Option, - #[prost(message, optional, tag="6")] - pub tcp_out_traffic: ::core::option::Option, - #[prost(int32, tag="7")] - pub disconnection_count: i32, - #[prost(message, repeated, tag="8")] - pub disconnection_detail: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="9")] - pub udp_in_traffic: ::core::option::Option, - #[prost(message, optional, tag="10")] - pub udp_out_traffic: ::core::option::Option, - #[prost(message, optional, tag="11")] - pub latency: ::core::option::Option, - } - /// Nested message and enum types in `NetInfo`. - pub mod net_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct ApiInfo { - #[prost(message, optional, tag="1")] - pub qps: ::core::option::Option, - #[prost(message, optional, tag="2")] - pub fail_qps: ::core::option::Option, - #[prost(message, optional, tag="3")] - pub out_traffic: ::core::option::Option, - #[prost(message, repeated, tag="4")] - pub detail: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `ApiInfo`. - pub mod api_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct ApiDetailInfo { - #[prost(string, tag="1")] - pub name: ::prost::alloc::string::String, - #[prost(message, optional, tag="2")] - pub qps: ::core::option::Option, - #[prost(message, optional, tag="3")] - pub fail_qps: ::core::option::Option, - #[prost(message, optional, tag="4")] - pub out_traffic: ::core::option::Option, - } - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct DisconnectionDetailInfo { - #[prost(string, tag="1")] - pub reason: ::prost::alloc::string::String, - #[prost(int32, tag="2")] - pub count: i32, - } - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct LatencyInfo { - #[prost(int32, tag="1")] - pub top99: i32, - #[prost(int32, tag="2")] - pub top95: i32, - #[prost(int32, tag="3")] - pub top75: i32, - #[prost(int32, tag="4")] - pub total_count: i32, - #[prost(int32, tag="5")] - pub delay1_s: i32, - #[prost(int32, tag="6")] - pub delay2_s: i32, - #[prost(int32, tag="7")] - pub delay3_s: i32, - #[prost(message, repeated, tag="8")] - pub detail: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `LatencyInfo`. - pub mod latency_info { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct LatencyDetailInfo { - #[prost(string, tag="1")] - pub witness: ::prost::alloc::string::String, - #[prost(int32, tag="2")] - pub top99: i32, - #[prost(int32, tag="3")] - pub top95: i32, - #[prost(int32, tag="4")] - pub top75: i32, - #[prost(int32, tag="5")] - pub count: i32, - #[prost(int32, tag="6")] - pub delay1_s: i32, - #[prost(int32, tag="7")] - pub delay2_s: i32, - #[prost(int32, tag="8")] - pub delay3_s: i32, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PbftMessage { - #[prost(message, optional, tag="1")] - pub raw_data: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub signature: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `PBFTMessage`. -pub mod pbft_message { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Raw { - #[prost(enumeration="MsgType", tag="1")] - pub msg_type: i32, - #[prost(enumeration="DataType", tag="2")] - pub data_type: i32, - #[prost(int64, tag="3")] - pub view_n: i64, - #[prost(int64, tag="4")] - pub epoch: i64, - #[prost(bytes="vec", tag="5")] - pub data: ::prost::alloc::vec::Vec, - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum MsgType { - ViewChange = 0, - Request = 1, - Preprepare = 2, - Prepare = 3, - Commit = 4, - } - impl MsgType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - MsgType::ViewChange => "VIEW_CHANGE", - MsgType::Request => "REQUEST", - MsgType::Preprepare => "PREPREPARE", - MsgType::Prepare => "PREPARE", - MsgType::Commit => "COMMIT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "VIEW_CHANGE" => Some(Self::ViewChange), - "REQUEST" => Some(Self::Request), - "PREPREPARE" => Some(Self::Preprepare), - "PREPARE" => Some(Self::Prepare), - "COMMIT" => Some(Self::Commit), - _ => None, - } - } - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum DataType { - Block = 0, - Srl = 1, - } - impl DataType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - DataType::Block => "BLOCK", - DataType::Srl => "SRL", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BLOCK" => Some(Self::Block), - "SRL" => Some(Self::Srl), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PbftCommitResult { - #[prost(bytes="vec", tag="1")] - pub data: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub signature: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Srl { - #[prost(bytes="vec", repeated, tag="1")] - pub sr_address: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AccountType { - Normal = 0, - AssetIssue = 1, - Contract = 2, -} -impl AccountType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - AccountType::Normal => "Normal", - AccountType::AssetIssue => "AssetIssue", - AccountType::Contract => "Contract", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Normal" => Some(Self::Normal), - "AssetIssue" => Some(Self::AssetIssue), - "Contract" => Some(Self::Contract), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ReasonCode { - Requested = 0, - BadProtocol = 2, - TooManyPeers = 4, - DuplicatePeer = 5, - IncompatibleProtocol = 6, - RandomElimination = 7, - PeerQuiting = 8, - UnexpectedIdentity = 9, - LocalIdentity = 10, - PingTimeout = 11, - UserReason = 16, - Reset = 17, - SyncFail = 18, - FetchFail = 19, - BadTx = 20, - BadBlock = 21, - Forked = 22, - Unlinkable = 23, - IncompatibleVersion = 24, - IncompatibleChain = 25, - TimeOut = 32, - ConnectFail = 33, - TooManyPeersWithSameIp = 34, - LightNodeSyncFail = 35, - BelowThanMe = 36, - NotWitness = 37, - NoSuchMessage = 38, - Unknown = 255, -} -impl ReasonCode { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ReasonCode::Requested => "REQUESTED", - ReasonCode::BadProtocol => "BAD_PROTOCOL", - ReasonCode::TooManyPeers => "TOO_MANY_PEERS", - ReasonCode::DuplicatePeer => "DUPLICATE_PEER", - ReasonCode::IncompatibleProtocol => "INCOMPATIBLE_PROTOCOL", - ReasonCode::RandomElimination => "RANDOM_ELIMINATION", - ReasonCode::PeerQuiting => "PEER_QUITING", - ReasonCode::UnexpectedIdentity => "UNEXPECTED_IDENTITY", - ReasonCode::LocalIdentity => "LOCAL_IDENTITY", - ReasonCode::PingTimeout => "PING_TIMEOUT", - ReasonCode::UserReason => "USER_REASON", - ReasonCode::Reset => "RESET", - ReasonCode::SyncFail => "SYNC_FAIL", - ReasonCode::FetchFail => "FETCH_FAIL", - ReasonCode::BadTx => "BAD_TX", - ReasonCode::BadBlock => "BAD_BLOCK", - ReasonCode::Forked => "FORKED", - ReasonCode::Unlinkable => "UNLINKABLE", - ReasonCode::IncompatibleVersion => "INCOMPATIBLE_VERSION", - ReasonCode::IncompatibleChain => "INCOMPATIBLE_CHAIN", - ReasonCode::TimeOut => "TIME_OUT", - ReasonCode::ConnectFail => "CONNECT_FAIL", - ReasonCode::TooManyPeersWithSameIp => "TOO_MANY_PEERS_WITH_SAME_IP", - ReasonCode::LightNodeSyncFail => "LIGHT_NODE_SYNC_FAIL", - ReasonCode::BelowThanMe => "BELOW_THAN_ME", - ReasonCode::NotWitness => "NOT_WITNESS", - ReasonCode::NoSuchMessage => "NO_SUCH_MESSAGE", - ReasonCode::Unknown => "UNKNOWN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "REQUESTED" => Some(Self::Requested), - "BAD_PROTOCOL" => Some(Self::BadProtocol), - "TOO_MANY_PEERS" => Some(Self::TooManyPeers), - "DUPLICATE_PEER" => Some(Self::DuplicatePeer), - "INCOMPATIBLE_PROTOCOL" => Some(Self::IncompatibleProtocol), - "RANDOM_ELIMINATION" => Some(Self::RandomElimination), - "PEER_QUITING" => Some(Self::PeerQuiting), - "UNEXPECTED_IDENTITY" => Some(Self::UnexpectedIdentity), - "LOCAL_IDENTITY" => Some(Self::LocalIdentity), - "PING_TIMEOUT" => Some(Self::PingTimeout), - "USER_REASON" => Some(Self::UserReason), - "RESET" => Some(Self::Reset), - "SYNC_FAIL" => Some(Self::SyncFail), - "FETCH_FAIL" => Some(Self::FetchFail), - "BAD_TX" => Some(Self::BadTx), - "BAD_BLOCK" => Some(Self::BadBlock), - "FORKED" => Some(Self::Forked), - "UNLINKABLE" => Some(Self::Unlinkable), - "INCOMPATIBLE_VERSION" => Some(Self::IncompatibleVersion), - "INCOMPATIBLE_CHAIN" => Some(Self::IncompatibleChain), - "TIME_OUT" => Some(Self::TimeOut), - "CONNECT_FAIL" => Some(Self::ConnectFail), - "TOO_MANY_PEERS_WITH_SAME_IP" => Some(Self::TooManyPeersWithSameIp), - "LIGHT_NODE_SYNC_FAIL" => Some(Self::LightNodeSyncFail), - "BELOW_THAN_ME" => Some(Self::BelowThanMe), - "NOT_WITNESS" => Some(Self::NotWitness), - "NO_SUCH_MESSAGE" => Some(Self::NoSuchMessage), - "UNKNOWN" => Some(Self::Unknown), - _ => None, - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AssetIssueContract { - #[prost(string, tag="41")] - pub id: ::prost::alloc::string::String, - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub name: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub abbr: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub total_supply: i64, - #[prost(message, repeated, tag="5")] - pub frozen_supply: ::prost::alloc::vec::Vec, - #[prost(int32, tag="6")] - pub trx_num: i32, - #[prost(int32, tag="7")] - pub precision: i32, - #[prost(int32, tag="8")] - pub num: i32, - #[prost(int64, tag="9")] - pub start_time: i64, - #[prost(int64, tag="10")] - pub end_time: i64, - #[prost(int64, tag="11")] - pub order: i64, - #[prost(int32, tag="16")] - pub vote_score: i32, - #[prost(bytes="vec", tag="20")] - pub description: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="21")] - pub url: ::prost::alloc::vec::Vec, - #[prost(int64, tag="22")] - pub free_asset_net_limit: i64, - #[prost(int64, tag="23")] - pub public_free_asset_net_limit: i64, - #[prost(int64, tag="24")] - pub public_free_asset_net_usage: i64, - #[prost(int64, tag="25")] - pub public_latest_free_net_time: i64, -} -/// Nested message and enum types in `AssetIssueContract`. -pub mod asset_issue_contract { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] - pub struct FrozenSupply { - #[prost(int64, tag="1")] - pub frozen_amount: i64, - #[prost(int64, tag="2")] - pub frozen_days: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransferAssetContract { - #[prost(bytes="vec", tag="1")] - pub asset_name: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub to_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub amount: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnfreezeAssetContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateAssetContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub description: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub url: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub new_limit: i64, - #[prost(int64, tag="5")] - pub new_public_limit: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ParticipateAssetIssueContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub to_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub asset_name: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub amount: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExchangeCreateContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub first_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub first_token_balance: i64, - #[prost(bytes="vec", tag="4")] - pub second_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub second_token_balance: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExchangeInjectContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub exchange_id: i64, - #[prost(bytes="vec", tag="3")] - pub token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub quant: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExchangeWithdrawContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub exchange_id: i64, - #[prost(bytes="vec", tag="3")] - pub token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub quant: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExchangeTransactionContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub exchange_id: i64, - #[prost(bytes="vec", tag="3")] - pub token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="4")] - pub quant: i64, - #[prost(int64, tag="5")] - pub expected: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketSellAssetContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub sell_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub sell_token_quantity: i64, - #[prost(bytes="vec", tag="4")] - pub buy_token_id: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub buy_token_quantity: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MarketCancelOrderContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub order_id: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountCreateContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub account_address: ::prost::alloc::vec::Vec, - #[prost(enumeration="AccountType", tag="3")] - pub r#type: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountUpdateContract { - #[prost(bytes="vec", tag="1")] - pub account_name: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub owner_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SetAccountIdContract { - #[prost(bytes="vec", tag="1")] - pub account_id: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub owner_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountPermissionUpdateContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] - pub owner: ::core::option::Option, - #[prost(message, optional, tag="3")] - pub witness: ::core::option::Option, - #[prost(message, repeated, tag="4")] - pub actives: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BuyStorageBytesContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub bytes: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BuyStorageContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub quant: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SellStorageContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub storage_bytes: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateBrokerageContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int32, tag="2")] - pub brokerage: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthenticationPath { - #[prost(bool, repeated, tag="1")] - pub value: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MerklePath { - #[prost(message, repeated, tag="1")] - pub authentication_paths: ::prost::alloc::vec::Vec, - #[prost(bool, repeated, tag="2")] - pub index: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub rt: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct OutputPoint { - #[prost(bytes="vec", tag="1")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int32, tag="2")] - pub index: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct OutputPointInfo { - #[prost(message, repeated, tag="1")] - pub out_points: ::prost::alloc::vec::Vec, - #[prost(int32, tag="2")] - pub block_num: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PedersenHash { - #[prost(bytes="vec", tag="1")] - pub content: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IncrementalMerkleTree { - #[prost(message, optional, tag="1")] - pub left: ::core::option::Option, - #[prost(message, optional, tag="2")] - pub right: ::core::option::Option, - #[prost(message, repeated, tag="3")] - pub parents: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IncrementalMerkleVoucher { - #[prost(message, optional, tag="1")] - pub tree: ::core::option::Option, - #[prost(message, repeated, tag="2")] - pub filled: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="3")] - pub cursor: ::core::option::Option, - #[prost(int64, tag="4")] - pub cursor_depth: i64, - #[prost(bytes="vec", tag="5")] - pub rt: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="10")] - pub output_point: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IncrementalMerkleVoucherInfo { - #[prost(message, repeated, tag="1")] - pub vouchers: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub paths: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SpendDescription { - #[prost(bytes="vec", tag="1")] - pub value_commitment: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub anchor: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub nullifier: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="4")] - pub rk: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="5")] - pub zkproof: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="6")] - pub spend_authority_signature: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ReceiveDescription { - #[prost(bytes="vec", tag="1")] - pub value_commitment: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub note_commitment: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub epk: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="4")] - pub c_enc: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="5")] - pub c_out: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="6")] - pub zkproof: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ShieldedTransferContract { - #[prost(bytes="vec", tag="1")] - pub transparent_from_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub from_amount: i64, - #[prost(message, repeated, tag="3")] - pub spend_description: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="4")] - pub receive_description: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="5")] - pub binding_signature: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="6")] - pub transparent_to_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="7")] - pub to_amount: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InventoryItems { - #[prost(int32, tag="1")] - pub r#type: i32, - #[prost(bytes="vec", repeated, tag="2")] - pub items: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FreezeBalanceContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub frozen_balance: i64, - #[prost(int64, tag="3")] - pub frozen_duration: i64, - #[prost(enumeration="ResourceCode", tag="10")] - pub resource: i32, - #[prost(bytes="vec", tag="15")] - pub receiver_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnfreezeBalanceContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(enumeration="ResourceCode", tag="10")] - pub resource: i32, - #[prost(bytes="vec", tag="15")] - pub receiver_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WithdrawBalanceContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransferContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub to_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub amount: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransactionBalanceTrace { - #[prost(bytes="vec", tag="1")] - pub transaction_identifier: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="2")] - pub operation: ::prost::alloc::vec::Vec, - #[prost(string, tag="3")] - pub r#type: ::prost::alloc::string::String, - #[prost(string, tag="4")] - pub status: ::prost::alloc::string::String, -} -/// Nested message and enum types in `TransactionBalanceTrace`. -pub mod transaction_balance_trace { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Operation { - #[prost(int64, tag="1")] - pub operation_identifier: i64, - #[prost(bytes="vec", tag="2")] - pub address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub amount: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockBalanceTrace { - #[prost(message, optional, tag="1")] - pub block_identifier: ::core::option::Option, - #[prost(int64, tag="2")] - pub timestamp: i64, - #[prost(message, repeated, tag="3")] - pub transaction_balance_trace: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `BlockBalanceTrace`. -pub mod block_balance_trace { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct BlockIdentifier { - #[prost(bytes="vec", tag="1")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub number: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct AccountTrace { - #[prost(int64, tag="1")] - pub balance: i64, - #[prost(int64, tag="99")] - pub placeholder: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountIdentifier { - #[prost(bytes="vec", tag="1")] - pub address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountBalanceRequest { - #[prost(message, optional, tag="1")] - pub account_identifier: ::core::option::Option, - #[prost(message, optional, tag="2")] - pub block_identifier: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AccountBalanceResponse { - #[prost(int64, tag="1")] - pub balance: i64, - #[prost(message, optional, tag="2")] - pub block_identifier: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FreezeBalanceV2Contract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub frozen_balance: i64, - #[prost(enumeration="ResourceCode", tag="3")] - pub resource: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnfreezeBalanceV2Contract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub unfreeze_balance: i64, - #[prost(enumeration="ResourceCode", tag="3")] - pub resource: i32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WithdrawExpireUnfreezeContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelegateResourceContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(enumeration="ResourceCode", tag="2")] - pub resource: i32, - #[prost(int64, tag="3")] - pub balance: i64, - #[prost(bytes="vec", tag="4")] - pub receiver_address: ::prost::alloc::vec::Vec, - #[prost(bool, tag="5")] - pub lock: bool, - #[prost(int64, tag="6")] - pub lock_period: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnDelegateResourceContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(enumeration="ResourceCode", tag="2")] - pub resource: i32, - #[prost(int64, tag="3")] - pub balance: i64, - #[prost(bytes="vec", tag="4")] - pub receiver_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CancelAllUnfreezeV2Contract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SmartContract { - #[prost(bytes="vec", tag="1")] - pub origin_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub contract_address: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="3")] - pub abi: ::core::option::Option, - #[prost(bytes="vec", tag="4")] - pub bytecode: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub call_value: i64, - #[prost(int64, tag="6")] - pub consume_user_resource_percent: i64, - #[prost(string, tag="7")] - pub name: ::prost::alloc::string::String, - #[prost(int64, tag="8")] - pub origin_energy_limit: i64, - #[prost(bytes="vec", tag="9")] - pub code_hash: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="10")] - pub trx_hash: ::prost::alloc::vec::Vec, - #[prost(int32, tag="11")] - pub version: i32, -} -/// Nested message and enum types in `SmartContract`. -pub mod smart_contract { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Abi { - #[prost(message, repeated, tag="1")] - pub entrys: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `ABI`. - pub mod abi { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Entry { - #[prost(bool, tag="1")] - pub anonymous: bool, - #[prost(bool, tag="2")] - pub constant: bool, - #[prost(string, tag="3")] - pub name: ::prost::alloc::string::String, - #[prost(message, repeated, tag="4")] - pub inputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="5")] - pub outputs: ::prost::alloc::vec::Vec, - #[prost(enumeration="entry::EntryType", tag="6")] - pub r#type: i32, - #[prost(bool, tag="7")] - pub payable: bool, - #[prost(enumeration="entry::StateMutabilityType", tag="8")] - pub state_mutability: i32, - } - /// Nested message and enum types in `Entry`. - pub mod entry { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Param { - #[prost(bool, tag="1")] - pub indexed: bool, - #[prost(string, tag="2")] - pub name: ::prost::alloc::string::String, - #[prost(string, tag="3")] - pub r#type: ::prost::alloc::string::String, - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum EntryType { - UnknownEntryType = 0, - Constructor = 1, - Function = 2, - Event = 3, - Fallback = 4, - Receive = 5, - Error = 6, - } - impl EntryType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - EntryType::UnknownEntryType => "UnknownEntryType", - EntryType::Constructor => "Constructor", - EntryType::Function => "Function", - EntryType::Event => "Event", - EntryType::Fallback => "Fallback", - EntryType::Receive => "Receive", - EntryType::Error => "Error", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UnknownEntryType" => Some(Self::UnknownEntryType), - "Constructor" => Some(Self::Constructor), - "Function" => Some(Self::Function), - "Event" => Some(Self::Event), - "Fallback" => Some(Self::Fallback), - "Receive" => Some(Self::Receive), - "Error" => Some(Self::Error), - _ => None, - } - } - } - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - pub enum StateMutabilityType { - UnknownMutabilityType = 0, - Pure = 1, - View = 2, - Nonpayable = 3, - Payable = 4, - } - impl StateMutabilityType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - StateMutabilityType::UnknownMutabilityType => "UnknownMutabilityType", - StateMutabilityType::Pure => "Pure", - StateMutabilityType::View => "View", - StateMutabilityType::Nonpayable => "Nonpayable", - StateMutabilityType::Payable => "Payable", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UnknownMutabilityType" => Some(Self::UnknownMutabilityType), - "Pure" => Some(Self::Pure), - "View" => Some(Self::View), - "Nonpayable" => Some(Self::Nonpayable), - "Payable" => Some(Self::Payable), - _ => None, - } - } - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, Copy, PartialEq, ::prost::Message)] -pub struct ContractState { - #[prost(int64, tag="1")] - pub energy_usage: i64, - #[prost(int64, tag="2")] - pub energy_factor: i64, - #[prost(int64, tag="3")] - pub update_cycle: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CreateSmartContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] - pub new_contract: ::core::option::Option, - #[prost(int64, tag="3")] - pub call_token_value: i64, - #[prost(int64, tag="4")] - pub token_id: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TriggerSmartContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub contract_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub call_value: i64, - #[prost(bytes="vec", tag="4")] - pub data: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub call_token_value: i64, - #[prost(int64, tag="6")] - pub token_id: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClearAbiContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub contract_address: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateSettingContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub contract_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub consume_user_resource_percent: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateEnergyLimitContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub contract_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="3")] - pub origin_energy_limit: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SmartContractDataWrapper { - #[prost(message, optional, tag="1")] - pub smart_contract: ::core::option::Option, - #[prost(bytes="vec", tag="2")] - pub runtimecode: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="3")] - pub contract_state: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WitnessCreateContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] - pub url: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct WitnessUpdateContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="12")] - pub update_url: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VoteWitnessContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="2")] - pub votes: ::prost::alloc::vec::Vec, - #[prost(bool, tag="3")] - pub support: bool, -} -/// Nested message and enum types in `VoteWitnessContract`. -pub mod vote_witness_contract { - #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] - pub struct Vote { - #[prost(bytes="vec", tag="1")] - pub vote_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub vote_count: i64, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProposalApproveContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub proposal_id: i64, - #[prost(bool, tag="3")] - pub is_add_approval: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProposalCreateContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(map="int64, int64", tag="2")] - pub parameters: ::std::collections::HashMap, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProposalDeleteContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(int64, tag="2")] - pub proposal_id: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VoteAssetContract { - #[prost(bytes="vec", tag="1")] - pub owner_address: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub vote_address: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(bool, tag="3")] - pub support: bool, - #[prost(int32, tag="5")] - pub count: i32, -} -// @@protoc_insertion_point(module) diff --git a/packages/substreams-tron/src/pb/request.tron.v1.rs b/packages/substreams-tron/src/pb/request.tron.v1.rs deleted file mode 100644 index 0aa07b513..000000000 --- a/packages/substreams-tron/src/pb/request.tron.v1.rs +++ /dev/null @@ -1,49 +0,0 @@ -// @generated -// This file is @generated by prost-build - -/// A single payment event from the ERC20FeeProxy contract -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Payment { - /// The token contract address (TRC20) - #[prost(string, tag = "1")] - pub token_address: ::prost::alloc::string::String, - /// The recipient address - #[prost(string, tag = "2")] - pub to: ::prost::alloc::string::String, - /// The payment amount (as string to preserve precision) - #[prost(string, tag = "3")] - pub amount: ::prost::alloc::string::String, - /// The indexed payment reference (hex encoded) - #[prost(string, tag = "4")] - pub payment_reference: ::prost::alloc::string::String, - /// The fee amount (as string to preserve precision) - #[prost(string, tag = "5")] - pub fee_amount: ::prost::alloc::string::String, - /// The fee recipient address - #[prost(string, tag = "6")] - pub fee_address: ::prost::alloc::string::String, - /// The sender address (msg.sender) - #[prost(string, tag = "7")] - pub from: ::prost::alloc::string::String, - /// Block number where the event was emitted - #[prost(uint64, tag = "8")] - pub block: u64, - /// Block timestamp (Unix timestamp in seconds) - #[prost(uint64, tag = "9")] - pub timestamp: u64, - /// Transaction hash - #[prost(string, tag = "10")] - pub tx_hash: ::prost::alloc::string::String, - /// The proxy contract address that emitted the event - #[prost(string, tag = "11")] - pub contract_address: ::prost::alloc::string::String, -} - -/// Collection of payment events -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Payments { - #[prost(message, repeated, tag = "1")] - pub payments: ::prost::alloc::vec::Vec, -} diff --git a/packages/substreams-tron/src/pb/sf.tron.type.v1.rs b/packages/substreams-tron/src/pb/sf.tron.type.v1.rs deleted file mode 100644 index 6cef6a28e..000000000 --- a/packages/substreams-tron/src/pb/sf.tron.type.v1.rs +++ /dev/null @@ -1,127 +0,0 @@ -// @generated -// This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Block { - #[prost(bytes="vec", tag="1")] - pub id: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] - pub header: ::core::option::Option, - #[prost(message, repeated, tag="3")] - pub transactions: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockHeader { - #[prost(uint64, tag="1")] - pub number: u64, - #[prost(bytes="vec", tag="2")] - pub tx_trie_root: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="3")] - pub witness_address: ::prost::alloc::vec::Vec, - #[prost(uint64, tag="4")] - pub parent_number: u64, - #[prost(bytes="vec", tag="5")] - pub parent_hash: ::prost::alloc::vec::Vec, - #[prost(uint32, tag="6")] - pub version: u32, - #[prost(int64, tag="7")] - pub timestamp: i64, - #[prost(bytes="vec", tag="8")] - pub witness_signature: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Transaction { - #[prost(bytes="vec", tag="1")] - pub txid: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] - pub signature: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(bytes="vec", tag="3")] - pub ref_block_bytes: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="4")] - pub ref_block_hash: ::prost::alloc::vec::Vec, - #[prost(int64, tag="5")] - pub expiration: i64, - #[prost(int64, tag="6")] - pub timestamp: i64, - #[prost(bytes="vec", repeated, tag="7")] - pub contract_result: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(bool, tag="8")] - pub result: bool, - #[prost(enumeration="ResponseCode", tag="9")] - pub code: i32, - #[prost(bytes="vec", tag="10")] - pub message: ::prost::alloc::vec::Vec, - #[prost(int64, tag="11")] - pub energy_used: i64, - #[prost(int64, tag="12")] - pub energy_penalty: i64, - #[prost(message, optional, tag="13")] - pub info: ::core::option::Option, - #[prost(message, repeated, tag="14")] - pub contracts: ::prost::alloc::vec::Vec, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ResponseCode { - Success = 0, - Sigerror = 1, - ContractValidateError = 2, - ContractExeError = 3, - BandwithError = 4, - DupTransactionError = 5, - TaposError = 6, - TooBigTransactionError = 7, - TransactionExpirationError = 8, - ServerBusy = 9, - NoConnection = 10, - NotEnoughEffectiveConnection = 11, - BlockUnsolidified = 12, - OtherError = 20, -} -impl ResponseCode { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ResponseCode::Success => "SUCCESS", - ResponseCode::Sigerror => "SIGERROR", - ResponseCode::ContractValidateError => "CONTRACT_VALIDATE_ERROR", - ResponseCode::ContractExeError => "CONTRACT_EXE_ERROR", - ResponseCode::BandwithError => "BANDWITH_ERROR", - ResponseCode::DupTransactionError => "DUP_TRANSACTION_ERROR", - ResponseCode::TaposError => "TAPOS_ERROR", - ResponseCode::TooBigTransactionError => "TOO_BIG_TRANSACTION_ERROR", - ResponseCode::TransactionExpirationError => "TRANSACTION_EXPIRATION_ERROR", - ResponseCode::ServerBusy => "SERVER_BUSY", - ResponseCode::NoConnection => "NO_CONNECTION", - ResponseCode::NotEnoughEffectiveConnection => "NOT_ENOUGH_EFFECTIVE_CONNECTION", - ResponseCode::BlockUnsolidified => "BLOCK_UNSOLIDIFIED", - ResponseCode::OtherError => "OTHER_ERROR", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SUCCESS" => Some(Self::Success), - "SIGERROR" => Some(Self::Sigerror), - "CONTRACT_VALIDATE_ERROR" => Some(Self::ContractValidateError), - "CONTRACT_EXE_ERROR" => Some(Self::ContractExeError), - "BANDWITH_ERROR" => Some(Self::BandwithError), - "DUP_TRANSACTION_ERROR" => Some(Self::DupTransactionError), - "TAPOS_ERROR" => Some(Self::TaposError), - "TOO_BIG_TRANSACTION_ERROR" => Some(Self::TooBigTransactionError), - "TRANSACTION_EXPIRATION_ERROR" => Some(Self::TransactionExpirationError), - "SERVER_BUSY" => Some(Self::ServerBusy), - "NO_CONNECTION" => Some(Self::NoConnection), - "NOT_ENOUGH_EFFECTIVE_CONNECTION" => Some(Self::NotEnoughEffectiveConnection), - "BLOCK_UNSOLIDIFIED" => Some(Self::BlockUnsolidified), - "OTHER_ERROR" => Some(Self::OtherError), - _ => None, - } - } -} -// @@protoc_insertion_point(module) diff --git a/packages/substreams-tron/subgraph.yaml b/packages/substreams-tron/subgraph.yaml deleted file mode 100644 index 330331af5..000000000 --- a/packages/substreams-tron/subgraph.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Substreams-powered Subgraph configuration for TRON payments -# Note: This is a template. To deploy: -# 1. Build the substreams: make build -# 2. Package it: substreams pack -# 3. Deploy to The Graph with this subgraph.yaml -specVersion: 1.0.0 -description: Request Network TRON ERC20FeeProxy payment events -repository: https://github.com/RequestNetwork/requestNetwork -schema: - file: ./schema.graphql - -dataSources: - - kind: substreams - name: TronPayments - network: tron - source: - package: - moduleName: map_erc20_fee_proxy_payments - file: ./request-network-tron-v0.1.0.spkg - mapping: - apiVersion: 0.0.7 - kind: substreams/graph-entities diff --git a/packages/substreams-tron/substreams.yaml b/packages/substreams-tron/substreams.yaml deleted file mode 100644 index f369a2ba9..000000000 --- a/packages/substreams-tron/substreams.yaml +++ /dev/null @@ -1,48 +0,0 @@ -specVersion: v0.1.0 -package: - name: request_network_tron - version: v0.1.0 - url: https://github.com/RequestNetwork/requestNetwork - doc: | - Request Network TRON Substreams module for indexing ERC20FeeProxy payment events. - Indexes TransferWithReferenceAndFee events from the deployed ERC20FeeProxy contracts - on TRON mainnet and Nile testnet. - -imports: - tron: https://spkg.io/streamingfast/tron-foundational-v0.1.2.spkg - -protobuf: - files: - - request/tron/v1/payments.proto - importPaths: - - ./proto - -binaries: - default: - type: wasm/rust-v1 - file: ./target/wasm32-unknown-unknown/release/request_network_tron.wasm - -modules: - - name: map_erc20_fee_proxy_payments - kind: map - initialBlock: 63208782 # Nile testnet deployment block (use lower for both networks) - inputs: - - params: string - - source: sf.tron.type.v1.Block - output: - type: proto:request.tron.v1.Payments - doc: | - Extracts TransferWithReferenceAndFee events from ERC20FeeProxy contracts. - Filters transactions to the known proxy contract addresses and parses - the event logs to extract payment details. - - Params format: - mainnet_proxy_address=
- nile_proxy_address=
- -network: tron - -params: - map_erc20_fee_proxy_payments: | - mainnet_proxy_address=TCUDPYnS9dH3WvFEaE7wN7vnDa51J4R4fd - nile_proxy_address=THK5rNmrvCujhmrXa5DB1dASepwXTr9cJs From 3d04d080992410d096d7c32674d589f09cb540d1 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 29 Jan 2026 13:58:23 -0300 Subject: [PATCH 15/15] fix: update codegen schema URL from sepolia to base The Sepolia subgraph no longer exists on The Graph Studio, causing GraphQL code generation to fail during builds. --- packages/payment-detection/codegen.yml | 2 +- .../payment-detection/src/thegraph/queries/graphql.config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/payment-detection/codegen.yml b/packages/payment-detection/codegen.yml index f67dfd436..455351978 100644 --- a/packages/payment-detection/codegen.yml +++ b/packages/payment-detection/codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: 'https://api.studio.thegraph.com/query/67444/request-payments-sepolia/version/latest' +schema: 'https://api.studio.thegraph.com/query/67444/request-payments-base/version/latest' documents: src/thegraph/queries/*.graphql generates: src/thegraph/generated/graphql.ts: diff --git a/packages/payment-detection/src/thegraph/queries/graphql.config.yml b/packages/payment-detection/src/thegraph/queries/graphql.config.yml index 6d35f9a0a..19b1d64ca 100644 --- a/packages/payment-detection/src/thegraph/queries/graphql.config.yml +++ b/packages/payment-detection/src/thegraph/queries/graphql.config.yml @@ -1 +1 @@ -schema: https://api.studio.thegraph.com/query/67444/request-payments-sepolia/version/latest +schema: https://api.studio.thegraph.com/query/67444/request-payments-base/version/latest