I don't know how open transactions works, but I don't like how complicated it is. Seems there are contracts to do this and that, and we want is a coin. If you had a lot of 5 and 10 coins it would save space too.
Complicated??------------------------------------------------------------------------------------------
SHOW ACCOUNT BALANCE (on server):
~/Projects/Open-Transactions/include
> opentxs balance
Welcome to Open Transactions -- version 0.82.h
PLEASE SIGN YOUR PASSPHRASE:
Balance: 1211
eMldMMiKfJRO8B8yJjzcezs9xvSt7dkdlWt50e8CDxn (FT's Silver)
------------------------------------------------------------------------------------------
SOURCE CODE for "balance" command, using OT API:def details_account_balance(strID)
{
var strName = OT_API_GetAccountWallet_Name(strID)
var strBalance = OT_API_GetAccountWallet_Balance(strID)
OT_API_Output(0, "\n Balance: ") //stderr
print(strBalance) // stdout
OT_API_Output(0, strID + " (" + strName + ")\n\n") //stderr
}
------------------------------------------------------------------------------------------
SHOW CASH PURSE (on local client):
~/Projects/Open-Transactions/include
> opentxs showpurse
Welcome to Open Transactions -- version 0.82.h
PLEASE SIGN YOUR PASSPHRASE:
Total value: 1
Token count: 1
Index Value Series ValidFrom ValidTo Status
0 1 0 1339606926 1355158926 valid
------------------------------------------------------------------------------------------
WITHDRAW CASH:
~/Projects/Open-Transactions/include
> opentxs withdraw
Welcome to Open Transactions -- version 0.82.h
PLEASE SIGN YOUR PASSPHRASE:
Enter the amount as integer[1]: 109
Server response (withdraw_cash): SUCCESS withdrawing cash! (From account on server, to local purse.)
Success retrieving intermediary files for account.
------------------------------------------------------------------------------------------
SOURCE CODE for withdraw cash: var madeEasy = OT_ME()
var strResponse = madeEasy.withdraw_cash(Server, strMyNymID, MyAcct, strAmount)
var strAttempt = "withdraw_cash"
// ***************************************************************
// Interpret the server's reply...
var nInterpretReply = InterpretTransactionMsgReply(Server, strMyNymID, MyAcct, strAttempt, strResponse)
if (1 == nInterpretReply)
{
// Download all the intermediary files (account balance, inbox, outbox, etc)
// since they have probably changed from this operation.
//
var bRetrieved = madeEasy.retrieve_account(Server, strMyNymID, MyAcct) //bForceDownload defaults to false.
OT_API_Output(0, "\n\nServer response ("+strAttempt+"): SUCCESS withdrawing cash! (From account on server to local purse.) \n")
OT_API_Output(0, (bRetrieved ? "Success" : "Failed") + " retrieving intermediary files for account.\n")
}
------------------------------------------------------------------------------------------
VIEW (UPDATED) BALANCE (on server):
~/Projects/Open-Transactions/include
> opentxs balance
Welcome to Open Transactions -- version 0.82.h
PLEASE SIGN YOUR PASSPHRASE:
Balance: 1102
eMldMMiKfJRO8B8yJjzcezs9xvSt7dkdlWt50e8CDxn (FT's Silver)
------------------------------------------------------------------------------------------
VIEW UPDATED PURSE (on local client):
~/Projects/Open-Transactions/include
> opentxs showpurse
Welcome to Open Transactions -- version 0.82.h
PLEASE SIGN YOUR PASSPHRASE:
Total value: 110
Token count: 7
Index Value Series ValidFrom ValidTo Status
0 1 0 1339606926 1355158926 valid
1 100 0 1339606926 1355158926 valid
2 1 0 1339606926 1355158926 valid
3 5 0 1339606926 1355158926 valid
4 1 0 1339606926 1355158926 valid
5 1 0 1339606926 1355158926 valid
6 1 0 1339606926 1355158926 valid
~/Projects/Open-Transactions/include
>
------------------------------------------------------------------------------------------
SOURCE CODE for "show purse": var strAmount = OT_API_Purse_GetTotalValue(Server, MyPurse, strPurse)
print("\n\nTotal value: " + strAmount)
// Loop through purse contents and display tokens.
var nCount = OT_API_Purse_Count(Server, MyPurse, strPurse)
// ----------------------
if (nCount > 0)
{
print("Token count: " + nCount.to_string() + "\n")
print("Index\tValue\tSeries\tValidFrom\tValidTo\t\tStatus")
var nIndex = -1
while (nCount > 0)
{
--nCount
++nIndex // on first iteration, this is now 0.
// -------------------
var strToken = OT_API_Purse_Peek(Server, MyPurse, MyNym, strPurse)
var strNewPurse = OT_API_Purse_Pop(Server, MyPurse, MyNym, strPurse)
strPurse = strNewPurse
// ------------------------------------------
var strDenomination = OT_API_Token_GetDenomination(Server, MyPurse, strToken)
var nSeries = OT_API_Token_GetSeries (Server, MyPurse, strToken)
var strValidFrom = OT_API_Token_GetValidFrom (Server, MyPurse, strToken)
var strValidTo = OT_API_Token_GetValidTo (Server, MyPurse, strToken)
var strTime = OT_API_GetTime()
// ------------------------------------------
// Output the token...
var strStatus = (strTime.to_int() > strValidTo.to_int()) ? "expired" : "valid"
print(nIndex.to_string() + "\t" + strDenomination + "\t" + nSeries.to_string() + "\t" + strValidFrom + "\t" + strValidTo + "\t" + strStatus)
// ------------------------------------------
} // while
} // if nCount > 0
No offense, but a trained monkey could write an OT client.