Compare commits
No commits in common. "main" and "ryansquared/icepick-internal" have entirely different histories.
main
...
ryansquare
File diff suppressed because it is too large
Load Diff
|
@ -29,11 +29,6 @@ pub enum Request {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
values: serde_json::Value,
|
values: serde_json::Value,
|
||||||
},
|
},
|
||||||
|
|
||||||
Cat {
|
|
||||||
#[serde(flatten)]
|
|
||||||
values: serde_json::Value,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
|
@ -63,12 +58,6 @@ impl Module for Internal {
|
||||||
description: "Save data from a JSON file.".to_string(),
|
description: "Save data from a JSON file.".to_string(),
|
||||||
arguments: vec![filename.clone()],
|
arguments: vec![filename.clone()],
|
||||||
},
|
},
|
||||||
icepick_module::help::Operation {
|
|
||||||
name: "cat".to_string(),
|
|
||||||
description: "Return all inputs. Usable in workflows to sum up all desired outputs"
|
|
||||||
.to_string(),
|
|
||||||
arguments: vec![],
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,11 +100,6 @@ impl Module for Internal {
|
||||||
"blob": {},
|
"blob": {},
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
Request::Cat { values } => {
|
|
||||||
Ok(serde_json::json!({
|
|
||||||
"blob": values,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,18 +5,12 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
bincode = "1.3.3"
|
|
||||||
bs58 = "0.5.1"
|
|
||||||
ed25519-dalek = "=1.0.1"
|
ed25519-dalek = "=1.0.1"
|
||||||
icepick-module = { version = "0.1.0", path = "../../icepick-module" }
|
icepick-module = { version = "0.1.0", path = "../../icepick-module" }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
solana-rpc-client = { version = "2.1.1", default-features = false }
|
solana-rpc-client = { version = "2.1.1", default-features = false }
|
||||||
solana-rpc-client-api = "2.1.7"
|
|
||||||
solana-rpc-client-nonce-utils = "2.1.7"
|
|
||||||
solana-sdk = { version = "2.1.1" }
|
solana-sdk = { version = "2.1.1" }
|
||||||
solana-transaction-status = "2.1.1"
|
|
||||||
solana-transaction-status-client-types = "2.1.1"
|
|
||||||
spl-associated-token-account = "6.0.0"
|
spl-associated-token-account = "6.0.0"
|
||||||
spl-token = "7.0.0"
|
spl-token = "7.0.0"
|
||||||
spl-token-2022 = "6.0.0"
|
spl-token-2022 = "6.0.0"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,8 +12,6 @@ use super::{derive_keys, get_command, Commands, ModuleConfig, Operation};
|
||||||
#[derive(Serialize, Deserialize, Clone, Debug)]
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
||||||
pub struct Workflow {
|
pub struct Workflow {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
||||||
#[serde(default)]
|
|
||||||
pub inputs: Vec<String>,
|
pub inputs: Vec<String>,
|
||||||
|
|
||||||
#[serde(rename = "step")]
|
#[serde(rename = "step")]
|
||||||
|
|
|
@ -4,9 +4,6 @@ read -r from_address
|
||||||
printf "%s" "Public key of the recipient address: "
|
printf "%s" "Public key of the recipient address: "
|
||||||
read -r to_address
|
read -r to_address
|
||||||
|
|
||||||
printf "%s" "Publick ey of the nonce account: "
|
|
||||||
read -r nonce_address
|
|
||||||
|
|
||||||
printf "%s" "Name of the token to transfer: "
|
printf "%s" "Name of the token to transfer: "
|
||||||
read -r token_name
|
read -r token_name
|
||||||
|
|
||||||
|
@ -24,4 +21,4 @@ cat <<EOF > /data/input.json
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
icepick workflow sol broadcast --cluster devnet --nonce-address "$nonce_address"
|
icepick workflow sol broadcast --cluster devnet
|
||||||
|
|
135
icepick.toml
135
icepick.toml
|
@ -29,17 +29,16 @@ inputs = { token = "token_name" }
|
||||||
# we want to store, and the value is the name to be assigned in storage.
|
# we want to store, and the value is the name to be assigned in storage.
|
||||||
outputs = { token_address = "token_address", token_decimals = "token_decimals" }
|
outputs = { token_address = "token_address", token_decimals = "token_decimals" }
|
||||||
|
|
||||||
# Load the transaction nonce from the SD card
|
# Load the Blockhash from the SD card
|
||||||
[[module.workflow.step]]
|
[[module.workflow.step]]
|
||||||
type = "internal-load-file"
|
type = "internal-load-file"
|
||||||
|
|
||||||
# Pre-defined values to be passed to the module.
|
# Pre-defined values to be passed to the module
|
||||||
# In this case, the `filename` field is reserved for marking which file to load.
|
values = { filename = "blockhash.json" }
|
||||||
values = { filename = "nonce.json" }
|
|
||||||
|
|
||||||
# This value is marked to be saved in-memory, and can be used as an input for
|
# This value is marked to be saved in-memory, and can be used as an input for
|
||||||
# later steps.
|
# later steps.
|
||||||
outputs = { nonce_authority = "nonce_authority", nonce_data = "nonce_data", nonce_address = "nonce_address" }
|
outputs = { blockhash = "blockhash" }
|
||||||
|
|
||||||
[[module.workflow.step]]
|
[[module.workflow.step]]
|
||||||
# Generate an unsigned Transaction
|
# Generate an unsigned Transaction
|
||||||
|
@ -59,20 +58,6 @@ decimals = "token_decimals"
|
||||||
to_address = "to_address"
|
to_address = "to_address"
|
||||||
from_address = "from_address"
|
from_address = "from_address"
|
||||||
|
|
||||||
[module.workflow.step.outputs]
|
|
||||||
instructions = "instructions"
|
|
||||||
derivation_accounts = "derivation_accounts"
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-compile"
|
|
||||||
|
|
||||||
[module.workflow.step.inputs]
|
|
||||||
instructions = "instructions"
|
|
||||||
derivation_accounts = "derivation_accounts"
|
|
||||||
nonce_address = "nonce_address"
|
|
||||||
nonce_authority = "nonce_authority"
|
|
||||||
nonce_data = "nonce_data"
|
|
||||||
|
|
||||||
[module.workflow.step.outputs]
|
[module.workflow.step.outputs]
|
||||||
transaction = "unsigned_transaction"
|
transaction = "unsigned_transaction"
|
||||||
|
|
||||||
|
@ -82,7 +67,7 @@ type = "sol-sign"
|
||||||
|
|
||||||
[module.workflow.step.inputs]
|
[module.workflow.step.inputs]
|
||||||
transaction = "unsigned_transaction"
|
transaction = "unsigned_transaction"
|
||||||
blockhash = "nonce_data"
|
blockhash = "blockhash"
|
||||||
|
|
||||||
[module.workflow.step.outputs]
|
[module.workflow.step.outputs]
|
||||||
transaction = "signed_transaction"
|
transaction = "signed_transaction"
|
||||||
|
@ -99,22 +84,19 @@ values = { filename = "transaction.json" }
|
||||||
# contain the signed transaction.
|
# contain the signed transaction.
|
||||||
inputs = { transaction = "signed_transaction" }
|
inputs = { transaction = "signed_transaction" }
|
||||||
|
|
||||||
# NOTE: To get a nonce address, the `generate-nonce-account` workflow should be
|
|
||||||
# run. It is the only workflow that uses a blockhash, which is why a
|
|
||||||
# `broadcast-with-blockhash` or similar is not, and should not be, implemented.
|
|
||||||
[[module.workflow]]
|
[[module.workflow]]
|
||||||
name = "broadcast"
|
name = "broadcast"
|
||||||
inputs = ["nonce_address", "cluster"]
|
inputs = ["cluster"]
|
||||||
|
|
||||||
[[module.workflow.step]]
|
[[module.workflow.step]]
|
||||||
type = "sol-get-nonce-account-data"
|
type = "sol-get-blockhash"
|
||||||
inputs = { nonce_address = "nonce_address", cluster = "cluster" }
|
inputs = { cluster = "cluster" }
|
||||||
outputs = { authority = "nonce_authority", durable_nonce = "nonce" }
|
outputs = { blockhash = "blockhash" }
|
||||||
|
|
||||||
[[module.workflow.step]]
|
[[module.workflow.step]]
|
||||||
type = "internal-save-file"
|
type = "internal-save-file"
|
||||||
values = { filename = "nonce.json" }
|
values = { filename = "blockhash.json" }
|
||||||
inputs = { nonce_authority = "nonce_authority", nonce_data = "nonce", nonce_address = "nonce_address" }
|
inputs = { blockhash = "blockhash" }
|
||||||
|
|
||||||
[[module.workflow.step]]
|
[[module.workflow.step]]
|
||||||
type = "internal-load-file"
|
type = "internal-load-file"
|
||||||
|
@ -124,99 +106,4 @@ outputs = { transaction = "transaction" }
|
||||||
[[module.workflow.step]]
|
[[module.workflow.step]]
|
||||||
type = "sol-broadcast"
|
type = "sol-broadcast"
|
||||||
inputs = { cluster = "cluster", transaction = "transaction" }
|
inputs = { cluster = "cluster", transaction = "transaction" }
|
||||||
outputs = { status = "status", url = "url", error = "error" }
|
|
||||||
|
|
||||||
[[module.workflow]]
|
|
||||||
name = "generate-nonce-account"
|
|
||||||
inputs = ["cluster", "authorization_address"]
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-generate-wallet"
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-get-wallet-address"
|
|
||||||
outputs = { pubkey = "wallet_pubkey" }
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-await-funds"
|
|
||||||
inputs = { address = "wallet_pubkey", cluster = "cluster" }
|
|
||||||
# enough to cover two signatures and the 1_500_000 approx. rent fee
|
|
||||||
values = { lamports = "1510000" }
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-get-blockhash"
|
|
||||||
inputs = { cluster = "cluster" }
|
|
||||||
outputs = { blockhash = "blockhash" }
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-create-nonce-account-and-signing-key"
|
|
||||||
|
|
||||||
[module.workflow.step.inputs]
|
|
||||||
from_address = "wallet_pubkey"
|
|
||||||
authorization_address = "authorization_address"
|
|
||||||
|
|
||||||
[module.workflow.step.outputs]
|
|
||||||
transaction = "unsigned_transaction"
|
|
||||||
nonce_pubkey = "nonce_pubkey"
|
|
||||||
nonce_privkey = "private_keys"
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-sign"
|
|
||||||
|
|
||||||
[module.workflow.step.inputs]
|
|
||||||
blockhash = "blockhash"
|
|
||||||
signing_keys = "private_keys"
|
|
||||||
transaction = "unsigned_transaction"
|
|
||||||
|
|
||||||
[module.workflow.step.outputs]
|
|
||||||
transaction = "signed_transaction"
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-broadcast"
|
|
||||||
inputs = { cluster = "cluster", transaction = "signed_transaction" }
|
|
||||||
outputs = { status = "status", url = "url" }
|
outputs = { status = "status", url = "url" }
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "internal-cat"
|
|
||||||
inputs = { status = "status", url = "url", nonce_account = "nonce_pubkey" }
|
|
||||||
outputs = { status = "status", url = "url", nonce_account = "nonce_account" }
|
|
||||||
|
|
||||||
[[module.workflow]]
|
|
||||||
# Transfer SOL from one address to another.
|
|
||||||
name = "transfer"
|
|
||||||
inputs = ["to_address", "from_address", "amount"]
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "internal-load-file"
|
|
||||||
values = { filename = "nonce.json" }
|
|
||||||
outputs = { nonce_authority = "nonce_authority", nonce_data = "nonce_data", nonce_address = "nonce_address" }
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-transfer"
|
|
||||||
inputs = { from_address = "from_address", to_address = "to_address", amount = "amount" }
|
|
||||||
outputs = { instructions = "instructions", derivation_accounts = "derivation_accounts" }
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-compile"
|
|
||||||
|
|
||||||
[module.workflow.step.inputs]
|
|
||||||
instructions = "instructions"
|
|
||||||
derivation_accounts = "derivation_accounts"
|
|
||||||
nonce_address = "nonce_address"
|
|
||||||
nonce_authority = "nonce_authority"
|
|
||||||
nonce_data = "nonce_data"
|
|
||||||
|
|
||||||
[module.workflow.step.outputs]
|
|
||||||
transaction = "unsigned_transaction"
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "sol-sign"
|
|
||||||
|
|
||||||
inputs = { blockhash = "nonce_data", transaction = "unsigned_transaction" }
|
|
||||||
outputs = { transaction = "signed_transaction" }
|
|
||||||
|
|
||||||
[[module.workflow.step]]
|
|
||||||
type = "internal-save-file"
|
|
||||||
|
|
||||||
values = { filename = "transaction.json" }
|
|
||||||
inputs = { transaction = "signed_transaction" }
|
|
||||||
|
|
Loading…
Reference in New Issue