diff --git a/src/declarations/backend/backend.did.d.ts b/src/declarations/backend/backend.did.d.ts index 44dcec6f4f..bb1a6cf3db 100644 --- a/src/declarations/backend/backend.did.d.ts +++ b/src/declarations/backend/backend.did.d.ts @@ -1,168 +1,161 @@ -import type { Principal } from '@dfinity/principal'; import type { ActorMethod } from '@dfinity/agent'; import type { IDL } from '@dfinity/candid'; +import type { Principal } from '@dfinity/principal'; -export type AddUserCredentialError = { 'InvalidCredential' : null } | - { 'VersionMismatch' : null } | - { 'ConfigurationError' : null } | - { 'UserNotFound' : null }; +export type AddUserCredentialError = + | { InvalidCredential: null } + | { VersionMismatch: null } + | { ConfigurationError: null } + | { UserNotFound: null }; export interface AddUserCredentialRequest { - 'credential_jwt' : string, - 'issuer_canister_id' : Principal, - 'current_user_version' : [] | [bigint], - 'credential_spec' : CredentialSpec, -} -export type ApiEnabled = { 'ReadOnly' : null } | - { 'Enabled' : null } | - { 'Disabled' : null }; -export type Arg = { 'Upgrade' : null } | - { 'Init' : InitArg }; -export type ArgumentValue = { 'Int' : number } | - { 'String' : string }; + credential_jwt: string; + issuer_canister_id: Principal; + current_user_version: [] | [bigint]; + credential_spec: CredentialSpec; +} +export type ApiEnabled = { ReadOnly: null } | { Enabled: null } | { Disabled: null }; +export type Arg = { Upgrade: null } | { Init: InitArg }; +export type ArgumentValue = { Int: number } | { String: string }; export interface CanisterStatusResultV2 { - 'controller' : Principal, - 'status' : CanisterStatusType, - 'freezing_threshold' : bigint, - 'balance' : Array<[Uint8Array | number[], bigint]>, - 'memory_size' : bigint, - 'cycles' : bigint, - 'settings' : DefiniteCanisterSettingsArgs, - 'idle_cycles_burned_per_day' : bigint, - 'module_hash' : [] | [Uint8Array | number[]], -} -export type CanisterStatusType = { 'stopped' : null } | - { 'stopping' : null } | - { 'running' : null }; + controller: Principal; + status: CanisterStatusType; + freezing_threshold: bigint; + balance: Array<[Uint8Array | number[], bigint]>; + memory_size: bigint; + cycles: bigint; + settings: DefiniteCanisterSettingsArgs; + idle_cycles_burned_per_day: bigint; + module_hash: [] | [Uint8Array | number[]]; +} +export type CanisterStatusType = { stopped: null } | { stopping: null } | { running: null }; export interface Config { - 'api' : [] | [Guards], - 'ecdsa_key_name' : string, - 'allowed_callers' : Array, - 'supported_credentials' : [] | [Array], - 'ic_root_key_raw' : [] | [Uint8Array | number[]], + api: [] | [Guards]; + ecdsa_key_name: string; + allowed_callers: Array; + supported_credentials: [] | [Array]; + ic_root_key_raw: [] | [Uint8Array | number[]]; } export interface CredentialSpec { - 'arguments' : [] | [Array<[string, ArgumentValue]>], - 'credential_type' : string, + arguments: [] | [Array<[string, ArgumentValue]>]; + credential_type: string; } -export type CredentialType = { 'ProofOfUniqueness' : null }; +export type CredentialType = { ProofOfUniqueness: null }; export interface CustomToken { - 'token' : Token, - 'version' : [] | [bigint], - 'enabled' : boolean, + token: Token; + version: [] | [bigint]; + enabled: boolean; } export interface DefiniteCanisterSettingsArgs { - 'controller' : Principal, - 'freezing_threshold' : bigint, - 'controllers' : Array, - 'memory_allocation' : bigint, - 'compute_allocation' : bigint, + controller: Principal; + freezing_threshold: bigint; + controllers: Array; + memory_allocation: bigint; + compute_allocation: bigint; } -export type GetUserProfileError = { 'NotFound' : null }; +export type GetUserProfileError = { NotFound: null }; export interface Guards { - 'user_data' : ApiEnabled, - 'threshold_key' : ApiEnabled, + user_data: ApiEnabled; + threshold_key: ApiEnabled; } export interface HttpRequest { - 'url' : string, - 'method' : string, - 'body' : Uint8Array | number[], - 'headers' : Array<[string, string]>, + url: string; + method: string; + body: Uint8Array | number[]; + headers: Array<[string, string]>; } export interface HttpResponse { - 'body' : Uint8Array | number[], - 'headers' : Array<[string, string]>, - 'status_code' : number, + body: Uint8Array | number[]; + headers: Array<[string, string]>; + status_code: number; } export interface IcrcToken { - 'ledger_id' : Principal, - 'index_id' : [] | [Principal], + ledger_id: Principal; + index_id: [] | [Principal]; } export interface InitArg { - 'api' : [] | [Guards], - 'ecdsa_key_name' : string, - 'allowed_callers' : Array, - 'supported_credentials' : [] | [Array], - 'ic_root_key_der' : [] | [Uint8Array | number[]], + api: [] | [Guards]; + ecdsa_key_name: string; + allowed_callers: Array; + supported_credentials: [] | [Array]; + ic_root_key_der: [] | [Uint8Array | number[]]; } export interface ListUsersRequest { - 'updated_after_timestamp' : [] | [bigint], - 'matches_max_length' : [] | [bigint], + updated_after_timestamp: [] | [bigint]; + matches_max_length: [] | [bigint]; } export interface ListUsersResponse { - 'users' : Array, - 'matches_max_length' : bigint, + users: Array; + matches_max_length: bigint; } export interface OisyUser { - 'principal' : Principal, - 'pouh_verified' : boolean, - 'updated_timestamp' : bigint, -} -export type Result = { 'Ok' : null } | - { 'Err' : AddUserCredentialError }; -export type Result_1 = { 'Ok' : UserProfile } | - { 'Err' : GetUserProfileError }; + principal: Principal; + pouh_verified: boolean; + updated_timestamp: bigint; +} +export type Result = { Ok: null } | { Err: AddUserCredentialError }; +export type Result_1 = { Ok: UserProfile } | { Err: GetUserProfileError }; export interface SignRequest { - 'to' : string, - 'gas' : bigint, - 'value' : bigint, - 'max_priority_fee_per_gas' : bigint, - 'data' : [] | [string], - 'max_fee_per_gas' : bigint, - 'chain_id' : bigint, - 'nonce' : bigint, + to: string; + gas: bigint; + value: bigint; + max_priority_fee_per_gas: bigint; + data: [] | [string]; + max_fee_per_gas: bigint; + chain_id: bigint; + nonce: bigint; } export interface SupportedCredential { - 'ii_canister_id' : Principal, - 'issuer_origin' : string, - 'issuer_canister_id' : Principal, - 'ii_origin' : string, - 'credential_type' : CredentialType, + ii_canister_id: Principal; + issuer_origin: string; + issuer_canister_id: Principal; + ii_origin: string; + credential_type: CredentialType; } -export type Token = { 'Icrc' : IcrcToken }; +export type Token = { Icrc: IcrcToken }; export interface UserCredential { - 'issuer' : string, - 'verified_date_timestamp' : [] | [bigint], - 'credential_type' : CredentialType, + issuer: string; + verified_date_timestamp: [] | [bigint]; + credential_type: CredentialType; } export interface UserProfile { - 'credentials' : Array, - 'version' : [] | [bigint], - 'created_timestamp' : bigint, - 'updated_timestamp' : bigint, + credentials: Array; + version: [] | [bigint]; + created_timestamp: bigint; + updated_timestamp: bigint; } export interface UserToken { - 'decimals' : [] | [number], - 'version' : [] | [bigint], - 'enabled' : [] | [boolean], - 'chain_id' : bigint, - 'contract_address' : string, - 'symbol' : [] | [string], + decimals: [] | [number]; + version: [] | [bigint]; + enabled: [] | [boolean]; + chain_id: bigint; + contract_address: string; + symbol: [] | [string]; } export interface UserTokenId { - 'chain_id' : bigint, - 'contract_address' : string, + chain_id: bigint; + contract_address: string; } export interface _SERVICE { - 'add_user_credential' : ActorMethod<[AddUserCredentialRequest], Result>, - 'caller_eth_address' : ActorMethod<[], string>, - 'config' : ActorMethod<[], Config>, - 'create_user_profile' : ActorMethod<[], UserProfile>, - 'eth_address_of' : ActorMethod<[Principal], string>, - 'get_canister_status' : ActorMethod<[], CanisterStatusResultV2>, - 'get_user_profile' : ActorMethod<[], Result_1>, - 'guard' : ActorMethod<[], undefined>, - 'http_request' : ActorMethod<[HttpRequest], HttpResponse>, - 'list_custom_tokens' : ActorMethod<[], Array>, - 'list_user_tokens' : ActorMethod<[], Array>, - 'list_users' : ActorMethod<[ListUsersRequest], ListUsersResponse>, - 'personal_sign' : ActorMethod<[string], string>, - 'remove_user_token' : ActorMethod<[UserTokenId], undefined>, - 'set_custom_token' : ActorMethod<[CustomToken], undefined>, - 'set_many_custom_tokens' : ActorMethod<[Array], undefined>, - 'set_many_user_tokens' : ActorMethod<[Array], undefined>, - 'set_user_token' : ActorMethod<[UserToken], undefined>, - 'sign_prehash' : ActorMethod<[string], string>, - 'sign_transaction' : ActorMethod<[SignRequest], string>, + add_user_credential: ActorMethod<[AddUserCredentialRequest], Result>; + caller_eth_address: ActorMethod<[], string>; + config: ActorMethod<[], Config>; + create_user_profile: ActorMethod<[], UserProfile>; + eth_address_of: ActorMethod<[Principal], string>; + get_canister_status: ActorMethod<[], CanisterStatusResultV2>; + get_user_profile: ActorMethod<[], Result_1>; + guard: ActorMethod<[], undefined>; + http_request: ActorMethod<[HttpRequest], HttpResponse>; + list_custom_tokens: ActorMethod<[], Array>; + list_user_tokens: ActorMethod<[], Array>; + list_users: ActorMethod<[ListUsersRequest], ListUsersResponse>; + personal_sign: ActorMethod<[string], string>; + remove_user_token: ActorMethod<[UserTokenId], undefined>; + set_custom_token: ActorMethod<[CustomToken], undefined>; + set_many_custom_tokens: ActorMethod<[Array], undefined>; + set_many_user_tokens: ActorMethod<[Array], undefined>; + set_user_token: ActorMethod<[UserToken], undefined>; + sign_prehash: ActorMethod<[string], string>; + sign_transaction: ActorMethod<[SignRequest], string>; } export declare const idlFactory: IDL.InterfaceFactory; export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[]; diff --git a/src/declarations/backend/backend.factory.certified.did.js b/src/declarations/backend/backend.factory.certified.did.js new file mode 100644 index 0000000000..1ac75a4af4 --- /dev/null +++ b/src/declarations/backend/backend.factory.certified.did.js @@ -0,0 +1,202 @@ +// @ts-ignore +export const idlFactory = ({ IDL }) => { + const ApiEnabled = IDL.Variant({ + ReadOnly: IDL.Null, + Enabled: IDL.Null, + Disabled: IDL.Null + }); + const Guards = IDL.Record({ + user_data: ApiEnabled, + threshold_key: ApiEnabled + }); + const CredentialType = IDL.Variant({ ProofOfUniqueness: IDL.Null }); + const SupportedCredential = IDL.Record({ + ii_canister_id: IDL.Principal, + issuer_origin: IDL.Text, + issuer_canister_id: IDL.Principal, + ii_origin: IDL.Text, + credential_type: CredentialType + }); + const InitArg = IDL.Record({ + api: IDL.Opt(Guards), + ecdsa_key_name: IDL.Text, + allowed_callers: IDL.Vec(IDL.Principal), + supported_credentials: IDL.Opt(IDL.Vec(SupportedCredential)), + ic_root_key_der: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const Arg = IDL.Variant({ Upgrade: IDL.Null, Init: InitArg }); + const ArgumentValue = IDL.Variant({ Int: IDL.Int32, String: IDL.Text }); + const CredentialSpec = IDL.Record({ + arguments: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, ArgumentValue))), + credential_type: IDL.Text + }); + const AddUserCredentialRequest = IDL.Record({ + credential_jwt: IDL.Text, + issuer_canister_id: IDL.Principal, + current_user_version: IDL.Opt(IDL.Nat64), + credential_spec: CredentialSpec + }); + const AddUserCredentialError = IDL.Variant({ + InvalidCredential: IDL.Null, + VersionMismatch: IDL.Null, + ConfigurationError: IDL.Null, + UserNotFound: IDL.Null + }); + const Result = IDL.Variant({ + Ok: IDL.Null, + Err: AddUserCredentialError + }); + const Config = IDL.Record({ + api: IDL.Opt(Guards), + ecdsa_key_name: IDL.Text, + allowed_callers: IDL.Vec(IDL.Principal), + supported_credentials: IDL.Opt(IDL.Vec(SupportedCredential)), + ic_root_key_raw: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const UserCredential = IDL.Record({ + issuer: IDL.Text, + verified_date_timestamp: IDL.Opt(IDL.Nat64), + credential_type: CredentialType + }); + const UserProfile = IDL.Record({ + credentials: IDL.Vec(UserCredential), + version: IDL.Opt(IDL.Nat64), + created_timestamp: IDL.Nat64, + updated_timestamp: IDL.Nat64 + }); + const CanisterStatusType = IDL.Variant({ + stopped: IDL.Null, + stopping: IDL.Null, + running: IDL.Null + }); + const DefiniteCanisterSettingsArgs = IDL.Record({ + controller: IDL.Principal, + freezing_threshold: IDL.Nat, + controllers: IDL.Vec(IDL.Principal), + memory_allocation: IDL.Nat, + compute_allocation: IDL.Nat + }); + const CanisterStatusResultV2 = IDL.Record({ + controller: IDL.Principal, + status: CanisterStatusType, + freezing_threshold: IDL.Nat, + balance: IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)), + memory_size: IDL.Nat, + cycles: IDL.Nat, + settings: DefiniteCanisterSettingsArgs, + idle_cycles_burned_per_day: IDL.Nat, + module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GetUserProfileError = IDL.Variant({ NotFound: IDL.Null }); + const Result_1 = IDL.Variant({ + Ok: UserProfile, + Err: GetUserProfileError + }); + const HttpRequest = IDL.Record({ + url: IDL.Text, + method: IDL.Text, + body: IDL.Vec(IDL.Nat8), + headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)) + }); + const HttpResponse = IDL.Record({ + body: IDL.Vec(IDL.Nat8), + headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)), + status_code: IDL.Nat16 + }); + const IcrcToken = IDL.Record({ + ledger_id: IDL.Principal, + index_id: IDL.Opt(IDL.Principal) + }); + const Token = IDL.Variant({ Icrc: IcrcToken }); + const CustomToken = IDL.Record({ + token: Token, + version: IDL.Opt(IDL.Nat64), + enabled: IDL.Bool + }); + const UserToken = IDL.Record({ + decimals: IDL.Opt(IDL.Nat8), + version: IDL.Opt(IDL.Nat64), + enabled: IDL.Opt(IDL.Bool), + chain_id: IDL.Nat64, + contract_address: IDL.Text, + symbol: IDL.Opt(IDL.Text) + }); + const ListUsersRequest = IDL.Record({ + updated_after_timestamp: IDL.Opt(IDL.Nat64), + matches_max_length: IDL.Opt(IDL.Nat64) + }); + const OisyUser = IDL.Record({ + principal: IDL.Principal, + pouh_verified: IDL.Bool, + updated_timestamp: IDL.Nat64 + }); + const ListUsersResponse = IDL.Record({ + users: IDL.Vec(OisyUser), + matches_max_length: IDL.Nat64 + }); + const UserTokenId = IDL.Record({ + chain_id: IDL.Nat64, + contract_address: IDL.Text + }); + const SignRequest = IDL.Record({ + to: IDL.Text, + gas: IDL.Nat, + value: IDL.Nat, + max_priority_fee_per_gas: IDL.Nat, + data: IDL.Opt(IDL.Text), + max_fee_per_gas: IDL.Nat, + chain_id: IDL.Nat, + nonce: IDL.Nat + }); + return IDL.Service({ + add_user_credential: IDL.Func([AddUserCredentialRequest], [Result], []), + caller_eth_address: IDL.Func([], [IDL.Text], []), + config: IDL.Func([], [Config]), + create_user_profile: IDL.Func([], [UserProfile], []), + eth_address_of: IDL.Func([IDL.Principal], [IDL.Text], []), + get_canister_status: IDL.Func([], [CanisterStatusResultV2], []), + get_user_profile: IDL.Func([], [Result_1]), + guard: IDL.Func([], [], []), + http_request: IDL.Func([HttpRequest], [HttpResponse]), + list_custom_tokens: IDL.Func([], [IDL.Vec(CustomToken)]), + list_user_tokens: IDL.Func([], [IDL.Vec(UserToken)]), + list_users: IDL.Func([ListUsersRequest], [ListUsersResponse]), + personal_sign: IDL.Func([IDL.Text], [IDL.Text], []), + remove_user_token: IDL.Func([UserTokenId], [], []), + set_custom_token: IDL.Func([CustomToken], [], []), + set_many_custom_tokens: IDL.Func([IDL.Vec(CustomToken)], [], []), + set_many_user_tokens: IDL.Func([IDL.Vec(UserToken)], [], []), + set_user_token: IDL.Func([UserToken], [], []), + sign_prehash: IDL.Func([IDL.Text], [IDL.Text], []), + sign_transaction: IDL.Func([SignRequest], [IDL.Text], []) + }); +}; +// @ts-ignore +export const init = ({ IDL }) => { + const ApiEnabled = IDL.Variant({ + ReadOnly: IDL.Null, + Enabled: IDL.Null, + Disabled: IDL.Null + }); + const Guards = IDL.Record({ + user_data: ApiEnabled, + threshold_key: ApiEnabled + }); + const CredentialType = IDL.Variant({ ProofOfUniqueness: IDL.Null }); + const SupportedCredential = IDL.Record({ + ii_canister_id: IDL.Principal, + issuer_origin: IDL.Text, + issuer_canister_id: IDL.Principal, + ii_origin: IDL.Text, + credential_type: CredentialType + }); + const InitArg = IDL.Record({ + api: IDL.Opt(Guards), + ecdsa_key_name: IDL.Text, + allowed_callers: IDL.Vec(IDL.Principal), + supported_credentials: IDL.Opt(IDL.Vec(SupportedCredential)), + ic_root_key_der: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const Arg = IDL.Variant({ Upgrade: IDL.Null, Init: InitArg }); + return [Arg]; +}; diff --git a/src/declarations/backend/backend.factory.did.js b/src/declarations/backend/backend.factory.did.js new file mode 100644 index 0000000000..7a983ed538 --- /dev/null +++ b/src/declarations/backend/backend.factory.did.js @@ -0,0 +1,202 @@ +// @ts-ignore +export const idlFactory = ({ IDL }) => { + const ApiEnabled = IDL.Variant({ + ReadOnly: IDL.Null, + Enabled: IDL.Null, + Disabled: IDL.Null + }); + const Guards = IDL.Record({ + user_data: ApiEnabled, + threshold_key: ApiEnabled + }); + const CredentialType = IDL.Variant({ ProofOfUniqueness: IDL.Null }); + const SupportedCredential = IDL.Record({ + ii_canister_id: IDL.Principal, + issuer_origin: IDL.Text, + issuer_canister_id: IDL.Principal, + ii_origin: IDL.Text, + credential_type: CredentialType + }); + const InitArg = IDL.Record({ + api: IDL.Opt(Guards), + ecdsa_key_name: IDL.Text, + allowed_callers: IDL.Vec(IDL.Principal), + supported_credentials: IDL.Opt(IDL.Vec(SupportedCredential)), + ic_root_key_der: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const Arg = IDL.Variant({ Upgrade: IDL.Null, Init: InitArg }); + const ArgumentValue = IDL.Variant({ Int: IDL.Int32, String: IDL.Text }); + const CredentialSpec = IDL.Record({ + arguments: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, ArgumentValue))), + credential_type: IDL.Text + }); + const AddUserCredentialRequest = IDL.Record({ + credential_jwt: IDL.Text, + issuer_canister_id: IDL.Principal, + current_user_version: IDL.Opt(IDL.Nat64), + credential_spec: CredentialSpec + }); + const AddUserCredentialError = IDL.Variant({ + InvalidCredential: IDL.Null, + VersionMismatch: IDL.Null, + ConfigurationError: IDL.Null, + UserNotFound: IDL.Null + }); + const Result = IDL.Variant({ + Ok: IDL.Null, + Err: AddUserCredentialError + }); + const Config = IDL.Record({ + api: IDL.Opt(Guards), + ecdsa_key_name: IDL.Text, + allowed_callers: IDL.Vec(IDL.Principal), + supported_credentials: IDL.Opt(IDL.Vec(SupportedCredential)), + ic_root_key_raw: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const UserCredential = IDL.Record({ + issuer: IDL.Text, + verified_date_timestamp: IDL.Opt(IDL.Nat64), + credential_type: CredentialType + }); + const UserProfile = IDL.Record({ + credentials: IDL.Vec(UserCredential), + version: IDL.Opt(IDL.Nat64), + created_timestamp: IDL.Nat64, + updated_timestamp: IDL.Nat64 + }); + const CanisterStatusType = IDL.Variant({ + stopped: IDL.Null, + stopping: IDL.Null, + running: IDL.Null + }); + const DefiniteCanisterSettingsArgs = IDL.Record({ + controller: IDL.Principal, + freezing_threshold: IDL.Nat, + controllers: IDL.Vec(IDL.Principal), + memory_allocation: IDL.Nat, + compute_allocation: IDL.Nat + }); + const CanisterStatusResultV2 = IDL.Record({ + controller: IDL.Principal, + status: CanisterStatusType, + freezing_threshold: IDL.Nat, + balance: IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)), + memory_size: IDL.Nat, + cycles: IDL.Nat, + settings: DefiniteCanisterSettingsArgs, + idle_cycles_burned_per_day: IDL.Nat, + module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const GetUserProfileError = IDL.Variant({ NotFound: IDL.Null }); + const Result_1 = IDL.Variant({ + Ok: UserProfile, + Err: GetUserProfileError + }); + const HttpRequest = IDL.Record({ + url: IDL.Text, + method: IDL.Text, + body: IDL.Vec(IDL.Nat8), + headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)) + }); + const HttpResponse = IDL.Record({ + body: IDL.Vec(IDL.Nat8), + headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)), + status_code: IDL.Nat16 + }); + const IcrcToken = IDL.Record({ + ledger_id: IDL.Principal, + index_id: IDL.Opt(IDL.Principal) + }); + const Token = IDL.Variant({ Icrc: IcrcToken }); + const CustomToken = IDL.Record({ + token: Token, + version: IDL.Opt(IDL.Nat64), + enabled: IDL.Bool + }); + const UserToken = IDL.Record({ + decimals: IDL.Opt(IDL.Nat8), + version: IDL.Opt(IDL.Nat64), + enabled: IDL.Opt(IDL.Bool), + chain_id: IDL.Nat64, + contract_address: IDL.Text, + symbol: IDL.Opt(IDL.Text) + }); + const ListUsersRequest = IDL.Record({ + updated_after_timestamp: IDL.Opt(IDL.Nat64), + matches_max_length: IDL.Opt(IDL.Nat64) + }); + const OisyUser = IDL.Record({ + principal: IDL.Principal, + pouh_verified: IDL.Bool, + updated_timestamp: IDL.Nat64 + }); + const ListUsersResponse = IDL.Record({ + users: IDL.Vec(OisyUser), + matches_max_length: IDL.Nat64 + }); + const UserTokenId = IDL.Record({ + chain_id: IDL.Nat64, + contract_address: IDL.Text + }); + const SignRequest = IDL.Record({ + to: IDL.Text, + gas: IDL.Nat, + value: IDL.Nat, + max_priority_fee_per_gas: IDL.Nat, + data: IDL.Opt(IDL.Text), + max_fee_per_gas: IDL.Nat, + chain_id: IDL.Nat, + nonce: IDL.Nat + }); + return IDL.Service({ + add_user_credential: IDL.Func([AddUserCredentialRequest], [Result], []), + caller_eth_address: IDL.Func([], [IDL.Text], []), + config: IDL.Func([], [Config], ['query']), + create_user_profile: IDL.Func([], [UserProfile], []), + eth_address_of: IDL.Func([IDL.Principal], [IDL.Text], []), + get_canister_status: IDL.Func([], [CanisterStatusResultV2], []), + get_user_profile: IDL.Func([], [Result_1], ['query']), + guard: IDL.Func([], [], []), + http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']), + list_custom_tokens: IDL.Func([], [IDL.Vec(CustomToken)], ['query']), + list_user_tokens: IDL.Func([], [IDL.Vec(UserToken)], ['query']), + list_users: IDL.Func([ListUsersRequest], [ListUsersResponse], ['query']), + personal_sign: IDL.Func([IDL.Text], [IDL.Text], []), + remove_user_token: IDL.Func([UserTokenId], [], []), + set_custom_token: IDL.Func([CustomToken], [], []), + set_many_custom_tokens: IDL.Func([IDL.Vec(CustomToken)], [], []), + set_many_user_tokens: IDL.Func([IDL.Vec(UserToken)], [], []), + set_user_token: IDL.Func([UserToken], [], []), + sign_prehash: IDL.Func([IDL.Text], [IDL.Text], []), + sign_transaction: IDL.Func([SignRequest], [IDL.Text], []) + }); +}; +// @ts-ignore +export const init = ({ IDL }) => { + const ApiEnabled = IDL.Variant({ + ReadOnly: IDL.Null, + Enabled: IDL.Null, + Disabled: IDL.Null + }); + const Guards = IDL.Record({ + user_data: ApiEnabled, + threshold_key: ApiEnabled + }); + const CredentialType = IDL.Variant({ ProofOfUniqueness: IDL.Null }); + const SupportedCredential = IDL.Record({ + ii_canister_id: IDL.Principal, + issuer_origin: IDL.Text, + issuer_canister_id: IDL.Principal, + ii_origin: IDL.Text, + credential_type: CredentialType + }); + const InitArg = IDL.Record({ + api: IDL.Opt(Guards), + ecdsa_key_name: IDL.Text, + allowed_callers: IDL.Vec(IDL.Principal), + supported_credentials: IDL.Opt(IDL.Vec(SupportedCredential)), + ic_root_key_der: IDL.Opt(IDL.Vec(IDL.Nat8)) + }); + const Arg = IDL.Variant({ Upgrade: IDL.Null, Init: InitArg }); + return [Arg]; +}; diff --git a/src/declarations/backend/index.d.ts b/src/declarations/backend/index.d.ts index 55daa14e7a..77d3c6a3cf 100644 --- a/src/declarations/backend/index.d.ts +++ b/src/declarations/backend/index.d.ts @@ -1,11 +1,6 @@ -import type { - ActorSubclass, - HttpAgentOptions, - ActorConfig, - Agent, -} from "@dfinity/agent"; -import type { Principal } from "@dfinity/principal"; -import type { IDL } from "@dfinity/candid"; +import type { ActorConfig, ActorSubclass, Agent, HttpAgentOptions } from '@dfinity/agent'; +import type { IDL } from '@dfinity/candid'; +import type { Principal } from '@dfinity/principal'; import { _SERVICE } from './backend.did'; @@ -13,18 +8,18 @@ export declare const idlFactory: IDL.InterfaceFactory; export declare const canisterId: string; export declare interface CreateActorOptions { - /** - * @see {@link Agent} - */ - agent?: Agent; - /** - * @see {@link HttpAgentOptions} - */ - agentOptions?: HttpAgentOptions; - /** - * @see {@link ActorConfig} - */ - actorOptions?: ActorConfig; + /** + * @see {@link Agent} + */ + agent?: Agent; + /** + * @see {@link HttpAgentOptions} + */ + agentOptions?: HttpAgentOptions; + /** + * @see {@link ActorConfig} + */ + actorOptions?: ActorConfig; } /** @@ -39,8 +34,8 @@ export declare interface CreateActorOptions { * @see {@link ActorConfig} */ export declare const createActor: ( - canisterId: string | Principal, - options?: CreateActorOptions + canisterId: string | Principal, + options?: CreateActorOptions ) => ActorSubclass<_SERVICE>; /**