Compare commits
28 Commits
grids3
..
78c9c67f38
| Author | SHA1 | Date | |
|---|---|---|---|
| 78c9c67f38 | |||
| 9bc0ffafd1 | |||
| a1fc5f19fa | |||
| efe0a64056 | |||
| 60985130cb | |||
| 6c172c4783 | |||
| 3838a7e3c5 | |||
| d014ae0982 | |||
| bb4bcbb7de | |||
| a695c21fc9 | |||
| 493bdb990c | |||
| 17f635af61 | |||
| 272ed01fdc | |||
| 49cd8b6687 | |||
| 966b4b2748 | |||
| fe182a5233 | |||
| f1696e2b9e | |||
| 2bf384ca82 | |||
| 4f2a3c6c6f | |||
| 7df04a81be | |||
| 6f02d4c4e6 | |||
| 56e63051bc | |||
| 3f1c9bd626 | |||
| 97e32574c4 | |||
| 6f5525afcf | |||
| 4f1958b210 | |||
| 3da9bd570b | |||
| d2163c1ff8 |
+79
-1110
File diff suppressed because it is too large
Load Diff
+1185
File diff suppressed because it is too large
Load Diff
+2
-36
@@ -190,48 +190,16 @@ l_to_i(S) ->
|
||||
end.
|
||||
|
||||
|
||||
-spec req(Type, Message) -> RequestMap
|
||||
when Type :: {sign, message | binary | bitcoin}
|
||||
| tx
|
||||
| ack
|
||||
| sign,
|
||||
Message :: binary(),
|
||||
RequestMap :: map().
|
||||
%% @doc
|
||||
%% GRIDS maps always contain the following keys:
|
||||
%% ```
|
||||
%% #{"grids" => 1,
|
||||
%% "chain" => "gajumaru",
|
||||
%% "network_id" => "groot.mainnet.gajumaru.io",
|
||||
%% "type" => "message" | "binary" | "binary" | "tx" | "ack"
|
||||
%% "public_id" => term(),
|
||||
%% "payload" => string()};
|
||||
%% '''
|
||||
|
||||
req(Type, Message) ->
|
||||
req(Type, Message, false).
|
||||
|
||||
req({sign, message}, Message, ID) ->
|
||||
req(sign, Message, ID) ->
|
||||
#{"grids" => 1,
|
||||
"chain" => "gajumaru",
|
||||
"network_id" => hz:network_id(),
|
||||
"type" => "message",
|
||||
"public_id" => ID,
|
||||
"payload" => Message};
|
||||
req({sign, binary}, Binary, ID) ->
|
||||
#{"grids" => 1,
|
||||
"chain" => "gajumaru",
|
||||
"network_id" => hz:network_id(),
|
||||
"type" => "binary",
|
||||
"public_id" => ID,
|
||||
"payload" => base64:encode(Binary)};
|
||||
req({sign, bitcoin}, Binary, ID) ->
|
||||
#{"grids" => 1,
|
||||
"chain" => "gajumaru",
|
||||
"network_id" => hz:network_id(),
|
||||
"type" => "bitcoin",
|
||||
"public_id" => ID,
|
||||
"payload" => base64:encode(Binary)};
|
||||
req(tx, Data, ID) ->
|
||||
#{"grids" => 1,
|
||||
"chain" => "gajumaru",
|
||||
@@ -245,6 +213,4 @@ req(ack, Message, ID) ->
|
||||
"network_id" => hz:network_id(),
|
||||
"type" => "ack",
|
||||
"public_id" => ID,
|
||||
"payload" => Message};
|
||||
req(sign, Message, ID) ->
|
||||
req({sign, message}, Message, ID).
|
||||
"payload" => Message}.
|
||||
|
||||
+1182
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user