-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sui-graphql-client: add execute transaction query (#22)
- Loading branch information
1 parent
74b91c1
commit bc65d4a
Showing
3 changed files
with
75 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::query_types::{schema, Base64}; | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic( | ||
schema = "rpc", | ||
graphql_type = "Mutation", | ||
variables = "ExecuteTransactionArgs" | ||
)] | ||
pub struct ExecuteTransactionQuery { | ||
#[arguments(signatures: $signatures, txBytes: $tx_bytes)] | ||
pub execute_transaction_block: ExecutionResult, | ||
} | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct ExecuteTransactionArgs { | ||
pub signatures: Vec<String>, | ||
pub tx_bytes: String, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(schema = "rpc", graphql_type = "ExecutionResult")] | ||
pub struct ExecutionResult { | ||
pub errors: Option<Vec<String>>, | ||
pub effects: TransactionBlockEffects, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Debug)] | ||
#[cynic(schema = "rpc", graphql_type = "TransactionBlockEffects")] | ||
pub struct TransactionBlockEffects { | ||
pub bcs: Base64, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters