|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The Wallet. Implementation dependant, as this interface must cope with diverging requirements. Within each wallet, WebFunds will expect the wallet to open and manage an account. This is a unit of authentication, a complete unit of payments, in that value within is managed separately from any other value. Within each account, WebFunds will expect the wallet to add and manage subaccounts. Subaccounts are the intersection between the account - authentication - and a particular type of value. So, for example, an account might be "Household Funds" and a sub-account might be "dollars." More specifically, types of value are identified by Ricardian contracts, so the subaccounts are often called contracts.
| Field Summary | |
static int |
CODE_FREEZE
adminEvent() codes. |
static int |
CODE_SHUTDOWN
adminEvent() codes. |
static int |
CODE_UNFREEZE
adminEvent() codes. |
| Method Summary | |
AccountInfo |
addAccount()
Add an account. |
ItemId |
addContract(AccountInfo info,
ItemId item)
Add a contract to this account. |
int |
adminEvent(int code,
java.lang.String reason)
Signal the wallet. |
void |
cancel(Transaction transaction)
Try to undo a given payment that this wallet has made. |
void |
cancel(Transaction[] transactions)
Try to undo a batch of payments that this wallet has made. |
void |
debug(java.io.PrintWriter bug)
A debugging interface, set this PrintWriter as where logs go. |
java.lang.String |
getAccountHelp()
|
AccountInfo[] |
getAccounts()
Get all accounts known to this wallet. |
java.lang.String |
getContractHelp()
|
ItemId[] |
getContracts(AccountInfo accountInfo)
Get all contracts that are in this account |
java.lang.String |
getProtocol()
Get the protocol name. |
java.lang.String |
getShortName()
Get a name for this wallet. |
Transaction[] |
getTransactions(AccountInfo account,
ItemId contract)
Get all the Transactions for a particular sub account, for display purposes. |
long |
getValue(AccountInfo account,
ItemId contract,
boolean pending)
Get the value held in a subaccount (contract) in a given account. |
java.lang.String |
getVersion()
Get the version number of the protocol. |
java.lang.String |
getWalletHelp()
Provide a help string for each of the different levels. |
void |
makeDeposit(byte[] payment,
AccountInfo target,
byte[] desc)
Make a deposit of a payment supplied by some other user's client via email or similar means. |
byte[] |
makePayment(ItemId contract,
AccountInfo source,
AccountInfo target,
long amount,
byte[] description,
java.util.Date validFrom,
java.util.Date validTill)
Make a payment. |
boolean |
removeAccount(AccountInfo accountInfo)
Remove this account. |
boolean |
removeContract(AccountInfo accountInfo,
ItemId contract)
Remove this contract from this account. |
boolean |
renameAccount(AccountInfo accountInfo,
java.lang.String name)
Rename this account to a new String. |
void |
setWalletContext(WalletContext wm)
Set the WalletContext so the WI can access the other components. |
void |
update(AccountInfo target,
ItemId contractId)
Update the subaccount with the latest info. |
| Field Detail |
public static final int CODE_SHUTDOWN
public static final int CODE_FREEZE
public static final int CODE_UNFREEZE
| Method Detail |
public java.lang.String getShortName()
public java.lang.String getProtocol()
public java.lang.String getVersion()
public void debug(java.io.PrintWriter bug)
public void setWalletContext(WalletContext wm)
public int adminEvent(int code,
java.lang.String reason)
code - a number that might indicate urgency or reasonreason - a printable or loggable string that might indicate reason
public long getValue(AccountInfo account,
ItemId contract,
boolean pending)
pending - if true, the value of pending payments, else confirmedpublic AccountInfo[] getAccounts()
public AccountInfo addAccount()
public ItemId[] getContracts(AccountInfo accountInfo)
public boolean renameAccount(AccountInfo accountInfo,
java.lang.String name)
public boolean removeAccount(AccountInfo accountInfo)
public boolean removeContract(AccountInfo accountInfo,
ItemId contract)
public ItemId addContract(AccountInfo info,
ItemId item)
public byte[] makePayment(ItemId contract,
AccountInfo source,
AccountInfo target,
long amount,
byte[] description,
java.util.Date validFrom,
java.util.Date validTill)
public void makeDeposit(byte[] payment,
AccountInfo target,
byte[] desc)
payment - is the byte array holding the raw paymentdesc - a text descriptiontarget - account to deposit to (may already be directed)public void cancel(Transaction transaction)
public void cancel(Transaction[] transactions)
public void update(AccountInfo target,
ItemId contractId)
public Transaction[] getTransactions(AccountInfo account,
ItemId contract)
public java.lang.String getWalletHelp()
public java.lang.String getAccountHelp()
public java.lang.String getContractHelp()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||