diff --git a/packages/guard/src/guard.gen.ts b/packages/guard/src/guard.gen.ts index a693ce74c..45c77d2a4 100644 --- a/packages/guard/src/guard.gen.ts +++ b/packages/guard/src/guard.gen.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -// sequence-guard v0.4.0 776b307c2145ac7a994eec63240acae042c96067 +// sequence-guard v0.5.0 29ecf507c86c5d53ab537783a32c1e8edf15d37f // -- // Code generated by webrpc-gen@v0.25.3 with typescript generator. DO NOT EDIT. // @@ -7,16 +7,16 @@ export const WebrpcHeader = 'Webrpc' -export const WebrpcHeaderValue = 'webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-guard@v0.4.0' +export const WebrpcHeaderValue = 'webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-guard@v0.5.0' // WebRPC description and code-gen version export const WebRPCVersion = 'v1' // Schema version of your RIDL schema -export const WebRPCSchemaVersion = 'v0.4.0' +export const WebRPCSchemaVersion = 'v0.5.0' // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = '776b307c2145ac7a994eec63240acae042c96067' +export const WebRPCSchemaHash = '29ecf507c86c5d53ab537783a32c1e8edf15d37f' type WebrpcGenVersions = { webrpcGenVersion: string @@ -70,6 +70,20 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions { // Types // +export enum PayloadType { + Calls = 'Calls', + Message = 'Message', + ConfigUpdate = 'ConfigUpdate', + SessionImplicitAuthorize = 'SessionImplicitAuthorize' +} + +export enum SignatureType { + Hash = 'Hash', + Sapient = 'Sapient', + EthSign = 'EthSign', + Erc1271 = 'Erc1271' +} + export interface Version { webrpcVersion: string schemaVersion: string @@ -99,7 +113,11 @@ export interface WalletSigner { export interface SignRequest { chainId: number msg: string - auxData: string + auxData?: string + wallet?: string + payloadType?: PayloadType + payloadData?: string + signatures?: Array } export interface OwnershipProof { @@ -107,6 +125,7 @@ export interface OwnershipProof { timestamp: number signer: string signature: string + chainId: number } export interface AuthToken { @@ -119,6 +138,13 @@ export interface RecoveryCode { used: boolean } +export interface Signature { + address: string + type: SignatureType + imageHash?: string + data: string +} + export interface Guard { ping(headers?: object, signal?: AbortSignal): Promise version(headers?: object, signal?: AbortSignal): Promise @@ -242,18 +268,21 @@ export interface SetPINArgs { pin: string timestamp: number signature: string + chainId: number } export interface SetPINReturn {} export interface ResetPINArgs { timestamp: number signature: string + chainId: number } export interface ResetPINReturn {} export interface CreateTOTPArgs { timestamp: number signature: string + chainId: number } export interface CreateTOTPReturn { @@ -269,6 +298,7 @@ export interface CommitTOTPReturn { export interface ResetTOTPArgs { timestamp: number signature: string + chainId: number } export interface ResetTOTPReturn {} @@ -281,6 +311,7 @@ export interface Reset2FAReturn {} export interface RecoveryCodesArgs { timestamp: number signature: string + chainId: number } export interface RecoveryCodesReturn { @@ -289,6 +320,7 @@ export interface RecoveryCodesReturn { export interface ResetRecoveryCodesArgs { timestamp: number signature: string + chainId: number } export interface ResetRecoveryCodesReturn { @@ -931,6 +963,32 @@ export class NotFoundError extends WebrpcError { } } +export class RequiresTOTPError extends WebrpcError { + constructor( + name: string = 'RequiresTOTP', + code: number = 6600, + message: string = `TOTP is required`, + status: number = 0, + cause?: string + ) { + super(name, code, message, status, cause) + Object.setPrototypeOf(this, RequiresTOTPError.prototype) + } +} + +export class RequiresPINError extends WebrpcError { + constructor( + name: string = 'RequiresPIN', + code: number = 6601, + message: string = `PIN is required`, + status: number = 0, + cause?: string + ) { + super(name, code, message, status, cause) + Object.setPrototypeOf(this, RequiresPINError.prototype) + } +} + export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -955,7 +1013,9 @@ export enum errors { Unavailable = 'Unavailable', QueryFailed = 'QueryFailed', ValidationFailed = 'ValidationFailed', - NotFound = 'NotFound' + NotFound = 'NotFound', + RequiresTOTP = 'RequiresTOTP', + RequiresPIN = 'RequiresPIN' } export enum WebrpcErrorCodes { @@ -982,7 +1042,9 @@ export enum WebrpcErrorCodes { Unavailable = 2002, QueryFailed = 2003, ValidationFailed = 2004, - NotFound = 3000 + NotFound = 3000, + RequiresTOTP = 6600, + RequiresPIN = 6601 } export const webrpcErrorByCode: { [code: number]: any } = { @@ -1009,7 +1071,9 @@ export const webrpcErrorByCode: { [code: number]: any } = { [2002]: UnavailableError, [2003]: QueryFailedError, [2004]: ValidationFailedError, - [3000]: NotFoundError + [3000]: NotFoundError, + [6600]: RequiresTOTPError, + [6601]: RequiresPINError } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise