-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add
sign_delete_account
short/long
examples
- Loading branch information
dj8yf0μl
committed
Jan 25, 2024
1 parent
756eed6
commit 84ab665
Showing
4 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use near_account_id::AccountId; | ||
use near_ledger::NEARLedgerError; | ||
|
||
#[path = "../common/lib.rs"] | ||
mod common; | ||
|
||
fn tx(ledger_pub_key: ed25519_dalek::PublicKey) -> near_primitives::transaction::Transaction { | ||
let mut tx = common::tx_template(ledger_pub_key); | ||
tx.actions = vec![near_primitives::transaction::Action::DeleteAccount( | ||
near_primitives::transaction::DeleteAccountAction { | ||
beneficiary_id: AccountId::new_unvalidated( | ||
"dc7e34eecec3096a4a661e10932834f801149c49dba9b93322f6d9de18047f9c1b11b3b31673033936ad07bddc01f9da27d974811e480fb197c799e23480a489".to_string()), | ||
}, | ||
)]; | ||
tx | ||
} | ||
|
||
fn main() -> Result<(), NEARLedgerError> { | ||
common::get_key_sign_and_verify_flow(tx) | ||
} |
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,21 @@ | ||
use std::str::FromStr; | ||
|
||
use near_account_id::AccountId; | ||
use near_ledger::NEARLedgerError; | ||
|
||
#[path = "../common/lib.rs"] | ||
mod common; | ||
|
||
fn tx(ledger_pub_key: ed25519_dalek::PublicKey) -> near_primitives::transaction::Transaction { | ||
let mut tx = common::tx_template(ledger_pub_key); | ||
tx.actions = vec![near_primitives::transaction::Action::DeleteAccount( | ||
near_primitives::transaction::DeleteAccountAction { | ||
beneficiary_id: AccountId::from_str("bob.near").unwrap(), | ||
}, | ||
)]; | ||
tx | ||
} | ||
|
||
fn main() -> Result<(), NEARLedgerError> { | ||
common::get_key_sign_and_verify_flow(tx) | ||
} |