Socket
Socket
Sign inDemoInstall

@swapkit/helpers

Package Overview
Dependencies
Maintainers
2
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swapkit/helpers - npm Package Compare versions

Comparing version 1.0.0-rc.99 to 1.0.0-rc.100

src/types/errors/apiV1.ts

2

package.json

@@ -39,3 +39,3 @@ {

"types": "./src/index.ts",
"version": "1.0.0-rc.99"
"version": "1.0.0-rc.100"
}

@@ -10,4 +10,5 @@ import {

type Params = {
chain: Chain;
index: number;
chain: Chain;
addressIndex?: number;
type?: "legacy" | "ledgerLive" | "nativeSegwitMiddleAccount" | "segwit";

@@ -21,6 +22,6 @@ };

export function getDerivationPathFor({ chain, index, type }: Params) {
export function getDerivationPathFor({ chain, index, addressIndex = 0, type }: Params) {
if (EVMChains.includes(chain as EVMChain)) {
if (type === "legacy") return [44, 60, 0, index];
if (type === "ledgerLive") return [44, 60, index, 0, 0];
if (type === "ledgerLive") return [44, 60, index, 0, addressIndex];
return updatedLastIndex(NetworkDerivationPath[chain], index);

@@ -32,3 +33,3 @@ }

if (type === "nativeSegwitMiddleAccount") return [84, chainId, index, 0, 0];
if (type === "nativeSegwitMiddleAccount") return [84, chainId, index, 0, addressIndex];
if (type === "segwit") return [49, chainId, 0, 0, index];

@@ -35,0 +36,0 @@ if (type === "legacy") return [44, chainId, 0, 0, index];

@@ -1,2 +0,2 @@

import type { Options } from "ky";
import type { KyInstance, Options } from "ky";
import ky from "ky";

@@ -24,7 +24,17 @@

const getTypedBaseRequestClient = (kyClient: KyInstance) => ({
get: <T>(url: string | URL | Request, options?: Options) => kyClient.get(url, options).json<T>(),
post: <T>(url: string | URL | Request, options?: Options) =>
kyClient.post(url, options).json<T>(),
});
export const RequestClient = {
get: <T>(url: string | URL | Request, options?: Options) =>
getKyClient().get(url, options).json<T>(),
post: <T>(url: string | URL | Request, options?: Options) =>
getKyClient().post(url, options).json<T>(),
...getTypedBaseRequestClient(getKyClient()),
extend: (options: Options) => {
const extendedClient = getKyClient().extend(options);
return {
...getTypedBaseRequestClient(extendedClient),
extend: RequestClient.extend,
};
},
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc