Skip to content

Comments

Feat/superhero ID#3627

Draft
alex-k8 wants to merge 14 commits intodevelopfrom
feat/superhero-id
Draft

Feat/superhero ID#3627
alex-k8 wants to merge 14 commits intodevelopfrom
feat/superhero-id

Conversation

@alex-k8
Copy link
Collaborator

@alex-k8 alex-k8 commented Sep 2, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 2, 2025

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

if (!addr) throw new Error('No æternity account');
const svc = new SuperheroIDService();
const txBase64 = await svc.buildSetIdTx(JSON.stringify(addressBook.value)) as any;
const tx = unpackTx(txBase64) as any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢


async function onDeployContract() {
try {
const res = await fetch('/contracts/SuperheroIds.aes');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to import it as text via https://v4.webpack.js.org/loaders/raw-loader/ or so

async function onCreateSuperheroId() {
try {
if (!superheroSvc.value) throw new Error('Connect Superhero ID first');
const addr = aeAccounts.value?.[0]?.address as `ak_${string}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const addr = aeAccounts.value?.[0]?.address as `ak_${string}`;
const addr = aeAccounts.value?.[0]?.address as Encoded.AccountAddress;

or better to use isEncoded of ensureEncoded

}],
id: APP_NAME,
type: IS_EXTENSION || IS_OFFSCREEN_TAB ? WALLET_TYPE.extension : WALLET_TYPE.window,
onCompiler: new CompilerHttp('https://v8.compiler.aepps.com'),
Copy link
Member

@davidyuk davidyuk Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, the http compiler is not for production use, it's better to precompile the contract on build using CompilerCli
I would use https://github.com/aeternity/contract-builder, but it is not maintained currently

@@ -0,0 +1,71 @@
[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need ACI if you compile the source code

}>;

export class SuperheroIDService {
private contractId: Encoded.ContractAddress = 'ct_kaUS1K6qFXn2wP2phR26WLWXEKu5YsgA2gq4RWvkB69KY2gYF';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private contractId: Encoded.ContractAddress = 'ct_kaUS1K6qFXn2wP2phR26WLWXEKu5YsgA2gq4RWvkB69KY2gYF';
private contractId = 'ct_kaUS1K6qFXn2wP2phR26WLWXEKu5YsgA2gq4RWvkB69KY2gYF' as const;

const aeSdk = await getAeSdk();
return Contract.initialize({
...aeSdk.getContext(),
...(options || {}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
...(options || {}),
...options,
$ node
> { ...null }
{}
> { ...false }
{}
> { ...undefined }
{}

🤷‍♀️

Promise<SuperheroIdsContract> {
const { getAeSdk } = useAeSdk();
const aeSdk = await getAeSdk();
return Contract.initialize({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface SuperheroIdsContractMethods extends ContractMethodsBase {
  set_id: (id: string) => void;
  get_id: () => string | undefined;
  has_id: () => boolean;
}
Suggested change
return Contract.initialize({
return Contract.initialize<SuperheroIdsContractMethods>({

so you won't need to unknown as SuperheroIdsContract below

if (!account?.secretKey) throw new Error('Missing secret key for encryption');
const key = await importAesKeyFromSecret(account.secretKey);
const ciphertext = await encrypt(key, id);
await (contract as any)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await (contract as any)
await contract

should work after the above fixes

amount: 0,
callData,
gasLimit,
} as any);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what error is here without as any?

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

@alex-k8 alex-k8 force-pushed the feat/superhero-id branch 2 times, most recently from 8084a26 to a9f624a Compare September 3, 2025 11:51
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

2 similar comments
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

@github-actions
Copy link

github-actions bot commented Sep 3, 2025

@github-actions
Copy link

github-actions bot commented Sep 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants