@aztec/foundation 0.32.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/abi/abi.d.ts +38 -27
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +1 -1
- package/dest/abi/decoder.d.ts +3 -2
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +1 -1
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/event_selector.d.ts +1 -1
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +2 -2
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/utils.d.ts +6 -6
- package/dest/array/array.d.ts +2 -2
- package/dest/array/array.d.ts.map +1 -1
- package/dest/array/array.js +3 -3
- package/dest/aztec-address/index.d.ts +1 -1
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +1 -1
- package/dest/collection/array.d.ts +1 -1
- package/dest/collection/array.d.ts.map +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.d.ts +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.js +1 -1
- package/dest/crypto/sha256/index.d.ts +1 -1
- package/dest/crypto/sha256/index.d.ts.map +1 -1
- package/dest/crypto/sha256/index.js +1 -1
- package/dest/fields/coordinate.d.ts +1 -1
- package/dest/fields/coordinate.d.ts.map +1 -1
- package/dest/json-rpc/client/json_rpc_client.d.ts +3 -3
- package/dest/json-rpc/client/json_rpc_client.d.ts.map +1 -1
- package/dest/json-rpc/client/json_rpc_client.js +1 -1
- package/dest/json-rpc/convert.d.ts +1 -1
- package/dest/json-rpc/convert.d.ts.map +1 -1
- package/dest/json-rpc/server/json_proxy.d.ts +1 -1
- package/dest/json-rpc/server/json_proxy.d.ts.map +1 -1
- package/dest/json-rpc/server/json_proxy.js +1 -1
- package/dest/json-rpc/server/json_rpc_server.d.ts +2 -2
- package/dest/json-rpc/server/json_rpc_server.d.ts.map +1 -1
- package/dest/json-rpc/server/json_rpc_server.js +1 -1
- package/dest/log/console.d.ts +1 -1
- package/dest/log/console.d.ts.map +1 -1
- package/dest/log/debug.d.ts +1 -1
- package/dest/log/debug.d.ts.map +1 -1
- package/dest/log/logger.d.ts +1 -1
- package/dest/log/logger.d.ts.map +1 -1
- package/dest/mutex/index.d.ts +1 -1
- package/dest/mutex/index.d.ts.map +1 -1
- package/dest/serialize/buffer_reader.d.ts +1 -1
- package/dest/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/serialize/field_reader.d.ts +2 -2
- package/dest/serialize/field_reader.d.ts.map +1 -1
- package/dest/serialize/field_reader.js +1 -1
- package/dest/serialize/free_funcs.d.ts +1 -1
- package/dest/serialize/free_funcs.d.ts.map +1 -1
- package/dest/sleep/index.d.ts +2 -1
- package/dest/sleep/index.d.ts.map +1 -1
- package/dest/sleep/index.js +4 -3
- package/dest/transport/browser/message_port_socket.d.ts +1 -1
- package/dest/transport/browser/message_port_socket.d.ts.map +1 -1
- package/dest/transport/browser/shared_worker_connector.d.ts +1 -1
- package/dest/transport/browser/shared_worker_connector.d.ts.map +1 -1
- package/dest/transport/browser/shared_worker_listener.d.ts +1 -1
- package/dest/transport/browser/shared_worker_listener.d.ts.map +1 -1
- package/dest/transport/browser/worker_connector.d.ts +1 -1
- package/dest/transport/browser/worker_connector.d.ts.map +1 -1
- package/dest/transport/browser/worker_listener.d.ts +1 -1
- package/dest/transport/browser/worker_listener.d.ts.map +1 -1
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts +3 -3
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts.map +1 -1
- package/dest/transport/dispatch/create_dispatch_proxy.js +1 -1
- package/dest/transport/interface/connector.d.ts +1 -1
- package/dest/transport/interface/connector.d.ts.map +1 -1
- package/dest/transport/interface/listener.d.ts +2 -2
- package/dest/transport/interface/listener.d.ts.map +1 -1
- package/dest/transport/node/node_connector.d.ts +2 -2
- package/dest/transport/node/node_connector.d.ts.map +1 -1
- package/dest/transport/node/node_connector_socket.d.ts +2 -2
- package/dest/transport/node/node_connector_socket.d.ts.map +1 -1
- package/dest/transport/node/node_listener.d.ts +1 -1
- package/dest/transport/node/node_listener.d.ts.map +1 -1
- package/dest/transport/node/node_listener_socket.d.ts +2 -2
- package/dest/transport/node/node_listener_socket.d.ts.map +1 -1
- package/dest/transport/transport_client.d.ts +1 -1
- package/dest/transport/transport_client.d.ts.map +1 -1
- package/dest/transport/transport_client.js +1 -1
- package/dest/transport/transport_server.d.ts +1 -1
- package/dest/transport/transport_server.d.ts.map +1 -1
- package/dest/types/index.d.ts +4 -0
- package/dest/types/index.d.ts.map +1 -1
- package/dest/wasm/wasm_module.d.ts +1 -1
- package/dest/wasm/wasm_module.d.ts.map +1 -1
- package/dest/wasm/wasm_module.js +1 -1
- package/dest/worker/browser/start_web_module.d.ts +1 -1
- package/dest/worker/browser/start_web_module.d.ts.map +1 -1
- package/dest/worker/browser/start_web_module.js +1 -1
- package/dest/worker/browser/web_data_store.d.ts +1 -1
- package/dest/worker/browser/web_data_store.d.ts.map +1 -1
- package/dest/worker/browser/web_data_store.js +1 -1
- package/dest/worker/browser/web_worker.d.ts +1 -1
- package/dest/worker/browser/web_worker.d.ts.map +1 -1
- package/dest/worker/browser/web_worker.js +1 -1
- package/dest/worker/node/node_data_store.d.ts +1 -1
- package/dest/worker/node/node_data_store.d.ts.map +1 -1
- package/dest/worker/node/node_data_store.js +1 -1
- package/dest/worker/node/node_worker.d.ts +1 -1
- package/dest/worker/node/node_worker.d.ts.map +1 -1
- package/dest/worker/node/node_worker.js +1 -1
- package/dest/worker/node/start_node_module.d.ts +1 -1
- package/dest/worker/node/start_node_module.d.ts.map +1 -1
- package/dest/worker/node/start_node_module.js +1 -1
- package/dest/worker/wasm_worker.d.ts +2 -2
- package/dest/worker/wasm_worker.d.ts.map +1 -1
- package/dest/worker/worker_pool.d.ts +1 -1
- package/dest/worker/worker_pool.d.ts.map +1 -1
- package/package.json +14 -8
- package/src/abi/abi.ts +47 -28
- package/src/abi/decoder.ts +5 -4
- package/src/abi/encoder.ts +3 -3
- package/src/abi/event_selector.ts +1 -1
- package/src/abi/function_selector.ts +2 -2
- package/src/abi/utils.ts +6 -6
- package/src/array/array.ts +8 -3
- package/src/aztec-address/index.ts +1 -1
- package/src/collection/array.ts +1 -1
- package/src/crypto/pedersen/pedersen.wasm.ts +1 -1
- package/src/crypto/sha256/index.ts +1 -1
- package/src/fields/coordinate.ts +1 -1
- package/src/json-rpc/client/json_rpc_client.ts +3 -3
- package/src/json-rpc/convert.ts +1 -1
- package/src/json-rpc/server/json_proxy.ts +1 -1
- package/src/json-rpc/server/json_rpc_server.ts +2 -2
- package/src/log/console.ts +1 -1
- package/src/log/debug.ts +1 -1
- package/src/log/logger.ts +1 -1
- package/src/mutex/index.ts +1 -1
- package/src/serialize/buffer_reader.ts +1 -1
- package/src/serialize/field_reader.ts +2 -2
- package/src/serialize/free_funcs.ts +1 -1
- package/src/sleep/index.ts +3 -2
- package/src/transport/browser/message_port_socket.ts +1 -1
- package/src/transport/browser/shared_worker_connector.ts +1 -1
- package/src/transport/browser/shared_worker_listener.ts +1 -1
- package/src/transport/browser/worker_connector.ts +1 -1
- package/src/transport/browser/worker_listener.ts +1 -1
- package/src/transport/dispatch/create_dispatch_proxy.ts +3 -3
- package/src/transport/interface/connector.ts +1 -1
- package/src/transport/interface/listener.ts +2 -2
- package/src/transport/node/node_connector.ts +2 -2
- package/src/transport/node/node_connector_socket.ts +2 -2
- package/src/transport/node/node_listener.ts +1 -1
- package/src/transport/node/node_listener_socket.ts +2 -2
- package/src/transport/transport_client.ts +3 -3
- package/src/transport/transport_server.ts +3 -3
- package/src/types/index.ts +6 -0
- package/src/wasm/wasm_module.ts +1 -1
- package/src/worker/browser/start_web_module.ts +2 -2
- package/src/worker/browser/web_data_store.ts +2 -2
- package/src/worker/browser/web_worker.ts +2 -2
- package/src/worker/node/node_data_store.ts +2 -2
- package/src/worker/node/node_worker.ts +2 -2
- package/src/worker/node/start_node_module.ts +2 -2
- package/src/worker/wasm_worker.ts +2 -2
- package/src/worker/worker_pool.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web_data_store.d.ts","sourceRoot":"","sources":["../../../src/worker/browser/web_data_store.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"web_data_store.d.ts","sourceRoot":"","sources":["../../../src/worker/browser/web_data_store.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C,OAAO,CAAC,EAAE,CAAU;;IAUpB;;;;OAIG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAInD;;;;OAIG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrD"}
|
|
@@ -29,4 +29,4 @@ export class WebDataStore {
|
|
|
29
29
|
await this.db.put(key, value);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViX2RhdGFfc3RvcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvd29ya2VyL2Jyb3dzZXIvd2ViX2RhdGFfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxPQUF5QixNQUFNLFNBQVMsQ0FBQztBQUNoRCxPQUFPLE9BQU8sTUFBTSxTQUFTLENBQUM7QUFJOUI7OztHQUdHO0FBQ0gsTUFBTSxPQUFPLFlBQVk7SUFHdkI7UUFDRSx5RUFBeUU7UUFDekUsNkVBQTZFO1FBQzdFLDJFQUEyRTtRQUMzRSwyREFBMkQ7UUFDM0QsSUFBSSxDQUFDLEVBQUUsR0FBRyxPQUFPLENBQUUsT0FBZSxFQUFFLENBQUMsQ0FBQztJQUN4QyxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILEtBQUssQ0FBQyxHQUFHLENBQUMsR0FBVztRQUNuQixPQUFPLE1BQU0sSUFBSSxDQUFDLEVBQUUsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxHQUFFLENBQUMsQ0FBQyxDQUFDO0lBQ2hELENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsS0FBSyxDQUFDLEdBQUcsQ0FBQyxHQUFXLEVBQUUsS0FBYTtRQUNsQyxNQUFNLElBQUksQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUNoQyxDQUFDO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web_worker.d.ts","sourceRoot":"","sources":["../../../src/worker/browser/web_worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"web_worker.d.ts","sourceRoot":"","sources":["../../../src/worker/browser/web_worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAY5G"}
|
|
@@ -20,4 +20,4 @@ export async function createWebWorker(url, initialMem, maxMem) {
|
|
|
20
20
|
await remoteModule.init(initialMem, maxMem);
|
|
21
21
|
return remoteModule;
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViX3dvcmtlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy93b3JrZXIvYnJvd3Nlci93ZWJfd29ya2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBb0IsZUFBZSxFQUFFLGVBQWUsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ25ILE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUdqRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLENBQUMsS0FBSyxVQUFVLGVBQWUsQ0FBQyxHQUFXLEVBQUUsVUFBbUIsRUFBRSxNQUFlO0lBQ3JGLE1BQU0sTUFBTSxHQUFHLElBQUksTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQy9CLE1BQU0sZ0JBQWdCLEdBQUcsSUFBSSxlQUFlLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDckQsTUFBTSxlQUFlLEdBQUcsSUFBSSxlQUFlLENBQWMsZ0JBQWdCLENBQUMsQ0FBQztJQUMzRSxNQUFNLGVBQWUsQ0FBQyxJQUFJLEVBQUUsQ0FBQztJQUM3QixNQUFNLFlBQVksR0FBRyxtQkFBbUIsQ0FBQyxVQUFVLEVBQUUsZUFBZSxDQUFlLENBQUM7SUFDcEYsWUFBWSxDQUFDLGFBQWEsR0FBRyxLQUFLLElBQUksRUFBRTtRQUN0QyxNQUFNLGVBQWUsQ0FBQyxPQUFPLENBQUMsRUFBRSxFQUFFLEVBQUUsbUJBQW1CLEVBQUUsSUFBSSxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFDckUsZUFBZSxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzFCLENBQUMsQ0FBQztJQUNGLE1BQU0sWUFBWSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDNUMsT0FBTyxZQUFZLENBQUM7QUFDdEIsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node_data_store.d.ts","sourceRoot":"","sources":["../../../src/worker/node/node_data_store.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"node_data_store.d.ts","sourceRoot":"","sources":["../../../src/worker/node/node_data_store.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,CAAC,EAAE,CAAU;gBAGR,IAAI,CAAC,EAAE,MAAM;IAMnB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI7C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrD"}
|
|
@@ -18,4 +18,4 @@ export class NodeDataStore {
|
|
|
18
18
|
await this.db.put(key, value);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZV9kYXRhX3N0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3dvcmtlci9ub2RlL25vZGVfZGF0YV9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLFNBQVMsTUFBTSxXQUFXLENBQUM7QUFDbEMsT0FBTyxPQUF5QixNQUFNLFNBQVMsQ0FBQztBQUNoRCxPQUFPLE9BQU8sTUFBTSxTQUFTLENBQUM7QUFJOUI7O0dBRUc7QUFDSCxNQUFNLE9BQU8sYUFBYTtJQUd4QiwyQkFBMkI7SUFDM0IsWUFBWSxJQUFhO1FBQ3ZCLDRFQUE0RTtRQUM1RSwyREFBMkQ7UUFDM0QsSUFBSSxDQUFDLEVBQUUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBRSxTQUFpQixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBRSxPQUFlLEVBQUUsQ0FBQyxDQUFDO0lBQzFFLENBQUM7SUFFRCxLQUFLLENBQUMsR0FBRyxDQUFDLEdBQVc7UUFDbkIsT0FBTyxNQUFNLElBQUksQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDLEtBQUssQ0FBQyxHQUFHLEVBQUUsR0FBRSxDQUFDLENBQUMsQ0FBQztJQUNoRCxDQUFDO0lBRUQsS0FBSyxDQUFDLEdBQUcsQ0FBQyxHQUFXLEVBQUUsS0FBYTtRQUNsQyxNQUFNLElBQUksQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUNoQyxDQUFDO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node_worker.d.ts","sourceRoot":"","sources":["../../../src/worker/node/node_worker.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"node_worker.d.ts","sourceRoot":"","sources":["../../../src/worker/node/node_worker.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAYlH"}
|
|
@@ -17,4 +17,4 @@ export async function createNodeWorker(filepath, initialMem, maxMem) {
|
|
|
17
17
|
await remoteModule.init(initialMem, maxMem);
|
|
18
18
|
return remoteModule;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZV93b3JrZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvd29ya2VyL25vZGUvbm9kZV93b3JrZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRXhDLE9BQU8sRUFBb0IsYUFBYSxFQUFFLGVBQWUsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ2pILE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUd2RDs7R0FFRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsZ0JBQWdCLENBQUMsUUFBZ0IsRUFBRSxVQUFtQixFQUFFLE1BQWU7SUFDM0YsTUFBTSxNQUFNLEdBQUcsSUFBSSxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7SUFDcEMsTUFBTSxnQkFBZ0IsR0FBRyxJQUFJLGFBQWEsQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUNuRCxNQUFNLGVBQWUsR0FBRyxJQUFJLGVBQWUsQ0FBYyxnQkFBZ0IsQ0FBQyxDQUFDO0lBQzNFLE1BQU0sZUFBZSxDQUFDLElBQUksRUFBRSxDQUFDO0lBQzdCLE1BQU0sWUFBWSxHQUFHLG1CQUFtQixDQUFDLFVBQVUsRUFBRSxlQUFlLENBQWUsQ0FBQztJQUNwRixZQUFZLENBQUMsYUFBYSxHQUFHLEtBQUssSUFBSSxFQUFFO1FBQ3RDLE1BQU0sZUFBZSxDQUFDLE9BQU8sQ0FBQyxFQUFFLEVBQUUsRUFBRSxtQkFBbUIsRUFBRSxJQUFJLEVBQUUsRUFBRSxFQUFFLENBQUMsQ0FBQztRQUNyRSxlQUFlLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDMUIsQ0FBQyxDQUFDO0lBQ0YsTUFBTSxZQUFZLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxNQUFNLENBQUMsQ0FBQztJQUM1QyxPQUFPLFlBQVksQ0FBQztBQUN0QixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_node_module.d.ts","sourceRoot":"","sources":["../../../src/worker/node/start_node_module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"start_node_module.d.ts","sourceRoot":"","sources":["../../../src/worker/node/start_node_module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAM5D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,QAejD"}
|
|
@@ -23,4 +23,4 @@ export function startNodeModule(module) {
|
|
|
23
23
|
module.addLogger((...args) => transportServer.broadcast({ fn: 'emit', args: ['log', ...args] }));
|
|
24
24
|
transportServer.start();
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfbm9kZV9tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvd29ya2VyL25vZGUvc3RhcnRfbm9kZV9tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTVDLE9BQU8sRUFBb0IsWUFBWSxFQUFFLGVBQWUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRzNGLElBQUksQ0FBQyxVQUFVLEVBQUUsQ0FBQztJQUNoQixNQUFNLElBQUksS0FBSyxDQUFDLGVBQWUsQ0FBQyxDQUFDO0FBQ25DLENBQUM7QUFFRDs7O0dBR0c7QUFDSCxNQUFNLFVBQVUsZUFBZSxDQUFDLE1BQWtCO0lBQ2hELE1BQU0sUUFBUSxHQUFHLEtBQUssRUFBRSxFQUFFLEVBQUUsRUFBRSxJQUFJLEVBQWUsRUFBRSxFQUFFO1FBQ25ELElBQUksRUFBRSxLQUFLLG1CQUFtQixFQUFFLENBQUM7WUFDL0IsZUFBZSxDQUFDLElBQUksRUFBRSxDQUFDO1lBQ3ZCLE9BQU87UUFDVCxDQUFDO1FBQ0QsSUFBSSxDQUFFLE1BQWMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDO1lBQ3pCLE1BQU0sSUFBSSxLQUFLLENBQUMsdUNBQXVDLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFDL0QsQ0FBQztRQUNELE9BQU8sTUFBTyxNQUFjLENBQUMsRUFBRSxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUMsQ0FBQztJQUM1QyxDQUFDLENBQUM7SUFDRixNQUFNLGlCQUFpQixHQUFHLElBQUksWUFBWSxFQUFFLENBQUM7SUFDN0MsTUFBTSxlQUFlLEdBQUcsSUFBSSxlQUFlLENBQWMsaUJBQWlCLEVBQUUsUUFBUSxDQUFDLENBQUM7SUFDdEYsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEdBQUcsSUFBVyxFQUFFLEVBQUUsQ0FBQyxlQUFlLENBQUMsU0FBUyxDQUFDLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsQ0FBQyxLQUFLLEVBQUUsR0FBRyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN4RyxlQUFlLENBQUMsS0FBSyxFQUFFLENBQUM7QUFDMUIsQ0FBQyJ9
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Proxify } from '../transport/index.js';
|
|
2
|
-
import { WasmModule } from '../wasm/wasm_module.js';
|
|
1
|
+
import { type Proxify } from '../transport/index.js';
|
|
2
|
+
import { type WasmModule } from '../wasm/wasm_module.js';
|
|
3
3
|
/**
|
|
4
4
|
* Represents either a WASM web worker, or node.js worker.
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasm_worker.d.ts","sourceRoot":"","sources":["../../src/worker/wasm_worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"wasm_worker.d.ts","sourceRoot":"","sources":["../../src/worker/wasm_worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG;IAAE,aAAa,IAAI,IAAI,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker_pool.d.ts","sourceRoot":"","sources":["../../src/worker/worker_pool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"worker_pool.d.ts","sourceRoot":"","sources":["../../src/worker/worker_pool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,UAAU,CAAC;AACxF;;;;GAIG;AACH,qBAAa,UAAU;IAYrB;;OAEG;IACH,OAAc,SAAS,SAAQ;IAC/B;;OAEG;IACH,OAAO,CAAC,OAAO,CAAoB;IAEnC;;;;;OAKG;WACU,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM;IAM7D;;;;;OAKG;IACU,IAAI,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAuB;IAY7F;;OAEG;IACU,OAAO;CAGrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"packageManager": "yarn@3.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dest/index.js",
|
|
@@ -45,25 +45,32 @@
|
|
|
45
45
|
"build": "yarn clean && tsc -b",
|
|
46
46
|
"build:dev": "tsc -b --watch",
|
|
47
47
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
48
|
+
"generate": "true",
|
|
48
49
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
49
50
|
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
50
|
-
"test
|
|
51
|
-
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
|
|
51
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests"
|
|
52
52
|
},
|
|
53
53
|
"inherits": [
|
|
54
54
|
"../package.common.json"
|
|
55
55
|
],
|
|
56
56
|
"jest": {
|
|
57
|
-
"
|
|
57
|
+
"transform": {
|
|
58
|
+
"^.+\\.tsx?$": [
|
|
59
|
+
"@swc/jest"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
58
62
|
"moduleNameMapper": {
|
|
59
63
|
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
|
|
60
64
|
},
|
|
61
65
|
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
|
|
62
|
-
"rootDir": "./src"
|
|
66
|
+
"rootDir": "./src",
|
|
67
|
+
"extensionsToTreatAsEsm": [
|
|
68
|
+
".ts"
|
|
69
|
+
]
|
|
63
70
|
},
|
|
64
71
|
"dependencies": {
|
|
65
|
-
"@aztec/bb.js": "0.
|
|
66
|
-
"@koa/cors": "^
|
|
72
|
+
"@aztec/bb.js": "0.33.0",
|
|
73
|
+
"@koa/cors": "^5.0.0",
|
|
67
74
|
"@noble/curves": "^1.2.0",
|
|
68
75
|
"bn.js": "^5.2.1",
|
|
69
76
|
"debug": "^4.3.4",
|
|
@@ -115,7 +122,6 @@
|
|
|
115
122
|
"jest": "^29.5.0",
|
|
116
123
|
"prettier": "^2.7.1",
|
|
117
124
|
"supertest": "^6.3.3",
|
|
118
|
-
"ts-jest": "^29.1.0",
|
|
119
125
|
"ts-node": "^10.9.1",
|
|
120
126
|
"typescript": "^5.0.4"
|
|
121
127
|
},
|
package/src/abi/abi.ts
CHANGED
|
@@ -2,6 +2,44 @@ import { inflate } from 'pako';
|
|
|
2
2
|
|
|
3
3
|
import { type FunctionSelector } from './function_selector.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A basic value.
|
|
7
|
+
*/
|
|
8
|
+
export interface BasicValue<T extends string, V> {
|
|
9
|
+
/**
|
|
10
|
+
* The kind of the value.
|
|
11
|
+
*/
|
|
12
|
+
kind: T;
|
|
13
|
+
value: V;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* An exported value.
|
|
18
|
+
*/
|
|
19
|
+
export type AbiValue =
|
|
20
|
+
| BasicValue<'boolean', boolean>
|
|
21
|
+
| BasicValue<'string', string>
|
|
22
|
+
| BasicValue<'array', AbiValue[]>
|
|
23
|
+
| TupleValue
|
|
24
|
+
| IntegerValue
|
|
25
|
+
| StructValue;
|
|
26
|
+
|
|
27
|
+
export type TypedStructFieldValue<T> = { name: string; value: T };
|
|
28
|
+
|
|
29
|
+
export interface StructValue {
|
|
30
|
+
kind: 'struct';
|
|
31
|
+
fields: TypedStructFieldValue<AbiValue>[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface TupleValue {
|
|
35
|
+
kind: 'tuple';
|
|
36
|
+
fields: AbiValue[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IntegerValue extends BasicValue<'integer', string> {
|
|
40
|
+
sign: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
5
43
|
/**
|
|
6
44
|
* A named type.
|
|
7
45
|
*/
|
|
@@ -13,7 +51,7 @@ export interface ABIVariable {
|
|
|
13
51
|
/**
|
|
14
52
|
* The type of the variable.
|
|
15
53
|
*/
|
|
16
|
-
type:
|
|
54
|
+
type: AbiType;
|
|
17
55
|
}
|
|
18
56
|
|
|
19
57
|
/**
|
|
@@ -47,7 +85,7 @@ export interface BasicType<T extends string> {
|
|
|
47
85
|
/**
|
|
48
86
|
* A variable type.
|
|
49
87
|
*/
|
|
50
|
-
export type
|
|
88
|
+
export type AbiType = BasicType<'field'> | BasicType<'boolean'> | IntegerType | ArrayType | StringType | StructType;
|
|
51
89
|
|
|
52
90
|
/**
|
|
53
91
|
* An integer type.
|
|
@@ -74,7 +112,7 @@ export interface ArrayType extends BasicType<'array'> {
|
|
|
74
112
|
/**
|
|
75
113
|
* The type of the array elements.
|
|
76
114
|
*/
|
|
77
|
-
type:
|
|
115
|
+
type: AbiType;
|
|
78
116
|
}
|
|
79
117
|
|
|
80
118
|
/**
|
|
@@ -101,24 +139,6 @@ export interface StructType extends BasicType<'struct'> {
|
|
|
101
139
|
path: string;
|
|
102
140
|
}
|
|
103
141
|
|
|
104
|
-
/**
|
|
105
|
-
* A contract event.
|
|
106
|
-
*/
|
|
107
|
-
export interface EventAbi {
|
|
108
|
-
/**
|
|
109
|
-
* The event name.
|
|
110
|
-
*/
|
|
111
|
-
name: string;
|
|
112
|
-
/**
|
|
113
|
-
* Fully qualified name of the event.
|
|
114
|
-
*/
|
|
115
|
-
path: string;
|
|
116
|
-
/**
|
|
117
|
-
* The fields of the event.
|
|
118
|
-
*/
|
|
119
|
-
fields: ABIVariable[];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
142
|
/**
|
|
123
143
|
* Aztec.nr function types.
|
|
124
144
|
*/
|
|
@@ -151,15 +171,11 @@ export interface FunctionAbi {
|
|
|
151
171
|
/**
|
|
152
172
|
* The types of the return values.
|
|
153
173
|
*/
|
|
154
|
-
returnTypes:
|
|
174
|
+
returnTypes: AbiType[];
|
|
155
175
|
/**
|
|
156
176
|
* Whether the function is flagged as an initializer.
|
|
157
177
|
*/
|
|
158
178
|
isInitializer: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Transitional: whether the function is an AVM function.
|
|
161
|
-
*/
|
|
162
|
-
isTranspiled?: boolean;
|
|
163
179
|
}
|
|
164
180
|
|
|
165
181
|
/**
|
|
@@ -260,9 +276,12 @@ export interface ContractArtifact {
|
|
|
260
276
|
*/
|
|
261
277
|
functions: FunctionArtifact[];
|
|
262
278
|
/**
|
|
263
|
-
* The
|
|
279
|
+
* The outputs of the contract.
|
|
264
280
|
*/
|
|
265
|
-
|
|
281
|
+
outputs: {
|
|
282
|
+
structs: Record<string, AbiType[]>;
|
|
283
|
+
globals: Record<string, AbiValue[]>;
|
|
284
|
+
};
|
|
266
285
|
|
|
267
286
|
/**
|
|
268
287
|
* The map of file ID to the source code and path of the file.
|
package/src/abi/decoder.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
2
|
-
import { Fr } from '../fields/index.js';
|
|
3
|
-
import { ABIParameter, type
|
|
2
|
+
import { type Fr } from '../fields/index.js';
|
|
3
|
+
import { type ABIParameter, type ABIVariable, type AbiType, type FunctionArtifact } from './abi.js';
|
|
4
4
|
import { isAztecAddressStruct } from './utils.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The type of our decoded ABI.
|
|
8
8
|
*/
|
|
9
9
|
export type DecodedReturn = bigint | boolean | AztecAddress | DecodedReturn[] | { [key: string]: DecodedReturn };
|
|
10
|
+
export type ProcessReturnValues = (DecodedReturn | undefined)[] | undefined;
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Decodes return values from a function call.
|
|
@@ -20,7 +21,7 @@ class ReturnValuesDecoder {
|
|
|
20
21
|
* @param abiType - The type of the return value.
|
|
21
22
|
* @returns The decoded return value.
|
|
22
23
|
*/
|
|
23
|
-
private decodeReturn(abiType:
|
|
24
|
+
private decodeReturn(abiType: AbiType): DecodedReturn {
|
|
24
25
|
switch (abiType.kind) {
|
|
25
26
|
case 'field':
|
|
26
27
|
return this.getNextField().toBigInt();
|
|
@@ -114,7 +115,7 @@ export class FunctionSignatureDecoder {
|
|
|
114
115
|
* @param param - The parameter type to decode.
|
|
115
116
|
* @returns A string representing the parameter type.
|
|
116
117
|
*/
|
|
117
|
-
private getParameterType(param:
|
|
118
|
+
private getParameterType(param: AbiType): string {
|
|
118
119
|
switch (param.kind) {
|
|
119
120
|
case 'field':
|
|
120
121
|
return 'Field';
|
package/src/abi/encoder.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fr } from '../fields/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { type AbiType, type FunctionAbi } from './abi.js';
|
|
3
3
|
import { isAddressStruct, isFunctionSelectorStruct, isWrappedFieldStruct } from './utils.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -11,7 +11,7 @@ class ArgumentEncoder {
|
|
|
11
11
|
|
|
12
12
|
constructor(private abi: FunctionAbi, private args: any[]) {}
|
|
13
13
|
|
|
14
|
-
static typeSize(abiType:
|
|
14
|
+
static typeSize(abiType: AbiType): number {
|
|
15
15
|
switch (abiType.kind) {
|
|
16
16
|
case 'field':
|
|
17
17
|
case 'boolean':
|
|
@@ -36,7 +36,7 @@ class ArgumentEncoder {
|
|
|
36
36
|
* @param arg - The value to encode.
|
|
37
37
|
* @param name - Name.
|
|
38
38
|
*/
|
|
39
|
-
private encodeArgument(abiType:
|
|
39
|
+
private encodeArgument(abiType: AbiType, arg: any, name?: string) {
|
|
40
40
|
if (arg === undefined || arg == null) {
|
|
41
41
|
throw new Error(`Undefined argument ${name ?? 'unnamed'} of type ${abiType.kind}`);
|
|
42
42
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fromHex, toBigIntBE } from '../bigint-buffer/index.js';
|
|
2
2
|
import { keccak, randomBytes } from '../crypto/index.js';
|
|
3
|
-
import { Fr } from '../fields/fields.js';
|
|
3
|
+
import { type Fr } from '../fields/fields.js';
|
|
4
4
|
import { BufferReader } from '../serialize/buffer_reader.js';
|
|
5
5
|
import { Selector } from './selector.js';
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fromHex, toBigIntBE } from '../bigint-buffer/index.js';
|
|
2
2
|
import { keccak, randomBytes } from '../crypto/index.js';
|
|
3
|
-
import { Fr } from '../fields/fields.js';
|
|
3
|
+
import { type Fr } from '../fields/fields.js';
|
|
4
4
|
import { BufferReader } from '../serialize/buffer_reader.js';
|
|
5
5
|
import { FieldReader } from '../serialize/field_reader.js';
|
|
6
|
-
import { ABIParameter } from './abi.js';
|
|
6
|
+
import { type ABIParameter } from './abi.js';
|
|
7
7
|
import { decodeFunctionSignature } from './decoder.js';
|
|
8
8
|
import { Selector } from './selector.js';
|
|
9
9
|
|
package/src/abi/utils.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AbiType } from './abi.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Returns whether the ABI type is an Aztec or Ethereum Address defined in Aztec.nr.
|
|
5
5
|
* @param abiType - Type to check.
|
|
6
6
|
* @returns Boolean.
|
|
7
7
|
*/
|
|
8
|
-
export function isAddressStruct(abiType:
|
|
8
|
+
export function isAddressStruct(abiType: AbiType) {
|
|
9
9
|
return isEthAddressStruct(abiType) || isAztecAddressStruct(abiType);
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ export function isAddressStruct(abiType: ABIType) {
|
|
|
14
14
|
* @param abiType - Type to check.
|
|
15
15
|
* @returns Boolean.
|
|
16
16
|
*/
|
|
17
|
-
export function isEthAddressStruct(abiType:
|
|
17
|
+
export function isEthAddressStruct(abiType: AbiType) {
|
|
18
18
|
return abiType.kind === 'struct' && abiType.path.endsWith('address::EthAddress');
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ export function isEthAddressStruct(abiType: ABIType) {
|
|
|
23
23
|
* @param abiType - Type to check.
|
|
24
24
|
* @returns Boolean.
|
|
25
25
|
*/
|
|
26
|
-
export function isAztecAddressStruct(abiType:
|
|
26
|
+
export function isAztecAddressStruct(abiType: AbiType) {
|
|
27
27
|
return abiType.kind === 'struct' && abiType.path.endsWith('address::AztecAddress');
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -32,7 +32,7 @@ export function isAztecAddressStruct(abiType: ABIType) {
|
|
|
32
32
|
* @param abiType - Type to check.
|
|
33
33
|
* @returns Boolean.
|
|
34
34
|
*/
|
|
35
|
-
export function isFunctionSelectorStruct(abiType:
|
|
35
|
+
export function isFunctionSelectorStruct(abiType: AbiType) {
|
|
36
36
|
return abiType.kind === 'struct' && abiType.path.endsWith('types::abis::function_selector::FunctionSelector');
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ export function isFunctionSelectorStruct(abiType: ABIType) {
|
|
|
40
40
|
* Returns whether the ABI type is a struct with a single `inner` field.
|
|
41
41
|
* @param abiType - Type to check.
|
|
42
42
|
*/
|
|
43
|
-
export function isWrappedFieldStruct(abiType:
|
|
43
|
+
export function isWrappedFieldStruct(abiType: AbiType) {
|
|
44
44
|
return (
|
|
45
45
|
abiType.kind === 'struct' &&
|
|
46
46
|
abiType.fields.length === 1 &&
|
package/src/array/array.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tuple } from '../serialize/index.js';
|
|
1
|
+
import { type Tuple } from '../serialize/index.js';
|
|
2
2
|
|
|
3
3
|
export type { FieldsOf } from '../types/index.js';
|
|
4
4
|
|
|
@@ -34,8 +34,13 @@ export function makeTuple<T, N extends number>(length: N, fn: (i: number) => T,
|
|
|
34
34
|
* @param fn - The generator function.
|
|
35
35
|
* @returns The array of numbers.
|
|
36
36
|
*/
|
|
37
|
-
export function makeHalfFullTuple<T, N extends number>(
|
|
38
|
-
|
|
37
|
+
export function makeHalfFullTuple<T, N extends number>(
|
|
38
|
+
length: N,
|
|
39
|
+
fn: (i: number) => T,
|
|
40
|
+
offset = 0,
|
|
41
|
+
makeEmpty: () => T,
|
|
42
|
+
) {
|
|
43
|
+
return Array.from({ length }, (v: any, i: number) => (i < length / 2 ? fn(i + offset) : makeEmpty())) as Tuple<T, N>;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inspect } from 'util';
|
|
2
2
|
|
|
3
3
|
import { Fr, fromBuffer } from '../fields/index.js';
|
|
4
|
-
import { BufferReader, FieldReader } from '../serialize/index.js';
|
|
4
|
+
import { type BufferReader, FieldReader } from '../serialize/index.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* AztecAddress represents a 32-byte address in the Aztec Protocol.
|
package/src/collection/array.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Tuple } from '../serialize/types.js';
|
|
1
|
+
import { type Tuple } from '../serialize/types.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pads an array to the target length by appending an element to its end. Throws if target length exceeds the input array length. Does not modify the input array.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BarretenbergSync, Fr as FrBarretenberg } from '@aztec/bb.js';
|
|
2
2
|
|
|
3
3
|
import { Fr } from '../../fields/fields.js';
|
|
4
|
-
import { Bufferable, serializeToBufferArray } from '../../serialize/serialize.js';
|
|
4
|
+
import { type Bufferable, serializeToBufferArray } from '../../serialize/serialize.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Create a pedersen commitment (point) from an array of input fields.
|
|
@@ -2,7 +2,7 @@ import { default as hash } from 'hash.js';
|
|
|
2
2
|
|
|
3
3
|
import { Fr } from '../../fields/fields.js';
|
|
4
4
|
import { truncateAndPad } from '../../serialize/free_funcs.js';
|
|
5
|
-
import { Bufferable, serializeToBuffer } from '../../serialize/serialize.js';
|
|
5
|
+
import { type Bufferable, serializeToBuffer } from '../../serialize/serialize.js';
|
|
6
6
|
|
|
7
7
|
export const sha256 = (data: Buffer) => Buffer.from(hash.sha256().update(data).digest());
|
|
8
8
|
|
package/src/fields/coordinate.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// Dev dependency just for the somewhat complex RemoteObject type
|
|
3
3
|
// This takes a {foo(): T} and makes {foo(): Promise<T>}
|
|
4
4
|
// while avoiding Promise of Promise.
|
|
5
|
-
import { RemoteObject } from 'comlink';
|
|
5
|
+
import { type RemoteObject } from 'comlink';
|
|
6
6
|
import { format } from 'util';
|
|
7
7
|
|
|
8
|
-
import { DebugLogger, createDebugLogger } from '../../log/index.js';
|
|
8
|
+
import { type DebugLogger, createDebugLogger } from '../../log/index.js';
|
|
9
9
|
import { NoRetryError, makeBackoff, retry } from '../../retry/index.js';
|
|
10
|
-
import { ClassConverter, JsonClassConverterInput, StringClassConverterInput } from '../class_converter.js';
|
|
10
|
+
import { ClassConverter, type JsonClassConverterInput, type StringClassConverterInput } from '../class_converter.js';
|
|
11
11
|
import { JsonStringify, convertFromJsonObj, convertToJsonObj } from '../convert.js';
|
|
12
12
|
|
|
13
13
|
export { JsonStringify } from '../convert.js';
|
package/src/json-rpc/convert.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import cloneDeepWith from 'lodash.clonedeepwith';
|
|
3
3
|
|
|
4
|
-
import { ClassConverter } from './class_converter.js';
|
|
4
|
+
import { type ClassConverter } from './class_converter.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Check prototype chain to determine if an object is 'plain' (not a class instance).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { format } from 'util';
|
|
2
2
|
|
|
3
3
|
import { createDebugLogger } from '../../log/index.js';
|
|
4
|
-
import { ClassConverter, JsonClassConverterInput, StringClassConverterInput } from '../class_converter.js';
|
|
4
|
+
import { ClassConverter, type JsonClassConverterInput, type StringClassConverterInput } from '../class_converter.js';
|
|
5
5
|
import { convertFromJsonObj, convertToJsonObj } from '../convert.js';
|
|
6
6
|
import { assert, hasOwnProperty } from '../js_utils.js';
|
|
7
7
|
|
|
@@ -6,9 +6,9 @@ import compress from 'koa-compress';
|
|
|
6
6
|
import Router from 'koa-router';
|
|
7
7
|
|
|
8
8
|
import { createDebugLogger } from '../../log/index.js';
|
|
9
|
-
import { JsonClassConverterInput, StringClassConverterInput } from '../class_converter.js';
|
|
9
|
+
import { type JsonClassConverterInput, type StringClassConverterInput } from '../class_converter.js';
|
|
10
10
|
import { convertBigintsInObj } from '../convert.js';
|
|
11
|
-
import { ClassMaps, JsonProxy } from './json_proxy.js';
|
|
11
|
+
import { type ClassMaps, JsonProxy } from './json_proxy.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* JsonRpcServer.
|
package/src/log/console.ts
CHANGED
package/src/log/debug.ts
CHANGED
package/src/log/logger.ts
CHANGED
|
@@ -2,7 +2,7 @@ import debug from 'debug';
|
|
|
2
2
|
import isNode from 'detect-node';
|
|
3
3
|
import { isatty } from 'tty';
|
|
4
4
|
|
|
5
|
-
import { LogData, LogFn } from './log_fn.js';
|
|
5
|
+
import { type LogData, type LogFn } from './log_fn.js';
|
|
6
6
|
|
|
7
7
|
// Matches a subset of Winston log levels
|
|
8
8
|
const LogLevels = ['silent', 'error', 'warn', 'info', 'verbose', 'debug', 'trace'] as const;
|
package/src/mutex/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Fq, Fr } from '../fields/fields.js';
|
|
2
|
-
import { Tuple } from './types.js';
|
|
1
|
+
import { Fq, type Fr } from '../fields/fields.js';
|
|
2
|
+
import { type Tuple } from './types.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The FieldReader class provides a utility for reading various data types from a field array.
|