diff --git a/Cargo.lock b/Cargo.lock index 81dc51084..3b61be8e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ dependencies = [ [[package]] name = "aleo" -version = "0.5.1" +version = "0.5.5" dependencies = [ "aleo-rust", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index eb288c8fd..71e401f0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleo" -version = "0.5.1" +version = "0.5.5" authors = [ "The Aleo Team " ] description = "Aleo" homepage = "https://aleo.org" diff --git a/sdk/README.md b/sdk/README.md index 5d04af2da..6ea169569 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -10,28 +10,31 @@ and node.js. Aleo provides the ability to run programs in zero knowledge. The Aleo SDK provides the tools to use these programs within the browser and all other levels of the web stack to build privacy protecting applications. -The Aleo SDK provides: -* Tools for executing, deploying, and interacting with Aleo programs in the browser -* Management of program state and data -* Aleo account creation and Aleo account data management -* Communication with the Aleo network +What the Aleo SDK provides (Click to see examples): +* [Tools for executing, deploying, and interacting with Aleo programs in the browser](https://aleo.tools/develop) +* [Aleo account creation and Aleo account data management](https://aleo.tools/account) +* [Management of program state and data](https://aleo.tools/record) +* [Communication with the Aleo network](https://aleo.tools/rest) This package is published at [**@aleohq/sdk**](https://www.npmjs.com/package/@aleohq/sdk) and makes use of [**@aleohq/wasm**](https://www.npmjs.com/package/@aleohq/wasm) under the hood. ## Build Guide -1. To build the project, go to the project's root and execute `npm install && npm run build`. +To build the project from source, go to the project's root and execute `npm install && npm run build`. ## Documentation -1. To view the documentation, open `docs/index.html`. -2. To regenerate the documentation, run `npx jsdoc --configure jsdoc.json --verbose` +API documentation for this package can be found on the [Aleo Developer Hub](https://developer.aleo.org/sdk/typescript/overview). -## Aleo Tools +To view the documentation locally, open `docs/index.html`. To regenerate the documentation, run `npx jsdoc --configure jsdoc.json --verbose` -[Aleo SDK account generator](https://aleohq.github.io/aleo/) +## Usage -[Aleo Home](https://www.aleo.org/) +This SDK is used to power [Aleo.tools](https://aleo.tools/develop). Aleo.tools is open source and can be used as a +reference for how to use the SDK to build your own zero knowledge web app. -You can visit the [SnarkVM repo](https://github.com/AleoHQ/snarkVM) and [SnarkOS repo](https://github.com/AleoHQ/snarkOS) to go deep into the code of aleo infrastructure +Sources can be found here: https://github.com/AleoHQ/sdk/tree/testnet3/website + +You can visit the [SnarkVM repo](https://github.com/AleoHQ/snarkVM) and [SnarkOS repo](https://github.com/AleoHQ/snarkOS) +if you're interested in learning more about the architecture that powers the Aleo SDK. diff --git a/sdk/src/function-key-provider.d.ts b/sdk/src/function-key-provider.d.ts index 8dbad2fb0..4cd1664fb 100644 --- a/sdk/src/function-key-provider.d.ts +++ b/sdk/src/function-key-provider.d.ts @@ -1,6 +1,11 @@ import { ProvingKey, VerifyingKey } from "."; type FunctionKeyPair = [ProvingKey, VerifyingKey]; type CachedKeyPair = [Uint8Array, Uint8Array]; +type AleoKeyProviderInitParams = { + proverUri?: string; + verifierUri?: string; + cacheKey?: string; +}; /** * Interface for record search parameters. This allows for arbitrary search parameters to be passed to record provider * implementations. @@ -272,4 +277,4 @@ declare class AleoKeyProvider implements FunctionKeyProvider { */ feeKeys(): Promise; } -export { AleoKeyProvider, AleoKeyProviderParams, CachedKeyPair, FunctionKeyPair, FunctionKeyProvider, KeySearchParams }; +export { AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, CachedKeyPair, FunctionKeyPair, FunctionKeyProvider, KeySearchParams }; diff --git a/sdk/src/function-key-provider.js.map b/sdk/src/function-key-provider.js.map index 3bc47d70d..08ec9b39c 100644 --- a/sdk/src/function-key-provider.js.map +++ b/sdk/src/function-key-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"function-key-provider.js","sourceRoot":"","sources":["function-key-provider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAC,MAAM,GAAG,CAAC;AAC7E,OAAO,KAAK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C,CAAC;gBAClJ,KAAK,mBAAmB,IAAI,4BAA4B,IAAI,iBAAiB,IAAI,yBAAyB;oBACtG,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;gBAClJ;oBACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;aAClD;QACL,CAAC;KAAA;IAED;;;;OAIG;IACG,QAAQ;;YACV,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtG,CAAC;KAAA;IAED;;;;SAIK;IACC,SAAS;;YACX,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxG,CAAC;KAAA;IAED;;;;OAIG;IACG,OAAO;;YACT,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpG,CAAC;KAAA;CACJ;AAED,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAuE,CAAA"} \ No newline at end of file +{"version":3,"file":"function-key-provider.js","sourceRoot":"","sources":["function-key-provider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAC,MAAM,GAAG,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B;;;GAGG;AACH,MAAM,qBAAqB;IAKvB;;;;;;;OAOG;IACH,YAAY,MAAqE;QAC7E,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WA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,CAAC,CAAC;gBAClJ;oBACI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;aAClD;QACL,CAAC;KAAA;IAED;;;;OAIG;IACG,QAAQ;;YACV,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtG,CAAC;KAAA;IAED;;;;SAIK;IACC,SAAS;;YACX,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxG,CAAC;KAAA;IAED;;;;OAIG;IACG,OAAO;;YACT,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpG,CAAC;KAAA;CACJ;AAED,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAkG,CAAA"} \ No newline at end of file diff --git a/sdk/src/index.d.ts b/sdk/src/index.d.ts index 62b7ebb42..c96447bb1 100644 --- a/sdk/src/index.d.ts +++ b/sdk/src/index.d.ts @@ -39,11 +39,13 @@ import { Output } from "./models/output"; import { Transaction } from "./models/transaction"; import { Transition } from "./models/transition"; import { DevServerClient } from "./dev-server-client"; -import { AleoKeyProvider, AleoKeyProviderParams, CachedKeyPair, FunctionKeyPair, FunctionKeyProvider, KeySearchParams } from "./function-key-provider"; +import { AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, FunctionKeyPair, FunctionKeyProvider, KeySearchParams } from "./function-key-provider"; import { BlockHeightSearch, NetworkRecordProvider, RecordProvider, RecordSearchParams } from "./record-provider"; +import { ProgramManager } from "./program-manager"; /** * Initialize Aleo WebAssembly into the browser. The SDK requires its Wasm Instance to be initialized before operating * so this function must be called before any other SDK functions are called. */ -import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey } from '@aleohq/nodejs'; -export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, Block, BlockHeightSearch, CachedKeyPair, DevServerClient, Execution, ExecutionResponse, FunctionKeyPair, FunctionKeyProvider, Input, KeySearchParams, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports, ProvingKey, Output, RecordCiphertext, RecordPlaintext, RecordProvider, RecordSearchParams, Signature, Transaction, Transition, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, logAndThrow }; +declare function initializeWasm(): Promise; +import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, ProgramManager as ProgramManagerBase, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey, initThreadPool } from '@aleohq/wasm'; +export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, Block, BlockHeightSearch, DevServerClient, Execution, ExecutionResponse, FunctionKeyPair, FunctionKeyProvider, Input, KeySearchParams, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports, ProgramManager, ProgramManagerBase, ProvingKey, Output, RecordCiphertext, RecordPlaintext, RecordProvider, RecordSearchParams, Signature, Transaction, Transition, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, initThreadPool, initializeWasm, logAndThrow }; diff --git a/sdk/src/index.js b/sdk/src/index.js index de036dcd0..a74445ed6 100644 --- a/sdk/src/index.js +++ b/sdk/src/index.js @@ -1,3 +1,4 @@ +import { __awaiter } from "tslib"; const KEY_STORE = "https://testnet3.parameters.aleo.org/"; const CREDITS_PROGRAM_KEYS = { transfer_private: { prover: KEY_STORE + "transfer_private.prover.2a9a6f2", verifier: KEY_STORE + "transfer_private.verifier.3a59762" }, @@ -18,18 +19,20 @@ import { DevServerClient } from "./dev-server-client"; import { AleoKeyProvider, AleoKeyProviderParams } from "./function-key-provider"; import { BlockHeightSearch, NetworkRecordProvider } from "./record-provider"; // If using the SDK in a browser context, uncomment these lines -// import { ProgramManager } from "./program-manager"; -//import init from '@aleohq/wasm'; +import { ProgramManager } from "./program-manager"; +import init from '@aleohq/wasm'; /** * Initialize Aleo WebAssembly into the browser. The SDK requires its Wasm Instance to be initialized before operating * so this function must be called before any other SDK functions are called. */ -// async function initializeWasm() { -// return await init(); -// } -// import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, ProgramManager as ProgramManagerBase, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey, initThreadPool } from '@aleohq/wasm'; -// export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, Block, BlockHeightSearch, DevServerClient, Execution, ExecutionResponse, FunctionKeyPair, FunctionKeyProvider, Input, KeySearchParams, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports, ProgramManager, ProgramManagerBase, ProvingKey, Output, RecordCiphertext, RecordPlaintext, RecordProvider, RecordSearchParams, Signature, Transaction, Transition, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, initThreadPool, initializeWasm, logAndThrow}; +function initializeWasm() { + return __awaiter(this, void 0, void 0, function* () { + return yield init(); + }); +} +import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, ProgramManager as ProgramManagerBase, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey, initThreadPool } from '@aleohq/wasm'; +export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, DevServerClient, ExecutionResponse, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProgramManager, ProgramManagerBase, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, initThreadPool, initializeWasm, logAndThrow }; // The following imports and exports are for a NodeJS context - if using the SDK in a browser context, delete or comment out these lines -import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey } from '@aleohq/nodejs'; -export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoNetworkClient, BlockHeightSearch, DevServerClient, ExecutionResponse, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, logAndThrow }; +// import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey} from '@aleohq/nodejs'; +// export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, Block, BlockHeightSearch, CachedKeyPair, DevServerClient, Execution, ExecutionResponse, FunctionKeyPair, FunctionKeyProvider, Input, KeySearchParams, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports, ProvingKey, Output, RecordCiphertext, RecordPlaintext, RecordProvider, RecordSearchParams, Signature, Transaction, Transition, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, logAndThrow} //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/sdk/src/index.js.map b/sdk/src/index.js.map index 0d13210e0..2308da579 100644 --- a/sdk/src/index.js.map +++ b/sdk/src/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,uCAAuC,CAAC;AAC1D,MAAM,oBAAoB,GAAG;IAC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AAgB,EAAE,eAAe,EAAsC,SAAS,EAA2B,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAC,CAAC;AAEnmB,wIAAwI;AACxI,0NAA0N;AAC1N,gjBAAgjB"} \ No newline at end of file diff --git a/sdk/src/index.ts b/sdk/src/index.ts index c02395802..14d9d7190 100644 --- a/sdk/src/index.ts +++ b/sdk/src/index.ts @@ -34,7 +34,7 @@ import { BlockHeightSearch, NetworkRecordProvider, RecordProvider, RecordSearchP * so this function must be called before any other SDK functions are called. */ // async function initializeWasm() { -// return await init(); +// return await init(); // } // import { Address, ExecutionResponse, PrivateKey, PrivateKeyCiphertext, Program, ProvingKey, RecordCiphertext, RecordPlaintext, ProgramManager as ProgramManagerBase, Signature, Transaction as WasmTransaction, ViewKey, VerifyingKey, initThreadPool } from '@aleohq/wasm'; // export { Account, Address, AleoKeyProvider, AleoKeyProviderParams, AleoKeyProviderInitParams, AleoNetworkClient, Block, BlockHeightSearch, DevServerClient, Execution, ExecutionResponse, FunctionKeyPair, FunctionKeyProvider, Input, KeySearchParams, NetworkRecordProvider, PrivateKey, PrivateKeyCiphertext, Program, ProgramImports, ProgramManager, ProgramManagerBase, ProvingKey, Output, RecordCiphertext, RecordPlaintext, RecordProvider, RecordSearchParams, Signature, Transaction, Transition, VerifyingKey, ViewKey, WasmTransaction, CREDITS_PROGRAM_KEYS, KEY_STORE, initThreadPool, initializeWasm, logAndThrow};