File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ export class ManualGlue extends Glue {
409409 // wallet_addEthereumChain isn't exactly the safest endpoint, so we
410410 // don't expect wallets to implement it. We try optimistically but
411411 // fall back to human instructions if necessary.
412- console . debug ( "`wallet_addEthereumChain` failed, going manual" ) ;
412+ console . debug ( "`wallet_addEthereumChain` failed, going manual" , e ) ;
413413 }
414414
415415 await this . instruct (
Original file line number Diff line number Diff line change @@ -123,12 +123,17 @@ function main() {
123123 throw new TypeError ( "'method' in body not a string" ) ;
124124 }
125125
126- if ( ! ( "params" in msg . body ) ) {
127- throw new TypeError ( "'params' not in message body" ) ;
128- }
129-
130- if ( ! ( msg . body . params instanceof Array ) ) {
131- throw new TypeError ( "'params' in body not an array" ) ;
126+ let params : unknown [ ] ;
127+ if ( "params" in msg . body ) {
128+ if ( ! ( msg . body . params instanceof Array ) ) {
129+ throw new TypeError (
130+ "'params' in body not an array"
131+ ) ;
132+ }
133+
134+ params = msg . body . params ;
135+ } else {
136+ params = [ ] ;
132137 }
133138
134139 if ( ! ( "number" in msg ) ) {
@@ -137,7 +142,7 @@ function main() {
137142
138143 result . result = await blockchain . send (
139144 msg . body . method ,
140- msg . body . params
145+ params
141146 ) ;
142147 webSocket ?. send (
143148 JSON . stringify ( {
You can’t perform that action at this time.
0 commit comments