11/* eslint-disable */
2- // sequence-guard v0.4 .0 776b307c2145ac7a994eec63240acae042c96067
2+ // sequence-guard v0.5 .0 910e01c32ffb24b42386d4ca6be119b0acc55c5f
33// --
44// Code generated by webrpc-gen@v0.25.3 with typescript generator. DO NOT EDIT.
55//
66// webrpc-gen -schema=guard.ridl -target=typescript -client -out=./clients/guard.gen.ts
77
88export const WebrpcHeader = 'Webrpc'
99
10- export const WebrpcHeaderValue = 'webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-guard@v0.4 .0'
10+ export const WebrpcHeaderValue = 'webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-guard@v0.5 .0'
1111
1212// WebRPC description and code-gen version
1313export const WebRPCVersion = 'v1'
1414
1515// Schema version of your RIDL schema
16- export const WebRPCSchemaVersion = 'v0.4 .0'
16+ export const WebRPCSchemaVersion = 'v0.5 .0'
1717
1818// Schema hash generated from your RIDL schema
19- export const WebRPCSchemaHash = '776b307c2145ac7a994eec63240acae042c96067 '
19+ export const WebRPCSchemaHash = '910e01c32ffb24b42386d4ca6be119b0acc55c5f '
2020
2121type WebrpcGenVersions = {
2222 webrpcGenVersion : string
@@ -70,6 +70,20 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
7070// Types
7171//
7272
73+ export enum PayloadType {
74+ Calls = 'Calls' ,
75+ Message = 'Message' ,
76+ ConfigUpdate = 'ConfigUpdate' ,
77+ SessionImplicitAuthorize = 'SessionImplicitAuthorize'
78+ }
79+
80+ export enum SignatureType {
81+ Hash = 'Hash' ,
82+ Sapient = 'Sapient' ,
83+ EthSign = 'EthSign' ,
84+ Erc1271 = 'Erc1271'
85+ }
86+
7387export interface Version {
7488 webrpcVersion : string
7589 schemaVersion : string
@@ -99,26 +113,39 @@ export interface WalletSigner {
99113export interface SignRequest {
100114 chainId : number
101115 msg : string
102- auxData : string
116+ auxData ?: string
117+ wallet ?: string
118+ payloadType ?: PayloadType
119+ payloadData ?: string
120+ signatures ?: Array < Signature >
103121}
104122
105123export interface OwnershipProof {
106124 wallet : string
107125 timestamp : number
108126 signer : string
109127 signature : string
128+ chainId : number
110129}
111130
112131export interface AuthToken {
113132 id : string
114133 token : string
134+ resetAuth ?: boolean
115135}
116136
117137export interface RecoveryCode {
118138 code : string
119139 used : boolean
120140}
121141
142+ export interface Signature {
143+ address : string
144+ type : SignatureType
145+ imageHash ?: string
146+ data : string
147+ }
148+
122149export interface Guard {
123150 ping ( headers ?: object , signal ?: AbortSignal ) : Promise < PingReturn >
124151 version ( headers ?: object , signal ?: AbortSignal ) : Promise < VersionReturn >
@@ -242,18 +269,21 @@ export interface SetPINArgs {
242269 pin : string
243270 timestamp : number
244271 signature : string
272+ chainId : number
245273}
246274
247275export interface SetPINReturn { }
248276export interface ResetPINArgs {
249277 timestamp : number
250278 signature : string
279+ chainId : number
251280}
252281
253282export interface ResetPINReturn { }
254283export interface CreateTOTPArgs {
255284 timestamp : number
256285 signature : string
286+ chainId : number
257287}
258288
259289export interface CreateTOTPReturn {
@@ -269,6 +299,7 @@ export interface CommitTOTPReturn {
269299export interface ResetTOTPArgs {
270300 timestamp : number
271301 signature : string
302+ chainId : number
272303}
273304
274305export interface ResetTOTPReturn { }
@@ -281,6 +312,7 @@ export interface Reset2FAReturn {}
281312export interface RecoveryCodesArgs {
282313 timestamp : number
283314 signature : string
315+ chainId : number
284316}
285317
286318export interface RecoveryCodesReturn {
@@ -289,6 +321,7 @@ export interface RecoveryCodesReturn {
289321export interface ResetRecoveryCodesArgs {
290322 timestamp : number
291323 signature : string
324+ chainId : number
292325}
293326
294327export interface ResetRecoveryCodesReturn {
@@ -931,6 +964,32 @@ export class NotFoundError extends WebrpcError {
931964 }
932965}
933966
967+ export class RequiresTOTPError extends WebrpcError {
968+ constructor (
969+ name : string = 'RequiresTOTP' ,
970+ code : number = 6600 ,
971+ message : string = `TOTP is required` ,
972+ status : number = 0 ,
973+ cause ?: string
974+ ) {
975+ super ( name , code , message , status , cause )
976+ Object . setPrototypeOf ( this , RequiresTOTPError . prototype )
977+ }
978+ }
979+
980+ export class RequiresPINError extends WebrpcError {
981+ constructor (
982+ name : string = 'RequiresPIN' ,
983+ code : number = 6601 ,
984+ message : string = `PIN is required` ,
985+ status : number = 0 ,
986+ cause ?: string
987+ ) {
988+ super ( name , code , message , status , cause )
989+ Object . setPrototypeOf ( this , RequiresPINError . prototype )
990+ }
991+ }
992+
934993export enum errors {
935994 WebrpcEndpoint = 'WebrpcEndpoint' ,
936995 WebrpcRequestFailed = 'WebrpcRequestFailed' ,
@@ -955,7 +1014,9 @@ export enum errors {
9551014 Unavailable = 'Unavailable' ,
9561015 QueryFailed = 'QueryFailed' ,
9571016 ValidationFailed = 'ValidationFailed' ,
958- NotFound = 'NotFound'
1017+ NotFound = 'NotFound' ,
1018+ RequiresTOTP = 'RequiresTOTP' ,
1019+ RequiresPIN = 'RequiresPIN'
9591020}
9601021
9611022export enum WebrpcErrorCodes {
@@ -982,7 +1043,9 @@ export enum WebrpcErrorCodes {
9821043 Unavailable = 2002 ,
9831044 QueryFailed = 2003 ,
9841045 ValidationFailed = 2004 ,
985- NotFound = 3000
1046+ NotFound = 3000 ,
1047+ RequiresTOTP = 6600 ,
1048+ RequiresPIN = 6601
9861049}
9871050
9881051export const webrpcErrorByCode : { [ code : number ] : any } = {
@@ -1009,7 +1072,9 @@ export const webrpcErrorByCode: { [code: number]: any } = {
10091072 [ 2002 ] : UnavailableError ,
10101073 [ 2003 ] : QueryFailedError ,
10111074 [ 2004 ] : ValidationFailedError ,
1012- [ 3000 ] : NotFoundError
1075+ [ 3000 ] : NotFoundError ,
1076+ [ 6600 ] : RequiresTOTPError ,
1077+ [ 6601 ] : RequiresPINError
10131078}
10141079
10151080export type Fetch = ( input : RequestInfo , init ?: RequestInit ) => Promise < Response >
0 commit comments