MCPcopy Index your code
hub / github.com/dfinity/icp-js-core

github.com/dfinity/icp-js-core @v6.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v6.0.0 ↗ · + Follow
1,392 symbols 3,480 edges 144 files 110 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

icp-js-core

NPM Version License

The source code repository for the @icp-sdk/core package - the official JavaScript SDK for building applications on the Internet Computer.

For Package Users

If you're looking to use the @icp-sdk/core package in your project, visit:

Quick Start

import { HttpAgent } from '@icp-sdk/core/agent';
import { Ed25519KeyIdentity } from '@icp-sdk/core/identity';
import { IDL } from '@icp-sdk/core/candid';
import { Principal } from '@icp-sdk/core/principal';

const identity = Ed25519KeyIdentity.generate();
const canisterId = Principal.fromText('uqqxf-5h777-77774-qaaaa-cai');

const agent = await HttpAgent.create({
  host: 'https://icp-api.io',
  identity,
});

// Send an update call to the canister
await agent.call(canisterId, {
  methodName: 'greet',
  arg: IDL.encode([IDL.Text], ['world']),
});

Contributing

This repository contains the source code for @icp-sdk/core and related packages. Contributions are welcome! Please refer to the CONTRIBUTING.md for details about setting up the development environment, running tests, and the review process.

License

This project is licensed under the Apache-2.0 License.

Extension points exported contracts — how you extend this code

UIConfig (Interface)
(no doc) [6 implementers]
packages/core/src/candid/candid-core.ts
CliOptions (Interface)
(no doc)
packages/migrate/src/index.ts
StartPocketICOptions (Interface)
(no doc)
e2e/node/pic-helpers.ts
PublicKey (Interface)
(no doc) [7 implementers]
packages/core/src/agent/auth.ts
DependencyMapping (Interface)
(no doc)
packages/migrate/src/types.ts
StartPocketICResult (Interface)
(no doc)
e2e/node/pic-helpers.ts
Identity (Interface)
(no doc) [6 implementers]
packages/core/src/agent/auth.ts
GenericPackageJson (Interface)
(no doc)
packages/migrate/src/types.ts

Core symbols most depended-on inside this repo

expect
called by 1177
packages/core/src/agent/der.ts
toString
called by 157
packages/core/src/agent/errors.ts
fromText
called by 140
packages/core/src/principal/principal.ts
encode
called by 136
packages/core/src/candid/idl.ts
expect
called by 133
packages/core/src/identity/secp256k1/der.ts
set
called by 105
packages/core/src/agent/utils/expirableStore.ts
fromCode
called by 103
packages/core/src/agent/errors.ts
get
called by 91
packages/core/src/agent/utils/expirableStore.ts

Shape

Method 660
Function 339
Class 251
Interface 124
Enum 18

Languages

TypeScript100%

Modules by API surface

packages/core/src/candid/idl.ts316 symbols
packages/core/src/agent/errors.ts230 symbols
packages/core/src/candid/candid-ui.ts54 symbols
packages/core/src/agent/certificate.ts54 symbols
packages/core/src/agent/agent/http/index.ts49 symbols
e2e/node/utils/mock-replica.ts43 symbols
packages/core/src/candid/candid-core.ts40 symbols
packages/core/src/identity/identity/delegation.ts33 symbols
packages/core/src/agent/agent/api.ts29 symbols
packages/core/src/identity/secp256k1/secp256k1.ts27 symbols
packages/core/src/identity/identity/ed25519.ts26 symbols
packages/core/src/agent/actor.ts26 symbols

For agents

$ claude mcp add icp-js-core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page