Permalink
Browse files

Merge branch 'master' into ticket-3249-login-with-token-parameter

  • Loading branch information...
2 parents e5901ef + 077b71b commit 307559dc67eab70032ed31944e52ec5c5219ddbc Paul Oliver committed Sep 5, 2011
Showing with 32 additions and 8 deletions.
  1. +11 −0 Makefile
  2. +16 −3 README → README.md
  3. +5 −5 src/smk_client.erl
View
@@ -0,0 +1,11 @@
+github:
+ git push origin github-master
+ git push github github-master:master
+ git tag v$(VSN)
+ git push origin refs/tags/v$(VSN):refs/tags/v$(VSN)
+ git push github refs/tags/v$(VSN):refs/tags/v$(VSN)
+
+delvsn:
+ git tag -d v$(VSN)
+ git push origin :refs/tags/v$(VSN)
+ git push github :refs/tags/v$(VSN)
View
@@ -2,7 +2,19 @@ Welcome to the Smarkets.com Erlang Software Development Kit!
The API for Smarkets.com is based on a set of messages transported between Smarkets' servers and clients asyncronously in a specific sequence. Each incoming and outgoing message to and from Smarkets is assigned a incrementing sequence number starting at 1 and only resetting back to 1 if a reset/re-login message is received. A full description of the API and how to handle sessions and sequence incrementing / playback is located in the file named API in the same project.
-Message formats are defined using Piqi data definition files and can be found in the eto_common and smk_api_common dependancies of this project fetched by running:
+# Using with your Application #
+
+Add the following dependency to your [rebar](https://github.com/basho/rebar).config and have at it.
+
+ {smk, "0.2.1", {git, "https://github.com/smarkets/smk_erlang_sdk.git", {tag, "v0.2.1"}}}
+
+Take a look at [smk_client](https://github.com/smarkets/smk_erlang_sdk/blob/master/src/smk_client.erl) and [smk_my_callbacks](https://github.com/smarkets/smk_erlang_sdk/blob/master/src/smk_my_callbacks.erl) example.
+
+*Requirements*: piqi 0.5.6 - the erlang piqi dependency for this is included in the main piqi repository so will be grabbed by rebar get-deps. Installation of piqi is outlined below.
+
+# Building #
+
+Message formats are defined using Piqi data definition files and can be found in the eto\_common and smk\_api\_common dependancies of this project fetched by running:
./rebar get-deps
@@ -11,11 +23,11 @@ To install the piqic command used to compile the fetched Piqi data definitions i
cd deps/piqi/
less INSTALL
-The resulting Erlang code is generated for by piqic and will be in erl/seto_piqi.erl, include/seto_piqi.hrl, src/eto_piqi.erl, and include/eto_piqi.hrl after running:
+The resulting Erlang code is generated for you by piqic and will be in src/seto\_piqi.erl, include/seto\_piqi.hrl, src/eto\_piqi.erl, and include/eto\_piqi.hrl after running:
./rebar compile
-An example client is available in src/smk_example_client.erl - to start it up simply crack open the Erlang shell and start typing:
+An example client is available in src/smk\_example\_client.erl - to start it up simply crack open the Erlang shell and start typing:
erl -pa ebin/ deps/*/ebin
1> application:start(lager).
@@ -53,3 +65,4 @@ An example client is available in src/smk_example_client.erl - to start it up si
{ok, 4}
As you can see from the above example the actual calls return ok and their outgoing sequence number, this means the message was sent to Smarkets, the response is asyncronously sent back from Smarkets and is in this example simply printed out by lager (logging). By being asyncronous it is possible to make more than one order before receiving the confirmation from the first.
+
View
@@ -140,8 +140,8 @@ subscribe(Name, Mkt) ->
gen_fsm:sync_send_event(Name,
#seto_payload{
eto_payload=#eto_payload{},
- type=market_subscription,
- market_subscription=#seto_market_subscription{
+ type=market_subscribe,
+ market_subscribe=#seto_market_subscribe{
market=Mkt
}}).
@@ -150,8 +150,8 @@ unsubscribe(Name, Mkt) ->
gen_fsm:sync_send_event(Name,
#seto_payload{
eto_payload=#eto_payload{},
- type=market_unsubscription,
- market_unsubscription=#seto_market_unsubscription{
+ type=market_unsubscribe,
+ market_unsubscribe=#seto_market_unsubscribe{
market=Mkt
}}).
@@ -240,7 +240,7 @@ handle_info({connect, Opts}, StateName, #s{session=Session, cache=Cache, name=Na
},
Host =
case application:get_env(smk, host) of
- undefined -> "api-dev.corp.smarkets.com";
+ undefined -> "api-sandbox.smarkets.com";
{ok, Host0} -> Host0
end,
Port =

0 comments on commit 307559d

Please sign in to comment.