WalletManagerNear
Defined in: wallet-near/src/manager.ts:22
One seed → NEAR accounts at m/44’/397’/i’ (SLIP-10 ed25519 — the NEAR Wallet / near-seed-phrase path; index 0 is what every NEAR wallet derives). Paths may be given relative to m/44’/397’ (“0’”) or in full; every segment must be hardened.
Built with an ed25519 Signer instead of a seed, the manager wraps it:
- a derivable
SeedSignersitting atm/44'/397'yieldsgetAccount(i)→i'children; - a
SeedSignerat a leaf, or any external signer, isgetAccount(0)(path = the signer’s path, or ‘external’); other indexes/paths throwSignerError.
getNamedAccount("alice.near", i) binds account i’s key to a named account.
Extends
Section titled “Extends”WalletManager<WalletAccountNear,NearConfig>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletManagerNear(
seedOrSigner,config?):WalletManagerNear
Defined in: wallet-near/src/manager.ts:23
Parameters
Section titled “Parameters”seedOrSigner
Section titled “seedOrSigner”string | Uint8Array<ArrayBufferLike> | Signer
config?
Section titled “config?”NearConfig = {}
Returns
Section titled “Returns”WalletManagerNear
Overrides
Section titled “Overrides”WalletManager<WalletAccountNear, NearConfig>.constructor
Properties
Section titled “Properties”_accounts
Section titled “_accounts”
protectedreadonly_accounts:Map<string,WalletAccountNear>
Defined in: core/dist/index.d.ts:271
Inherited from
Section titled “Inherited from”WalletManager._accounts
_config
Section titled “_config”
protectedreadonly_config:NearConfig
Defined in: core/dist/index.d.ts:270
Inherited from
Section titled “Inherited from”WalletManager._config
_signer
Section titled “_signer”
protectedreadonly_signer:Signer|undefined
Defined in: core/dist/index.d.ts:269
Inherited from
Section titled “Inherited from”WalletManager._signer
Methods
Section titled “Methods”cachedAccount()
Section titled “cachedAccount()”
protectedcachedAccount(key,create):Promise<WalletAccountNear>
Defined in: core/dist/index.d.ts:295
The account cached under key, built by create at most once: concurrent calls share one
build. Throws once the manager is disposed; an account whose build finishes after dispose()
is disposed itself and the call throws, so no live signing account outlives the manager.
Parameters
Section titled “Parameters”string
create
Section titled “create”() => WalletAccountNear | Promise<WalletAccountNear>
Returns
Section titled “Returns”Promise<WalletAccountNear>
Inherited from
Section titled “Inherited from”WalletManager.cachedAccount
dispose()
Section titled “dispose()”dispose():
void
Defined in: core/dist/index.d.ts:302
Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”WalletManager.dispose
externalSigner()
Section titled “externalSigner()”
protectedexternalSigner():Signer|undefined
Defined in: core/dist/index.d.ts:281
The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.
Returns
Section titled “Returns”Signer | undefined
Inherited from
Section titled “Inherited from”WalletManager.externalSigner
getAccount()
Section titled “getAccount()”getAccount(
index?):Promise<WalletAccountNear>
Defined in: wallet-near/src/manager.ts:28
Account index on the chain’s standard path. Cached per index.
Parameters
Section titled “Parameters”index?
Section titled “index?”number = 0
Returns
Section titled “Returns”Promise<WalletAccountNear>
Overrides
Section titled “Overrides”WalletManager.getAccount
getAccountByPath()
Section titled “getAccountByPath()”getAccountByPath(
path):Promise<WalletAccountNear>
Defined in: wallet-near/src/manager.ts:32
Account at an explicit path. Cached per path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<WalletAccountNear>
Overrides
Section titled “Overrides”WalletManager.getAccountByPath
getFeeRates()
Section titled “getFeeRates()”getFeeRates():
Promise<FeeRates>
Defined in: wallet-near/src/manager.ts:71
NEAR has one protocol gas price (gas_price RPC, yoctoNEAR per gas); it can rise ~1%/block, so fast = ×1.1.
Returns
Section titled “Returns”Promise<FeeRates>
Overrides
Section titled “Overrides”WalletManager.getFeeRates
getNamedAccount()
Section titled “getNamedAccount()”getNamedAccount(
accountId,index?):Promise<WalletAccountNear>
Defined in: wallet-near/src/manager.ts:46
The key of account index, bound to a named account that lists it as a full-access key.
Parameters
Section titled “Parameters”accountId
Section titled “accountId”string
index?
Section titled “index?”number = 0
Returns
Section titled “Returns”Promise<WalletAccountNear>
getReadOnlyAccount()
Section titled “getReadOnlyAccount()”getReadOnlyAccount(
accountId,publicKey?):WalletAccountReadOnlyNear
Defined in: wallet-near/src/manager.ts:66
A read-only account for any account id, with this manager’s config.
Parameters
Section titled “Parameters”accountId
Section titled “accountId”string
publicKey?
Section titled “publicKey?”Uint8Array<ArrayBufferLike> | NearPublicKey
Returns
Section titled “Returns”requireSigner()
Section titled “requireSigner()”
protectedrequireSigner(curve):Signer
Defined in: core/dist/index.d.ts:283
The external signer, asserted to sign on curve; throws when the manager holds a mnemonic instead.
Parameters
Section titled “Parameters”SignerCurve
Returns
Section titled “Returns”Signer
Inherited from
Section titled “Inherited from”WalletManager.requireSigner
seedBytes()
Section titled “seedBytes()”
protectedseedBytes():Uint8Array
Defined in: core/dist/index.d.ts:275
The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.
Returns
Section titled “Returns”Uint8Array
Inherited from
Section titled “Inherited from”WalletManager.seedBytes
signerAccount()
Section titled “signerAccount()”
protectedsignerAccount(key,signer,relativePath,build):Promise<WalletAccountNear>
Defined in: core/dist/index.d.ts:300
cachedAccount over an injected signer: the signer itself (relativePath undefined) or
its child along relativePath. A child that never becomes an account is disposed.
Parameters
Section titled “Parameters”string
signer
Section titled “signer”Signer
relativePath
Section titled “relativePath”string | undefined
(leaf, publicKey) => WalletAccountNear
Returns
Section titled “Returns”Promise<WalletAccountNear>
Inherited from
Section titled “Inherited from”WalletManager.signerAccount
getRandomSeedPhrase()
Section titled “getRandomSeedPhrase()”
staticgetRandomSeedPhrase(words?):string
Defined in: core/dist/index.d.ts:279
Same as the core getRandomSeedPhrase.
Parameters
Section titled “Parameters”words?
Section titled “words?”12 | 24
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”WalletManager.getRandomSeedPhrase
isValidSeedPhrase()
Section titled “isValidSeedPhrase()”
staticisValidSeedPhrase(seed):boolean
Defined in: core/dist/index.d.ts:277
Same as the core isValidSeedPhrase.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”WalletManager.isValidSeedPhrase