@hyperlane-xyz/aleo-sdk 19.11.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/README.md +59 -0
- package/dist/artifacts.d.ts +13 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +23 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/clients/base.d.ts +17 -0
- package/dist/clients/base.d.ts.map +1 -0
- package/dist/clients/base.js +66 -0
- package/dist/clients/base.js.map +1 -0
- package/dist/clients/protocol.d.ts +9 -0
- package/dist/clients/protocol.d.ts.map +1 -0
- package/dist/clients/protocol.js +21 -0
- package/dist/clients/protocol.js.map +1 -0
- package/dist/clients/provider.d.ts +65 -0
- package/dist/clients/provider.d.ts.map +1 -0
- package/dist/clients/provider.js +768 -0
- package/dist/clients/provider.js.map +1 -0
- package/dist/clients/signer.d.ts +44 -0
- package/dist/clients/signer.d.ts.map +1 -0
- package/dist/clients/signer.js +473 -0
- package/dist/clients/signer.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/helper.d.ts +25 -0
- package/dist/utils/helper.d.ts.map +1 -0
- package/dist/utils/helper.js +159 -0
- package/dist/utils/helper.js.map +1 -0
- package/dist/utils/types.d.ts +24 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +21 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Hyperlane Aleo SDK
|
|
2
|
+
|
|
3
|
+
The Hyperlane Aleo SDK is a fully typed TypeScript SDK for the [Aleo Implementation](https://github.com/hyperlane-xyz/hyperlane-aleo).
|
|
4
|
+
It can be used as a standalone SDK for frontend or in backend applications which want to connect to a Aleo chain which has the Hyperlane blueprint installed.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# Install with NPM
|
|
10
|
+
npm install @hyperlane-xyz/aleo-sdk
|
|
11
|
+
|
|
12
|
+
# Or with Yarn
|
|
13
|
+
yarn add @hyperlane-xyz/aleo-sdk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { AleoProvider, AleoSigner } from "@hyperlane-xyz/aleo-sdk";
|
|
20
|
+
|
|
21
|
+
const signer = await AleoSigner.connectWithSigner(
|
|
22
|
+
['http://localhost:3030'],
|
|
23
|
+
PRIV_KEY,
|
|
24
|
+
{
|
|
25
|
+
metadata: {
|
|
26
|
+
chainId: 1
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const mailboxAddress = await signer.createMailbox({ domainId: 75898670 });
|
|
32
|
+
|
|
33
|
+
const mailbox = await signer.getMailbox({ mailboxAddress });
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
// performing queries without signer
|
|
37
|
+
const provider = await AleoProvider.connect(
|
|
38
|
+
['http://localhost:3030'],
|
|
39
|
+
1
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const mailbox = await provider.getMailbox({ mailboxAddress });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Environment variables
|
|
46
|
+
|
|
47
|
+
A couple of env variables are used to influence the behaviour of the aleo-sdk.
|
|
48
|
+
|
|
49
|
+
- **ALEO_SKIP_PROOFS=true/false**: if set to true it will build transactions specifically for the aleo devnode skipping proof generation and making the execution much faster. This is very helpful for running e2e tests or for testnet deploys.
|
|
50
|
+
- **ALEO_SKIP_SUFFIXES=true/false**: if set to true it will deploy all contracts with the original program id. This is only needed for the first ever core deploy.
|
|
51
|
+
- **ALEO_UPGRADE_AUTHORITY=\<authority>**: if this is set the aleo-sdk will make all programs upgradable during the deploy step. For normal aleo wallets the value should simply be
|
|
52
|
+
the aleo account address. For multisigs the format should be the following: "my_multisig.aleo/my_mapping/my_key"
|
|
53
|
+
- **ALEO_CONSENSUS_VERSION_HEIGHTS=0,1,2,3,4,5,6,7,8,9,10,11**: if this is set to an array of numbers it will be used to call the `getOrInitConsensusVersionTestHeights` needed for local networks
|
|
54
|
+
- **ALEO_ISM_MANAGER_SUFFIX=\<suffix>**: if this is set the suffix will be appended to the ism manager program (ism_manager\_{suffix}.aleo)
|
|
55
|
+
- **ALEO_WARP_SUFFIX=usdc**: if this is set the suffixes of warp programs will be set to this value, when omitted a random id is chosen
|
|
56
|
+
|
|
57
|
+
## Setup
|
|
58
|
+
|
|
59
|
+
Node 18 or newer is required.
|