Conversation
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
1 similar comment
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
src/popup/pages/AddressBook.vue
Outdated
| 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; |
src/popup/pages/Dashboard.vue
Outdated
|
|
||
| async function onDeployContract() { | ||
| try { | ||
| const res = await fetch('/contracts/SuperheroIds.aes'); |
There was a problem hiding this comment.
you should be able to import it as text via https://v4.webpack.js.org/loaders/raw-loader/ or so
src/popup/pages/Dashboard.vue
Outdated
| async function onCreateSuperheroId() { | ||
| try { | ||
| if (!superheroSvc.value) throw new Error('Connect Superhero ID first'); | ||
| const addr = aeAccounts.value?.[0]?.address as `ak_${string}`; |
There was a problem hiding this comment.
| 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'), |
There was a problem hiding this comment.
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 @@ | |||
| [ | |||
There was a problem hiding this comment.
you don't need ACI if you compile the source code
| }>; | ||
|
|
||
| export class SuperheroIDService { | ||
| private contractId: Encoded.ContractAddress = 'ct_kaUS1K6qFXn2wP2phR26WLWXEKu5YsgA2gq4RWvkB69KY2gYF'; |
There was a problem hiding this comment.
| private contractId: Encoded.ContractAddress = 'ct_kaUS1K6qFXn2wP2phR26WLWXEKu5YsgA2gq4RWvkB69KY2gYF'; | |
| private contractId = 'ct_kaUS1K6qFXn2wP2phR26WLWXEKu5YsgA2gq4RWvkB69KY2gYF' as const; |
| const aeSdk = await getAeSdk(); | ||
| return Contract.initialize({ | ||
| ...aeSdk.getContext(), | ||
| ...(options || {}), |
There was a problem hiding this comment.
| ...(options || {}), | |
| ...options, |
$ node
> { ...null }
{}
> { ...false }
{}
> { ...undefined }
{}
🤷♀️
| Promise<SuperheroIdsContract> { | ||
| const { getAeSdk } = useAeSdk(); | ||
| const aeSdk = await getAeSdk(); | ||
| return Contract.initialize({ |
There was a problem hiding this comment.
interface SuperheroIdsContractMethods extends ContractMethodsBase {
set_id: (id: string) => void;
get_id: () => string | undefined;
has_id: () => boolean;
}| 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) |
There was a problem hiding this comment.
| await (contract as any) | |
| await contract |
should work after the above fixes
| amount: 0, | ||
| callData, | ||
| gasLimit, | ||
| } as any); |
There was a problem hiding this comment.
what error is here without as any?
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
1 similar comment
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
1 similar comment
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
8084a26 to
a9f624a
Compare
a9f624a to
8be7f67
Compare
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
2 similar comments
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
|
Deployed to feat-superhero-id.wallet.z52da5wt.xyz, artifacts |
No description provided.