@wallet-standard/base
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0-rc.2
@@ -6,3 +6,3 @@ /** A namespaced identifier in the format `${namespace}:${string}`. */ | ||
/** An object where the keys are namespaced identifiers in the format `${namespace}:${string}`. */ | ||
export declare type IdentifierRecord<T> = Record<IdentifierString, T>; | ||
export declare type IdentifierRecord<T> = Readonly<Record<IdentifierString, T>>; | ||
/** TODO: docs */ | ||
@@ -9,0 +9,0 @@ export declare type WalletVersion = '1.0.0'; |
import type { Wallet } from './wallet.js'; | ||
/** Global `window.navigator.wallets` interface. */ | ||
export interface WindowNavigatorWallets { | ||
/** | ||
* TODO: docs | ||
*/ | ||
push(...callbacks: WindowNavigatorWalletsPushCallback[]): void; | ||
/** TODO: docs */ | ||
export interface AppInitializeEventAPI { | ||
/** TODO: docs */ | ||
register(wallet: Wallet): () => void; | ||
} | ||
/** | ||
* TODO: docs | ||
*/ | ||
export declare type WindowNavigatorWalletsPushCallback = ({ register }: { | ||
register(...wallets: Wallet[]): () => void; | ||
}) => void; | ||
/** Global `navigator` containing a `wallets` interface. */ | ||
export interface WalletsNavigator extends Navigator { | ||
/** TODO: docs */ | ||
export declare type AppInitializeEventType = 'wallet-standard-app-initialize'; | ||
/** TODO: docs */ | ||
export interface AppInitializeEvent extends CustomEvent<AppInitializeEventAPI> { | ||
/** TODO: docs */ | ||
wallets?: WindowNavigatorWallets; | ||
readonly type: AppInitializeEventType; | ||
} | ||
/** Global `window` containing a `navigator.wallets` interface. */ | ||
export interface NavigatorWalletsWindow extends Window { | ||
/** TODO: docs */ | ||
export declare type WalletInitializeEventCallback = (api: AppInitializeEventAPI) => void; | ||
/** TODO: docs */ | ||
export declare type WalletInitializeEventType = 'wallet-standard-wallet-initialize'; | ||
/** TODO: docs */ | ||
export interface WalletInitializeEvent extends CustomEvent<WalletInitializeEventCallback> { | ||
/** TODO: docs */ | ||
navigator: WalletsNavigator; | ||
readonly type: WalletInitializeEventType; | ||
} | ||
/** TODO: docs */ | ||
export interface WalletEventsWindow { | ||
/** TODO: docs */ | ||
addEventListener(type: AppInitializeEventType, listener: (event: AppInitializeEvent) => void): void; | ||
/** TODO: docs */ | ||
addEventListener(type: WalletInitializeEventType, listener: (event: WalletInitializeEvent) => void): void; | ||
/** TODO: docs */ | ||
dispatchEvent(event: AppInitializeEvent): void; | ||
/** TODO: docs */ | ||
dispatchEvent(event: WalletInitializeEvent): void; | ||
} | ||
//# sourceMappingURL=window.d.ts.map |
{ | ||
"name": "@wallet-standard/base", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0-rc.2", | ||
"author": "Solana Maintainers <maintainers@solana.foundation>", | ||
"repository": "https://github.com/wallet-standard/wallet-standard", | ||
"license": "Apache-2.0", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src", | ||
"LICENSE" | ||
], | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=16" | ||
}, | ||
@@ -20,10 +28,2 @@ "type": "module", | ||
}, | ||
"files": [ | ||
"lib", | ||
"src", | ||
"LICENSE" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
@@ -30,0 +30,0 @@ "shx": "^0.3.4" |
@@ -17,6 +17,6 @@ # Wallet Standard | ||
- Global [`window.navigator.wallets`](src/window.ts) interface | ||
- [`Wallet`](src/wallet.ts) and [`WalletAccount`](src/account.ts) interfaces | ||
- Wallet [`setupWindowNavigatorWallets`](../wallet/src/setup.ts) function | ||
- App [`initializeWindowNavigatorWallets`](../app/src/initialize.ts) function | ||
- [`Wallet` and `WalletAccount`](src/wallet.ts) interfaces | ||
- Global [`window`](src/window.ts) events | ||
- Wallet [`initializeWallet`](../wallet/src/initialize.ts) function | ||
- App [`initializeApp`](../app/src/initialize.ts) function | ||
- [Example](../../example/wallets/src/window.ts) of how wallets attach to the window | ||
@@ -23,0 +23,0 @@ |
@@ -8,3 +8,3 @@ /** A namespaced identifier in the format `${namespace}:${string}`. */ | ||
/** An object where the keys are namespaced identifiers in the format `${namespace}:${string}`. */ | ||
export type IdentifierRecord<T> = Record<IdentifierString, T>; | ||
export type IdentifierRecord<T> = Readonly<Record<IdentifierString, T>>; | ||
@@ -11,0 +11,0 @@ /** TODO: docs */ |
import type { Wallet } from './wallet.js'; | ||
/** Global `window.navigator.wallets` interface. */ | ||
export interface WindowNavigatorWallets { | ||
/** | ||
* TODO: docs | ||
*/ | ||
push(...callbacks: WindowNavigatorWalletsPushCallback[]): void; | ||
/** TODO: docs */ | ||
export interface AppInitializeEventAPI { | ||
/** TODO: docs */ | ||
register(wallet: Wallet): () => void; | ||
} | ||
/** | ||
* TODO: docs | ||
*/ | ||
export type WindowNavigatorWalletsPushCallback = ({ register }: { register(...wallets: Wallet[]): () => void }) => void; | ||
/** TODO: docs */ | ||
export type AppInitializeEventType = 'wallet-standard-app-initialize'; | ||
/** Global `navigator` containing a `wallets` interface. */ | ||
export interface WalletsNavigator extends Navigator { | ||
/** TODO: docs */ | ||
export interface AppInitializeEvent extends CustomEvent<AppInitializeEventAPI> { | ||
/** TODO: docs */ | ||
wallets?: WindowNavigatorWallets; | ||
readonly type: AppInitializeEventType; | ||
} | ||
/** Global `window` containing a `navigator.wallets` interface. */ | ||
export interface NavigatorWalletsWindow extends Window { | ||
/** TODO: docs */ | ||
export type WalletInitializeEventCallback = (api: AppInitializeEventAPI) => void; | ||
/** TODO: docs */ | ||
export type WalletInitializeEventType = 'wallet-standard-wallet-initialize'; | ||
/** TODO: docs */ | ||
export interface WalletInitializeEvent extends CustomEvent<WalletInitializeEventCallback> { | ||
/** TODO: docs */ | ||
navigator: WalletsNavigator; | ||
readonly type: WalletInitializeEventType; | ||
} | ||
/** TODO: docs */ | ||
export interface WalletEventsWindow { | ||
/** TODO: docs */ | ||
addEventListener(type: AppInitializeEventType, listener: (event: AppInitializeEvent) => void): void; | ||
/** TODO: docs */ | ||
addEventListener(type: WalletInitializeEventType, listener: (event: WalletInitializeEvent) => void): void; | ||
/** TODO: docs */ | ||
dispatchEvent(event: AppInitializeEvent): void; | ||
/** TODO: docs */ | ||
dispatchEvent(event: WalletInitializeEvent): void; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
32620
196
0