Skip to content

Commit

Permalink
Merge pull request #2668 from demergent-labs/canisters_idl
Browse files Browse the repository at this point in the history
Change import paths `azle/canisters/[canisterName]` to `azle/canisters/[canisterName]/idl` (breaking changes)
  • Loading branch information
lastmjs authored Feb 11, 2025
2 parents 1d9b95d + 102c27f commit 812b025
Show file tree
Hide file tree
Showing 44 changed files with 30 additions and 22 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getCrc32 } from '@dfinity/principal/lib/esm/utils/getCrc';
import jsSHA from 'jssha';

import { blob, Principal } from '../../../src/lib/experimental';
import { blob, Principal } from '../../../../src/lib/experimental';

// TODO we need to review these heavily
export function hexAddressFromPrincipal(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
millisatoshi_per_byte,
satoshi,
utxo
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';
import * as bitcoinApi from 'basic_bitcoin/src/bitcoin_api';
import {
determineNetwork,
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/demo/bitcoin_psbt/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { jsonParse, jsonStringify } from 'azle';
import { bitcoin_network } from 'azle/canisters/management';
import { bitcoin_network } from 'azle/canisters/management/idl';
import { determineKeyName, determineNetwork } from 'basic_bitcoin/src';
import * as bitcoinApi from 'basic_bitcoin/src/bitcoin_api';
import express, { Request } from 'express';
Expand Down
6 changes: 5 additions & 1 deletion examples/experimental/demo/ckbtc/wallet/backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// better using the latest Wasm and did that I know of

import { call, canisterSelf, IDL, msgCaller, Principal, update } from 'azle';
import { Account, TransferArgs, TransferResult } from 'azle/canisters/icrc_1';
import {
Account,
TransferArgs,
TransferResult
} from 'azle/canisters/icrc_1/idl';

import {
GetBtcAddressArgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// better using the latest Wasm and did that I know of

import { call, canisterSelf, IDL, msgCaller } from 'azle';
import { Account, TransferArgs, TransferResult } from 'azle/canisters/icrc_1';
import {
Account,
TransferArgs,
TransferResult
} from 'azle/canisters/icrc_1/idl';
import {
blob,
Canister,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { call, canisterSelf } from 'azle';
import {
http_request_args,
http_request_result
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';
import {
Canister,
ic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
SupportedStandard,
TransferArgs,
TransferResult
} from 'azle/canisters/icrc_1';
} from 'azle/canisters/icrc_1/idl';
import {
AllowanceArgs,
AllowanceResult,
ApproveArgs,
ApproveResult,
TransferFromArgs,
TransferFromResult
} from 'azle/canisters/icrc_2';
} from 'azle/canisters/icrc_2/idl';
import {
Canister,
nat,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TransferFee,
TransferFeeArg,
TransferResult
} from 'azle/canisters/icp';
} from 'azle/canisters/icp/idl';
import {
Canister,
nat32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
uninstall_code_args,
update_settings_args,
upload_chunk_args
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';
import {
blob,
bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ecdsa_public_key_result,
sign_with_ecdsa_args,
sign_with_ecdsa_result
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';
import { blob, Canister, Record, serialize, update } from 'azle/experimental';

const PublicKey = Record({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { call, candidEncode, canisterSelf, msgReply } from 'azle';
import {
http_request_args,
http_request_result
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';
import {
Canister,
ic,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
bitcoin_get_utxos_args,
bitcoin_get_utxos_result,
bitcoin_send_transaction_args
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';

const BITCOIN_API_CYCLE_COST = 100_000_000n;
const BITCOIN_BASE_TRANSACTION_COST = 5_000_000_000n;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
http_request_args,
http_request_result,
http_transform_args
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';

export default class {
stableStorage = new StableBTreeMap<string, string>(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
TransferArgs,
TransferResult,
Value
} from 'azle/canisters/icrc_1';
} from 'azle/canisters/icrc_1/idl';
import {
AllowanceArgs,
AllowanceResult,
Expand All @@ -13,7 +13,7 @@ import {
SupportedStandard,
TransferFromArgs,
TransferFromResult
} from 'azle/canisters/icrc_2';
} from 'azle/canisters/icrc_2/idl';

export default class {
icrcPrincipal = getIcrcPrincipal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
TransferFee,
TransferFeeArg,
TransferResult
} from 'azle/canisters/icp';
} from 'azle/canisters/icp/idl';

export default class {
icpCanisterPrincipal = getIcpCanisterPrincipal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
update_settings_args,
upload_chunk_args,
upload_chunk_result
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';

type State = {
createdCanisterId: Principal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ecdsa_public_key_result,
sign_with_ecdsa_args,
sign_with_ecdsa_result
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';

const PublicKey = IDL.Record({
publicKey: IDL.Vec(IDL.Nat8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
http_request_args,
http_request_result,
http_transform_args
} from 'azle/canisters/management';
} from 'azle/canisters/management/idl';

export default class {
@update([], IDL.Text)
Expand Down
2 changes: 1 addition & 1 deletion src/build/experimental/commands/compile/get_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getContext(
const consumer = await getConsumer(canisterConfig);
const managementDid = (
await readFile(
join(AZLE_PACKAGE_PATH, 'canisters', 'management', 'ic.did')
join(AZLE_PACKAGE_PATH, 'canisters', 'management', 'idl', 'ic.did')
)
).toString();
const wasmData: WasmData = {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/experimental/fetch/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '../experimental';

import { inflate } from 'pako';

import { http_transform } from '../../../../canisters/management';
import { http_transform } from '../../../../canisters/management/idl';
import { canisterSelf } from '../../stable/ic_apis/canister_self';
import { azleFetch, serialize } from '.';
import { AzleFetchResponse } from './response';
Expand Down

0 comments on commit 812b025

Please sign in to comment.