multisig rhai flow POC app
This commit is contained in:
8
flowbroker/templates/rhai_examples/minimal_flow.rhai
Normal file
8
flowbroker/templates/rhai_examples/minimal_flow.rhai
Normal file
@@ -0,0 +1,8 @@
|
||||
// Minimal Single Signature Flow
|
||||
let flow_id = create_flow("Quick Sign");
|
||||
|
||||
let step1_id = add_step(flow_id, "Sign the message", 0);
|
||||
add_requirement(step1_id, "any_signer_pk", "Please provide your signature.");
|
||||
|
||||
print("Minimal Flow (ID: " + flow_id + ") defined.");
|
||||
()
|
@@ -0,0 +1,18 @@
|
||||
// Flow with Multi-Requirement Step
|
||||
// If create_flow, add_step, or add_requirement fail from Rust,
|
||||
// the script will stop and the error will be reported by the server.
|
||||
|
||||
let flow_id = create_flow("Multi-Req Sign Off");
|
||||
|
||||
let step1_id = add_step(flow_id, "Initial Signatures (3 needed)", 0);
|
||||
|
||||
add_requirement(step1_id, "signer1_pk", "Signatory 1: Please sign terms.");
|
||||
add_requirement(step1_id, "signer2_pk", "Signatory 2: Please sign terms.");
|
||||
add_requirement(step1_id, "signer3_pk", "Signatory 3: Please sign terms.");
|
||||
|
||||
let step2_id = add_step(flow_id, "Final Confirmation", 1);
|
||||
|
||||
add_requirement(step2_id, "final_approver_pk", "Final approval for multi-req sign off.");
|
||||
|
||||
print("Multi-Requirement Flow (ID: " + flow_id + ") defined.");
|
||||
()
|
14
flowbroker/templates/rhai_examples/simple_two_step.rhai
Normal file
14
flowbroker/templates/rhai_examples/simple_two_step.rhai
Normal file
@@ -0,0 +1,14 @@
|
||||
// Simple Two-Step Flow
|
||||
// If create_flow, add_step, or add_requirement fail from Rust,
|
||||
// the script will stop and the error will be reported by the server.
|
||||
|
||||
let flow_id = create_flow("Simple Two-Stepper");
|
||||
|
||||
let step1_id = add_step(flow_id, "Collect Document", 0);
|
||||
add_requirement(step1_id, "user_pubkey_document", "Please sign the document hash.");
|
||||
|
||||
let step2_id = add_step(flow_id, "Approval Signature", 1);
|
||||
add_requirement(step2_id, "approver_pubkey", "Please approve the collected document.");
|
||||
|
||||
print("Simple Two-Step Flow (ID: " + flow_id + ") defined.");
|
||||
()
|
Reference in New Issue
Block a user