Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/src/ol/account.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export class AccountResolver {
return this.olService.getSlowWallet(account.address);
}

@ResolveField(() => Boolean, { nullable: true })
public async reauthorized(@Parent() account: Account): Promise<Boolean | null> {
return this.olService.getReauthorized(account.address);
}

@ResolveField(() => PaginatedMovements)
public async movements(
@Parent() account: Account,
Expand Down
9 changes: 9 additions & 0 deletions api/src/ol/ol.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ export class OlService {
}
}

public async getReauthorized(address: Uint8Array): Promise<boolean> {
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<null | BN> {
const js = this.natsService.jetstream;
const kv = await js.views.kv('ol');
Expand Down
1 change: 1 addition & 0 deletions api/src/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type Account {
address: Bytes!
balance: Decimal
slowWallet: SlowWallet
reauthorized: Boolean!
movements(first: Int! = 10, after: String, order: OrderDirection! = ASC): PaginatedMovements!
}

Expand Down
1 change: 1 addition & 0 deletions web-app/src/modules/core/routes/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const GET_ACCOUNT = gql`
account(address: $address) {
address
balance
reauthorized
slowWallet {
unlocked
}
Expand Down