@@ -24,6 +24,7 @@ import {
24
24
UpdateAccountResponseStruct ,
25
25
} from './internal/api' ;
26
26
import type { JsonRpcRequest } from './JsonRpcRequest' ;
27
+ import { KeyringRpcMethod } from './rpc-handler' ;
27
28
import type { OmitUnion } from './utils' ;
28
29
import { strictMask } from './utils' ;
29
30
@@ -62,7 +63,7 @@ export class KeyringClient implements Keyring {
62
63
async listAccounts ( ) : Promise < KeyringAccount [ ] > {
63
64
return strictMask (
64
65
await this . #send( {
65
- method : 'keyring_listAccounts' ,
66
+ method : KeyringRpcMethod . ListAccounts ,
66
67
} ) ,
67
68
ListAccountsResponseStruct ,
68
69
) ;
@@ -71,7 +72,7 @@ export class KeyringClient implements Keyring {
71
72
async getAccount ( id : string ) : Promise < KeyringAccount > {
72
73
return strictMask (
73
74
await this . #send( {
74
- method : 'keyring_getAccount' ,
75
+ method : KeyringRpcMethod . GetAccount ,
75
76
params : { id } ,
76
77
} ) ,
77
78
GetAccountResponseStruct ,
@@ -83,7 +84,7 @@ export class KeyringClient implements Keyring {
83
84
) : Promise < KeyringAccount > {
84
85
return strictMask (
85
86
await this . #send( {
86
- method : 'keyring_createAccount' ,
87
+ method : KeyringRpcMethod . CreateAccount ,
87
88
params : { options } ,
88
89
} ) ,
89
90
CreateAccountResponseStruct ,
@@ -93,7 +94,7 @@ export class KeyringClient implements Keyring {
93
94
async filterAccountChains ( id : string , chains : string [ ] ) : Promise < string [ ] > {
94
95
return strictMask (
95
96
await this . #send( {
96
- method : 'keyring_filterAccountChains' ,
97
+ method : KeyringRpcMethod . FilterAccountChains ,
97
98
params : { id, chains } ,
98
99
} ) ,
99
100
FilterAccountChainsResponseStruct ,
@@ -103,7 +104,7 @@ export class KeyringClient implements Keyring {
103
104
async updateAccount ( account : KeyringAccount ) : Promise < void > {
104
105
assert (
105
106
await this . #send( {
106
- method : 'keyring_updateAccount' ,
107
+ method : KeyringRpcMethod . UpdateAccount ,
107
108
params : { account } ,
108
109
} ) ,
109
110
UpdateAccountResponseStruct ,
@@ -113,7 +114,7 @@ export class KeyringClient implements Keyring {
113
114
async deleteAccount ( id : string ) : Promise < void > {
114
115
assert (
115
116
await this . #send( {
116
- method : 'keyring_deleteAccount' ,
117
+ method : KeyringRpcMethod . DeleteAccount ,
117
118
params : { id } ,
118
119
} ) ,
119
120
DeleteAccountResponseStruct ,
@@ -123,7 +124,7 @@ export class KeyringClient implements Keyring {
123
124
async exportAccount ( id : string ) : Promise < KeyringAccountData > {
124
125
return strictMask (
125
126
await this . #send( {
126
- method : 'keyring_exportAccount' ,
127
+ method : KeyringRpcMethod . ExportAccount ,
127
128
params : { id } ,
128
129
} ) ,
129
130
ExportAccountResponseStruct ,
@@ -133,7 +134,7 @@ export class KeyringClient implements Keyring {
133
134
async listRequests ( ) : Promise < KeyringRequest [ ] > {
134
135
return strictMask (
135
136
await this . #send( {
136
- method : 'keyring_listRequests' ,
137
+ method : KeyringRpcMethod . ListRequests ,
137
138
} ) ,
138
139
ListRequestsResponseStruct ,
139
140
) ;
@@ -142,7 +143,7 @@ export class KeyringClient implements Keyring {
142
143
async getRequest ( id : string ) : Promise < KeyringRequest > {
143
144
return strictMask (
144
145
await this . #send( {
145
- method : 'keyring_getRequest' ,
146
+ method : KeyringRpcMethod . GetRequest ,
146
147
params : { id } ,
147
148
} ) ,
148
149
GetRequestResponseStruct ,
@@ -152,7 +153,7 @@ export class KeyringClient implements Keyring {
152
153
async submitRequest ( request : KeyringRequest ) : Promise < KeyringResponse > {
153
154
return strictMask (
154
155
await this . #send( {
155
- method : 'keyring_submitRequest' ,
156
+ method : KeyringRpcMethod . SubmitRequest ,
156
157
params : request ,
157
158
} ) ,
158
159
SubmitRequestResponseStruct ,
@@ -165,7 +166,7 @@ export class KeyringClient implements Keyring {
165
166
) : Promise < void > {
166
167
assert (
167
168
await this . #send( {
168
- method : 'keyring_approveRequest' ,
169
+ method : KeyringRpcMethod . ApproveRequest ,
169
170
params : { id, data } ,
170
171
} ) ,
171
172
ApproveRequestResponseStruct ,
@@ -175,7 +176,7 @@ export class KeyringClient implements Keyring {
175
176
async rejectRequest ( id : string ) : Promise < void > {
176
177
assert (
177
178
await this . #send( {
178
- method : 'keyring_rejectRequest' ,
179
+ method : KeyringRpcMethod . RejectRequest ,
179
180
params : { id } ,
180
181
} ) ,
181
182
RejectRequestResponseStruct ,
0 commit comments