Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ckbtc/src/bitcoin.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ActorSubclass } from "@dfinity/agent";
import type { CanisterOptions } from "@dfinity/utils";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { mock } from "vitest-mock-extended";
import type {
_SERVICE as BitcoinService,
Expand Down
4 changes: 2 additions & 2 deletions packages/ckbtc/src/minter.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ActorSubclass } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import { arrayOfNumberToUint8Array, toNullable } from "@dfinity/utils";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
Account,
Expand Down
2 changes: 1 addition & 1 deletion packages/ckbtc/src/mocks/minter.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";

export const minterCanisterIdMock: Principal = Principal.fromText(
"q3fc5-haaaa-aaaaa-aaahq-cai",
Expand Down
2 changes: 1 addition & 1 deletion packages/ckbtc/src/types/canister.options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import type { CanisterOptions } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";

export interface CkBTCCanisterOptions<T>
extends Omit<CanisterOptions<T>, "canisterId"> {
Expand Down
2 changes: 1 addition & 1 deletion packages/ckbtc/src/types/minter.params.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import type { QueryParams } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type { RetrieveBtcArgs } from "../../candid/minter";

export interface MinterAccount {
Expand Down
4 changes: 2 additions & 2 deletions packages/cketh/src/minter.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ActorSubclass } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import { arrayOfNumberToUint8Array, toNullable } from "@dfinity/utils";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
_SERVICE as CkETHMinterService,
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/src/minter.canister.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Principal } from "@dfinity/principal";
import {
Canister,
createServices,
toNullable,
type QueryParams,
} from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type {
_SERVICE as CkETHMinterService,
Eip1559TransactionPrice,
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/src/mocks/minter.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";

export const minterCanisterIdMock: Principal = Principal.fromText(
"sv3dd-oaaaa-aaaar-qacoa-cai",
Expand Down
4 changes: 2 additions & 2 deletions packages/cketh/src/orchestrator.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ActorSubclass } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
_SERVICE as CkETHOrchestratorService,
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/src/types/canister.options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import type { CanisterOptions } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";

export interface CkETHMinterCanisterOptions<T>
extends Omit<CanisterOptions<T>, "canisterId"> {
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/src/types/minter.params.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { isNullish, toNullable, type QueryParams } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type { Eip1559TransactionPriceArg } from "../../candid/minter";

export type Eip1559TransactionPriceParams = {
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/src/utils/minter.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";
import { encodePrincipalToEthAddress } from "./minter.utils";

describe("minter-utils", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cketh/src/utils/minter.utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { decodeBase32 } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";

/**
* Encode a principal to a byte array as Ethereum data hex (staring with 0x).
Expand Down
4 changes: 2 additions & 2 deletions packages/cmc/src/cmc.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ActorSubclass, HttpAgent } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import { arrayOfNumberToUint8Array, type QueryParams } from "@dfinity/utils";
import type { ActorSubclass, HttpAgent } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
_SERVICE as CMCService,
Expand Down
2 changes: 1 addition & 1 deletion packages/cmc/src/cmc.canister.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { Canister, createServices, type QueryParams } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type {
_SERVICE as CMCCanisterService,
Cycles,
Expand Down
4 changes: 2 additions & 2 deletions packages/cmc/src/cmc.mock.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Identity } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import type { Identity } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";

export const mockPrincipalText =
"xlmdg-vkosz-ceopx-7wtgu-g3xmd-koiyc-awqaq-7modz-zf6r6-364rh-oqe";
Expand Down
2 changes: 1 addition & 1 deletion packages/cmc/src/cmc.options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import type { CanisterOptions } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type { _SERVICE as CanisterService } from "../candid/cmc";

export interface CMCCanisterOptions
Expand Down
12 changes: 6 additions & 6 deletions packages/ic-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ Stop a canister

Get canister details (memory size, status, etc.)

| Method | Type |
| ---------------- | ------------------------------------------------------------ |
| `canisterStatus` | `(canisterId: Principal) => Promise<canister_status_result>` |
| Method | Type |
| ---------------- | --------------------------------------------- |
| `canisterStatus` | `(canisterId: Principal) => Promise<unknown>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L291)

Expand Down Expand Up @@ -258,9 +258,9 @@ Creates a canister. Only available on development instances.

Given a canister ID as input, this method returns a vector of logs of that canister including its trap messages. The canister logs are not collected in canister methods running in non-replicated mode (NRQ, CQ, CRy, CRt, CC, and F modes, as defined in Overview of imports). The total size of all returned logs does not exceed 4KiB. If new logs are added resulting in exceeding the maximum total log size of 4KiB, the oldest logs will be removed. Logs persist across canister upgrades and they are deleted if the canister is reinstalled or uninstalled.

| Method | Type |
| ------------------- | ---------------------------------------------------------------- |
| `fetchCanisterLogs` | `(canisterId: Principal) => Promise<fetch_canister_logs_result>` |
| Method | Type |
| ------------------- | --------------------------------------------- |
| `fetchCanisterLogs` | `(canisterId: Principal) => Promise<unknown>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L343)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ActorSubclass, HttpAgent } from "@dfinity/agent";
import { toNullable, type ServiceResponse } from "@dfinity/utils";
import type { ActorSubclass, HttpAgent } from "@icp-sdk/core/agent";
import { mock } from "vitest-mock-extended";
import type {
canister_install_mode,
Expand Down
2 changes: 1 addition & 1 deletion packages/ic-management/src/ic-management.canister.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Principal } from "@dfinity/principal";
import {
createServices,
hexStringToUint8Array,
toNullable,
} from "@dfinity/utils";
import { Principal } from "@icp-sdk/core/principal";
import type {
chunk_hash,
_SERVICE as IcManagementService,
Expand Down
2 changes: 1 addition & 1 deletion packages/ic-management/src/ic-management.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";
import {
toCanisterSettings,
type CanisterSettings,
Expand Down
2 changes: 1 addition & 1 deletion packages/ic-management/src/types/ic-management.params.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Principal } from "@dfinity/principal";
import { isNullish, toNullable } from "@dfinity/utils";
import { Principal } from "@icp-sdk/core/principal";
import type {
canister_install_mode,
canister_settings,
Expand Down
2 changes: 1 addition & 1 deletion packages/ic-management/src/types/snapshot.params.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { assertNever, isNullish, nonNullish, toNullable } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type {
canister_id,
read_canister_snapshot_data_args,
Expand Down
4 changes: 2 additions & 2 deletions packages/ic-management/src/utils/transform.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CallConfig } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import type { CallConfig } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mockCanisterId } from "../ic-management.mock";
import { transform } from "./transform.utils";

Expand Down
4 changes: 2 additions & 2 deletions packages/ic-management/src/utils/transform.utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ActorConfig, CallConfig } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import { fromNullable, nonNullish } from "@dfinity/utils";
import type { ActorConfig, CallConfig } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";

type CallTransform = Required<ActorConfig>["callTransform"];

Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/src/account_identifier.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";
import { AccountIdentifier, SubAccount } from "./account_identifier";
import { mockAccountIdentifier } from "./mocks/ledger.mock";

Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/src/account_identifier.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Principal } from "@dfinity/principal";
import {
arrayOfNumberToUint8Array,
asciiStringToByteArray,
bigEndianCrc32,
hexStringToUint8Array,
uint8ArrayToHexString,
} from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import { sha224 } from "@noble/hashes/sha2";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Principal } from "@dfinity/principal";
import { toNullable } from "@dfinity/utils";
import { Principal } from "@icp-sdk/core/principal";
import { mockAccountIdentifier } from "../../mocks/ledger.mock";
import { mockConsentMessageRequest } from "../../mocks/ledger.request.mock";
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/src/constants/canister_ids.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";

export const MAINNET_LEDGER_CANISTER_ID = Principal.fromText(
"ryjl3-tyaaa-aaaaa-aaaba-cai",
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/src/index.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ActorSubclass } from "@dfinity/agent";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { mock } from "vitest-mock-extended";
import type {
GetAccountIdentifierTransactionsError,
Expand Down
4 changes: 2 additions & 2 deletions packages/ledger-icp/src/ledger.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ActorSubclass } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import { arrayOfNumberToUint8Array } from "@dfinity/utils";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
Account,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/src/ledger.canister.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { Canister, createServices, type QueryParams } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type {
Icrc1BlockIndex,
_SERVICE as LedgerService,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icp/src/mocks/ledger.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";
import { AccountIdentifier } from "../account_identifier";

export const mockAccountIdentifier = AccountIdentifier.fromHex(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Principal } from "@dfinity/principal";
import { toNullable } from "@dfinity/utils";
import { Principal } from "@icp-sdk/core/principal";
import { mockPrincipalText } from "../mocks/ledger.mock";
import type {
ApproveParams,
Expand Down
4 changes: 2 additions & 2 deletions packages/ledger-icrc/src/index-ng.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ActorSubclass } from "@dfinity/agent";
import type { Status } from "@dfinity/ledger-icp/candid";
import { Principal } from "@dfinity/principal";
import { arrayOfNumberToUint8Array } from "@dfinity/utils";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
Account,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/index-ng.canister.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { createServices, type QueryParams } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type { SubAccount } from "../candid/icrc_index";
import type {
GetTransactions,
Expand Down
4 changes: 2 additions & 2 deletions packages/ledger-icrc/src/index.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ActorSubclass } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type {
Account,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/index.canister.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import { Canister, createServices, type QueryParams } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type {
GetTransactions,
_SERVICE as IcrcIndexService,
Expand Down
4 changes: 2 additions & 2 deletions packages/ledger-icrc/src/ledger.canister.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ActorSubclass } from "@dfinity/agent";
import { Principal } from "@dfinity/principal";
import { arrayOfNumberToUint8Array, toNullable } from "@dfinity/utils";
import type { ActorSubclass } from "@icp-sdk/core/agent";
import { Principal } from "@icp-sdk/core/principal";
import { mock } from "vitest-mock-extended";
import type { Account } from "../candid/icrc_index";
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/ledger.canister.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Principal } from "@dfinity/principal";
import {
Canister,
createServices,
toNullable,
type Nullable,
type QueryParams,
} from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";
import type {
Account,
Allowance,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/mocks/ledger.mock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";
import type { MetadataValue } from "../../candid/icrc_ledger";
import { IcrcMetadataResponseEntries } from "../types/ledger.responses";

Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/types/canister.options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Principal } from "@dfinity/principal";
import type { CanisterOptions } from "@dfinity/utils";
import type { Principal } from "@icp-sdk/core/principal";

export interface IcrcLedgerCanisterOptions<T>
extends Omit<CanisterOptions<T>, "canisterId"> {
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/types/ledger.responses.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Principal } from "@dfinity/principal";
import type { Principal } from "@icp-sdk/core/principal";
import type { Subaccount, Value } from "../../candid/icrc_ledger";

// Source: https://github.com/dfinity/icrc-1#standard-metadata-entries
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/utils/ledger.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Principal } from "@dfinity/principal";
import { Principal } from "@icp-sdk/core/principal";
import { mockPrincipal } from "../mocks/ledger.mock";
import {
IcrcMetadataResponseEntries,
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger-icrc/src/utils/ledger.utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Principal } from "@dfinity/principal";
import {
bigEndianCrc32,
encodeBase32,
Expand All @@ -8,6 +7,7 @@ import {
notEmptyString,
uint8ArrayToHexString,
} from "@dfinity/utils";
import { Principal } from "@icp-sdk/core/principal";
import {
IcrcMetadataResponseEntries,
type IcrcAccount,
Expand Down
12 changes: 6 additions & 6 deletions packages/nns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ Parameters:

Merge Maturity of a neuron

| Method | Type |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
| Method | Type |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: any; nonce?: bigint or undefined; }) => Promise<bigint>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L867)

Expand Down Expand Up @@ -561,9 +561,9 @@ Remove hotkey to neuron

Gets the NeuronID of a newly created neuron.

| Method | Type |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal or undefined; }) => Promise<bigint or undefined>` |
| Method | Type |
| --------------------------------- | ---------------------------------------------------------------------------------------------- |
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: any; }) => Promise<bigint or undefined>` |

[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L952)

Expand Down
Loading