diff --git a/examples/canister/dfx.json b/examples/canister/dfx.json index afb29f81aa..0e29c3875a 100644 --- a/examples/canister/dfx.json +++ b/examples/canister/dfx.json @@ -5,12 +5,7 @@ "main": "src/index.ts", "candid_gen": "automatic", "env": ["SOME_CANISTER_PRINCIPAL", "AZLE_TEST_FETCH"], - "assets": [ - [ - ".azle/some_canister/some_canister.did", - "candid/some_canister.did" - ] - ], + "assets": [["src/some_canister.did", "candid/some_canister.did"]], "declarations": { "output": "test/dfx_generated/canister", "node_compatibility": true @@ -19,6 +14,7 @@ "some_canister": { "type": "azle", "main": "src/some_canister.ts", + "candid": "src/some_canister.did", "candid_gen": "automatic", "declarations": { "output": "test/dfx_generated/some_canister", diff --git a/examples/canister/src/some_canister.did b/examples/canister/src/some_canister.did new file mode 100644 index 0000000000..f61de65f9f --- /dev/null +++ b/examples/canister/src/some_canister.did @@ -0,0 +1,4 @@ +service: () -> { + query1: () -> (bool) query; + update1: () -> (text); +} diff --git a/examples/composite_queries/dfx.json b/examples/composite_queries/dfx.json index 1f1eed988d..9dde8280a5 100644 --- a/examples/composite_queries/dfx.json +++ b/examples/composite_queries/dfx.json @@ -11,8 +11,8 @@ "AZLE_TEST_FETCH" ], "assets": [ - [".azle/canister2/canister2.did", "candid/canister2.did"], - [".azle/canister3/canister3.did", "candid/canister3.did"] + ["src/canister2/index.did", "candid/canister2.did"], + ["src/canister3/index.did", "candid/canister3.did"] ], "declarations": { "output": "test/dfx_generated/canister1", @@ -22,11 +22,10 @@ "canister2": { "type": "azle", "main": "src/canister2/index.ts", + "candid": "src/canister2/index.did", "candid_gen": "automatic", "env": ["CANISTER3_PRINCIPAL", "AZLE_TEST_FETCH"], - "assets": [ - [".azle/canister3/canister3.did", "candid/canister3.did"] - ], + "assets": [["src/canister3/index.did", "candid/canister3.did"]], "declarations": { "output": "test/dfx_generated/canister2", "node_compatibility": true @@ -35,6 +34,7 @@ "canister3": { "type": "azle", "main": "src/canister3/index.ts", + "candid": "src/canister3/index.did", "candid_gen": "automatic", "declarations": { "output": "test/dfx_generated/canister3", diff --git a/examples/composite_queries/src/canister2/index.did b/examples/composite_queries/src/canister2/index.did new file mode 100644 index 0000000000..01f39353d7 --- /dev/null +++ b/examples/composite_queries/src/canister2/index.did @@ -0,0 +1,7 @@ +service: () -> { + deepQuery: () -> (text) query; + incCounter: () -> (nat) query; + manualQuery: () -> (text) query; + simpleQuery: () -> (text) query; + updateQuery: () -> (text); +} diff --git a/examples/composite_queries/src/canister3/index.did b/examples/composite_queries/src/canister3/index.did new file mode 100644 index 0000000000..78eacc0a1e --- /dev/null +++ b/examples/composite_queries/src/canister3/index.did @@ -0,0 +1,3 @@ +service: () -> { + deepQuery: () -> (text) query; +} diff --git a/examples/cross_canister_calls/dfx.json b/examples/cross_canister_calls/dfx.json index 28d9a093de..45c879e55e 100644 --- a/examples/cross_canister_calls/dfx.json +++ b/examples/cross_canister_calls/dfx.json @@ -5,9 +5,7 @@ "main": "src/canister1/index.ts", "candid_gen": "automatic", "env": ["CANISTER2_PRINCIPAL", "AZLE_TEST_FETCH"], - "assets": [ - [".azle/canister2/canister2.did", "candid/canister2.did"] - ], + "assets": [["src/canister2/index.did", "candid/canister2.did"]], "declarations": { "output": "test/dfx_generated/canister1", "node_compatibility": true @@ -16,6 +14,7 @@ "canister2": { "type": "azle", "main": "src/canister2/index.ts", + "candid": "src/canister2/index.did", "candid_gen": "automatic", "declarations": { "output": "test/dfx_generated/canister2", diff --git a/examples/cross_canister_calls/src/canister2/index.did b/examples/cross_canister_calls/src/canister2/index.did new file mode 100644 index 0000000000..25c20581d3 --- /dev/null +++ b/examples/cross_canister_calls/src/canister2/index.did @@ -0,0 +1,9 @@ +service: () -> { + account: (record {id:text}) -> (opt record {id:text; balance:nat64}) query; + accounts: () -> (vec record {id:text; balance:nat64}) query; + balance: (text) -> (nat64) query; + getNotification: () -> (text) query; + receiveNotification: (text) -> (); + transfer: (text, text, nat64) -> (nat64); + trap: () -> (text) query; +} diff --git a/examples/cycles/dfx.json b/examples/cycles/dfx.json index 2f7ae3dac7..ceaf4fcbc2 100644 --- a/examples/cycles/dfx.json +++ b/examples/cycles/dfx.json @@ -3,6 +3,7 @@ "cycles": { "type": "azle", "main": "src/cycles/index.ts", + "candid": "src/cycles/index.did", "candid_gen": "automatic", "declarations": { "output": "test/dfx_generated/cycles", @@ -14,7 +15,7 @@ "main": "src/intermediary/index.ts", "candid_gen": "automatic", "env": ["CYCLES_PRINCIPAL", "AZLE_TEST_FETCH"], - "assets": [[".azle/cycles/cycles.did", "candid/cycles.did"]], + "assets": [["src/cycles/index.did", "candid/cycles.did"]], "declarations": { "output": "test/dfx_generated/intermediary", "node_compatibility": true diff --git a/examples/cycles/src/cycles/index.did b/examples/cycles/src/cycles/index.did new file mode 100644 index 0000000000..0d3dfd51c0 --- /dev/null +++ b/examples/cycles/src/cycles/index.did @@ -0,0 +1,6 @@ +service: () -> { + getCanisterBalance: () -> (nat64) query; + getCanisterBalance128: () -> (nat) query; + receiveCycles: () -> (nat64); + receiveCycles128: () -> (nat); +} diff --git a/examples/func_types/canisters/notifiers/index.did b/examples/func_types/canisters/notifiers/index.did new file mode 100644 index 0000000000..9ea58c8334 --- /dev/null +++ b/examples/func_types/canisters/notifiers/index.did @@ -0,0 +1,3 @@ +service: () -> { + getNotifier: () -> (func (vec nat8) -> () oneway) query; +} diff --git a/examples/func_types/dfx.json b/examples/func_types/dfx.json index a22bc2ebbe..4d7c1c6232 100644 --- a/examples/func_types/dfx.json +++ b/examples/func_types/dfx.json @@ -6,7 +6,7 @@ "candid_gen": "automatic", "env": ["NOTIFIERS_PRINCIPAL", "AZLE_TEST_FETCH"], "assets": [ - [".azle/notifiers/notifiers.did", "candid/notifiers.did"] + ["canisters/notifiers/index.did", "candid/notifiers.did"] ], "declarations": { "output": "test/dfx_generated/func_types", @@ -16,6 +16,7 @@ "notifiers": { "type": "azle", "main": "canisters/notifiers/index.ts", + "candid": "canisters/notifiers/index.did", "candid_gen": "automatic", "env": ["NOTIFIERS_PRINCIPAL"], "declarations": { diff --git a/examples/recursion/dfx.json b/examples/recursion/dfx.json index 533f2dd9e7..e8976930dc 100644 --- a/examples/recursion/dfx.json +++ b/examples/recursion/dfx.json @@ -7,7 +7,7 @@ "env": ["MY_CANISTER_PRINCIPAL", "AZLE_TEST_FETCH"], "assets": [ [ - ".azle/recursive_canister/recursive_canister.did", + "src/recursive_canister/index.did", "candid/recursive_canister.did" ] ], @@ -19,6 +19,7 @@ "recursive_canister": { "type": "azle", "main": "src/recursive_canister/index.ts", + "candid": "src/recursive_canister/index.did", "candid_gen": "automatic", "declarations": { "output": "test/dfx_generated/recursive_canister", diff --git a/examples/recursion/src/recursive_canister/index.did b/examples/recursion/src/recursive_canister/index.did new file mode 100644 index 0000000000..7c6f8c66e8 --- /dev/null +++ b/examples/recursion/src/recursive_canister/index.did @@ -0,0 +1,6 @@ +type rec_0 = service {getMessage: () -> (text) query; myQuery: (rec_0) -> (rec_0) query;}; +type rec_1 = service {getMessage: () -> (text) query; myQuery: (rec_1) -> (rec_1) query;}; +service: (text) -> { + getMessage: () -> (text) query; + myQuery: (rec_0) -> (rec_1) query; +} diff --git a/examples/rejections/dfx.json b/examples/rejections/dfx.json index 6ca5bf3cc0..28a0b93882 100644 --- a/examples/rejections/dfx.json +++ b/examples/rejections/dfx.json @@ -6,10 +6,7 @@ "candid_gen": "automatic", "env": ["SOME_CANISTER_PRINCIPAL", "AZLE_TEST_FETCH"], "assets": [ - [ - ".azle/some_canister/some_canister.did", - "candid/some_canister.did" - ], + ["src/some_canister/index.did", "candid/some_canister.did"], ["src/nonexistent.did", "candid/nonexistent.did"] ], "declarations": { @@ -20,6 +17,7 @@ "some_canister": { "type": "azle", "main": "src/some_canister/index.ts", + "candid": "src/some_canister/index.did", "candid_gen": "automatic", "declarations": { "output": "test/dfx_generated/some_canister", diff --git a/examples/rejections/src/some_canister/index.did b/examples/rejections/src/some_canister/index.did new file mode 100644 index 0000000000..4cef085492 --- /dev/null +++ b/examples/rejections/src/some_canister/index.did @@ -0,0 +1,5 @@ +service: () -> { + accept: () -> (bool) query; + error: () -> (empty) query; + reject: (text) -> (empty) query; +}