/**
* **Module ID:** `0x1::account`
*
* @module
*/
import type * as p from "@movingco/prelude";
/**
* Resource representing an account.
*
* Type name: `0x1::account::Account`
*/
export interface IAccount {
authentication_key: p.ByteString;
sequence_number: p.U64;
coin_register_events: {
/** Total number of events emitted to this event stream. */
counter: p.U64;
/** A globally unique ID for this event stream. */
guid: {
id: {
/** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */
creation_num: p.U64;
/** Address that created the GUID */
addr: p.RawAddress;
};
};
};
rotation_capability_offer: {
for: {
vec: ReadonlyArray
;
};
};
signer_capability_offer: {
for: {
vec: ReadonlyArray;
};
};
}
/** Type name: `0x1::account::CapabilityOffer` */
export interface ICapabilityOffer {
for: {
vec: ReadonlyArray;
};
}
/**
* This holds information that will be picked up by the VM to call the
* correct chain-specific prologue and epilogue functions
*
* Type name: `0x1::account::ChainSpecificAccountInfo`
*/
export interface IChainSpecificAccountInfo {
module_addr: p.RawAddress;
module_name: p.ByteString;
script_prologue_name: p.ByteString;
module_prologue_name: p.ByteString;
writeset_prologue_name: p.ByteString;
multi_agent_prologue_name: p.ByteString;
user_epilogue_name: p.ByteString;
writeset_epilogue_name: p.ByteString;
}
/** Type name: `0x1::account::CoinRegisterEvent` */
export interface ICoinRegisterEvent {
type_info: {
account_address: p.RawAddress;
module_name: p.ByteString;
struct_name: p.ByteString;
};
}
/** Type name: `0x1::account::OriginatingAddress` */
export interface IOriginatingAddress {
address_map: {
handle: p.U128;
};
}
/** Type name: `0x1::account::RotationCapability` */
export interface IRotationCapability {
account: p.RawAddress;
}
/**
* This structs stores the challenge message that should be signed during key rotation. First, this struct is
* signed by the account owner's current public key, which proves possession of a capability to rotate the key.
* Second, this struct is signed by the new public key that the account owner wants to rotate to, which proves
* knowledge of this new public key's associated secret key. These two signatures cannot be replayed in another
* context because they include the TXN's unique sequence number.
*
* Type name: `0x1::account::RotationProofChallenge`
*/
export interface IRotationProofChallenge {
sequence_number: p.U64;
originator: p.RawAddress;
current_auth_key: p.RawAddress;
new_public_key: p.ByteString;
}
/** Type name: `0x1::account::SignerCapability` */
export interface ISignerCapability {
account: p.RawAddress;
}
/** Payload arguments for {@link entry.transfer}. */
export declare type TransferArgs = {
args: {
/** IDL type: `Address` */
to: p.RawAddress;
/** IDL type: `U64` */
amount: p.U64;
};
};
/** Payload arguments for {@link entry.create_account}. */
export declare type CreateAccountArgs = {
args: {
/** IDL type: `Address` */
auth_key: p.RawAddress;
};
};
/** Payload arguments for {@link entry.rotate_authentication_key}. */
export declare type RotateAuthenticationKeyArgs = {
args: {
/** IDL type: `Vector(U8)` */
new_auth_key: p.ByteString;
};
};
/** Payload arguments for {@link entry.rotate_authentication_key_ed25519}. */
export declare type RotateAuthenticationKeyEd25519Args = {
args: {
/** IDL type: `Vector(U8)` */
curr_sig_bytes: p.ByteString;
/** IDL type: `Vector(U8)` */
new_sig_bytes: p.ByteString;
/** IDL type: `Vector(U8)` */
curr_pk_bytes: p.ByteString;
/** IDL type: `Vector(U8)` */
new_pk_bytes: p.ByteString;
};
};
export * as entry from "./entry.js";
export * as entryNames from "./entryNames.js";
export { idl } from "./idl.js";
export * as payloads from "./payloads.js";
/** The address of the module. */
export declare const ADDRESS: "0x1";
/** The full module name. */
export declare const FULL_NAME: "0x1::account";
/** The name of the module. */
export declare const NAME: "account";
/** Module ID information. */
export declare const id: {
readonly ADDRESS: "0x1";
readonly FULL_NAME: "0x1::account";
readonly NAME: "account";
};
export * as errors from "./errors.js";
/** Module error codes. */
export declare const errorCodes: {
readonly "1": {
readonly name: "EACCOUNT_ALREADY_EXISTS";
readonly doc: "Account already exists";
};
readonly "2": {
readonly name: "EACCOUNT_DOES_NOT_EXIST";
readonly doc: "Account does not exist";
};
readonly "3": {
readonly name: "ESEQUENCE_NUMBER_TOO_BIG";
readonly doc: "Sequence number exceeds the maximum value for a u64";
};
readonly "4": {
readonly name: "EMALFORMED_AUTHENTICATION_KEY";
readonly doc: "The provided authentication key has an invalid length";
};
readonly "5": {
readonly name: "ECANNOT_RESERVED_ADDRESS";
readonly doc: "Cannot create account because address is reserved";
};
readonly "6": {
readonly name: "EOUT_OF_GAS";
readonly doc: "Transaction exceeded its allocated max gas";
};
readonly "7": {
readonly name: "EWRITESET_NOT_ALLOWED";
readonly doc: "Writesets are not allowed";
};
readonly "8": {
readonly name: "EWRONG_CURRENT_PUBLIC_KEY";
readonly doc: "Specified current public key is not correct";
};
readonly "9": {
readonly name: "EINVALID_PROOF_OF_KNOWLEDGE";
readonly doc: "Specified proof of knowledge required to prove ownership of a public key is invalid";
};
readonly "10": {
readonly name: "ENO_CAPABILITY";
readonly doc: "The caller does not have a digital-signature-based capability to call this function";
};
readonly "1001": {
readonly name: "PROLOGUE_EINVALID_ACCOUNT_AUTH_KEY";
readonly doc: "Prologue errors. These are separated out from the other errors in this\nmodule since they are mapped separately to major VM statuses, and are\nimportant to the semantics of the system.";
};
readonly "1002": {
readonly name: "PROLOGUE_ESEQUENCE_NUMBER_TOO_OLD";
};
readonly "1003": {
readonly name: "PROLOGUE_ESEQUENCE_NUMBER_TOO_NEW";
};
readonly "1004": {
readonly name: "PROLOGUE_EACCOUNT_DOES_NOT_EXIST";
};
readonly "1005": {
readonly name: "PROLOGUE_ECANT_PAY_GAS_DEPOSIT";
};
readonly "1006": {
readonly name: "PROLOGUE_ETRANSACTION_EXPIRED";
};
readonly "1007": {
readonly name: "PROLOGUE_EBAD_CHAIN_ID";
};
readonly "1008": {
readonly name: "PROLOGUE_EINVALID_WRITESET_SENDER";
};
readonly "1009": {
readonly name: "PROLOGUE_ESEQUENCE_NUMBER_TOO_BIG";
};
readonly "1010": {
readonly name: "PROLOGUE_ESECONDARY_KEYS_ADDRESSES_COUNT_MISMATCH";
};
};
/** All module function IDLs. */
export declare const functions: {
readonly create_account: {
readonly name: "create_account";
readonly doc: "Basic account creation methods.";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "auth_key";
readonly ty: "address";
}];
};
readonly rotate_authentication_key: {
readonly name: "rotate_authentication_key";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "new_auth_key";
readonly ty: {
readonly vector: "u8";
};
}];
};
readonly rotate_authentication_key_ed25519: {
readonly name: "rotate_authentication_key_ed25519";
readonly doc: "Rotates the authentication key and records a mapping on chain from the new authentication key to the originating\naddress of the account. To authorize the rotation, a signature under the old public key on a `RotationProofChallenge`\nis given in `current_sig`. To ensure the account owner knows the secret key corresponding to the new public key\nin `new_pubkey`, a proof-of-knowledge is given in `new_sig` (i.e., a signature under the new public key on the\nsame `RotationProofChallenge` struct).";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "curr_sig_bytes";
readonly ty: {
readonly vector: "u8";
};
}, {
readonly name: "new_sig_bytes";
readonly ty: {
readonly vector: "u8";
};
}, {
readonly name: "curr_pk_bytes";
readonly ty: {
readonly vector: "u8";
};
}, {
readonly name: "new_pk_bytes";
readonly ty: {
readonly vector: "u8";
};
}];
};
readonly transfer: {
readonly name: "transfer";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "to";
readonly ty: "address";
}, {
readonly name: "amount";
readonly ty: "u64";
}];
};
};
/** All struct types with ability `key`. */
export declare const resources: {
readonly Account: "0x1::account::Account";
readonly ChainSpecificAccountInfo: "0x1::account::ChainSpecificAccountInfo";
readonly OriginatingAddress: "0x1::account::OriginatingAddress";
};
/** All struct types. */
export declare const structs: {
readonly Account: "0x1::account::Account";
readonly CapabilityOffer: "0x1::account::CapabilityOffer";
readonly ChainSpecificAccountInfo: "0x1::account::ChainSpecificAccountInfo";
readonly CoinRegisterEvent: "0x1::account::CoinRegisterEvent";
readonly OriginatingAddress: "0x1::account::OriginatingAddress";
readonly RotationCapability: "0x1::account::RotationCapability";
readonly RotationProofChallenge: "0x1::account::RotationProofChallenge";
readonly SignerCapability: "0x1::account::SignerCapability";
};
export declare const moduleDefinition: {
readonly errorCodes: {
readonly "1": {
readonly name: "EACCOUNT_ALREADY_EXISTS";
readonly doc: "Account already exists";
};
readonly "2": {
readonly name: "EACCOUNT_DOES_NOT_EXIST";
readonly doc: "Account does not exist";
};
readonly "3": {
readonly name: "ESEQUENCE_NUMBER_TOO_BIG";
readonly doc: "Sequence number exceeds the maximum value for a u64";
};
readonly "4": {
readonly name: "EMALFORMED_AUTHENTICATION_KEY";
readonly doc: "The provided authentication key has an invalid length";
};
readonly "5": {
readonly name: "ECANNOT_RESERVED_ADDRESS";
readonly doc: "Cannot create account because address is reserved";
};
readonly "6": {
readonly name: "EOUT_OF_GAS";
readonly doc: "Transaction exceeded its allocated max gas";
};
readonly "7": {
readonly name: "EWRITESET_NOT_ALLOWED";
readonly doc: "Writesets are not allowed";
};
readonly "8": {
readonly name: "EWRONG_CURRENT_PUBLIC_KEY";
readonly doc: "Specified current public key is not correct";
};
readonly "9": {
readonly name: "EINVALID_PROOF_OF_KNOWLEDGE";
readonly doc: "Specified proof of knowledge required to prove ownership of a public key is invalid";
};
readonly "10": {
readonly name: "ENO_CAPABILITY";
readonly doc: "The caller does not have a digital-signature-based capability to call this function";
};
readonly "1001": {
readonly name: "PROLOGUE_EINVALID_ACCOUNT_AUTH_KEY";
readonly doc: "Prologue errors. These are separated out from the other errors in this\nmodule since they are mapped separately to major VM statuses, and are\nimportant to the semantics of the system.";
};
readonly "1002": {
readonly name: "PROLOGUE_ESEQUENCE_NUMBER_TOO_OLD";
};
readonly "1003": {
readonly name: "PROLOGUE_ESEQUENCE_NUMBER_TOO_NEW";
};
readonly "1004": {
readonly name: "PROLOGUE_EACCOUNT_DOES_NOT_EXIST";
};
readonly "1005": {
readonly name: "PROLOGUE_ECANT_PAY_GAS_DEPOSIT";
};
readonly "1006": {
readonly name: "PROLOGUE_ETRANSACTION_EXPIRED";
};
readonly "1007": {
readonly name: "PROLOGUE_EBAD_CHAIN_ID";
};
readonly "1008": {
readonly name: "PROLOGUE_EINVALID_WRITESET_SENDER";
};
readonly "1009": {
readonly name: "PROLOGUE_ESEQUENCE_NUMBER_TOO_BIG";
};
readonly "1010": {
readonly name: "PROLOGUE_ESECONDARY_KEYS_ADDRESSES_COUNT_MISMATCH";
};
};
readonly functions: {
readonly create_account: {
readonly name: "create_account";
readonly doc: "Basic account creation methods.";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "auth_key";
readonly ty: "address";
}];
};
readonly rotate_authentication_key: {
readonly name: "rotate_authentication_key";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "new_auth_key";
readonly ty: {
readonly vector: "u8";
};
}];
};
readonly rotate_authentication_key_ed25519: {
readonly name: "rotate_authentication_key_ed25519";
readonly doc: "Rotates the authentication key and records a mapping on chain from the new authentication key to the originating\naddress of the account. To authorize the rotation, a signature under the old public key on a `RotationProofChallenge`\nis given in `current_sig`. To ensure the account owner knows the secret key corresponding to the new public key\nin `new_pubkey`, a proof-of-knowledge is given in `new_sig` (i.e., a signature under the new public key on the\nsame `RotationProofChallenge` struct).";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "curr_sig_bytes";
readonly ty: {
readonly vector: "u8";
};
}, {
readonly name: "new_sig_bytes";
readonly ty: {
readonly vector: "u8";
};
}, {
readonly name: "curr_pk_bytes";
readonly ty: {
readonly vector: "u8";
};
}, {
readonly name: "new_pk_bytes";
readonly ty: {
readonly vector: "u8";
};
}];
};
readonly transfer: {
readonly name: "transfer";
readonly ty_args: readonly [];
readonly args: readonly [{
readonly name: "to";
readonly ty: "address";
}, {
readonly name: "amount";
readonly ty: "u64";
}];
};
};
readonly resources: {
readonly Account: "0x1::account::Account";
readonly ChainSpecificAccountInfo: "0x1::account::ChainSpecificAccountInfo";
readonly OriginatingAddress: "0x1::account::OriginatingAddress";
};
readonly structs: {
readonly Account: "0x1::account::Account";
readonly CapabilityOffer: "0x1::account::CapabilityOffer";
readonly ChainSpecificAccountInfo: "0x1::account::ChainSpecificAccountInfo";
readonly CoinRegisterEvent: "0x1::account::CoinRegisterEvent";
readonly OriginatingAddress: "0x1::account::OriginatingAddress";
readonly RotationCapability: "0x1::account::RotationCapability";
readonly RotationProofChallenge: "0x1::account::RotationProofChallenge";
readonly SignerCapability: "0x1::account::SignerCapability";
};
readonly ADDRESS: "0x1";
readonly FULL_NAME: "0x1::account";
readonly NAME: "account";
};
//# sourceMappingURL=index.d.ts.map