@aptos-labs/wallet-adapter-core
Advanced tools
@@ -29,3 +29,2 @@ "use strict"; | ||
__export(src_exports, { | ||
AccountAddress: () => import_ts_sdk4.AccountAddress, | ||
ChainIdToAnsSupportedNetworkMap: () => ChainIdToAnsSupportedNetworkMap, | ||
@@ -59,7 +58,7 @@ NetworkName: () => NetworkName, | ||
// src/version.ts | ||
var WALLET_ADAPTER_CORE_VERSION = "4.1.0"; | ||
var WALLET_ADAPTER_CORE_VERSION = "4.1.1"; | ||
// src/WalletCore.ts | ||
var import_aptos4 = require("aptos"); | ||
var import_ts_sdk6 = require("@aptos-labs/ts-sdk"); | ||
var import_ts_sdk5 = require("@aptos-labs/ts-sdk"); | ||
var import_eventemitter32 = __toESM(require("eventemitter3")); | ||
@@ -499,8 +498,5 @@ var import_wallet_standard2 = require("@aptos-labs/wallet-standard"); | ||
// src/AIP62StandardWallets/types.ts | ||
var import_ts_sdk4 = require("@aptos-labs/ts-sdk"); | ||
// src/AIP62StandardWallets/WalletStandard.ts | ||
var import_wallet_standard = require("@aptos-labs/wallet-standard"); | ||
var import_ts_sdk5 = require("@aptos-labs/ts-sdk"); | ||
var import_ts_sdk4 = require("@aptos-labs/ts-sdk"); | ||
var WalletStandardCore = class { | ||
@@ -567,4 +563,4 @@ async connect(wallet) { | ||
let verified = false; | ||
if (response.args.signature instanceof import_ts_sdk5.MultiEd25519Signature) { | ||
if (!(account.publicKey instanceof import_ts_sdk5.MultiEd25519PublicKey)) { | ||
if (response.args.signature instanceof import_ts_sdk4.MultiEd25519Signature) { | ||
if (!(account.publicKey instanceof import_ts_sdk4.MultiEd25519PublicKey)) { | ||
throw new WalletSignMessageAndVerifyError( | ||
@@ -815,6 +811,6 @@ "Public key and Signature type mismatch" | ||
} | ||
const aptosConfig = new import_ts_sdk6.AptosConfig({ | ||
const aptosConfig = new import_ts_sdk5.AptosConfig({ | ||
network: convertNetwork(this._network) | ||
}); | ||
const aptos = new import_ts_sdk6.Aptos(aptosConfig); | ||
const aptos = new import_ts_sdk5.Aptos(aptosConfig); | ||
const name = await aptos.ans.getPrimaryName({ | ||
@@ -843,4 +839,4 @@ address: this._account.address.toString() | ||
this._account = { | ||
address: connectStandardAccount.args.address, | ||
publicKey: connectStandardAccount.args.publicKey, | ||
address: connectStandardAccount.args.address.toString(), | ||
publicKey: connectStandardAccount.args.publicKey.toString(), | ||
ansName: connectStandardAccount.args.ansName | ||
@@ -852,4 +848,4 @@ }; | ||
this._account = { | ||
address: standardAccount.address, | ||
publicKey: standardAccount.publicKey, | ||
address: standardAccount.address.toString(), | ||
publicKey: standardAccount.publicKey.toString(), | ||
ansName: standardAccount.ansName | ||
@@ -1011,3 +1007,3 @@ }; | ||
const aptosConfig = getAptosConfig(this._network); | ||
const aptos = new import_ts_sdk6.Aptos(aptosConfig); | ||
const aptos = new import_ts_sdk5.Aptos(aptosConfig); | ||
if (this._wallet.signAndSubmitTransaction) { | ||
@@ -1076,3 +1072,3 @@ if (this._wallet.isAIP62Standard) { | ||
}; | ||
const rawTransaction = await (0, import_ts_sdk6.generateRawTransaction)({ | ||
const rawTransaction = await (0, import_ts_sdk5.generateRawTransaction)({ | ||
aptosConfig, | ||
@@ -1084,3 +1080,3 @@ payload, | ||
return await this.walletStandardCore.signTransaction( | ||
new import_ts_sdk6.SimpleTransaction(rawTransaction), | ||
new import_ts_sdk5.SimpleTransaction(rawTransaction), | ||
this._wallet, | ||
@@ -1114,5 +1110,5 @@ false | ||
const signature = transactionAuthenticator.signature.value; | ||
const accountAuthenticator = new import_ts_sdk6.AccountAuthenticatorEd25519( | ||
new import_ts_sdk6.Ed25519PublicKey(publicKey), | ||
new import_ts_sdk6.Ed25519Signature(signature) | ||
const accountAuthenticator = new import_ts_sdk5.AccountAuthenticatorEd25519( | ||
new import_ts_sdk5.Ed25519PublicKey(publicKey), | ||
new import_ts_sdk5.Ed25519Signature(signature) | ||
); | ||
@@ -1156,6 +1152,6 @@ return accountAuthenticator; | ||
} | ||
const aptosConfig = new import_ts_sdk6.AptosConfig({ | ||
const aptosConfig = new import_ts_sdk5.AptosConfig({ | ||
network: convertNetwork(this.network) | ||
}); | ||
const aptos = new import_ts_sdk6.Aptos(aptosConfig); | ||
const aptos = new import_ts_sdk5.Aptos(aptosConfig); | ||
if (additionalSignersAuthenticators !== void 0) { | ||
@@ -1214,3 +1210,3 @@ const multiAgentTxn = { | ||
}); | ||
const chainId = network === import_ts_sdk6.Network.DEVNET ? await fetchDevnetChainId() : import_ts_sdk6.NetworkToChainId[network]; | ||
const chainId = network === import_ts_sdk5.Network.DEVNET ? await fetchDevnetChainId() : import_ts_sdk5.NetworkToChainId[network]; | ||
if (this._wallet.changeNetwork) { | ||
@@ -1264,3 +1260,2 @@ const networkInfo = { | ||
0 && (module.exports = { | ||
AccountAddress, | ||
ChainIdToAnsSupportedNetworkMap, | ||
@@ -1267,0 +1262,0 @@ NetworkName, |
@@ -1,2 +0,1 @@ | ||
import { AccountAddress, PublicKey } from "@aptos-labs/ts-sdk"; | ||
import { WalletName } from "../LegacyWalletPlugins/types"; | ||
@@ -12,8 +11,2 @@ import { WalletReadyState } from "../constants"; | ||
export type AvailableWallets = "Nightly" | "Petra" | "T wallet"; | ||
export type NewStandardAccountInfo = { | ||
address: AccountAddress; | ||
publicKey: PublicKey; | ||
ansName?: string; | ||
}; | ||
export { AccountAddress } from "@aptos-labs/ts-sdk"; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -29,3 +29,2 @@ "use strict"; | ||
__export(src_exports, { | ||
AccountAddress: () => import_ts_sdk4.AccountAddress, | ||
ChainIdToAnsSupportedNetworkMap: () => ChainIdToAnsSupportedNetworkMap, | ||
@@ -59,7 +58,7 @@ NetworkName: () => NetworkName, | ||
// src/version.ts | ||
var WALLET_ADAPTER_CORE_VERSION = "4.1.0"; | ||
var WALLET_ADAPTER_CORE_VERSION = "4.1.1"; | ||
// src/WalletCore.ts | ||
var import_aptos4 = require("aptos"); | ||
var import_ts_sdk6 = require("@aptos-labs/ts-sdk"); | ||
var import_ts_sdk5 = require("@aptos-labs/ts-sdk"); | ||
var import_eventemitter32 = __toESM(require("eventemitter3")); | ||
@@ -499,8 +498,5 @@ var import_wallet_standard2 = require("@aptos-labs/wallet-standard"); | ||
// src/AIP62StandardWallets/types.ts | ||
var import_ts_sdk4 = require("@aptos-labs/ts-sdk"); | ||
// src/AIP62StandardWallets/WalletStandard.ts | ||
var import_wallet_standard = require("@aptos-labs/wallet-standard"); | ||
var import_ts_sdk5 = require("@aptos-labs/ts-sdk"); | ||
var import_ts_sdk4 = require("@aptos-labs/ts-sdk"); | ||
var WalletStandardCore = class { | ||
@@ -567,4 +563,4 @@ async connect(wallet) { | ||
let verified = false; | ||
if (response.args.signature instanceof import_ts_sdk5.MultiEd25519Signature) { | ||
if (!(account.publicKey instanceof import_ts_sdk5.MultiEd25519PublicKey)) { | ||
if (response.args.signature instanceof import_ts_sdk4.MultiEd25519Signature) { | ||
if (!(account.publicKey instanceof import_ts_sdk4.MultiEd25519PublicKey)) { | ||
throw new WalletSignMessageAndVerifyError( | ||
@@ -815,6 +811,6 @@ "Public key and Signature type mismatch" | ||
} | ||
const aptosConfig = new import_ts_sdk6.AptosConfig({ | ||
const aptosConfig = new import_ts_sdk5.AptosConfig({ | ||
network: convertNetwork(this._network) | ||
}); | ||
const aptos = new import_ts_sdk6.Aptos(aptosConfig); | ||
const aptos = new import_ts_sdk5.Aptos(aptosConfig); | ||
const name = await aptos.ans.getPrimaryName({ | ||
@@ -843,4 +839,4 @@ address: this._account.address.toString() | ||
this._account = { | ||
address: connectStandardAccount.args.address, | ||
publicKey: connectStandardAccount.args.publicKey, | ||
address: connectStandardAccount.args.address.toString(), | ||
publicKey: connectStandardAccount.args.publicKey.toString(), | ||
ansName: connectStandardAccount.args.ansName | ||
@@ -852,4 +848,4 @@ }; | ||
this._account = { | ||
address: standardAccount.address, | ||
publicKey: standardAccount.publicKey, | ||
address: standardAccount.address.toString(), | ||
publicKey: standardAccount.publicKey.toString(), | ||
ansName: standardAccount.ansName | ||
@@ -1011,3 +1007,3 @@ }; | ||
const aptosConfig = getAptosConfig(this._network); | ||
const aptos = new import_ts_sdk6.Aptos(aptosConfig); | ||
const aptos = new import_ts_sdk5.Aptos(aptosConfig); | ||
if (this._wallet.signAndSubmitTransaction) { | ||
@@ -1076,3 +1072,3 @@ if (this._wallet.isAIP62Standard) { | ||
}; | ||
const rawTransaction = await (0, import_ts_sdk6.generateRawTransaction)({ | ||
const rawTransaction = await (0, import_ts_sdk5.generateRawTransaction)({ | ||
aptosConfig, | ||
@@ -1084,3 +1080,3 @@ payload, | ||
return await this.walletStandardCore.signTransaction( | ||
new import_ts_sdk6.SimpleTransaction(rawTransaction), | ||
new import_ts_sdk5.SimpleTransaction(rawTransaction), | ||
this._wallet, | ||
@@ -1114,5 +1110,5 @@ false | ||
const signature = transactionAuthenticator.signature.value; | ||
const accountAuthenticator = new import_ts_sdk6.AccountAuthenticatorEd25519( | ||
new import_ts_sdk6.Ed25519PublicKey(publicKey), | ||
new import_ts_sdk6.Ed25519Signature(signature) | ||
const accountAuthenticator = new import_ts_sdk5.AccountAuthenticatorEd25519( | ||
new import_ts_sdk5.Ed25519PublicKey(publicKey), | ||
new import_ts_sdk5.Ed25519Signature(signature) | ||
); | ||
@@ -1156,6 +1152,6 @@ return accountAuthenticator; | ||
} | ||
const aptosConfig = new import_ts_sdk6.AptosConfig({ | ||
const aptosConfig = new import_ts_sdk5.AptosConfig({ | ||
network: convertNetwork(this.network) | ||
}); | ||
const aptos = new import_ts_sdk6.Aptos(aptosConfig); | ||
const aptos = new import_ts_sdk5.Aptos(aptosConfig); | ||
if (additionalSignersAuthenticators !== void 0) { | ||
@@ -1214,3 +1210,3 @@ const multiAgentTxn = { | ||
}); | ||
const chainId = network === import_ts_sdk6.Network.DEVNET ? await fetchDevnetChainId() : import_ts_sdk6.NetworkToChainId[network]; | ||
const chainId = network === import_ts_sdk5.Network.DEVNET ? await fetchDevnetChainId() : import_ts_sdk5.NetworkToChainId[network]; | ||
if (this._wallet.changeNetwork) { | ||
@@ -1264,3 +1260,2 @@ const networkInfo = { | ||
0 && (module.exports = { | ||
AccountAddress, | ||
ChainIdToAnsSupportedNetworkMap, | ||
@@ -1267,0 +1262,0 @@ NetworkName, |
@@ -5,3 +5,3 @@ import { Types } from "aptos"; | ||
import { AptosSignAndSubmitTransactionOutput, AptosSignMessageOutput, UserResponse, AccountInfo as StandardAccountInfo, NetworkInfo as StandardNetworkInfo, AptosChangeNetworkMethod } from "@aptos-labs/wallet-standard"; | ||
import { AptosStandardSupportedWallet, NewStandardAccountInfo } from "../AIP62StandardWallets/types"; | ||
import { AptosStandardSupportedWallet } from "../AIP62StandardWallets/types"; | ||
export { TxnBuilderTypes, Types } from "aptos"; | ||
@@ -40,3 +40,3 @@ export type { InputGenerateTransactionData, InputGenerateTransactionOptions, AnyRawTransaction, InputSubmitTransactionData, PendingTransactionResponse, AccountAuthenticator, Network, } from "@aptos-labs/ts-sdk"; | ||
networkChange(network: NetworkInfo | null): void; | ||
accountChange(account: AccountInfo | NewStandardAccountInfo | null): void; | ||
accountChange(account: AccountInfo | null): void; | ||
} | ||
@@ -43,0 +43,0 @@ export interface SignMessagePayload { |
@@ -1,2 +0,2 @@ | ||
export declare const WALLET_ADAPTER_CORE_VERSION = "4.1.0"; | ||
export declare const WALLET_ADAPTER_CORE_VERSION = "4.1.1"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -6,3 +6,3 @@ import { Types } from "aptos"; | ||
import { AccountInfo, InputTransactionData, NetworkInfo, SignMessagePayload, SignMessageResponse, Wallet, WalletCoreEvents, WalletInfo } from "./LegacyWalletPlugins"; | ||
import { AptosStandardWallet, AptosStandardSupportedWallet, AvailableWallets, NewStandardAccountInfo } from "./AIP62StandardWallets"; | ||
import { AptosStandardWallet, AptosStandardSupportedWallet, AvailableWallets } from "./AIP62StandardWallets"; | ||
export type IAptosWallet = AptosStandardWallet & Wallet; | ||
@@ -146,3 +146,3 @@ export declare class WalletCore extends EventEmitter<WalletCoreEvents> { | ||
*/ | ||
get account(): AccountInfo | NewStandardAccountInfo | null; | ||
get account(): AccountInfo | null; | ||
/** | ||
@@ -149,0 +149,0 @@ * Getter for the current wallet network |
{ | ||
"name": "@aptos-labs/wallet-adapter-core", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "Aptos Wallet Adapter Core", | ||
@@ -38,4 +38,4 @@ "main": "./dist/index.js", | ||
"typescript": "^4.5.3", | ||
"@aptos-labs/eslint-config-adapter": "0.0.0", | ||
"@aptos-labs/wallet-adapter-tsconfig": "0.0.0" | ||
"@aptos-labs/eslint-config-adapter": "0.0.1", | ||
"@aptos-labs/wallet-adapter-tsconfig": "0.0.1" | ||
}, | ||
@@ -42,0 +42,0 @@ "dependencies": { |
@@ -1,2 +0,1 @@ | ||
import { AccountAddress, PublicKey } from "@aptos-labs/ts-sdk"; | ||
import { WalletName } from "../LegacyWalletPlugins/types"; | ||
@@ -14,9 +13,1 @@ import { WalletReadyState } from "../constants"; | ||
export type AvailableWallets = "Nightly" | "Petra" | "T wallet"; | ||
export type NewStandardAccountInfo = { | ||
address: AccountAddress; | ||
publicKey: PublicKey; | ||
ansName?: string; | ||
}; | ||
export { AccountAddress } from "@aptos-labs/ts-sdk"; |
@@ -21,6 +21,3 @@ import { Types } from "aptos"; | ||
} from "@aptos-labs/wallet-standard"; | ||
import { | ||
AptosStandardSupportedWallet, | ||
NewStandardAccountInfo, | ||
} from "../AIP62StandardWallets/types"; | ||
import { AptosStandardSupportedWallet } from "../AIP62StandardWallets/types"; | ||
@@ -79,3 +76,3 @@ export { TxnBuilderTypes, Types } from "aptos"; | ||
networkChange(network: NetworkInfo | null): void; | ||
accountChange(account: AccountInfo | NewStandardAccountInfo | null): void; | ||
accountChange(account: AccountInfo | null): void; | ||
} | ||
@@ -82,0 +79,0 @@ |
@@ -1,1 +0,1 @@ | ||
export const WALLET_ADAPTER_CORE_VERSION = "4.1.0"; | ||
export const WALLET_ADAPTER_CORE_VERSION = "4.1.1"; |
@@ -79,3 +79,2 @@ import { TxnBuilderTypes, Types, BCS } from "aptos"; | ||
AvailableWallets, | ||
NewStandardAccountInfo, | ||
} from "./AIP62StandardWallets"; | ||
@@ -106,3 +105,3 @@ import { GA4 } from "./ga"; | ||
// Current connected account | ||
private _account: AccountInfo | NewStandardAccountInfo | null = null; | ||
private _account: AccountInfo | null = null; | ||
@@ -341,3 +340,3 @@ // Current connected network | ||
private ensureAccountExists( | ||
account: AccountInfo | NewStandardAccountInfo | null | ||
account: AccountInfo | null | ||
): asserts account is AccountInfo { | ||
@@ -451,4 +450,4 @@ if (!account) { | ||
this._account = { | ||
address: connectStandardAccount.args.address, | ||
publicKey: connectStandardAccount.args.publicKey, | ||
address: connectStandardAccount.args.address.toString(), | ||
publicKey: connectStandardAccount.args.publicKey.toString(), | ||
ansName: connectStandardAccount.args.ansName, | ||
@@ -461,4 +460,4 @@ }; | ||
this._account = { | ||
address: standardAccount.address, | ||
publicKey: standardAccount.publicKey, | ||
address: standardAccount.address.toString(), | ||
publicKey: standardAccount.publicKey.toString(), | ||
ansName: standardAccount.ansName, | ||
@@ -568,3 +567,3 @@ }; | ||
*/ | ||
get account(): AccountInfo | NewStandardAccountInfo | null { | ||
get account(): AccountInfo | null { | ||
try { | ||
@@ -571,0 +570,0 @@ return this._account; |
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
473962
-0.62%6474
-0.45%