-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sui-transaction-builder: introduce a crate for building transaction (#41
- Loading branch information
1 parent
b2e9b83
commit 85b9a86
Showing
12 changed files
with
1,227 additions
and
26 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
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
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 @@ | ||
package_test_example*.json |
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,26 @@ | ||
[package] | ||
name = "sui-transaction-builder" | ||
version = "0.1.0" | ||
authors = ["Stefan Stanciulescu <[email protected]>", "Brandon Williams <[email protected]>"] | ||
license = "Apache-2.0" | ||
edition = "2021" | ||
publish = false | ||
readme = "README.md" | ||
description = "Transaction API for the Rust SDK for the Sui Blockchain" | ||
|
||
[dependencies] | ||
base64ct = "1.6" | ||
bcs = "0.1.6" | ||
serde = { version = "1.0", features = ["derive"] } | ||
sui-types = { package = "sui-sdk-types", path = "../sui-sdk-types", features = ["serde", "hash"] } | ||
sui-graphql-client = { package = "sui-graphql-client", path = "../sui-graphql-client" } | ||
thiserror = "2.0" | ||
|
||
[dev-dependencies] | ||
anyhow = "1.0" | ||
rand = "0.8" | ||
serde_json = "1.0" | ||
sui-crypto = { package = "sui-crypto", path = "../sui-crypto" , features = ["ed25519"] } | ||
sui-types = { package = "sui-sdk-types", path = "../sui-sdk-types", features = ["rand"] } | ||
tokio = { version = "1.0", features = ["full"] } | ||
|
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,40 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use base64ct::Error as Base64Error; | ||
use sui_types::types::ObjectId; | ||
|
||
#[derive(thiserror::Error, Debug, Clone)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
#[error("Conversion error due to input issue: {0}")] | ||
Input(String), | ||
#[error("Gas object should be an immutable or owned object")] | ||
WrongGasObject, | ||
#[error("Decoding error: {0}")] | ||
Decoding(#[from] Base64Error), | ||
#[error("Missing object id")] | ||
MissingObjectId, | ||
#[error("Missing version for object {0}")] | ||
MissingVersion(ObjectId), | ||
#[error("Missing digest for object {0}")] | ||
MissingDigest(ObjectId), | ||
#[error("Missing sender")] | ||
MissingSender, | ||
#[error("Missing gas objects")] | ||
MissingGasObjects, | ||
#[error("Missing gas budget")] | ||
MissingGasBudget, | ||
#[error("Missing gas price")] | ||
MissingGasPrice, | ||
#[error("Missing object kind for object {0}")] | ||
MissingObjectKind(ObjectId), | ||
#[error("Missing initial shared version for object {0}")] | ||
MissingInitialSharedVersion(ObjectId), | ||
#[error("Missing pure value")] | ||
MissingPureValue, | ||
#[error("Unknown shared object mutability for object {0}")] | ||
SharedObjectMutability(ObjectId), | ||
#[error("Unsupported literal")] | ||
UnsupportedLiteral, | ||
} |
Oops, something went wrong.