@tronweb3/tronwallet-abstract-adapter
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -38,4 +38,8 @@ "use strict"; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
switchChain(_chainId) { | ||
return Promise.reject("The current wallet doesn't support switch chain."); | ||
} | ||
} | ||
exports.Adapter = Adapter; | ||
//# sourceMappingURL=adapter.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WalletWindowClosedError = exports.WalletWalletLoadError = exports.WalletSignTransactionError = exports.WalletSignMessageError = exports.WalletDisconnectionError = exports.WalletConnectionError = exports.WalletDisconnectedError = exports.WalletNotSelectedError = exports.WalletNotFoundError = exports.WalletError = void 0; | ||
exports.WalletSwitchChainError = exports.WalletWindowClosedError = exports.WalletWalletLoadError = exports.WalletSignTransactionError = exports.WalletSignMessageError = exports.WalletDisconnectionError = exports.WalletConnectionError = exports.WalletDisconnectedError = exports.WalletNotSelectedError = exports.WalletNotFoundError = exports.WalletError = void 0; | ||
class WalletError extends Error { | ||
@@ -106,2 +106,12 @@ constructor(message, error) { | ||
exports.WalletWindowClosedError = WalletWindowClosedError; | ||
/** | ||
* Occurs when request wallet to switch chain. | ||
*/ | ||
class WalletSwitchChainError extends WalletError { | ||
constructor() { | ||
super(...arguments); | ||
this.name = 'WalletSwitchChainError'; | ||
} | ||
} | ||
exports.WalletSwitchChainError = WalletSwitchChainError; | ||
//# sourceMappingURL=errors.js.map |
@@ -32,3 +32,7 @@ import EventEmitter from 'eventemitter3'; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
switchChain(_chainId) { | ||
return Promise.reject("The current wallet doesn't support switch chain."); | ||
} | ||
} | ||
//# sourceMappingURL=adapter.js.map |
@@ -93,2 +93,11 @@ export class WalletError extends Error { | ||
} | ||
/** | ||
* Occurs when request wallet to switch chain. | ||
*/ | ||
export class WalletSwitchChainError extends WalletError { | ||
constructor() { | ||
super(...arguments); | ||
this.name = 'WalletSwitchChainError'; | ||
} | ||
} | ||
//# sourceMappingURL=errors.js.map |
@@ -28,2 +28,3 @@ import EventEmitter from 'eventemitter3'; | ||
signTransaction(transaction: Transaction, privateKey?: string): Promise<SignedTransaction>; | ||
switchChain(chainId: string): Promise<void>; | ||
} | ||
@@ -62,3 +63,4 @@ /** | ||
abstract signTransaction(transaction: Transaction, privateKey?: string): Promise<SignedTransaction>; | ||
switchChain(_chainId: string): Promise<void>; | ||
} | ||
//# sourceMappingURL=adapter.d.ts.map |
@@ -64,2 +64,8 @@ export declare class WalletError extends Error { | ||
} | ||
/** | ||
* Occurs when request wallet to switch chain. | ||
*/ | ||
export declare class WalletSwitchChainError extends WalletError { | ||
name: string; | ||
} | ||
//# sourceMappingURL=errors.d.ts.map |
export type NetworkNodeConfig = { | ||
chainId: string; | ||
chain: string; | ||
@@ -3,0 +4,0 @@ fullNode: string; |
{ | ||
"name": "@tronweb3/tronwallet-abstract-adapter", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "tronprotocol", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -31,2 +31,3 @@ import EventEmitter from 'eventemitter3'; | ||
signTransaction(transaction: Transaction, privateKey?: string): Promise<SignedTransaction>; | ||
switchChain(chainId: string): Promise<void>; | ||
} | ||
@@ -77,2 +78,6 @@ | ||
abstract signTransaction(transaction: Transaction, privateKey?: string): Promise<SignedTransaction>; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
switchChain(_chainId: string): Promise<void> { | ||
return Promise.reject("The current wallet doesn't support switch chain."); | ||
} | ||
} |
@@ -77,1 +77,7 @@ export class WalletError extends Error { | ||
} | ||
/** | ||
* Occurs when request wallet to switch chain. | ||
*/ | ||
export class WalletSwitchChainError extends WalletError { | ||
name = 'WalletSwitchChainError'; | ||
} |
export type NetworkNodeConfig = { | ||
chainId: string; | ||
chain: string; | ||
@@ -3,0 +4,0 @@ fullNode: string; |
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
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
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
40538
850