@near-wallet-selector/core
Advanced tools
Comparing version 8.2.1 to 8.3.0
{ | ||
"name": "@near-wallet-selector/core", | ||
"version": "8.2.1", | ||
"version": "8.3.0", | ||
"description": "This is the core package for NEAR Wallet Selector.", | ||
@@ -30,5 +30,7 @@ "keywords": [ | ||
"dependencies": { | ||
"borsh": "0.7.0", | ||
"events": "3.3.0", | ||
"js-sha256": "0.9.0", | ||
"rxjs": "7.8.1" | ||
} | ||
} |
@@ -8,5 +8,5 @@ export type { WalletSelector, WalletSelectorParams, WalletSelectorEvents, WalletSelectorStore, } from "./lib/wallet-selector.types"; | ||
export type { WalletSelectorState, ContractState, ModuleState, AccountState, } from "./lib/store.types"; | ||
export type { WalletModuleFactory, WalletModule, WalletBehaviourFactory, WalletBehaviourOptions, Wallet, WalletType, WalletMetadata, WalletEvents, SignInParams, BrowserWalletMetadata, BrowserWalletBehaviour, BrowserWallet, InjectedWalletMetadata, InjectedWalletBehaviour, InjectedWallet, InstantLinkWalletMetadata, InstantLinkWalletBehaviour, InstantLinkWallet, HardwareWalletMetadata, HardwareWalletSignInParams, HardwareWalletBehaviour, HardwareWallet, HardwareWalletAccount, BridgeWalletMetadata, BridgeWalletBehaviour, BridgeWallet, VerifiedOwner, VerifyOwnerParams, Account, Transaction, Action, ActionType, CreateAccountAction, DeployContractAction, FunctionCallAction, TransferAction, StakeAction, AddKeyAction, DeleteKeyAction, DeleteAccountAction, AddKeyPermission, AccountImportData, } from "./lib/wallet"; | ||
export type { WalletModuleFactory, WalletModule, WalletBehaviourFactory, WalletBehaviourOptions, Wallet, WalletType, WalletMetadata, WalletEvents, SignInParams, BrowserWalletMetadata, BrowserWalletBehaviour, BrowserWallet, InjectedWalletMetadata, InjectedWalletBehaviour, InjectedWallet, InstantLinkWalletMetadata, InstantLinkWalletBehaviour, InstantLinkWallet, HardwareWalletMetadata, HardwareWalletSignInParams, HardwareWalletBehaviour, HardwareWallet, HardwareWalletAccount, BridgeWalletMetadata, BridgeWalletBehaviour, BridgeWallet, VerifiedOwner, VerifyOwnerParams, Account, Transaction, Action, ActionType, CreateAccountAction, DeployContractAction, FunctionCallAction, TransferAction, StakeAction, AddKeyAction, DeleteKeyAction, DeleteAccountAction, AddKeyPermission, AccountImportData, SignedMessage, SignMessageParams, } from "./lib/wallet"; | ||
export type { FinalExecutionOutcome } from "near-api-js/lib/providers"; | ||
export { waitFor, getActiveAccount, isCurrentBrowserSupported, } from "./lib/helpers"; | ||
export { waitFor, getActiveAccount, isCurrentBrowserSupported, verifyFullKeyBelongsToUser, verifySignature, } from "./lib/helpers"; | ||
export { translate, allowOnlyLanguage } from "./lib/translate/translate"; |
export * from "./waitFor"; | ||
export * from "./getActiveAccount"; | ||
export * from "./detect-browser"; | ||
export * from "./verify-signature/verify-signature"; |
import type { BehaviorSubject, Observable } from "rxjs"; | ||
import type { Wallet, Account } from "./wallet"; | ||
import type { SignMessageMethod } from "./wallet"; | ||
export interface ContractState { | ||
@@ -29,3 +30,3 @@ /** | ||
*/ | ||
wallet(): Promise<Variation>; | ||
wallet(): Promise<Variation & SignMessageMethod>; | ||
}; | ||
@@ -32,0 +33,0 @@ export type AccountState = Account & { |
@@ -6,2 +6,3 @@ import type { Account, Wallet, WalletModuleFactory } from "./wallet/wallet.types"; | ||
import type { SupportedLanguage } from "./translate/translate"; | ||
import type { SignMessageMethod } from "./wallet/wallet.types"; | ||
export interface WalletSelectorParams { | ||
@@ -83,3 +84,3 @@ /** | ||
*/ | ||
wallet<Variation extends Wallet = Wallet>(id?: string): Promise<Variation>; | ||
wallet<Variation extends Wallet = Wallet>(id?: string): Promise<Variation & SignMessageMethod>; | ||
/** | ||
@@ -86,0 +87,0 @@ * Determines whether we're signed in to one or more accounts. |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import type { providers, utils } from "near-api-js"; | ||
@@ -72,2 +73,18 @@ import type { EventEmitterService, LoggerService, ProviderService, JsonStorageService } from "../services"; | ||
} | ||
export interface SignMessageParams { | ||
message: string; | ||
recipient: string; | ||
nonce: Buffer; | ||
callbackUrl?: string; | ||
state?: string; | ||
} | ||
export interface SignedMessage { | ||
accountId: string; | ||
publicKey: string; | ||
signature: string; | ||
state?: string; | ||
} | ||
export type SignMessageMethod = { | ||
signMessage(params: SignMessageParams): Promise<SignedMessage | void>; | ||
}; | ||
interface SignAndSendTransactionParams { | ||
@@ -122,2 +139,3 @@ /** | ||
signAndSendTransactions(params: SignAndSendTransactionsParams): Promise<Array<providers.FinalExecutionOutcome>>; | ||
signMessage?(params: SignMessageParams): Promise<SignedMessage | void>; | ||
} | ||
@@ -124,0 +142,0 @@ type BaseWallet<Type extends string, Metadata extends BaseWalletMetadata, Behaviour> = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
529303
39
13051
5
+ Addedborsh@0.7.0
+ Addedjs-sha256@0.9.0