-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f102df3
commit 14f1bdb
Showing
3 changed files
with
19 additions
and
1 deletion.
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,15 @@ | ||
import * as Aleo from '@demox-labs/aleo-sdk'; | ||
import { NETWORK } from '../../constants'; | ||
|
||
const [privateKey, requestId, programAddress] = process.argv.slice(2); | ||
|
||
const addressHash = Aleo.Plaintext.fromString(NETWORK!, programAddress).hashBhp256(); | ||
const plaintextString = `{ | ||
arg: ${addressHash}, | ||
op_type: 4u8, | ||
request_id: ${requestId}u64 | ||
}`; | ||
const hashedField = Aleo.Plaintext.fromString(NETWORK!, plaintextString).hashBhp256(); | ||
|
||
// Sign the hash with the oracle private keys | ||
const signature0 = Aleo.Signature.sign_plaintext(NETWORK!, privateKey, hashedField).to_string(); |
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