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

ic0

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ic0 - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

12

lib/index.d.ts
import { HttpAgent } from '@dfinity/agent';
import { agentCanister } from './canister/agentCanister';
import { devCanister } from './canister/devCanister';
import { mockCanister } from './canister/mockCanister';
import { Canister, Network, Replica } from './types';
export declare const replica: (host?: string | HttpAgent | undefined) => Replica;
declare const ic: Replica;
declare const local: Replica;
declare const defaultExport: Replica;
declare type AgentReplica = Replica<ReturnType<typeof agentCanister>>;
declare const replica: (host?: string | HttpAgent | undefined) => AgentReplica;
declare const ic: AgentReplica;
declare const local: AgentReplica;
declare const defaultExport: AgentReplica;
export default defaultExport;
export { ic, local, devCanister, mockCanister };
export { ic, local, replica, devCanister, mockCanister };
export type { Canister, Network, Replica };
//# sourceMappingURL=index.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.mockCanister = exports.devCanister = exports.local = exports.ic = exports.replica = void 0;
exports.mockCanister = exports.devCanister = exports.replica = exports.local = exports.ic = void 0;
const agent_1 = require("@dfinity/agent");

@@ -44,3 +44,3 @@ const cross_fetch_1 = __importDefault(require("cross-fetch"));

if (!deferred) {
deferred = (0, exports.replica)(...args);
deferred = replica(...args);
}

@@ -56,7 +56,9 @@ return deferred(...replicaArgs);

Object.assign(defaultExport, {
default: defaultExport,
ic,
local,
replica: exports.replica,
replica,
devCanister: devCanister_1.devCanister,
mockCanister: mockCanister_1.mockCanister,
__esModule: true, // Import as ES Module
});

@@ -63,0 +65,0 @@ module.exports = defaultExport;

@@ -5,4 +5,4 @@ export interface Network {

}
export interface Replica {
(id: string): Canister;
export interface Replica<T extends Canister> {
(id: string): T;
}

@@ -9,0 +9,0 @@ export interface Canister {

{
"name": "ic0",
"version": "0.1.1",
"version": "0.2.0",
"description": "An easy-to-use JavaScript API for the Internet Computer.",

@@ -5,0 +5,0 @@ "author": "DFINITY Foundation",

@@ -8,3 +8,5 @@ import { HttpAgent } from '@dfinity/agent';

export const replica = (host?: string | HttpAgent | undefined): Replica => {
type AgentReplica = Replica<ReturnType<typeof agentCanister>>;
const replica = (host?: string | HttpAgent | undefined): AgentReplica => {
let agent: HttpAgent;

@@ -35,4 +37,4 @@ if (!host) {

// Defer creating the agent for built-in replica values
const deferredReplica = (...args: Parameters<typeof replica>): Replica => {
let deferred: Replica | undefined;
const deferredReplica = (...args: Parameters<typeof replica>): AgentReplica => {
let deferred: AgentReplica | undefined;
return (...replicaArgs) => {

@@ -51,2 +53,3 @@ if (!deferred) {

Object.assign(defaultExport, {
default: defaultExport,
ic,

@@ -57,2 +60,3 @@ local,

mockCanister,
__esModule: true, // Import as ES Module
});

@@ -62,3 +66,3 @@

export default defaultExport;
export { ic, local, devCanister, mockCanister };
export { ic, local, replica, devCanister, mockCanister };
export type { Canister, Network, Replica };

@@ -6,4 +6,4 @@ export interface Network {

export interface Replica {
(id: string): Canister;
export interface Replica<T extends Canister> {
(id: string): T;
}

@@ -10,0 +10,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