diff --git a/api/src/ol/account.resolver.ts b/api/src/ol/account.resolver.ts index aa1d91c1..bda71540 100644 --- a/api/src/ol/account.resolver.ts +++ b/api/src/ol/account.resolver.ts @@ -36,6 +36,11 @@ export class AccountResolver { return this.olService.getSlowWallet(account.address); } + @ResolveField(() => Boolean, { nullable: true }) + public async reauthorized(@Parent() account: Account): Promise { + return this.olService.getReauthorized(account.address); + } + @ResolveField(() => PaginatedMovements) public async movements( @Parent() account: Account, diff --git a/api/src/ol/ol.service.ts b/api/src/ol/ol.service.ts index 93238def..b3372989 100644 --- a/api/src/ol/ol.service.ts +++ b/api/src/ol/ol.service.ts @@ -250,6 +250,15 @@ export class OlService { } } + public async getReauthorized(address: Uint8Array): Promise { + const res = await this.aptosClient.view({ + function: '0x1::reauthorization::is_v8_authorized', + type_arguments: [], + arguments: [`0x${Buffer.from(address).toString('hex')}`], + }); + return res[0] as boolean; + } + public async getLatestStableVersion(): Promise { const js = this.natsService.jetstream; const kv = await js.views.kv('ol'); diff --git a/api/src/schema.gql b/api/src/schema.gql index b680af78..133ba201 100644 --- a/api/src/schema.gql +++ b/api/src/schema.gql @@ -113,6 +113,7 @@ type Account { address: Bytes! balance: Decimal slowWallet: SlowWallet + reauthorized: Boolean! movements(first: Int! = 10, after: String, order: OrderDirection! = ASC): PaginatedMovements! } diff --git a/web-app/src/modules/core/routes/Account/Account.tsx b/web-app/src/modules/core/routes/Account/Account.tsx index 4a36b510..11a54da0 100644 --- a/web-app/src/modules/core/routes/Account/Account.tsx +++ b/web-app/src/modules/core/routes/Account/Account.tsx @@ -16,6 +16,7 @@ const GET_ACCOUNT = gql` account(address: $address) { address balance + reauthorized slowWallet { unlocked }