Skip to content

Commit

Permalink
Merge pull request #184 from ar-io/PE-6551-register-ants
Browse files Browse the repository at this point in the history
fix(register): update spawn ant to register at end of spawn
  • Loading branch information
atticusofsparta authored Aug 8, 2024
2 parents 94ad786 + 4320c80 commit 9880ac1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/utils/ao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export async function spawnANT({
stateContractTxId?: string;
antRegistryId?: string;
}): Promise<string> {
// AoSigner is not a Contract Signer - should probably add that to the contract signer type
const registryClient = new AOProcess({
processId: antRegistryId,
ao,
});

//TODO: cache locally and only fetch if not cached
const luaString = (await defaultArweave.transactions.getData(luaCodeTxId, {
decode: true,
Expand Down Expand Up @@ -105,6 +111,14 @@ export async function spawnANT({
});
}

await registryClient.send({
tags: [
{ name: 'Action', value: 'Register' },
{ name: 'Process-Id', value: processId },
],
signer,
});

return processId;
}

Expand Down

0 comments on commit 9880ac1

Please sign in to comment.