-
Notifications
You must be signed in to change notification settings - Fork 0
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
a1cd859
commit bcd983a
Showing
1 changed file
with
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as algosdk from "algosdk"; | ||
import { my_mnemonic as mnemonic } from "../config"; | ||
|
||
(async () => { | ||
const account = algosdk.mnemonicToSecretKey(mnemonic); | ||
|
||
const algodClient = new algosdk.Algodv2( | ||
"a".repeat(64), | ||
"https://testnet-api.algonode.cloud", | ||
443 | ||
); | ||
|
||
const appId = 723522691; | ||
|
||
let uint8Array = new Uint8Array([85, 254, 181, 91]); | ||
|
||
const appCall = algosdk.makeApplicationNoOpTxnFromObject({ | ||
sender: account.addr, | ||
appIndex: appId, | ||
suggestedParams: await algodClient.getTransactionParams().do(), | ||
appArgs: [uint8Array, algosdk.bigIntToBytes(26340, 8)], | ||
}); | ||
|
||
const signedTxn = appCall.signTxn(account.sk); | ||
|
||
await algodClient.sendRawTransaction(signedTxn).do(); | ||
|
||
const res = await algosdk.waitForConfirmation(algodClient, appCall.txID(), 3); | ||
|
||
const decoder = new TextDecoder(); | ||
|
||
console.log(decoder.decode(res.logs?res.logs[0]:new Uint8Array([]))); | ||
})(); |