Skip to content

Commit

Permalink
Merge branch 'main' into manual
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs authored Jun 24, 2024
2 parents a0fe11e + 1cefab0 commit fd947be
Show file tree
Hide file tree
Showing 361 changed files with 8,719 additions and 2,257 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ jobs:
"tests/end_to_end/candid_rpc/class_syntax/stable_memory",
"tests/end_to_end/candid_rpc/class_syntax/stable_structures",
"tests/end_to_end/candid_rpc/class_syntax/timers",
"tests/end_to_end/candid_rpc/class_syntax/tuple_types",
"tests/end_to_end/candid_rpc/class_syntax/update",
"tests/end_to_end/candid_rpc/class_syntax/vanilla_js"
]
END
)
Expand Down
2 changes: 1 addition & 1 deletion examples/async_await/src/async_await.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { blob, Canister, ic, update, Void } from 'azle';
import { managementCanister } from 'azle/canisters/management';
import { blob, Canister, ic, update, Void } from 'azle/experimental';

export default Canister({
getRandomnessDirectly: update([], blob, async () => {
Expand Down
1 change: 1 addition & 0 deletions examples/async_await/test/tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActorSubclass } from '@dfinity/agent';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/async_await/async_await.did';

export function getTests(async_await_canister: ActorSubclass<_SERVICE>): Test {
Expand Down
2 changes: 1 addition & 1 deletion examples/audio_recorder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
update,
Variant,
Vec
} from 'azle';
} from 'azle/experimental';

const User = Record({
id: Principal,
Expand Down
1 change: 1 addition & 0 deletions examples/audio_recorder/test/tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActorSubclass } from '@dfinity/agent';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/audio_recorder/audio_recorder.did';

// TODO to be more thorough we could test all of the error cases as well
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_bitcoin/src/bitcoin_api.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { serialize } from 'azle';
import {
BitcoinNetwork,
GetUtxosResult,
MillisatoshiPerByte
} from 'azle/canisters/management/bitcoin';
import { serialize } from 'azle/experimental';

// The fees for the various bitcoin endpoints.
const GET_BALANCE_COST_CYCLES: bigint = 100_000_000n;
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_bitcoin/src/ecdsa_api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { serialize } from 'azle';
import { serialize } from 'azle/experimental';

// The fee for the `sign_with_ecdsa` endpoint using the test key.
const SIGN_WITH_ECDSA_COST_CYCLES: bigint = 10_000_000_000n;
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_bitcoin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { jsonParse, jsonStringify } from 'azle';
import { BitcoinNetwork } from 'azle/canisters/management';
import { jsonParse, jsonStringify } from 'azle/experimental';
import express, { Request } from 'express';

import * as bitcoinApi from './bitcoin_api';
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_bitcoin/test/tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeAll } from '@jest/globals';
import { jsonParse, jsonStringify } from 'azle';
import { GetUtxosResult, Utxo } from 'azle/canisters/management';
import { jsonParse, jsonStringify } from 'azle/experimental';
import { expect, it, please, Test, wait } from 'azle/test/jest';
import { Transaction } from 'bitcoinjs-lib';

Expand Down
10 changes: 9 additions & 1 deletion examples/bitcoin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { blob, bool, Canister, serialize, text, update, Vec } from 'azle';
import {
GetUtxosResult,
MillisatoshiPerByte,
Satoshi
} from 'azle/canisters/management';
import {
blob,
bool,
Canister,
serialize,
text,
update,
Vec
} from 'azle/experimental';

const BITCOIN_API_CYCLE_COST = 100_000_000n;
const BITCOIN_BASE_TRANSACTION_COST = 5_000_000_000n;
Expand Down
1 change: 1 addition & 0 deletions examples/bitcoin/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { afterAll, beforeAll } from '@jest/globals';
import { expect, it, please, Test, wait } from 'azle/test/jest';

import { bitcoinCli } from './bitcoin_cli';
// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/bitcoin/bitcoin.did';
import {
BitcoinDaemon,
Expand Down
2 changes: 1 addition & 1 deletion examples/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 { BitcoinNetwork } from 'azle/canisters/management';
import { jsonParse, jsonStringify } from 'azle/experimental';
import { determineKeyName, determineNetwork } from 'basic_bitcoin/src';
import * as bitcoinApi from 'basic_bitcoin/src/bitcoin_api';
import express, { Request } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion examples/blob_array/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { blob, Canister, query, Vec } from 'azle';
import { blob, Canister, query, Vec } from 'azle/experimental';

export default Canister({
getBlob: query([], blob, () => {
Expand Down
1 change: 1 addition & 0 deletions examples/blob_array/test/tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActorSubclass } from '@dfinity/agent';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/blob_array/blob_array.did';

const HELLO_BYTES = Uint8Array.from([104, 101, 108, 108, 111]);
Expand Down
2 changes: 1 addition & 1 deletion examples/bytes/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { blob, Canister, update } from 'azle';
import { blob, Canister, update } from 'azle/experimental';

export default Canister({
getBytes: update([blob], blob, (bytes) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/call_raw/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Result,
text,
update
} from 'azle';
} from 'azle/experimental';

export default Canister({
executeCallRaw: update(
Expand Down
1 change: 1 addition & 0 deletions examples/call_raw/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ActorSubclass } from '@dfinity/agent';
import { Principal } from '@dfinity/principal';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/call_raw/call_raw.did';

export function getTests(call_raw_canister: ActorSubclass<_SERVICE>): Test {
Expand Down
2 changes: 1 addition & 1 deletion examples/candid_encoding/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { blob, Canister, ic, query, text } from 'azle';
import { blob, Canister, ic, query, text } from 'azle/experimental';

export default Canister({
// encodes a Candid string to Candid bytes
Expand Down
1 change: 1 addition & 0 deletions examples/candid_encoding/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { describe } from '@jest/globals';
import { expect, it, please, Test } from 'azle/test/jest';
import { execSync } from 'child_process';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/candid_encoding/candid_encoding.did';

export function getTests(
Expand Down
2 changes: 1 addition & 1 deletion examples/candid_keywords/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
Variant,
Vec,
Void
} from 'azle';
} from 'azle/experimental';

const MyCanister = Canister({
query1: query([], bool),
Expand Down
1 change: 1 addition & 0 deletions examples/candid_keywords/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ActorSubclass } from '@dfinity/agent';
import { Principal } from '@dfinity/principal';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/candid_keywords/candid_keywords.did';

export function getTests(candid_canister: ActorSubclass<_SERVICE>): Test {
Expand Down
2 changes: 1 addition & 1 deletion examples/canister/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
text,
update,
Vec
} from 'azle';
} from 'azle/experimental';

import SomeCanister from './some_canister';

Expand Down
2 changes: 1 addition & 1 deletion examples/canister/src/some_canister.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bool, Canister, query, text, update } from 'azle';
import { bool, Canister, query, text, update } from 'azle/experimental';

export default Canister({
query1: query([], bool, () => {
Expand Down
1 change: 1 addition & 0 deletions examples/canister/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Principal } from '@dfinity/principal';
import { getCanisterId } from 'azle/dfx';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/canister/canister.did';

export function getTests(canister: ActorSubclass<_SERVICE>): Test {
Expand Down
6 changes: 3 additions & 3 deletions examples/ckbtc/wallet/backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// TODO maybe this should be Ledger? We should look into making the Ledger
// better using the latest Wasm and did that I know of

import { ICRC } from 'azle/canisters/icrc';
import { TransferError } from 'azle/canisters/icrc/icrc_1';
import {
blob,
Canister,
Expand All @@ -16,9 +18,7 @@ import {
Some,
text,
update
} from 'azle';
import { ICRC } from 'azle/canisters/icrc';
import { TransferError } from 'azle/canisters/icrc/icrc_1';
} from 'azle/experimental';

import { Minter, UpdateBalanceResult } from './minter';

Expand Down
2 changes: 1 addition & 1 deletion examples/ckbtc/wallet/backend/minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
update,
Variant,
Vec
} from 'azle';
} from 'azle/experimental';

const Utxo = Record({
outpoint: Record({ txid: Vec(nat8), vout: nat32 }),
Expand Down
2 changes: 1 addition & 1 deletion examples/ckbtc/wallet/frontend/elements/ck-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { ActorSubclass, HttpAgent, Identity } from '@dfinity/agent';
import { AuthClient } from '@dfinity/auth-client';
import { nat, nat64 } from 'azle';
import { nat, nat64 } from 'azle/experimental';
import { html, LitElement } from 'lit';
import { customElement, state } from 'lit/decorators.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/complex_init/src/complex_init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Some,
text,
Tuple
} from 'azle';
} from 'azle/experimental';

const User = Record({
id: text
Expand Down
10 changes: 9 additions & 1 deletion examples/complex_init/src/rec_init/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { Canister, init, nat, Null, query, Recursive, Variant } from 'azle';
import {
Canister,
init,
nat,
Null,
query,
Recursive,
Variant
} from 'azle/experimental';

const Node = Recursive(() =>
Variant({
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/candid_types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Null, Record, Recursive, text, Variant, Vec } from 'azle';
import { Null, Record, Recursive, text, Variant, Vec } from 'azle/experimental';

export const ReactionType = Variant({
Fire: Null,
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canister } from 'azle';
import { Canister } from 'azle/experimental';

import { createPost, getAllPosts } from './posts';
import { createReaction, getAllReactions } from './reactions';
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/posts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nat32, query, text, update, Vec } from 'azle';
import { nat32, query, text, update, Vec } from 'azle/experimental';

import { Post } from './candid_types';
import { getReactionFromStateReaction } from './reactions';
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/reactions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nat32, query, text, update, Vec } from 'azle';
import { nat32, query, text, update, Vec } from 'azle/experimental';

import { Reaction, ReactionType } from './candid_types';
import { getPostFromStatePost } from './posts';
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vec } from 'azle';
import { Vec } from 'azle/experimental';

import { ReactionType } from './candid_types';

Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/threads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nat32, query, text, update, Vec } from 'azle';
import { nat32, query, text, update, Vec } from 'azle/experimental';

import { Thread } from './candid_types';
import { getPostFromStatePost } from './posts';
Expand Down
2 changes: 1 addition & 1 deletion examples/complex_types/src/users.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nat32, query, text, update, Vec } from 'azle';
import { nat32, query, text, update, Vec } from 'azle/experimental';

import { User } from './candid_types';
import { getPostFromStatePost } from './posts';
Expand Down
1 change: 1 addition & 0 deletions examples/composite_queries/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ActorSubclass } from '@dfinity/agent';
import { getCanisterId } from 'azle/dfx';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/canister1/canister1.did';

export function getTests(canister1: ActorSubclass<_SERVICE>): Test {
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canister, nat64, query, update } from 'azle';
import { Canister, nat64, query, update } from 'azle/experimental';

let count: nat64 = 0n;

Expand Down
1 change: 1 addition & 0 deletions examples/counter/test/tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActorSubclass } from '@dfinity/agent';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/counter/counter.did';

export function getTests(counterCanister: ActorSubclass<_SERVICE>): Test {
Expand Down
2 changes: 1 addition & 1 deletion examples/cycles/src/cycles/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canister, ic, nat, nat64, query, update } from 'azle';
import { Canister, ic, nat, nat64, query, update } from 'azle/experimental';

export default Canister({
receiveCycles: update([], nat64, () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/cycles/src/intermediary/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
serialize,
update,
Void
} from 'azle';
} from 'azle/experimental';

import Cycles from '../cycles';

Expand Down
2 changes: 1 addition & 1 deletion examples/date/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Canister, nat32, nat64, query, text } from 'azle';
import { Canister, nat32, nat64, query, text } from 'azle/experimental';

export default Canister({
getDate: query([text], nat32, (isoString) => {
Expand Down
12 changes: 6 additions & 6 deletions examples/ethereum_json_rpc/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import {
HttpResponse,
HttpTransformArgs,
managementCanister
} from 'azle/canisters/management';
import {
Canister,
ic,
Expand All @@ -9,12 +14,7 @@ import {
StableBTreeMap,
text,
update
} from 'azle';
import {
HttpResponse,
HttpTransformArgs,
managementCanister
} from 'azle/canisters/management';
} from 'azle/experimental';

let stableStorage = StableBTreeMap<text, text>(0);

Expand Down
1 change: 1 addition & 0 deletions examples/ethereum_json_rpc/test/tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActorSubclass } from '@dfinity/agent';
import { expect, it, Test } from 'azle/test/jest';

// @ts-ignore this path may not exist when these tests are imported into other test projects
import { _SERVICE } from './dfx_generated/ethereum_json_rpc/ethereum_json_rpc.did';

export function getTests(
Expand Down
2 changes: 1 addition & 1 deletion examples/ethers_base/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// just use a faucet like https://www.ethereum-ecosystem.com/faucets/base-sepolia to get some more
// We should be good for a few hundred tests

import { jsonParse } from 'azle';
import { jsonParse } from 'azle/experimental';
import { expect, it, Test, wait } from 'azle/test/jest';

let callerAddress: string;
Expand Down
2 changes: 1 addition & 1 deletion examples/fetch_ic/src/backend/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ic } from 'azle';
import { ic } from 'azle/experimental';
import express from 'express';

const app = express();
Expand Down
2 changes: 1 addition & 1 deletion examples/func_types/canisters/func_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
Variant,
Vec,
Void
} from 'azle';
} from 'azle/experimental';

import Notifier, { NotifierFunc } from '../notifiers';

Expand Down
Loading

0 comments on commit fd947be

Please sign in to comment.