New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ironforge/sdk

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ironforge/sdk - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

7

dist/sdk.d.ts
import { AccountsSdk } from './accounts';
import { PlatformEnv } from './types';
export * from './accounts';
export * from './types';
export * from './utils/cluster';
export { accountsHostForEnv } from './utils';
export { accountsHostWithPrefix, rpcHostWithPrefix } from './utils';
/**

@@ -16,5 +15,5 @@ * The Ironforge SDK which is used as an entry point to all available SDK methods.

* @param apiKey The API key to use for all requests.
* @param env The environment to use for all requests, only provide this if you work at Ironforge :)
* @param prefix The prefix to use for all request urls.
*/
constructor(apiKey: string, env?: PlatformEnv);
constructor(apiKey: string, prefix?: string);
/**

@@ -21,0 +20,0 @@ * Provides access to the accounts SDK methods.

@@ -17,5 +17,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.IronforgeSdk = exports.accountsHostForEnv = void 0;
exports.IronforgeSdk = exports.rpcHostWithPrefix = exports.accountsHostWithPrefix = void 0;
const accounts_1 = require("./accounts");
const types_1 = require("./types");
const utils_1 = require("./utils");

@@ -26,3 +25,4 @@ __exportStar(require("./accounts"), exports);

var utils_2 = require("./utils");
Object.defineProperty(exports, "accountsHostForEnv", { enumerable: true, get: function () { return utils_2.accountsHostForEnv; } });
Object.defineProperty(exports, "accountsHostWithPrefix", { enumerable: true, get: function () { return utils_2.accountsHostWithPrefix; } });
Object.defineProperty(exports, "rpcHostWithPrefix", { enumerable: true, get: function () { return utils_2.rpcHostWithPrefix; } });
/**

@@ -37,7 +37,7 @@ * The Ironforge SDK which is used as an entry point to all available SDK methods.

* @param apiKey The API key to use for all requests.
* @param env The environment to use for all requests, only provide this if you work at Ironforge :)
* @param prefix The prefix to use for all request urls.
*/
constructor(apiKey, env = types_1.PLATFORM_ENV_PROD) {
constructor(apiKey, prefix) {
this.apiKey = apiKey;
this._accountsHost = (0, utils_1.accountsHostForEnv)(env);
this._accountsHost = (0, utils_1.accountsHostWithPrefix)(prefix);
}

@@ -44,0 +44,0 @@ /**

@@ -36,22 +36,1 @@ /**

};
/**
* Dev environment, used to develop the Ironforge platform.
*/
export declare const PLATFORM_ENV_DEV = "dev";
/**
* Stage environment, used to test the Ironforge platform.
*/
export declare const PLATFORM_ENV_STAGE = "stage";
/**
* Prod environment, used to run the Ironforge platform.
* This is the environment that all users of the SDK outside of Ironforge should use.
*/
export declare const PLATFORM_ENV_PROD = "prod";
/**
* All possible platform environments.
*/
export declare const PLATFORM_ENVS: readonly ["dev", "stage", "prod"];
/**
* PlatformEnv is a union type of all possible platform environments.
*/
export type PlatformEnv = (typeof PLATFORM_ENVS)[number];

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.PLATFORM_ENVS = exports.PLATFORM_ENV_PROD = exports.PLATFORM_ENV_STAGE = exports.PLATFORM_ENV_DEV = exports.isSuccessResult = exports.isFailureResult = void 0;
exports.isSuccessResult = exports.isFailureResult = void 0;
/**

@@ -22,26 +22,2 @@ * Checks if the given result is a failure result.

exports.isSuccessResult = isSuccessResult;
// -----------------
// PlatformEnv
// -----------------
/**
* Dev environment, used to develop the Ironforge platform.
*/
exports.PLATFORM_ENV_DEV = 'dev';
/**
* Stage environment, used to test the Ironforge platform.
*/
exports.PLATFORM_ENV_STAGE = 'stage';
/**
* Prod environment, used to run the Ironforge platform.
* This is the environment that all users of the SDK outside of Ironforge should use.
*/
exports.PLATFORM_ENV_PROD = 'prod';
/**
* All possible platform environments.
*/
exports.PLATFORM_ENVS = [
exports.PLATFORM_ENV_DEV,
exports.PLATFORM_ENV_STAGE,
exports.PLATFORM_ENV_PROD,
];
//# sourceMappingURL=types.js.map

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

import { PlatformEnv } from '../types';
export * from './cluster';

@@ -17,5 +16,9 @@ export declare function tryExtractResultFromResponse<T>(res: Response): Promise<{

* Returns the accounts host for the given environment.
* @param env The environment to use for all requests, provide
* [PLATFORM_ENV_PROD] unless you work at Ironforge :)
* @param maybePrefix The prefix use for all requests, provide
*/
export declare function accountsHostForEnv(env: PlatformEnv): string;
export declare function accountsHostWithPrefix(maybePrefix?: string): string;
/**
* Returns the RPC host for the given environment.
* @param maybePrefix The prefix use for all requests, provide
*/
export declare function rpcHostWithPrefix(maybePrefix?: string): string;

@@ -17,4 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.accountsHostForEnv = exports.requestHeaders = exports.tryExtractResultFromResponse = void 0;
const types_1 = require("../types");
exports.rpcHostWithPrefix = exports.accountsHostWithPrefix = exports.requestHeaders = exports.tryExtractResultFromResponse = void 0;
__exportStar(require("./cluster"), exports);

@@ -44,10 +43,18 @@ async function tryExtractResultFromResponse(res) {

* Returns the accounts host for the given environment.
* @param env The environment to use for all requests, provide
* [PLATFORM_ENV_PROD] unless you work at Ironforge :)
* @param maybePrefix The prefix use for all requests, provide
*/
function accountsHostForEnv(env) {
const prefix = env === types_1.PLATFORM_ENV_PROD ? '' : `${env}.`;
function accountsHostWithPrefix(maybePrefix) {
const prefix = maybePrefix == null ? '' : `${maybePrefix}.`;
return `${prefix}accounts.ironforge.network`;
}
exports.accountsHostForEnv = accountsHostForEnv;
exports.accountsHostWithPrefix = accountsHostWithPrefix;
/**
* Returns the RPC host for the given environment.
* @param maybePrefix The prefix use for all requests, provide
*/
function rpcHostWithPrefix(maybePrefix) {
const prefix = maybePrefix == null ? '' : `${maybePrefix}.`;
return `${prefix}rpc.ironforge.network`;
}
exports.rpcHostWithPrefix = rpcHostWithPrefix;
//# sourceMappingURL=index.js.map
{
"name": "@ironforge/sdk",
"version": "0.0.1",
"version": "0.0.2",
"description": "IronForge SDK.",

@@ -5,0 +5,0 @@ "main": "dist/sdk.js",

@@ -5,2 +5,4 @@ # @ironforge/sdk [![Build+Test+Lint](https://github.com/ironforge-cloud/sdk/actions/workflows/build-test-lint.yml/badge.svg)](https://github.com/ironforge-cloud/sdk/actions/workflows/build-test-lint.yml)

[Docs](https://ironforge-cloud.github.io/sdk/docs/)
## Example

@@ -7,0 +9,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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