Skip to content

Commit 0c7357c

Browse files
committed
chore: aleo addresses
1 parent 60fea2f commit 0c7357c

6 files changed

Lines changed: 271 additions & 163 deletions

File tree

typescript/aleo-sdk/src/clients/provider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,14 +1022,18 @@ export class AleoProvider extends AleoBase implements AltVM.IProvider {
10221022
async getEnrollRemoteRouterTransaction(
10231023
req: AltVM.ReqEnrollRemoteRouter,
10241024
): Promise<AleoTransaction> {
1025+
const bytes = [...Buffer.from(req.remoteRouter.receiverAddress, 'hex')].map(
1026+
(b) => `${b}u8`,
1027+
);
1028+
10251029
return {
10261030
programName: req.tokenAddress,
10271031
functionName: 'enroll_remote_router',
10281032
priorityFee: 0,
10291033
privateFee: false,
10301034
inputs: [
10311035
`${req.remoteRouter.receiverDomainId}u32`,
1032-
req.remoteRouter.receiverAddress,
1036+
JSON.stringify(bytes).replaceAll('"', ''),
10331037
`${req.remoteRouter.gas}u128`,
10341038
],
10351039
skipProof: this.skipProof,

typescript/aleo-sdk/src/deploy.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { addressToBytesAleo, bytesToAddressAleo } from '@hyperlane-xyz/utils';
2+
13
import { AleoSigner } from './clients/signer.js';
24

35
const main = async () => {
@@ -19,25 +21,9 @@ const main = async () => {
1921

2022
const address = signer.getSignerAddress();
2123
console.log('signer address: ', address);
22-
23-
const balance = await signer.getBalance({
24-
address,
25-
denom: '',
26-
});
27-
console.log('signer credits balance: ', balance);
28-
29-
const { mailboxAddress } = await signer.createMailbox({
30-
domainId: 1337,
31-
});
32-
console.log('mailboxAddress', mailboxAddress);
33-
34-
const { tokenAddress } = await signer.createSyntheticToken({
35-
mailboxAddress,
36-
name: 'usdc',
37-
denom: 'usdc',
38-
decimals: 18,
39-
});
40-
console.log('tokenAddress', tokenAddress);
24+
const bytes = addressToBytesAleo(address);
25+
console.log('signer bytes', bytes);
26+
console.log('signer address from bytes', bytesToAddressAleo(bytes));
4127
} catch (err) {
4228
console.log(err);
4329
}

0 commit comments

Comments
 (0)