@nktkas/hyperliquid
Version:
Unofficial Hyperliquid API SDK for all major JS runtimes, written in TypeScript and provided with tests
27 lines (26 loc) • 1.2 kB
JavaScript
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAbstractEthersSigner = isAbstractEthersSigner;
exports.isAbstractEthersV5Signer = isAbstractEthersV5Signer;
/** Checks if the given value is an abstract ethers signer. */
function isAbstractEthersSigner(client) {
return typeof client === "object" && client !== null &&
"signTypedData" in client && typeof client.signTypedData === "function" &&
client.signTypedData.length === 3;
}
/** Checks if the given value is an abstract ethers v5 signer. */
function isAbstractEthersV5Signer(client) {
return typeof client === "object" && client !== null &&
"_signTypedData" in client && typeof client._signTypedData === "function" &&
client._signTypedData.length === 3;
}
});