Skip to content

Instantly share code, notes, and snippets.

periodic_pay_escrow = periodic_pay_core.And(periodic_pay_transfer.Or(periodic_pay_close))
periodic_pay_close = And(Txn.close_remainder_to() == tmpl_rcv,
Txn.receiver() == Global.zero_address(),
Txn.first_valid() == tmpl_timeout,
Txn.amount() == Int(0))
periodic_pay_transfer = And(Txn.close_remainder_to() == Global.zero_address(),
Txn.receiver() == tmpl_rcv,
Txn.amount() == tmpl_amt)
periodic_pay_core = And(Txn.type_enum() == Int(1),
Txn.fee() <= tmpl_fee,
Txn.first_valid() % tmpl_period == Int(0),
Txn.last_valid() == tmpl_dur + Txn.first_valid(),
Txn.lease() == tmpl_x)
const algosdk = require('algosdk');
const fs = require('fs');
//Retrieve the token, server and port values for your installation in the algod.net
//and algod.token files within the data directory
const token = "a967f42b017cd4c5c95a633e87b5ff14226ae60609e174bf5832722631946e13";
const server = "http://127.0.0.1";
const port = 8080;
//Recover the account
#!/usr/bin/env python3
from pyteal import *
#template variables
tmpl_fee = Int(1000)
tmpl_period = Int(50)
tmpl_dur = Int(1000)
tmpl_x = Bytes("base64", "y9OJ5MRLCHQj8GqbikAUKMBI7hom+SOj8dlopNdNHXI=")
tmpl_amt = Int(2000)
import params
from algosdk import kmd, mnemonic
from algosdk.wallet import Wallet
# create a kmd client
kcl = kmd.KMDClient(params.kmd_token, params.kmd_address)
# wallet = Wallet("wallet_name", "wallet_password", kcl)
walletid = None
# this file generates standalone accounts using algosdk, creates a multisig object with those standalone accounts and imports them into a KMD wallet
import params
from algosdk import kmd, algod, account, encoding, mnemonic, transaction
# create a kmd client
kcl = kmd.KMDClient(params.kmd_token, params.kmd_address)
acl = algod.AlgodClient(params.algod_token, params.algod_address)
import params
from algosdk import kmd, account, encoding, mnemonic
# create a kmd client
kcl = kmd.KMDClient(params.kmd_token, params.kmd_address)
walletid = None
wallets = kcl.list_wallets()
print("Wallet List:", wallets)
for arrayitem in wallets:
import params
from algosdk import kmd, mnemonic
# create a kmd client
kcl = kmd.KMDClient(params.kmd_token, params.kmd_address)
# get the master derivation key from the mnemonic
backup = "alpha worry field wait hobby artist grape engine sponsor broccoli scare thing bean kind say royal inmate hood situate lock benefit omit index about usual"
mdk = mnemonic.to_master_derivation_key(backup)