auth keys
Affinity M-Queue

The following workflow describes basic methods for processors in Async360.

WEB APP
var tokenResp = await Request(get_envoy_token, client);
var mydata = new ApeUserData
{
 ClientTaskID = tokenResp.task_id,
 OrderID = Order.LineID
};
var req = new SubscibeRequest
{
 address = Order.PaymentAddress,
 include_data = (mydata).ToB64(),
 network = "btc",
 queue_name = "my-checkout"
};

await Request(api_methods.subscribe, req);
1
subscribe-address

Subscribe unlimited addresses; use your extended public keys to locally derive new and unique deposit addresses with every payment instance.

CLIENT WS
var websocket = new WebSocket("wss://env.async360.com/");
websocket.addEventListener("open",
 function (event) {
   websocket.send(
    JSON.stringify({ClientToken: token})
  );
});
websocket.addEventListener("message",
  function (e) {
     var obj = JSON.parse(e.data);
     var message = obj.Message;
    if (message) {
      updateCallback(message);
  }
});
2
start-envoy

Apeshift Envoy is deployed here to browsers, allowing the remote process (below) to enjoy client response alongside its persistent M-Queue connection.

MQ PROCESS
var mydata = (ApeUserData)mq.UserData.FromB64();
var myResp = new ClientConfirmResponse()
{
  transaction = mydata.OrderID
};

var req = new InvokeEnvoyRequest
{
  new_timeout = 0,
  message = (myResp).ToB64(),
  task_id = mydata.ClientTaskID
};

await Request(api_methods.invoke_envoy, req);
3
invoke-envoy

Async360 ServiceWebSocket
[Endpoint] wss://bcq.async360.com
{
  "dqcommand": "trNDsob9yUnztWgw3txXFFuO3M",
  "result": {
    "TxnEvent": "mempool",
    "Network": "BTC",
    "Height": "-1"
    "TxnId": "TRANSACTION HASH",
    "Address": "BTC ADDRESS",
    "Value": "SATOSHI"
    "UserData": "aGVsbG8="
  }
}

DQ COMMAND

Applications should respond with provided dqcommand, or event will persist in the channel for 10 days and re-attempted until properly acknowledged.


API Methods

method create_blockchain_mq

Create a network queue to initiate a dedicated and persistent Blockchains MQ socket.

request

"Params":{
"queue_name":"checkout"
}

response

{
  "id": "2",
  "jsonrpc": "2.0",
  "error": null,
  "result": {
    "connection_string": "trNDsob9yUnztWgw3txXFFuO3M....."
  }
}
include_data

A user defined value to help identify this scenario.


method subscribe

Add an address to your blockchain network queue.

request

"Params":{
"network":"btc",
"address":"3LUpbPG3Dfz7nmV4DfT2VjYtNj3LNj8X49",
"queue_name":"checkout",
"include_data":"YOUR-BASE64-STRING"
}

response

{
  "id": "2",
  "jsonrpc": "2.0",
  "error": null,
  "result": {
    "status":"success"
  }
}
include_data

Any user defined data which should be returned with your blockchain network events for this address, such as client context or task for later use when invoking an Apeshift Envoy.