-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Larkooo/burner-accounts
feat: deploying burner accounts
- Loading branch information
Showing
7 changed files
with
149 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
use starknet::macros::felt; | ||
use starknet_crypto::FieldElement; | ||
|
||
pub const KATANA_ACCOUNT_CLASS_HASH: FieldElement = | ||
felt!("0x04d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f"); | ||
pub const UDC_ADDRESS: FieldElement = | ||
felt!("0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf"); |
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,30 @@ | ||
use anyhow::Result; | ||
|
||
use starknet::{ | ||
core::types::StarknetError, | ||
providers::{Provider, ProviderError}, | ||
}; | ||
use starknet_crypto::FieldElement; | ||
|
||
pub async fn watch_tx<P>(provider: P, transaction_hash: FieldElement) -> Result<()> | ||
where | ||
P: Provider, | ||
ProviderError: 'static, | ||
{ | ||
loop { | ||
// TODO: check with sequencer gateway if it's not confirmed after an extended period of | ||
// time, as full nodes don't have access to failed transactions and would report them | ||
// as `NotReceived`. | ||
match provider.get_transaction_receipt(transaction_hash).await { | ||
Ok(_) => { | ||
// With JSON-RPC, once we get a receipt, the transaction must have been confirmed. | ||
// Rejected transactions simply aren't available. This needs to be changed once we | ||
// implement the sequencer fallback. | ||
|
||
return Ok(()); | ||
} | ||
Err(ProviderError::StarknetError(StarknetError::TransactionHashNotFound)) => {} | ||
Err(err) => return Err(err.into()), | ||
} | ||
} | ||
} |