@solana/wallet-adapter-base
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -1,2 +0,2 @@ | ||
import { PublicKey, Transaction } from '@solana/web3.js'; | ||
import { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js'; | ||
import EventEmitter from 'eventemitter3'; | ||
@@ -6,8 +6,11 @@ import { WalletError } from './errors'; | ||
export interface WalletAdapterEvents { | ||
ready: () => void; | ||
connect: () => void; | ||
disconnect: () => void; | ||
error: (error: WalletError) => void; | ||
ready(): void; | ||
connect(): void; | ||
disconnect(): void; | ||
error(error: WalletError): void; | ||
} | ||
export interface WalletAdapter extends EventEmitter<WalletAdapterEvents> { | ||
export interface SendTransactionOptions extends SendOptions { | ||
signers?: Signer[]; | ||
} | ||
export interface WalletAdapterProps { | ||
publicKey: PublicKey | null; | ||
@@ -18,7 +21,17 @@ ready: boolean; | ||
autoApprove: boolean; | ||
connect: () => Promise<void>; | ||
disconnect: () => Promise<void>; | ||
signTransaction: (transaction: Transaction) => Promise<Transaction>; | ||
signAllTransactions: (transaction: Transaction[]) => Promise<Transaction[]>; | ||
connect(): Promise<void>; | ||
disconnect(): Promise<void>; | ||
sendTransaction(transaction: Transaction, connection: Connection, options?: SendTransactionOptions): Promise<TransactionSignature>; | ||
} | ||
export declare type WalletAdapter = WalletAdapterProps & EventEmitter<WalletAdapterEvents>; | ||
export declare abstract class BaseWalletAdapter extends EventEmitter<WalletAdapterEvents> implements WalletAdapter { | ||
abstract publicKey: PublicKey | null; | ||
abstract ready: boolean; | ||
abstract connecting: boolean; | ||
abstract connected: boolean; | ||
abstract autoApprove: boolean; | ||
abstract connect(): Promise<void>; | ||
abstract disconnect(): Promise<void>; | ||
abstract sendTransaction(transaction: Transaction, connection: Connection, options?: SendTransactionOptions): Promise<TransactionSignature>; | ||
} | ||
export declare enum WalletAdapterNetwork { | ||
@@ -25,0 +38,0 @@ Mainnet = "mainnet-beta", |
import EventEmitter from 'eventemitter3'; | ||
export { EventEmitter }; | ||
export class BaseWalletAdapter extends EventEmitter { | ||
} | ||
export var WalletAdapterNetwork; | ||
@@ -4,0 +6,0 @@ (function (WalletAdapterNetwork) { |
@@ -35,5 +35,8 @@ export declare class WalletError extends Error { | ||
} | ||
export declare class WalletSignatureError extends WalletError { | ||
export declare class WalletSendTransactionError extends WalletError { | ||
name: string; | ||
} | ||
export declare class WalletSignTransactionError extends WalletError { | ||
name: string; | ||
} | ||
export declare class WalletWindowBlockedError extends WalletError { | ||
@@ -40,0 +43,0 @@ name: string; |
@@ -67,8 +67,14 @@ export class WalletError extends Error { | ||
} | ||
export class WalletSignatureError extends WalletError { | ||
export class WalletSendTransactionError extends WalletError { | ||
constructor() { | ||
super(...arguments); | ||
this.name = 'WalletSignatureError'; | ||
this.name = 'WalletSendTransactionError'; | ||
} | ||
} | ||
export class WalletSignTransactionError extends WalletError { | ||
constructor() { | ||
super(...arguments); | ||
this.name = 'WalletSignTransactionError'; | ||
} | ||
} | ||
export class WalletWindowBlockedError extends WalletError { | ||
@@ -75,0 +81,0 @@ constructor() { |
export * from './adapter'; | ||
export * from './errors'; | ||
export * from './poll'; | ||
export * from './signer'; |
export * from './adapter'; | ||
export * from './errors'; | ||
export * from './poll'; | ||
export * from './signer'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@solana/wallet-adapter-base", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"author": "Solana Maintainers <maintainers@solana.foundation>", | ||
@@ -30,3 +30,3 @@ "repository": "https://github.com/solana-labs/wallet-adapter", | ||
}, | ||
"gitHead": "45013f04ea3be6a877e899f16c33d23884d147ec" | ||
"gitHead": "76ff330eaf74b916f448eb8870302ae127a94b3d" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { PublicKey, Transaction } from '@solana/web3.js'; | ||
import { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js'; | ||
import EventEmitter from 'eventemitter3'; | ||
@@ -8,9 +8,13 @@ import { WalletError } from './errors'; | ||
export interface WalletAdapterEvents { | ||
ready: () => void; | ||
connect: () => void; | ||
disconnect: () => void; | ||
error: (error: WalletError) => void; | ||
ready(): void; | ||
connect(): void; | ||
disconnect(): void; | ||
error(error: WalletError): void; | ||
} | ||
export interface WalletAdapter extends EventEmitter<WalletAdapterEvents> { | ||
export interface SendTransactionOptions extends SendOptions { | ||
signers?: Signer[]; | ||
} | ||
export interface WalletAdapterProps { | ||
publicKey: PublicKey | null; | ||
@@ -22,8 +26,29 @@ ready: boolean; | ||
connect: () => Promise<void>; | ||
disconnect: () => Promise<void>; | ||
signTransaction: (transaction: Transaction) => Promise<Transaction>; | ||
signAllTransactions: (transaction: Transaction[]) => Promise<Transaction[]>; | ||
connect(): Promise<void>; | ||
disconnect(): Promise<void>; | ||
sendTransaction( | ||
transaction: Transaction, | ||
connection: Connection, | ||
options?: SendTransactionOptions | ||
): Promise<TransactionSignature>; | ||
} | ||
export type WalletAdapter = WalletAdapterProps & EventEmitter<WalletAdapterEvents>; | ||
export abstract class BaseWalletAdapter extends EventEmitter<WalletAdapterEvents> implements WalletAdapter { | ||
abstract publicKey: PublicKey | null; | ||
abstract ready: boolean; | ||
abstract connecting: boolean; | ||
abstract connected: boolean; | ||
abstract autoApprove: boolean; | ||
abstract connect(): Promise<void>; | ||
abstract disconnect(): Promise<void>; | ||
abstract sendTransaction( | ||
transaction: Transaction, | ||
connection: Connection, | ||
options?: SendTransactionOptions | ||
): Promise<TransactionSignature>; | ||
} | ||
export enum WalletAdapterNetwork { | ||
@@ -30,0 +55,0 @@ Mainnet = 'mainnet-beta', |
@@ -50,6 +50,10 @@ export class WalletError extends Error { | ||
export class WalletSignatureError extends WalletError { | ||
name = 'WalletSignatureError'; | ||
export class WalletSendTransactionError extends WalletError { | ||
name = 'WalletSendTransactionError'; | ||
} | ||
export class WalletSignTransactionError extends WalletError { | ||
name = 'WalletSignTransactionError'; | ||
} | ||
export class WalletWindowBlockedError extends WalletError { | ||
@@ -56,0 +60,0 @@ name = 'WalletWindowBlockedError'; |
export * from './adapter'; | ||
export * from './errors'; | ||
export * from './poll'; | ||
export * from './signer'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32686
23
438