-
Notifications
You must be signed in to change notification settings - Fork 3
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 #22 from starknet-id/feat/strk_support
feat: add altcoin buy & renew support
- Loading branch information
Showing
10 changed files
with
720 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
from starkware.crypto.signature.signature import private_to_stark_key, get_random_private_key, sign | ||
from starknet_py.hash.utils import pedersen_hash | ||
|
||
priv_key = 123 | ||
pub_key = private_to_stark_key(priv_key) | ||
print("pub_key:", hex(pub_key)) | ||
|
||
user_addr = 0x123 | ||
erc20_addr = 0x5 | ||
quote = 591205338160899000000 | ||
max_validity = 1000 | ||
encoded_string = 724720344857006587549020016926517802128122613457935427138661 | ||
data = pedersen_hash(pedersen_hash(pedersen_hash(erc20_addr, quote), max_validity), encoded_string) | ||
|
||
(x, y) = sign(data, priv_key) | ||
print("sig:", hex(x), hex(y)) |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mod main; | ||
mod internal; | ||
mod asserts; | ||
mod utils; | ||
mod utils; |
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
Oops, something went wrong.