[wip] updating sidekick

This commit is contained in:
2023-07-19 00:38:03 -06:00
parent 373d43dd8c
commit 50cac48f99
5 changed files with 220 additions and 24 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{type, library}. {type, library}.
{realm, local}. {realm, local}.
{name, awcp}. {name, awcp}.
{version, "0.2.1"}. {version, "0.2.2"}.
{deps, []}. {deps, []}.
+148 -7
View File
@@ -257,13 +257,13 @@ export {
RpcResp_W2A_address_subscribe, RpcResp_W2A_address_subscribe,
EventData_A2W_address_subscribe, EventData_A2W_address_subscribe,
EventData_W2A_address_subscribe, EventData_W2A_address_subscribe,
//// transaction.sign (propagate) // transaction.sign (propagate)
//Params_A2W_tx_sign_yesprop, Params_A2W_tx_sign_yesprop,
//Result_W2A_tx_sign_yesprop, Result_W2A_tx_sign_yesprop,
//RpcCall_A2W_tx_sign_yesprop, RpcCall_A2W_tx_sign_yesprop,
//RpcResp_W2A_tx_sign_yesprop, RpcResp_W2A_tx_sign_yesprop,
//EventData_A2W_tx_sign_yesprop, EventData_A2W_tx_sign_yesprop,
//EventData_W2A_tx_sign_yesprop, EventData_W2A_tx_sign_yesprop,
// transaction.sign (do not propagate) // transaction.sign (do not propagate)
Params_A2W_tx_sign_noprop, Params_A2W_tx_sign_noprop,
Result_W2A_tx_sign_noprop, Result_W2A_tx_sign_noprop,
@@ -1110,6 +1110,147 @@ type EventData_W2A_address_subscribe
//----------------------------------------------------------------------------
// transaction.sign (do propagate)
//----------------------------------------------------------------------------
/**
* Parameters for "transaction.sign" (do propagate)
*
* If `returnSigned` is `false`, then Superhero will propagate the transaction.
*
* (layer 4)
*
* @example
* ```json
* {
* "tx": "tx_+FgMAaEBuzbuuWjOzR7ecjOY8+u7HdNk0KoxTQcCDerZELEQ+UShAXtm5sMFBwg25Ol5IFI9w+pZy7/YbFi6BwPqi80KuKdsCoYPJvVhyAAAAYdoYWluYW5h9uAnNQ==",
* "returnSigned": false,
* "networkId": "ae_uat"
* }
* ```
*/
type Params_A2W_tx_sign_yesprop
= {tx : string,
returnSigned : false,
networkId : string}
/**
* Success result type for "transaction.sign" (do propagate)
*
* (layer 4)
*
* @example
* {
* "signedTransaction": "tx_+KILAfhCuEDxWnvffMvyrkFWnrImYej38rh99vM9f6pORl/yWTvU97nvUcY8/ck8lgtPA8w5odGSDb9LGY/JSZXsmsXhgKkHuFr4WAwBoQG7Nu65aM7NHt5yM5jz67sd02TQqjFNBwIN6tkQsRD5RKEBe2bmwwUHCDbk6XkgUj3D6lnLv9hsWLoHA+qLzQq4p2wKhg8m9WHIAAABh2hhaW5hbmF7X54G"
* }
*/
type Result_W2A_tx_sign_yesprop
= {signedTransaction : string};
/**
* Request type for "transaction.sign" (do propagate)
*
* (layer 3)
*
* @example
* ```json
* {
* "jsonrpc": "2.0",
* "id": "sk-tx-sign-1",
* "method": "transaction.sign",
* "params": {
* "tx": "tx_+FgMAaEBuzbuuWjOzR7ecjOY8+u7HdNk0KoxTQcCDerZELEQ+UShAXtm5sMFBwg25Ol5IFI9w+pZy7/YbFi6BwPqi80KuKdsCoYPJvVhyAAAAYdoYWluYW5h9uAnNQ==",
* "returnSigned": true,
* "networkId": "ae_uat"
* }
* }
* ```
*/
type RpcCall_A2W_tx_sign_yesprop
= RpcCall<"transaction.sign",
Params_A2W_tx_sign_yesprop>;
/**
* Response type for "transaction.sign" (do propagate)
*
* (layer 3)
*
* @example
* ```json
* {
* "jsonrpc": "2.0",
* "id": "sk-tx-sign-1",
* "method": "transaction.sign",
* "result": {
* "signedTransaction": "tx_+KILAfhCuEDxWnvffMvyrkFWnrImYej38rh99vM9f6pORl/yWTvU97nvUcY8/ck8lgtPA8w5odGSDb9LGY/JSZXsmsXhgKkHuFr4WAwBoQG7Nu65aM7NHt5yM5jz67sd02TQqjFNBwIN6tkQsRD5RKEBe2bmwwUHCDbk6XkgUj3D6lnLv9hsWLoHA+qLzQq4p2wKhg8m9WHIAAABh2hhaW5hbmF7X54G"
* }
* }
* ```
*/
type RpcResp_W2A_tx_sign_yesprop
= RpcResp<"transaction.sign",
Result_W2A_tx_sign_yesprop>;
/**
* Event data for aepp-to-waellet "transaction.sign" (do propagate) message
*
* (layer 2)
*
* @example
* ```json
* {
* "type": "to_waellet",
* "data": {
* "jsonrpc": "2.0",
* "id": "sk-tx-sign-1",
* "method": "transaction.sign",
* "params": {
* "tx": "tx_+FgMAaEBuzbuuWjOzR7ecjOY8+u7HdNk0KoxTQcCDerZELEQ+UShAXtm5sMFBwg25Ol5IFI9w+pZy7/YbFi6BwPqi80KuKdsCoYPJvVhyAAAAYdoYWluYW5h9uAnNQ==",
* "returnSigned": false,
* "networkId": "ae_uat"
* }
* }
* }
* ```
*/
type EventData_A2W_tx_sign_yesprop
= EventData_A2W<RpcCall_A2W_tx_sign_yesprop>;
/**
* Event data for waellet-to-aepp "transaction.sign" (do propagate) response
*
* (layer 2)
*
* @example
* ```json
* {
* "type": "to_aepp",
* "data": {
* "jsonrpc": "2.0",
* "id": "sk-tx-sign-1",
* "method": "transaction.sign",
* "result": {
* "signedTransaction": "tx_+KILAfhCuEDxWnvffMvyrkFWnrImYej38rh99vM9f6pORl/yWTvU97nvUcY8/ck8lgtPA8w5odGSDb9LGY/JSZXsmsXhgKkHuFr4WAwBoQG7Nu65aM7NHt5yM5jz67sd02TQqjFNBwIN6tkQsRD5RKEBe2bmwwUHCDbk6XkgUj3D6lnLv9hsWLoHA+qLzQq4p2wKhg8m9WHIAAABh2hhaW5hbmF7X54G"
* }
* }
* }
* ```
*/
type EventData_W2A_tx_sign_yesprop
= EventData_W2A<RpcResp_W2A_tx_sign_yesprop>;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// transaction.sign (do not propagate) // transaction.sign (do not propagate)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
+2 -2
View File
@@ -1,5 +1,5 @@
{type, library}. {type, library}.
{realm, local}. {realm, local}.
{name, sidekick}. {name, sidekick}.
{version, "0.2.1"}. {version, "0.2.2"}.
{deps, ["local-awcp-0.2.1"]}. {deps, ["local-awcp-0.2.2"]}.
+38 -2
View File
@@ -92,7 +92,7 @@ export {
// IMPORTS // IMPORTS
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
import * as awcp from './jex_include/local-awcp-0.2.1/dist/awcp.js'; import * as awcp from './jex_include/local-awcp-0.2.2/dist/awcp.js';
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -1038,8 +1038,44 @@ msg_sign
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// API: tx sign (no prop) // API: tx sign (do prop)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/**
* Ask the wallet to sign the transaction and propagate it into the network
*/
async function
tx_sign_yesprop
(id : number | string,
params : awcp.Params_A2W_tx_sign_yesprop,
timeout_ms : number,
timeout_msg : string,
logger : Logger)
: Promise<Safe<awcp.Result_W2A_tx_sign_yesprop, awcp.RpcError | SkTimeoutError>>
{
logger.debug('address', {id:id, params:params, timeout_ms:timeout_ms, timeout_msg:timeout_msg});
let msgr = new MsgR(logger);
// FIXME: for type purposes, making the correct RPC message should be up here
// this way we can enforce that it's a correct RPC call with typescript
// Ideal:
// let result = await msgr.send_raseev(id, awcp.METHOD_CONNECTION_OPEN, params, target, timeout_ms, timeout_msg);
let result =
await msgr.send_raseev
<"transaction.sign", awcp.Params_A2W_tx_sign_yesprop, awcp.Result_W2A_tx_sign_yesprop>
(id, "transaction.sign", params, timeout_ms, timeout_msg);
return result;
}
//-----------------------------------------------------------------------------
// API: tx sign (do not propagate transaction)
//-----------------------------------------------------------------------------
/**
* Ask the wallet to sign the transaction but do not propagate the transaction,
* instead just return the signed data
*/
async function async function
tx_sign_noprop tx_sign_noprop
(id : number | string, (id : number | string,
+31 -12
View File
@@ -95,12 +95,14 @@
TypeScript stuff (hurray).</p> TypeScript stuff (hurray).</p>
<p>Vanillae started as our own internal toolset that we developed in the <p>Vanillae started as our own internal toolset that we developed in the
process of making <a href="https://aegora.jp/">Aegora.jp</a>. In process of making <a href="https://aegora.jp/">Aegora.jp</a>. Aegora is a
particular, Craig developed Vanillae.erl because talking to the blockchain normal, vanilla, e-commerce site. We just happen to use Æternity as the
was needlessly annoying, and Peter developed Sidekick because the Æternity payment backend. In particular, Craig developed Vanillae.erl because
JavaScript SDK was (is) impossible to use. We then open-sourced our talking to the blockchain from the server backend was needlessly annoying,
tooling, and the Æternity Foundation decided to pay us to continue to and Peter developed Sidekick because the Æternity JavaScript SDK was (is)
develop it and expand it.</p> impossible to use. We then open-sourced our "talk to Æternity" tooling,
and the Æternity Foundation decided to pay us to continue to develop it and
expand it.</p>
<p>Aegora is the first normal e-commerce platform that utilizes any form of <p>Aegora is the first normal e-commerce platform that utilizes any form of
cryptocurrency. We would like if Aegora made us billionaires, but really cryptocurrency. We would like if Aegora made us billionaires, but really
@@ -120,17 +122,34 @@
<p>Our hypothesis is that most cryptocurrencies (i.e. every coin except <p>Our hypothesis is that most cryptocurrencies (i.e. every coin except
Æternity) are technically deficient to the point that they are totally Æternity) are technically deficient to the point that they are totally
useless in the space of Things That Actually Have To Work (i.e. useless in The Space Of Things That Actually Have To Work (e.g.
business).</p> non-scam commerce). To test this hypothesis, our goal is to make Æternity
easily usable and see if people start using it in The Space Of Things That
Actually Have To Work.</p>
<p>As of July 2023, Æternity is still in the same usability class as Arch
Linux. Our goal with this project to get to like Debian.<p>
<p>From our personal experience building Aegora, <i>once you understand how
to use it</i>, Æternity is <b><i>by far</i></b> the easiest electronic
payment system to use in a commercial application. It is the genuine
manifestation of Satoshi's dream.</p>
</div> </div>
<div class="section yellowish" id="s-vanillae-erl"> <div class="section yellowish" id="s-vanillae-erl">
<h2>4. Vanillae.erl</h2> <h2>4. Vanillae.erl</h2>
<p> <p>This is an Erlang application that smooths over the rough edges
This is an Erlang application that smooths over the rough edges involved in talking to Æternity nodes from an Erlang program.</p>
involved in talking to Æternity nodes.
</p> <p>Vanillae.erl is also a standard that is meant to be mimicked in other
languages. The idea is to have a "library" (Erlangers: it's an Erlang
application) of Erlang function calls that return natural Erlang data
structures. The API is designed in such a way that the API should
generalize to other languages. We would like there to be a Vanillae.py for
instance (Python 2 of course), which would maybe require startup or
something, maybe the natural idiom would be whatever you do to make `with`
syntax work, whatever. The point is, there should be a
</div> </div>
<div class="section skyish" id="s-sidekick"> <div class="section skyish" id="s-sidekick">