Class: WalletService
Hierarchy
Subscribable
<{name
:WalletName
|undefined
}>↳
WalletService
Table of contents
Constructors
Properties
Accessors
Methods
- _catchAccountChange
- connect
- destroy
- get
- getBalance
- getBalanceByPolicies
- getBech32ChangeAddress
- getBech32StakeAddress
- getChangeAddress
- getDefaultApi
- getNetworkId
- getNetworkType
- getRewardAddress
- getStakeAddress
- getUtxos
- initializeBridge
- isConnected
- isConnectedTo
- isMainnet
- prepareWalletName
- set
- signData
- signTx
- submitTx
- subscribe
Constructors
constructor
• new WalletService(_debug
, _extensions
)
Parameters
Name | Type |
---|---|
_debug | DebugService |
_extensions | ExtensionsService |
Overrides
Subscribable<{ name: WalletName | undefined; }\>.constructor
Properties
_api
• Private
Optional
_api: any
_debug
• Private
_debug: any
_extensions
• Private
_extensions: any
_isMobile
• Private
_isMobile: any
_isReconnecting
• Private
_isReconnecting: any
Description
true when a wallet reconnection attempt has been triggered
_onAccountChange
• Protected
Optional
_onAccountChange: OnAccountChange
Description
external callback to be executed upon wallet reconnection attempt
_onReconnection
• Private
_onReconnection: any
Description
queue of processes to be executed upon wallet reconnection attempt
Accessors
_subscribableValues
• get
_subscribableValues(): Values
Gets all values
Returns
Values
Inherited from
Subscribable._subscribableValues
fullName
• get
fullName(): undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
| "mobile-nami"
| "mobile-eternl"
| "mobile-flint"
| "mobile-gerowallet"
| "mobile-typhoncip30"
| "mobile-nufi"
| "mobile-lace"
Returns
undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
| "mobile-nami"
| "mobile-eternl"
| "mobile-flint"
| "mobile-gerowallet"
| "mobile-typhoncip30"
| "mobile-nufi"
| "mobile-lace"
info
• get
info(): undefined
| WalletInfo
<"nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
>
Returns
undefined
| WalletInfo
<"nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
>
name
• get
name(): undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
Returns
undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
Methods
_catchAccountChange
▸ Protected
_catchAccountChange<Fn
>(fn
, ...args
): Promise
<undefined
| Awaited
<ReturnType
<Fn
>>>
Type parameters
Name | Type |
---|---|
Fn | extends (...args : never []) => any |
Parameters
Name | Type |
---|---|
fn | undefined | Fn |
...args | Parameters <Fn > |
Returns
Promise
<undefined
| Awaited
<ReturnType
<Fn
>>>
connect
▸ connect(name
, options?
): Promise
<false
| WalletInfo
<"nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
>>
Parameters
Name | Type |
---|---|
name | "nami" | "eternl" | "flint" | "gerowallet" | "typhoncip30" | "nufi" | "lace" |
options? | ConnectWalletOptions |
Returns
Promise
<false
| WalletInfo
<"nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
>>
destroy
▸ destroy(): void
Returns
void
get
▸ get<K
>(key
): { name
: undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
}[K
]
Gets a value
Type parameters
Name | Type |
---|---|
K | extends "name" |
Parameters
Name | Type |
---|---|
key | K |
Returns
{ name
: undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
}[K
]
Inherited from
Subscribable.get
getBalance
▸ getBalance(): Promise
<string
>
Returns
Promise
<string
>
getBalanceByPolicies
▸ getBalanceByPolicies(): Promise
<BalanceByPolicies
>
Returns
Promise
<BalanceByPolicies
>
getBech32ChangeAddress
▸ getBech32ChangeAddress(): Promise
<string
>
Returns
Promise
<string
>
getBech32StakeAddress
▸ getBech32StakeAddress(): Promise
<string
>
Returns
Promise
<string
>
getChangeAddress
▸ getChangeAddress(): Promise
<string
>
Returns
Promise
<string
>
getDefaultApi
▸ getDefaultApi(name?
): Promise
<null
| DefaultWalletApi
<"nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
>>
Parameters
Name | Type |
---|---|
name? | "nami" | "eternl" | "flint" | "gerowallet" | "typhoncip30" | "nufi" | "lace" |
Returns
Promise
<null
| DefaultWalletApi
<"nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
>>
getNetworkId
▸ getNetworkId(): Promise
<number
>
Returns
Promise
<number
>
getNetworkType
▸ getNetworkType(): Promise
<NetworkType
>
Returns
Promise
<NetworkType
>
getRewardAddress
▸ getRewardAddress(): Promise
<string
>
Returns
Promise
<string
>
getStakeAddress
▸ getStakeAddress(): Promise
<string
>
Returns
Promise
<string
>
getUtxos
▸ getUtxos(): Promise
<string
[]>
Returns
Promise
<string
[]>
initializeBridge
▸ initializeBridge(): Promise
<boolean
>
Returns
Promise
<boolean
>
isConnected
▸ isConnected(): Promise
<boolean
>
Returns
Promise
<boolean
>
isConnectedTo
▸ isConnectedTo(wallet
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
wallet | "nami" | "eternl" | "flint" | "gerowallet" | "typhoncip30" | "nufi" | "lace" |
Returns
Promise
<boolean
>
isMainnet
▸ isMainnet(): Promise
<boolean
>
Returns
Promise
<boolean
>
prepareWalletName
▸ prepareWalletName<T
>(name
): T
Type parameters
Name | Type |
---|---|
T | extends undefined | "nami" | "eternl" | "flint" | "gerowallet" | "typhoncip30" | "nufi" | "lace" | "mobile-nami" | "mobile-eternl" | "mobile-flint" | "mobile-gerowallet" | "mobile-typhoncip30" | "mobile-nufi" | "mobile-lace" |
Parameters
Name | Type |
---|---|
name | T |
Returns
T
set
▸ Protected
set<K
>(key
, v
): { name
: undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
}[K
]
Sets a value and notifies all listeners
Type parameters
Name | Type |
---|---|
K | extends "name" |
Parameters
Name | Type |
---|---|
key | K |
v | { name : undefined | "nami" | "eternl" | "flint" | "gerowallet" | "typhoncip30" | "nufi" | "lace" }[K ] |
Returns
{ name
: undefined
| "nami"
| "eternl"
| "flint"
| "gerowallet"
| "typhoncip30"
| "nufi"
| "lace"
}[K
]
Inherited from
Subscribable.set
signData
▸ signData(payload
): Promise
<undefined
| Signature
>
Parameters
Name | Type |
---|---|
payload | string |
Returns
Promise
<undefined
| Signature
>
signTx
▸ signTx(tx
, partialSign?
): Promise
<string
>
Parameters
Name | Type |
---|---|
tx | string |
partialSign? | boolean |
Returns
Promise
<string
>
submitTx
▸ submitTx(tx
): Promise
<string
>
Parameters
Name | Type |
---|---|
tx | string |
Returns
Promise
<string
>
subscribe
▸ subscribe<K
>(key
, listener
): () => void
Subscribes to a value
Type parameters
Name | Type |
---|---|
K | extends "name" |
Parameters
Name | Type |
---|---|
key | K |
listener | (v : { name : undefined | "nami" | "eternl" | "flint" | "gerowallet" | "typhoncip30" | "nufi" | "lace" }[K ]) => void |
Returns
fn
▸ (): void
Subscribes to a value
Returns
void
Inherited from
Subscribable.subscribe