UNPKG

@roochnetwork/rooch-sdk-kit

Version:
36 lines (35 loc) 858 B
// src/http/httpTransport.ts import { RoochHTTPTransport } from "@roochnetwork/rooch-sdk"; var HTTPTransport = class extends RoochHTTPTransport { constructor(options, requestErrorCallback) { super(options); this.requestCallback = requestErrorCallback; } async request(input) { let result; try { if (input.method === "rooch_executeRawTransaction") { this.requestCallback("requesting"); } result = await super.request(input); if (input.method === "rooch_executeRawTransaction") { this.requestCallback("success"); } return result; } catch (e) { if ("code" in e) { this.requestCallback("error", { code: e.code, message: e.message }); } throw e; } } }; export { HTTPTransport }; //# sourceMappingURL=httpTransport.js.map