Compare commits

..

No commits in common. "dd7736f5c8f0d2c8e72f503ae6e439322073b270" and "c6736ba6784f7bc2663f30e83d63b2d9d3ef5e8e" have entirely different histories.

2 changed files with 59 additions and 34 deletions

View File

@ -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

View File

@ -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
@ -69,9 +68,7 @@ type = "sol-compile"
[module.workflow.step.inputs] [module.workflow.step.inputs]
instructions = "instructions" instructions = "instructions"
derivation_accounts = "derivation_accounts" derivation_accounts = "derivation_accounts"
nonce_address = "nonce_address" blockhash = "blockhash"
nonce_authority = "nonce_authority"
nonce_data = "nonce_data"
[module.workflow.step.outputs] [module.workflow.step.outputs]
transaction = "unsigned_transaction" transaction = "unsigned_transaction"
@ -82,7 +79,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 +96,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"
@ -182,14 +176,13 @@ inputs = { status = "status", url = "url", nonce_account = "nonce_pubkey" }
outputs = { status = "status", url = "url", nonce_account = "nonce_account" } outputs = { status = "status", url = "url", nonce_account = "nonce_account" }
[[module.workflow]] [[module.workflow]]
# Transfer SOL from one address to another. name = "transfer-online-nonced"
name = "transfer" inputs = ["nonce_address", "to_address", "from_address", "amount", "cluster"]
inputs = ["to_address", "from_address", "amount"]
[[module.workflow.step]] [[module.workflow.step]]
type = "internal-load-file" type = "sol-get-nonce-account-data"
values = { filename = "nonce.json" } inputs = { nonce_address = "nonce_address", cluster = "cluster" }
outputs = { nonce_authority = "nonce_authority", nonce_data = "nonce_data", nonce_address = "nonce_address" } outputs = { authority = "nonce_authority", durable_nonce = "nonce" }
[[module.workflow.step]] [[module.workflow.step]]
type = "sol-transfer" type = "sol-transfer"
@ -202,9 +195,9 @@ type = "sol-compile"
[module.workflow.step.inputs] [module.workflow.step.inputs]
instructions = "instructions" instructions = "instructions"
derivation_accounts = "derivation_accounts" derivation_accounts = "derivation_accounts"
nonce_data = "nonce"
nonce_address = "nonce_address" nonce_address = "nonce_address"
nonce_authority = "nonce_authority" nonce_authority = "from_address"
nonce_data = "nonce_data"
[module.workflow.step.outputs] [module.workflow.step.outputs]
transaction = "unsigned_transaction" transaction = "unsigned_transaction"
@ -212,11 +205,46 @@ transaction = "unsigned_transaction"
[[module.workflow.step]] [[module.workflow.step]]
type = "sol-sign" type = "sol-sign"
inputs = { blockhash = "nonce_data", transaction = "unsigned_transaction" } inputs = { blockhash = "nonce", transaction = "unsigned_transaction" }
outputs = { transaction = "signed_transaction" } outputs = { transaction = "signed_transaction" }
[[module.workflow.step]] [[module.workflow.step]]
type = "internal-save-file" type = "sol-broadcast"
inputs = { cluster = "cluster", transaction = "signed_transaction" }
outputs = { status = "status", url = "url" }
values = { filename = "transaction.json" } [[module.workflow]]
inputs = { transaction = "signed_transaction" } name = "transfer-online"
inputs = ["to_address", "from_address", "amount", "cluster"]
[[module.workflow.step]]
type = "sol-get-blockhash"
inputs = { cluster = "cluster" }
outputs = { blockhash = "blockhash" }
[[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"
blockhash = "blockhash"
[module.workflow.step.outputs]
transaction = "unsigned_transaction"
[[module.workflow.step]]
type = "sol-sign"
inputs = { blockhash = "blockhash", transaction = "unsigned_transaction" }
outputs = { transaction = "signed_transaction" }
[[module.workflow.step]]
type = "sol-broadcast"
inputs = { cluster = "cluster", transaction = "signed_transaction" }
outputs = { status = "status", url = "url" }