Package com.algorand.algosdk.account
Class LogicSigAccount
- java.lang.Object
-
- com.algorand.algosdk.account.LogicSigAccount
-
public class LogicSigAccount extends Object
-
-
Field Summary
Fields Modifier and Type Field Description LogicsigSignaturelsigEd25519PublicKeysigKey
-
Constructor Summary
Constructors Constructor Description LogicSigAccount(byte[] logic, List<byte[]> args)Creates a new escrow LogicSig Account The address of the account is the hash of its program (logic)LogicSigAccount(byte[] logic, List<byte[]> args, PrivateKey privateKey)Creates a new delegated LogicSigAccount.LogicSigAccount(byte[] logic, List<byte[]> args, PrivateKey privateKey, MultisigAddress ma)Creates a new delegated LogicSigAccount.LogicSigAccount(LogicsigSignature lsig, Ed25519PublicKey signerPublicKey)Creates a new delegated LogicSigAccount from existing LogicSig
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendMultiSig(PrivateKey privateKey)Adds a signature from the delegating multi-sig accountAddressgetAddress()getAddress returns the address of the LogicSigAccountTxnSignergetTransactionSigner()booleanisDelegated()IsDelegated returns true iff.SignedTransactionsignLogicSigTransaction(Transaction tx)Sign a transaction with this account
-
-
-
Field Detail
-
sigKey
public final Ed25519PublicKey sigKey
-
lsig
public final LogicsigSignature lsig
-
-
Constructor Detail
-
LogicSigAccount
public LogicSigAccount(byte[] logic, List<byte[]> args)Creates a new escrow LogicSig Account The address of the account is the hash of its program (logic)- Parameters:
logic- the bytes of programargs- the arguments of the program
-
LogicSigAccount
public LogicSigAccount(byte[] logic, List<byte[]> args, PrivateKey privateKey) throws NoSuchAlgorithmException, IOExceptionCreates a new delegated LogicSigAccount. This type of LogicSigAccount has the authority to sign transaction on behalf of another account, or so to say that account delegate the transaction signing to the program. If the delegating account is a multi-sig account, please pass in a multi-address for class construction (do not use this constructor in that case)- Parameters:
logic- the bytes of programargs- the arguments of the programprivateKey- the (only) private key of the delegating account- Throws:
NoSuchAlgorithmExceptionIOException
-
LogicSigAccount
public LogicSigAccount(byte[] logic, List<byte[]> args, PrivateKey privateKey, MultisigAddress ma) throws IOException, NoSuchAlgorithmExceptionCreates a new delegated LogicSigAccount. This type of LogicSigAccount has the authority to sign transaction on behalf of another account, or so to say that account delegate the transaction signing to the program. The delegated Account here is a multi-sig account. To add additional signature from other member, use appendMultiSig method.- Parameters:
logic- the bytes of programargs- the arguments of the programprivateKey- is the private key of one of the member of delegating multi-sig accountma- is the multi-sig-address of the delegating account.- Throws:
IOExceptionNoSuchAlgorithmException
-
LogicSigAccount
public LogicSigAccount(LogicsigSignature lsig, Ed25519PublicKey signerPublicKey) throws IllegalArgumentException, NoSuchAlgorithmException
Creates a new delegated LogicSigAccount from existing LogicSig- Parameters:
lsig- is an existing LogicSig.signerPublicKey- must be present if the LogicSig is delegated and the delegating account is backed by a single private key (i.e. not a multi-sig account). It must be the public key of the delegating account, or an error will be returned if it is present.- Throws:
IllegalArgumentExceptionNoSuchAlgorithmException
-
-
Method Detail
-
appendMultiSig
public void appendMultiSig(PrivateKey privateKey) throws IllegalArgumentException, IOException, NoSuchAlgorithmException
Adds a signature from the delegating multi-sig account- Parameters:
privateKey- is the private key of one of the member of delegating multi-sig account- Throws:
IllegalArgumentExceptionIOExceptionNoSuchAlgorithmException
-
isDelegated
public boolean isDelegated()
IsDelegated returns true iff. the LogicSig has been delegated to another account with a signature- Returns:
- boolean
-
getAddress
public Address getAddress() throws NoSuchAlgorithmException, IllegalArgumentException
getAddress returns the address of the LogicSigAccount- Returns:
- the address of the LogicSigAccount
- Throws:
NoSuchAlgorithmExceptionIllegalArgumentException
-
signLogicSigTransaction
public SignedTransaction signLogicSigTransaction(Transaction tx) throws NoSuchAlgorithmException, IOException
Sign a transaction with this account- Parameters:
tx- transaction- Returns:
- signed transaction from LogicSigAccount
- Throws:
NoSuchAlgorithmExceptionIOException
-
getTransactionSigner
public TxnSigner getTransactionSigner()
-
-