(chainId: symbol, asap: boolean)
| 825 | } |
| 826 | |
| 827 | async #handshake(chainId: symbol, asap: boolean) { |
| 828 | const promises = []; |
| 829 | const commandsWithErrorHandlers = await this.#getHandshakeCommands(); |
| 830 | |
| 831 | if (asap) commandsWithErrorHandlers.reverse() |
| 832 | |
| 833 | for (const { cmd, errorHandler } of commandsWithErrorHandlers) { |
| 834 | promises.push( |
| 835 | this.#queue |
| 836 | .addCommand(cmd, { |
| 837 | chainId, |
| 838 | asap |
| 839 | }) |
| 840 | .catch(errorHandler) |
| 841 | ); |
| 842 | } |
| 843 | return promises; |
| 844 | } |
| 845 | |
| 846 | async #getHandshakeCommands(): Promise< |
| 847 | Array<{ cmd: CommandArguments } & { errorHandler?: (err: Error) => void }> |
no test coverage detected