augurproject / augur.js Goto Github PK
View Code? Open in Web Editor NEWAugur JavaScript API
License: MIT License
Augur JavaScript API
License: MIT License
EthereumJS is huge, 2mb minified, and we don't use all of it. We should remove the unused parts and reduce our app size by a possible order of magnitude. @tinybike
Give the front-end some flexibility WRT key derivation function, number of hashing rounds, etc.; this is all built in to keythereum so there's no reason augur.js should be limited.
For consistency with geth.
Filters were working, now they're not. Seems likely whatever changes/refactoring broke comments also broke filters.
Here are the three options I think we have:
Option 1
Augur.batch(function (augur) {
augur.methodName(..., callback1);
augur.methodName(..., callback2);
});
Option 2
var batch = Augur.batch();
batch.methodName(..., callback1);
batch.methodName(..., callback2);
batch.execute();
Option 3
var batch = Augur.batch();
Augur.methodName(..., callback1, batch);
Augur.methodName(..., callback2, batch);
batch.execute();
I think Option 1 is the nicest to use, but potentially awkward to implement. Option 2 seems like the middle ground on usability and implementation difficulty. Option 3 is probably pretty terrible since Javascript doesn't give us default argument values to make it easier to distinguish between all of the optional callbacks and the batch.
in an effort to further optimize loading markets, i'm using this contract method that returns several market properties at once. it's doing some comment thing as well and spamming the logs as well. i'd prefer to keep it as lean as possible and not do anything else while optimizing the market loading.
please do the thing where these are returned as BigNumbers and of course transformed from fixed-point when needed (i think two of the values require this treatment.
the array of values is fine (as apposed to converting them to labeled object)
i think just mimicking what you did with createMarkets would be ideal.
the callback fires twice. once with the correct value, once undefined.
getting this now with some call to augur.js. happens right away when trying to load markets.
called @ app.js:6068(anonymous function) @ app.js:32018module.exports.parse @ app.js:31939(anonymous function) @ app.js:31987
Official global namereg contract is supposed to be available tomorrow.
there are certain account "handles" and passwords that fail registration. it would be nice to know what those are.
i'm happy to implement a good UX and error messaging if we can come up with a reasonable set of criteria for both.
manually passing in network id is error prone and bad interface design if you can make an rpc call and determine it yourself. please implement this and make the usage transparent on Augur.connect()
i think it's this call: https://github.com/ethereum/wiki/wiki/JSON-RPC#net_version
what i could find from the market loaders:
getMarketInfo - result[1]
getMarketInfo - result[5]
getMarketOutcomeInfo - result[0]
getMarketOutcomeInfo - result[1]
getParticipantSharesPurchased
Augur.addMarketComment({
marketId: hashId/BigNumber
author: address,
message: string
})
Augur.getMarketComments(marketId)
this would store the the comment in an associated centralized datastore, whisper network or ipfs with timestamp of course.
"he ultimate solution to global warming will be geoengineering (defined as a majority of research papers claiming this is why temps dropped)"
is not market 0x1607e87fb97385cc01690314169cf9c60b7e7e0a7498572612e9ee53ab3cbb7b description.
try entering a password in the register box by typing quickly, i.e. not like a random old person who types like a chicken pecking... it won't pickup all the letters.
i don't have a way to know if dispatch succeed so i blinding call it every block until the period is current. please add an onSuccess call back so i can be smarter about these calls.
Look into what (if any) failure modes can result from logged in to the same account multiple times simultaneously. Obvious potential problem is if both try and submit transactions at (roughly) the same time, they will both be assigned the same nonce by the client, which will (may?) cause geth to reject one of them.
apparently geth supports RPC batching, but web3 does not.
i think it would be a big win for augur.js, if you could make a method like getMarkets that batches up a lot of what we're trying to do in an initial market load on the client.
this might solve the scaling issue way better than async.
this is a great start, but after using it, i'd like to see it take care of everything contract and augur. the methods should take normal values like '0.02' and do the conversion to fixed point. it should use whatever rpc interface it likes and it would be nice if it did sanity checking on inputs and good exceptions handles.
it so close to this already and i'm totally sold on this abstraction.
Developing Augur shouldn't require a stable geth and sane data on the chain. Integrate fixtures into the augur.js test harness.
Issue originated @ augur-client (AugurProject/augur-ui#29) but applies equally to the API.
i never seem to be able to sign into an account i "registered". i get sign in failed
So people can do stuff.
i'm check the the client code and can't find anything suspect.
requesting simulation: -60581acb88fdcffec6b1065829a0a2d2002648368a184bfb68562a7d4d99a99c 2 3 setting simulation: 0.000 0.000
i believe we some regression in augur.js. please confirm and fix if needed.
Primary (eth3.augur.net) demo host had to be restarted today and the backup nodes didn't automatically catch the RPC requests.
there's an RPC method for this that might be mature enough. not sure if you really need to call it every time.
such as:
Augur.constants.CONTRACT_ADDRESSES[7]
the index value being a network id. in this case '7'.
the result would be an object containing all the contracts by our naming convention and the current address. exactly how you have it.
Register followed by sign in works fine in the client until the page is reloaded. After that, sign in fails (with the uninformative error message sign in failed
). Not sure if this is an augur.js or client issue, but seems likely to be augur.js because most of the account machinery is here.
expecting:
0x6fc0a64e2dce367e35417bfd1568fa35af9f3e4b
getting:
0x0000000000000000000000006fc0a64e2dce367e35417bfd1568fa35af9f3e4b
For some reasom the marketIds returned by augur.js are sometime (half the time?) off by exactly 2^256. please figure out why and make this consistent.
it would be nice to have my account be immediately available after a refresh. would assist debuggin' flow as well.
None of these are actually producing a tx, silently failing and not firing an onSent.
The "holdings" section of the UI shows shares from other accounts. This is likely due to careless use of coinbase
as a default value for certain transaction parameters and from
fields. (For hosted nodes, this is the demo account, which should not be used as a default.)
Ethereum's ABI encoding for dynamic parameters is being changed to https://github.com/ethereum/wiki/wiki/Proposal-for-new-ABI-value-encoding. augur.js's encoder will need to be updated accordingly.
There's several RPC methods around the logs and filtering, but i think this is the one that will allow us to get price history for markets.
The interface I expect would look something like:
Augur.getMarketPriceHistory(marketID, outcomeID)
returning a list of objects like:
[...{price: BigNumber, timestamp: moment or Date}...]
Joey has implemented this in logs. See AugurProject/augur-core#8
I'm getting this after submitting a ballot
// makeReports.se
Augur.prototype.report = function (branch, report, votePeriod, salt, onSent, onSuccess, onFailed) {
if (branch.constructor === Object && branch.branchId) {
report = branch.report;
votePeriod = branch.votePeriod;
salt = branch.salt;
if (branch.onSent) onSent = branch.onSent;
if (branch.onSuccess) onSuccess = branch.onSuccess;
if (branch.onFailed) onFailed = branch.onFailed;
branch = branch.branchId;
}
var tx = utilities.copy(this.tx.report);
tx.params = [branch, Augur.abi.fix(report, "hex"), votePeriod, salt];
return this.send_call_confirm(tx, onSent, onSuccess, onFailed);
};
Augur.sendReputation and Augur.sendCash both need these.
also, it would be nice to have a sendEther method with the same.
Running augurjs in FF will eventually crash it (approx. 8 refreshes). Other browsers show some struggle running it. We should test augurjs piece by piece to isolate where issues may be occurring and resolving them. @tinybike
Accounts are stored in localStorage and it would be very nice if they were portable. Easiest method probably to use keythereum methods to dump the account info to file, then import into different browser/machine/etc.
Comments were working and broke sometime over the past month.
It watches for new transactions and fire a callback and returns a nice data structure of the tx that is augur related (ie. share purchased/sold, etc.)
for starters, it would be nice to know when a new market/event has hit the chain so i can update the client. (don't want to have to poll all markets, all the time!)
so it always matches the browser's
Either update the README, or expand the docs and make them prettier (e.g. https://readthedocs.org/). Long-term we'll definitely want the latter option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.