-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'js_rearchitecture' into azle_book_rewrite
- Loading branch information
Showing
165 changed files
with
3,699 additions
and
4,141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
// JS docs licensed under: | ||
// | ||
// - https://github.com/dfinity/cdk-rs/blob/main/LICENSE | ||
// | ||
// Some documentation changed from original work. | ||
|
||
import { | ||
Record, | ||
Opt, | ||
Vec, | ||
Principal, | ||
Variant, | ||
nat64, | ||
nat8, | ||
Null | ||
} from '../../src/lib'; | ||
import { managementCanister } from '.'; | ||
|
||
/** Argument type of {@link managementCanister.canister_info}. */ | ||
export const CanisterInfoArgs = Record({ | ||
/** Principle of the canister. */ | ||
canister_id: Principal, | ||
/** | ||
* Number of most recent changes requested to be retrieved from canister | ||
* history. No changes are retrieved if this field is `None`. | ||
*/ | ||
num_requested_changes: Opt(nat64) | ||
}); | ||
|
||
/** Details about a canister creation. */ | ||
export const CreationRecord = Record({ | ||
/** Initial set of canister controllers. */ | ||
controllers: Vec(Principal) | ||
}); | ||
|
||
/** The mode with which a canister is installed. */ | ||
export const CanisterInstallMode = Variant({ | ||
/** A fresh install of a new canister. */ | ||
install: Null, | ||
/** Reinstalling a canister that was already installed. */ | ||
reinstall: Null, | ||
/** Upgrade an existing canister. */ | ||
upgrade: Null | ||
}); | ||
|
||
/** Details about a canister code deployment. */ | ||
export const CodeDeploymentRecord = Record({ | ||
/** See {@link CanisterInstallMode}. */ | ||
mode: CanisterInstallMode, | ||
/** A SHA256 hash of the new module installed on the canister. */ | ||
module_hash: Vec(nat8) | ||
}); | ||
|
||
/** Details about updating canister controllers. */ | ||
export const ControllersChangeRecord = Record({ | ||
/** The full new set of canister controllers. */ | ||
controllers: Vec(Principal) | ||
}); | ||
|
||
/** Provides details on the respective canister change. */ | ||
export const CanisterChangeDetails = Variant({ | ||
/** See {@link CreationRecord}. */ | ||
creation: CreationRecord, | ||
/** Uninstalling canister's module */ | ||
code_uninstall: Null, | ||
/** See {@link CodeDeploymentRecord}. */ | ||
code_deployment: CodeDeploymentRecord, | ||
/** See {@link ControllersChangeRecord}. */ | ||
controllers_change: ControllersChangeRecord | ||
}); | ||
|
||
/** Details about a canister change initiated by a user. */ | ||
export const FromUserRecord = Record({ | ||
/** Principle of the user. */ | ||
user_id: Principal | ||
}); | ||
|
||
/** | ||
* Details about a canister change initiated by a canister (called *originator*). | ||
*/ | ||
export const FromCanisterRecord = Record({ | ||
/** Principle of the originator. */ | ||
canister_id: Principal, | ||
/** | ||
* Canister version of the originator when the originator initiated the | ||
* change. This is `None` if the original does not include its canister | ||
* version in the field `sender_canister_version` of the management canister | ||
* payload. | ||
*/ | ||
canister_version: Opt(nat64) | ||
}); | ||
|
||
/** Provides details on who initiated a canister change. */ | ||
export const CanisterChangeOrigin = Variant({ | ||
/** See {@link FromUserRecord}. */ | ||
from_user: FromUserRecord, | ||
/** See {@link FromCanisterRecord}. */ | ||
from_canister: FromCanisterRecord | ||
}); | ||
|
||
/** Represents a canister change as stored in the canister history. */ | ||
export const CanisterChange = Record({ | ||
/** | ||
* The system timestamp (in nanoseconds since Unix Epoch) at which the | ||
* change was performed | ||
*/ | ||
timestamp_nanos: nat64, | ||
/** The canister version after performing the change. */ | ||
canister_version: nat64, | ||
/** The change’s origin (a user or a canister). */ | ||
origin: CanisterChangeOrigin, | ||
/** The change’s details. */ | ||
details: CanisterChangeDetails | ||
}); | ||
|
||
/** Return type of {@link managementCanister.canister_info}. */ | ||
export const CanisterInfoResult = Record({ | ||
/** | ||
* Total number of changes ever recorded in canister history. This might be | ||
* higher than the number of canister changes in recent_changes because the | ||
* IC might drop old canister changes from its history (with 20 most recent | ||
* canister changes to always remain in the list). | ||
*/ | ||
total_num_changes: nat64, | ||
/** | ||
* The canister changes stored in the order from the oldest to the most | ||
* recent. | ||
*/ | ||
recent_changes: Vec(CanisterChange), | ||
/** | ||
* A SHA256 hash of the module installed on the canister. This is null if | ||
* the canister is empty. | ||
*/ | ||
module_hash: Opt(Vec(nat8)), | ||
/** Controllers of the canister. */ | ||
controllers: Vec(Principal) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
type rec_2 = record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}; | ||
type rec_3 = record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}; | ||
type rec_4 = record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}; | ||
type rec_5 = record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}; | ||
type rec_6 = variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}; | ||
type rec_7 = record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; | ||
type rec_8 = variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}; | ||
type rec_9 = record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; | ||
type rec_10 = record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; | ||
type rec_11 = record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; | ||
type rec_12 = variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}; | ||
service: () -> { | ||
createUser: (text) -> (rec_2); | ||
readUsers: () -> (vec rec_3) query; | ||
readUserById: (principal) -> (opt rec_4) query; | ||
deleteUser: (principal) -> (variant {Ok:rec_5; Err:rec_6}); | ||
createRecording: (vec nat8, text, principal) -> (variant {Ok:rec_7; Err:rec_8}); | ||
readRecordings: () -> (vec rec_9) query; | ||
readRecordingById: (principal) -> (opt rec_10) query; | ||
deleteRecording: (principal) -> (variant {Ok:rec_11; Err:rec_12}); | ||
createRecording: (vec nat8, text, principal) -> (variant {Ok:record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; Err:variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}}); | ||
createUser: (text) -> (record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}); | ||
deleteRecording: (principal) -> (variant {Ok:record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}; Err:variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}}); | ||
deleteUser: (principal) -> (variant {Ok:record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}; Err:variant {RecordingDoesNotExist:principal; UserDoesNotExist:principal}}); | ||
readRecordingById: (principal) -> (opt record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}) query; | ||
readRecordings: () -> (vec record {id:principal; audio:vec nat8; userId:principal; name:text; createdAt:nat64}) query; | ||
readUserById: (principal) -> (opt record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}) query; | ||
readUsers: () -> (vec record {id:principal; username:text; recordingIds:vec principal; createdAt:nat64}) query; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,15 @@ | ||
type rec_41 = variant {Int:int; Nat:nat; Blob:vec nat8; Text:text}; | ||
type rec_42 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_43 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_45 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_44 = record {to:rec_45; fee:opt nat; memo:opt vec nat8; from_subaccount:opt vec nat8; created_at_time:opt nat64; amount:nat}; | ||
type rec_53 = record {message:text; error_code:nat}; | ||
type rec_49 = record {min_burn_amount:nat}; | ||
type rec_52 = record {duplicate_of:nat}; | ||
type rec_48 = record {expected_fee:nat}; | ||
type rec_51 = record {ledger_time:nat64}; | ||
type rec_50 = record {balance:nat}; | ||
type rec_47 = variant {GenericError:rec_53; TemporarilyUnavailable; BadBurn:rec_49; Duplicate:rec_52; BadFee:rec_48; CreatedInFuture:rec_51; TooOld; InsufficientFunds:rec_50}; | ||
type rec_46 = variant {Ok:nat; Err:rec_47}; | ||
type rec_54 = record {url:text; name:text}; | ||
type rec_56 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_55 = record {fee:opt nat; memo:opt vec nat8; from_subaccount:opt vec nat8; created_at_time:opt nat64; amount:nat; expected_allowance:opt nat; expires_at:opt nat64; spender:rec_56}; | ||
type rec_65 = record {message:text; error_code:nat}; | ||
type rec_64 = record {duplicate_of:nat}; | ||
type rec_59 = record {expected_fee:nat}; | ||
type rec_61 = record {current_allowance:nat}; | ||
type rec_63 = record {ledger_time:nat64}; | ||
type rec_62 = record {ledger_time:nat64}; | ||
type rec_60 = record {balance:nat}; | ||
type rec_58 = variant {GenericError:rec_65; TemporarilyUnavailable; Duplicate:rec_64; BadFee:rec_59; AllowanceChanged:rec_61; CreatedInFuture:rec_63; TooOld; Expired:rec_62; InsufficientFunds:rec_60}; | ||
type rec_57 = variant {Ok:nat; Err:rec_58}; | ||
type rec_68 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_67 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_66 = record {to:rec_68; fee:opt nat; from:rec_67; memo:opt vec nat8; created_at_time:opt nat64; amount:nat}; | ||
type rec_77 = record {message:text; error_code:nat}; | ||
type rec_74 = record {allowance:nat}; | ||
type rec_72 = record {min_burn_amount:nat}; | ||
type rec_76 = record {duplicate_of:nat}; | ||
type rec_71 = record {expected_fee:nat}; | ||
type rec_75 = record {ledger_time:nat64}; | ||
type rec_73 = record {balance:nat}; | ||
type rec_70 = variant {GenericError:rec_77; TemporarilyUnavailable; InsufficientAllowance:rec_74; BadBurn:rec_72; Duplicate:rec_76; BadFee:rec_71; CreatedInFuture:rec_75; TooOld; InsufficientFunds:rec_73}; | ||
type rec_69 = variant {Ok:nat; Err:rec_70}; | ||
type rec_79 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_80 = record {owner:principal; subaccount:opt vec nat8}; | ||
type rec_78 = record {account:rec_79; spender:rec_80}; | ||
type rec_81 = record {allowance:nat; expires_at:opt nat64}; | ||
service: () -> { | ||
icrc1_metadata: () -> (vec record {text; rec_41}) query; | ||
icrc1_name: () -> (text) query; | ||
icrc1_balance_of: (record {owner:principal; subaccount:opt vec nat8}) -> (nat) query; | ||
icrc1_decimals: () -> (nat8) query; | ||
icrc1_symbol: () -> (text) query; | ||
icrc1_fee: () -> (nat) query; | ||
icrc1_metadata: () -> (vec record {text; variant {Int:int; Nat:nat; Blob:vec nat8; Text:text}}) query; | ||
icrc1_minting_account: () -> (opt record {owner:principal; subaccount:opt vec nat8}) query; | ||
icrc1_name: () -> (text) query; | ||
icrc1_supported_standards: () -> (vec record {url:text; name:text}) query; | ||
icrc1_symbol: () -> (text) query; | ||
icrc1_total_supply: () -> (nat) query; | ||
icrc1_minting_account: () -> (opt rec_42) query; | ||
icrc1_balance_of: (rec_43) -> (nat) query; | ||
icrc1_transfer: (rec_44) -> (rec_46); | ||
icrc1_supported_standards: () -> (vec rec_54) query; | ||
icrc2_approve: (rec_55) -> (rec_57); | ||
icrc2_transfer_from: (rec_66) -> (rec_69); | ||
icrc2_allowance: (rec_78) -> (rec_81); | ||
icrc1_transfer: (record {to:record {owner:principal; subaccount:opt vec nat8}; fee:opt nat; memo:opt vec nat8; from_subaccount:opt vec nat8; created_at_time:opt nat64; amount:nat}) -> (variant {Ok:nat; Err:variant {GenericError:record {message:text; error_code:nat}; TemporarilyUnavailable; BadBurn:record {min_burn_amount:nat}; Duplicate:record {duplicate_of:nat}; BadFee:record {expected_fee:nat}; CreatedInFuture:record {ledger_time:nat64}; TooOld; InsufficientFunds:record {balance:nat}}}); | ||
icrc2_allowance: (record {account:record {owner:principal; subaccount:opt vec nat8}; spender:record {owner:principal; subaccount:opt vec nat8}}) -> (record {allowance:nat; expires_at:opt nat64}); | ||
icrc2_approve: (record {fee:opt nat; memo:opt vec nat8; from_subaccount:opt vec nat8; created_at_time:opt nat64; amount:nat; expected_allowance:opt nat; expires_at:opt nat64; spender:record {owner:principal; subaccount:opt vec nat8}}) -> (variant {Ok:nat; Err:variant {GenericError:record {message:text; error_code:nat}; TemporarilyUnavailable; Duplicate:record {duplicate_of:nat}; BadFee:record {expected_fee:nat}; AllowanceChanged:record {current_allowance:nat}; CreatedInFuture:record {ledger_time:nat64}; TooOld; Expired:record {ledger_time:nat64}; InsufficientFunds:record {balance:nat}}}); | ||
icrc2_transfer_from: (record {to:record {owner:principal; subaccount:opt vec nat8}; fee:opt nat; from:record {owner:principal; subaccount:opt vec nat8}; memo:opt vec nat8; created_at_time:opt nat64; amount:nat}) -> (variant {Ok:nat; Err:variant {GenericError:record {message:text; error_code:nat}; TemporarilyUnavailable; InsufficientAllowance:record {allowance:nat}; BadBurn:record {min_burn_amount:nat}; Duplicate:record {duplicate_of:nat}; BadFee:record {expected_fee:nat}; CreatedInFuture:record {ledger_time:nat64}; TooOld; InsufficientFunds:record {balance:nat}}}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
service: () -> { | ||
accessible: () -> (bool); | ||
inaccessible: () -> (bool); | ||
alsoInaccessible: () -> (bool); | ||
inaccessible: () -> (bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.