sdk-js

@nevermined-io/sdk - v3.0.48 / NvmAccount

Class: NvmAccount

Account information.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new NvmAccount(id, accountType?): NvmAccount

Parameters

Name Type
id string
accountType NvmAccountType

Returns

NvmAccount

Defined in

src/models/NvmAccount.ts:70

Properties

accountSigner

Private Optional accountSigner: Account | { address: `0x${string}` ; experimental_signAuthorization: (parameters: Authorization) => Promise<SignAuthorizationReturnType> ; nonceManager?: NonceManager ; publicKey: `0x${string}` ; sign: (parameters: { hash: `0x${string}` }) => Promise<`0x${string}`> ; signMessage: (__namedParameters: { message: SignableMessage }) => Promise<`0x${string}`> ; signTransaction: <serializer, transaction>(transaction: transaction, options?: { serializer?: serializer }) => Promise<IsNarrowable<TransactionSerialized<GetTransactionType<transaction>>, `0x${string}`> extends true ? TransactionSerialized<GetTransactionType<transaction>> : `0x${string}`> ; signTypedData: <typedData, primaryType>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`> ; source: "privateKey" ; type: "local" }

Defined in

src/models/NvmAccount.ts:16


accountType

accountType: NvmAccountType

Defined in

src/models/NvmAccount.ts:19


babySecret

Optional babySecret: string

Defined in

src/models/NvmAccount.ts:15


babyX

Optional babyX: string

Defined in

src/models/NvmAccount.ts:13


babyY

Optional babyY: string

Defined in

src/models/NvmAccount.ts:14


id

Private id: string

Defined in

src/models/NvmAccount.ts:71


kernelClient

Private Optional kernelClient: KernelAccountClient<Transport, Chain, any, any, any>

Defined in

src/models/NvmAccount.ts:17


password

Private Optional password: string

Defined in

src/models/NvmAccount.ts:12


zeroDevSigner

Private Optional zeroDevSigner: SmartAccount<any>

Defined in

src/models/NvmAccount.ts:18

Methods

getAccountSigner

getAccountSigner(): undefined | Account | SmartAccount<any> | { address: `0x${string}` ; experimental_signAuthorization: (parameters: Authorization) => Promise<SignAuthorizationReturnType> ; nonceManager?: NonceManager ; publicKey: `0x${string}` ; sign: (parameters: { hash: `0x${string}` }) => Promise<`0x${string}`> ; signMessage: (__namedParameters: { message: SignableMessage }) => Promise<`0x${string}`> ; signTransaction: <serializer, transaction>(transaction: transaction, options?: { serializer?: serializer }) => Promise<IsNarrowable<TransactionSerialized<GetTransactionType<transaction>>, `0x${string}`> extends true ? TransactionSerialized<GetTransactionType<transaction>> : `0x${string}`> ; signTypedData: <typedData, primaryType>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`> ; source: "privateKey" ; type: "local" }

Returns

undefined | Account | SmartAccount<any> | { address: `0x${string}` ; experimental_signAuthorization: (parameters: Authorization) => Promise<SignAuthorizationReturnType> ; nonceManager?: NonceManager ; publicKey: `0x${string}` ; sign: (parameters: { hash: `0x${string}` }) => Promise<`0x${string}`> ; signMessage: (__namedParameters: { message: SignableMessage }) => Promise<`0x${string}`> ; signTransaction: <serializer, transaction>(transaction: transaction, options?: { serializer?: serializer }) => Promise<IsNarrowable<TransactionSerialized<GetTransactionType<transaction>>, `0x${string}`> extends true ? TransactionSerialized<GetTransactionType<transaction>> : `0x${string}`> ; signTypedData: <typedData, primaryType>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`> ; source: "privateKey" ; type: "local" }

Defined in

src/models/NvmAccount.ts:78


getAddress

getAddress(): `0x${string}`

Returns

`0x${string}`

Defined in

src/models/NvmAccount.ts:97


getId

getId(): `0x${string}`

Returns

`0x${string}`

Defined in

src/models/NvmAccount.ts:101


getKernelClient

getKernelClient(): undefined | KernelAccountClient<Transport, Chain, any, any, any>

Returns

undefined | KernelAccountClient<Transport, Chain, any, any, any>

Defined in

src/models/NvmAccount.ts:82


getPassword

getPassword(): undefined | string

Returns account password.

Returns

undefined | string

The account password.

Defined in

src/models/NvmAccount.ts:137


getPublic

getPublic(): string

Returns

string

Defined in

src/models/NvmAccount.ts:109


getType

getType(): "local" | "json-rpc" | "smart" | "zerodev" | "sessionKey"

Returns

"local" | "json-rpc" | "smart" | "zerodev" | "sessionKey"

Defined in

src/models/NvmAccount.ts:86


getZeroDevSigner

getZeroDevSigner(): SmartAccount<any>

Returns

SmartAccount<any>

Defined in

src/models/NvmAccount.ts:89


isZeroDev

isZeroDev(): boolean

Returns

boolean

Defined in

src/models/NvmAccount.ts:93


setId

setId(id): void

Parameters

Name Type
id string

Returns

void

Defined in

src/models/NvmAccount.ts:105


setPassword

setPassword(password): void

Set account password.

Parameters

Name Type Description
password string Password for account.

Returns

void

Defined in

src/models/NvmAccount.ts:129


signTextLocally

signTextLocally(text): Promise<`0x${string}`>

Parameters

Name Type
text string | Uint8Array

Returns

Promise<`0x${string}`>

Defined in

src/models/NvmAccount.ts:113


fromAccount

fromAccount(account): NvmAccount

Returns a nevermined Account from a viem account

Parameters

Name Type Description
account Account | { address: `0x${string}` ; experimental_signAuthorization: (parameters: Authorization) => Promise<SignAuthorizationReturnType> ; nonceManager?: NonceManager ; publicKey: `0x${string}` ; sign: (parameters: { hash: `0x${string}` }) => Promise<`0x${string}`> ; signMessage: (__namedParameters: { message: SignableMessage }) => Promise<`0x${string}`> ; signTransaction: <serializer, transaction>(transaction: transaction, options?: { serializer?: serializer }) => Promise<IsNarrowable<TransactionSerialized<GetTransactionType<transaction>>, `0x${string}`> extends true ? TransactionSerialized<GetTransactionType<transaction>> : `0x${string}`> ; signTypedData: <typedData, primaryType>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`> ; source: "privateKey" ; type: "local" } A viem local account

Returns

NvmAccount

The nevermined account

Defined in

src/models/NvmAccount.ts:27


fromAddress

fromAddress(address): NvmAccount

Returns a nevermined Account from an address. This method is used for browser integration (i.e Metamask)

Parameters

Name Type Description
address `0x${string}` A wallet address

Returns

NvmAccount

The nevermined account

Defined in

src/models/NvmAccount.ts:40


fromZeroDevSessionKey

fromZeroDevSessionKey(kernelClient): NvmAccount

Parameters

Name Type
kernelClient KernelAccountClient<Transport, Chain, any, any, any>

Returns

NvmAccount

Defined in

src/models/NvmAccount.ts:62


fromZeroDevSigner

fromZeroDevSigner(kernelClient): Promise<NvmAccount>

Returns a nevermined Account from a zerodev signer

Parameters

Name Type
kernelClient KernelAccountClient<Transport, Chain, any, any, any>

Returns

Promise<NvmAccount>

The nevermined account

Defined in

src/models/NvmAccount.ts:52