Comparing version 2.22.8 to 2.22.9
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createWebAuthnCredential = void 0; | ||
var webauthn_p256_1 = require("webauthn-p256"); | ||
Object.defineProperty(exports, "createWebAuthnCredential", { enumerable: true, get: function () { return webauthn_p256_1.createCredential; } }); | ||
exports.createWebAuthnCredential = createWebAuthnCredential; | ||
const PublicKey = require("ox/PublicKey"); | ||
const WebAuthnP256 = require("ox/WebAuthnP256"); | ||
async function createWebAuthnCredential(parameters) { | ||
const credential = await WebAuthnP256.createCredential(parameters); | ||
return { | ||
id: credential.id, | ||
publicKey: PublicKey.toHex(credential.publicKey, { includePrefix: false }), | ||
raw: credential.raw, | ||
}; | ||
} | ||
//# sourceMappingURL=createWebAuthnCredential.js.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.wrapSignature = wrapSignature; | ||
const webauthn_p256_1 = require("webauthn-p256"); | ||
const Signature = require("ox/Signature"); | ||
const readContract_js_1 = require("../../../actions/public/readContract.js"); | ||
@@ -213,3 +213,3 @@ const address_js_1 = require("../../../constants/address.js"); | ||
function toWebAuthnSignature({ webauthn, signature, }) { | ||
const { r, s } = (0, webauthn_p256_1.parseSignature)(signature); | ||
const { r, s } = Signature.fromHex(signature); | ||
return (0, encodeAbiParameters_js_1.encodeAbiParameters)([ | ||
@@ -216,0 +216,0 @@ { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toWebAuthnAccount = toWebAuthnAccount; | ||
const webauthn_p256_1 = require("webauthn-p256"); | ||
const Signature = require("ox/Signature"); | ||
const WebAuthnP256 = require("ox/WebAuthnP256"); | ||
const hashMessage_js_1 = require("../../utils/signature/hashMessage.js"); | ||
@@ -14,3 +15,13 @@ const hashTypedData_js_1 = require("../../utils/signature/hashTypedData.js"); | ||
async sign({ hash }) { | ||
return (0, webauthn_p256_1.sign)({ credentialId: id, getFn, hash, rpId }); | ||
const { metadata, raw, signature } = await WebAuthnP256.sign({ | ||
credentialId: id, | ||
getFn, | ||
challenge: hash, | ||
rpId, | ||
}); | ||
return { | ||
signature: Signature.toHex(signature), | ||
raw, | ||
webauthn: metadata, | ||
}; | ||
}, | ||
@@ -17,0 +28,0 @@ async signMessage({ message }) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '2.22.8'; | ||
exports.version = '2.22.9'; | ||
//# sourceMappingURL=version.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.zoraTestnet = exports.zoraSepolia = exports.zora = exports.worldchainSepolia = exports.worldchain = exports.unichainSepolia = exports.soneiumMinato = exports.snaxTestnet = exports.snax = exports.shape = exports.pgnTestnet = exports.pgn = exports.optimismSepolia = exports.optimismGoerli = exports.optimism = exports.metalL2 = exports.inkSepolia = exports.fraxtalTestnet = exports.fraxtal = exports.blast = exports.baseSepolia = exports.baseGoerli = exports.base = exports.ancient8Sepolia = exports.ancient8 = void 0; | ||
exports.zoraTestnet = exports.zoraSepolia = exports.zora = exports.worldchainSepolia = exports.worldchain = exports.unichainSepolia = exports.soneiumMinato = exports.soneium = exports.snaxTestnet = exports.snax = exports.shape = exports.pgnTestnet = exports.pgn = exports.optimismSepolia = exports.optimismGoerli = exports.optimism = exports.metalL2 = exports.inkSepolia = exports.fraxtalTestnet = exports.fraxtal = exports.blast = exports.baseSepolia = exports.baseGoerli = exports.base = exports.ancient8Sepolia = exports.ancient8 = void 0; | ||
var ancient8_js_1 = require("../chains/definitions/ancient8.js"); | ||
@@ -40,2 +40,4 @@ Object.defineProperty(exports, "ancient8", { enumerable: true, get: function () { return ancient8_js_1.ancient8; } }); | ||
Object.defineProperty(exports, "snaxTestnet", { enumerable: true, get: function () { return snaxTestnet_js_1.snaxTestnet; } }); | ||
var soneium_js_1 = require("../chains/definitions/soneium.js"); | ||
Object.defineProperty(exports, "soneium", { enumerable: true, get: function () { return soneium_js_1.soneium; } }); | ||
var soneiumMinato_js_1 = require("../chains/definitions/soneiumMinato.js"); | ||
@@ -42,0 +44,0 @@ Object.defineProperty(exports, "soneiumMinato", { enumerable: true, get: function () { return soneiumMinato_js_1.soneiumMinato; } }); |
@@ -1,3 +0,12 @@ | ||
// biome-ignore lint/performance/noBarrelFile: | ||
export { createCredential as createWebAuthnCredential, } from 'webauthn-p256'; | ||
// TODO(v3): Remove this in favor of `ox/WebAuthnP256` entirely. | ||
import * as PublicKey from 'ox/PublicKey'; | ||
import * as WebAuthnP256 from 'ox/WebAuthnP256'; | ||
export async function createWebAuthnCredential(parameters) { | ||
const credential = await WebAuthnP256.createCredential(parameters); | ||
return { | ||
id: credential.id, | ||
publicKey: PublicKey.toHex(credential.publicKey, { includePrefix: false }), | ||
raw: credential.raw, | ||
}; | ||
} | ||
//# sourceMappingURL=createWebAuthnCredential.js.map |
@@ -1,2 +0,2 @@ | ||
import { parseSignature as parseP256Signature, } from 'webauthn-p256'; | ||
import * as Signature from 'ox/Signature'; | ||
import { readContract } from '../../../actions/public/readContract.js'; | ||
@@ -229,3 +229,3 @@ import { entryPoint06Address } from '../../../constants/address.js'; | ||
export function toWebAuthnSignature({ webauthn, signature, }) { | ||
const { r, s } = parseP256Signature(signature); | ||
const { r, s } = Signature.fromHex(signature); | ||
return encodeAbiParameters([ | ||
@@ -232,0 +232,0 @@ { |
@@ -1,2 +0,3 @@ | ||
import { sign } from 'webauthn-p256'; | ||
import * as Signature from 'ox/Signature'; | ||
import * as WebAuthnP256 from 'ox/WebAuthnP256'; | ||
import { hashMessage } from '../../utils/signature/hashMessage.js'; | ||
@@ -16,3 +17,13 @@ import { hashTypedData } from '../../utils/signature/hashTypedData.js'; | ||
async sign({ hash }) { | ||
return sign({ credentialId: id, getFn, hash, rpId }); | ||
const { metadata, raw, signature } = await WebAuthnP256.sign({ | ||
credentialId: id, | ||
getFn, | ||
challenge: hash, | ||
rpId, | ||
}); | ||
return { | ||
signature: Signature.toHex(signature), | ||
raw, | ||
webauthn: metadata, | ||
}; | ||
}, | ||
@@ -19,0 +30,0 @@ async signMessage({ message }) { |
@@ -24,2 +24,3 @@ // biome-ignore lint/performance/noBarrelFile: entrypoint module | ||
export { arthera } from './definitions/arthera.js'; | ||
export { artheraTestnet } from './definitions/artheraTestnet.js'; | ||
export { assetChain } from './definitions/assetChain.js'; | ||
@@ -302,2 +303,4 @@ export { assetChainTestnet } from './definitions/assetChainTestnet.js'; | ||
export { nautilus } from './definitions/nautilus.js'; | ||
export { near } from './definitions/near.js'; | ||
export { nearTestnet } from './definitions/nearTestnet.js'; | ||
export { neonDevnet } from './definitions/neonDevnet.js'; | ||
@@ -409,2 +412,3 @@ export { neonMainnet } from './definitions/neonMainnet.js'; | ||
export { snaxTestnet } from './definitions/snaxTestnet.js'; | ||
export { soneium } from './definitions/soneium.js'; | ||
export { soneiumMinato } from './definitions/soneiumMinato.js'; | ||
@@ -411,0 +415,0 @@ export { sonic } from './definitions/sonic.js'; |
@@ -1,2 +0,2 @@ | ||
export const version = '2.22.8'; | ||
export const version = '2.22.9'; | ||
//# sourceMappingURL=version.js.map |
@@ -20,2 +20,3 @@ // biome-ignore lint/performance/noBarrelFile: entrypoint module | ||
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js'; | ||
export { soneium } from '../chains/definitions/soneium.js'; | ||
export { soneiumMinato } from '../chains/definitions/soneiumMinato.js'; | ||
@@ -22,0 +23,0 @@ export { unichainSepolia } from '../chains/definitions/unichainSepolia.js'; |
@@ -1,2 +0,11 @@ | ||
export { type CreateCredentialParameters as CreateWebAuthnCredentialParameters, type CreateCredentialReturnType as CreateWebAuthnCredentialReturnType, type P256Credential, createCredential as createWebAuthnCredential, } from 'webauthn-p256'; | ||
import * as WebAuthnP256 from 'ox/WebAuthnP256'; | ||
import type { Hex } from '../../types/misc.js'; | ||
export type P256Credential = { | ||
id: WebAuthnP256.P256Credential['id']; | ||
publicKey: Hex; | ||
raw: WebAuthnP256.P256Credential['raw']; | ||
}; | ||
export type CreateWebAuthnCredentialParameters = WebAuthnP256.createCredential.Options; | ||
export type CreateWebAuthnCredentialReturnType = P256Credential; | ||
export declare function createWebAuthnCredential(parameters: CreateWebAuthnCredentialParameters): Promise<CreateWebAuthnCredentialReturnType>; | ||
//# sourceMappingURL=createWebAuthnCredential.d.ts.map |
import type { Address } from 'abitype'; | ||
import { type WebAuthnData } from 'webauthn-p256'; | ||
import type * as WebAuthnP256 from 'ox/WebAuthnP256'; | ||
import type { LocalAccount } from '../../../accounts/types.js'; | ||
@@ -57,3 +57,3 @@ import type { Client } from '../../../clients/createClient.js'; | ||
export declare function toWebAuthnSignature({ webauthn, signature, }: { | ||
webauthn: WebAuthnData; | ||
webauthn: WebAuthnP256.SignMetadata; | ||
signature: Hex; | ||
@@ -60,0 +60,0 @@ }): `0x${string}`; |
@@ -1,3 +0,4 @@ | ||
import { type P256Credential, type SignParameters } from 'webauthn-p256'; | ||
import * as WebAuthnP256 from 'ox/WebAuthnP256'; | ||
import type { ErrorType } from '../../errors/utils.js'; | ||
import type { P256Credential } from './createWebAuthnCredential.js'; | ||
import type { WebAuthnAccount } from './types.js'; | ||
@@ -18,7 +19,7 @@ export type ToWebAuthnAccountParameters = { | ||
*/ | ||
getFn?: SignParameters['getFn'] | undefined; | ||
getFn?: WebAuthnP256.sign.Options['getFn'] | undefined; | ||
/** | ||
* The relying party identifier to use. | ||
*/ | ||
rpId?: SignParameters['rpId'] | undefined; | ||
rpId?: WebAuthnP256.sign.Options['rpId'] | undefined; | ||
}; | ||
@@ -25,0 +26,0 @@ export type ToWebAuthnAccountReturnType = WebAuthnAccount; |
import type { Abi, Address, TypedData } from 'abitype'; | ||
import type { SignReturnType as WebAuthnSignReturnType } from 'webauthn-p256'; | ||
import type * as WebAuthnP256 from 'ox/WebAuthnP256'; | ||
import type { Client } from '../../clients/createClient.js'; | ||
@@ -185,2 +185,7 @@ import type { Hash, Hex, SignableMessage } from '../../types/misc.js'; | ||
}>>; | ||
export type WebAuthnSignReturnType = { | ||
signature: Hex; | ||
webauthn: WebAuthnP256.SignMetadata; | ||
raw: WebAuthnP256.sign.ReturnType['raw']; | ||
}; | ||
export type WebAuthnAccount = { | ||
@@ -187,0 +192,0 @@ id: string; |
@@ -24,2 +24,3 @@ export type { Chain } from '../types/chain.js'; | ||
export { arthera } from './definitions/arthera.js'; | ||
export { artheraTestnet } from './definitions/artheraTestnet.js'; | ||
export { assetChain } from './definitions/assetChain.js'; | ||
@@ -302,2 +303,4 @@ export { assetChainTestnet } from './definitions/assetChainTestnet.js'; | ||
export { nautilus } from './definitions/nautilus.js'; | ||
export { near } from './definitions/near.js'; | ||
export { nearTestnet } from './definitions/nearTestnet.js'; | ||
export { neonDevnet } from './definitions/neonDevnet.js'; | ||
@@ -409,2 +412,3 @@ export { neonMainnet } from './definitions/neonMainnet.js'; | ||
export { snaxTestnet } from './definitions/snaxTestnet.js'; | ||
export { soneium } from './definitions/soneium.js'; | ||
export { soneiumMinato } from './definitions/soneiumMinato.js'; | ||
@@ -411,0 +415,0 @@ export { sonic } from './definitions/sonic.js'; |
@@ -1,2 +0,2 @@ | ||
export declare const version = "2.22.8"; | ||
export declare const version = "2.22.9"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -19,2 +19,3 @@ export { ancient8 } from '../chains/definitions/ancient8.js'; | ||
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js'; | ||
export { soneium } from '../chains/definitions/soneium.js'; | ||
export { soneiumMinato } from '../chains/definitions/soneiumMinato.js'; | ||
@@ -21,0 +22,0 @@ export { unichainSepolia } from '../chains/definitions/unichainSepolia.js'; |
@@ -1,7 +0,27 @@ | ||
// biome-ignore lint/performance/noBarrelFile: | ||
export { | ||
type CreateCredentialParameters as CreateWebAuthnCredentialParameters, | ||
type CreateCredentialReturnType as CreateWebAuthnCredentialReturnType, | ||
type P256Credential, | ||
createCredential as createWebAuthnCredential, | ||
} from 'webauthn-p256' | ||
// TODO(v3): Remove this in favor of `ox/WebAuthnP256` entirely. | ||
import * as PublicKey from 'ox/PublicKey' | ||
import * as WebAuthnP256 from 'ox/WebAuthnP256' | ||
import type { Hex } from '../../types/misc.js' | ||
export type P256Credential = { | ||
id: WebAuthnP256.P256Credential['id'] | ||
publicKey: Hex | ||
raw: WebAuthnP256.P256Credential['raw'] | ||
} | ||
export type CreateWebAuthnCredentialParameters = | ||
WebAuthnP256.createCredential.Options | ||
export type CreateWebAuthnCredentialReturnType = P256Credential | ||
export async function createWebAuthnCredential( | ||
parameters: CreateWebAuthnCredentialParameters, | ||
): Promise<CreateWebAuthnCredentialReturnType> { | ||
const credential = await WebAuthnP256.createCredential(parameters) | ||
return { | ||
id: credential.id, | ||
publicKey: PublicKey.toHex(credential.publicKey, { includePrefix: false }), | ||
raw: credential.raw, | ||
} | ||
} |
import type { Address, TypedData } from 'abitype' | ||
import { | ||
type WebAuthnData, | ||
parseSignature as parseP256Signature, | ||
} from 'webauthn-p256' | ||
import * as Signature from 'ox/Signature' | ||
import type * as WebAuthnP256 from 'ox/WebAuthnP256' | ||
@@ -322,6 +320,6 @@ import type { LocalAccount } from '../../../accounts/types.js' | ||
}: { | ||
webauthn: WebAuthnData | ||
webauthn: WebAuthnP256.SignMetadata | ||
signature: Hex | ||
}) { | ||
const { r, s } = parseP256Signature(signature) | ||
const { r, s } = Signature.fromHex(signature) | ||
return encodeAbiParameters( | ||
@@ -328,0 +326,0 @@ [ |
@@ -1,2 +0,3 @@ | ||
import { type P256Credential, type SignParameters, sign } from 'webauthn-p256' | ||
import * as Signature from 'ox/Signature' | ||
import * as WebAuthnP256 from 'ox/WebAuthnP256' | ||
@@ -6,2 +7,3 @@ import type { ErrorType } from '../../errors/utils.js' | ||
import { hashTypedData } from '../../utils/signature/hashTypedData.js' | ||
import type { P256Credential } from './createWebAuthnCredential.js' | ||
import type { WebAuthnAccount } from './types.js' | ||
@@ -23,7 +25,7 @@ | ||
*/ | ||
getFn?: SignParameters['getFn'] | undefined | ||
getFn?: WebAuthnP256.sign.Options['getFn'] | undefined | ||
/** | ||
* The relying party identifier to use. | ||
*/ | ||
rpId?: SignParameters['rpId'] | undefined | ||
rpId?: WebAuthnP256.sign.Options['rpId'] | undefined | ||
} | ||
@@ -49,3 +51,13 @@ | ||
async sign({ hash }) { | ||
return sign({ credentialId: id, getFn, hash, rpId }) | ||
const { metadata, raw, signature } = await WebAuthnP256.sign({ | ||
credentialId: id, | ||
getFn, | ||
challenge: hash, | ||
rpId, | ||
}) | ||
return { | ||
signature: Signature.toHex(signature), | ||
raw, | ||
webauthn: metadata, | ||
} | ||
}, | ||
@@ -52,0 +64,0 @@ async signMessage({ message }) { |
import type { Abi, Address, TypedData } from 'abitype' | ||
import type { SignReturnType as WebAuthnSignReturnType } from 'webauthn-p256' | ||
import type * as WebAuthnP256 from 'ox/WebAuthnP256' | ||
@@ -222,2 +222,9 @@ import type { Client } from '../../clients/createClient.js' | ||
// TODO(v3): Remove this in favor of `WebAuthnP256.sign.ReturnType` from Ox. | ||
export type WebAuthnSignReturnType = { | ||
signature: Hex | ||
webauthn: WebAuthnP256.SignMetadata | ||
raw: WebAuthnP256.sign.ReturnType['raw'] | ||
} | ||
export type WebAuthnAccount = { | ||
@@ -224,0 +231,0 @@ id: string |
@@ -26,2 +26,3 @@ export type { Chain } from '../types/chain.js' | ||
export { arthera } from './definitions/arthera.js' | ||
export { artheraTestnet } from './definitions/artheraTestnet.js' | ||
export { assetChain } from './definitions/assetChain.js' | ||
@@ -304,2 +305,4 @@ export { assetChainTestnet } from './definitions/assetChainTestnet.js' | ||
export { nautilus } from './definitions/nautilus.js' | ||
export { near } from './definitions/near.js' | ||
export { nearTestnet } from './definitions/nearTestnet.js' | ||
export { neonDevnet } from './definitions/neonDevnet.js' | ||
@@ -411,2 +414,3 @@ export { neonMainnet } from './definitions/neonMainnet.js' | ||
export { snaxTestnet } from './definitions/snaxTestnet.js' | ||
export { soneium } from './definitions/soneium.js' | ||
export { soneiumMinato } from './definitions/soneiumMinato.js' | ||
@@ -413,0 +417,0 @@ export { sonic } from './definitions/sonic.js' |
@@ -1,1 +0,1 @@ | ||
export const version = '2.22.8' | ||
export const version = '2.22.9' |
@@ -20,2 +20,3 @@ // biome-ignore lint/performance/noBarrelFile: entrypoint module | ||
export { snaxTestnet } from '../chains/definitions/snaxTestnet.js' | ||
export { soneium } from '../chains/definitions/soneium.js' | ||
export { soneiumMinato } from '../chains/definitions/soneiumMinato.js' | ||
@@ -22,0 +23,0 @@ export { unichainSepolia } from '../chains/definitions/unichainSepolia.js' |
{ | ||
"name": "viem", | ||
"description": "TypeScript Interface for Ethereum", | ||
"version": "2.22.8", | ||
"version": "2.22.9", | ||
"main": "./_cjs/index.js", | ||
@@ -183,4 +183,3 @@ "module": "./_esm/index.js", | ||
"isows": "1.0.6", | ||
"ox": "0.6.0", | ||
"webauthn-p256": "0.0.10", | ||
"ox": "0.6.5", | ||
"ws": "8.18.0" | ||
@@ -187,0 +186,0 @@ }, |
@@ -228,8 +228,2 @@ <!-- > [!IMPORTANT] --> | ||
</a> | ||
<a href="https://brave.com"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/brave-dark.svg"> | ||
<img alt="brave logo" src="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/brave-light.svg" width="auto" height="50"> | ||
</picture> | ||
</a> | ||
<a href="https://linea.build"> | ||
@@ -259,8 +253,2 @@ <picture> | ||
</a> | ||
<a href="https://uxuy.com"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/uxuy-dark.svg"> | ||
<img alt="uxuy logo" src="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/uxuy-light.svg" width="auto" height="50"> | ||
</picture> | ||
</a> | ||
<a href="https://polymarket.com"> | ||
@@ -267,0 +255,0 @@ <picture> |
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 too big to display
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
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 too big to display
14762210
9
7480
267410
30
6
285
+ Addedox@0.6.5(transitive)
- Removedwebauthn-p256@0.0.10
- Removedox@0.6.0(transitive)
- Removedwebauthn-p256@0.0.10(transitive)
Updatedox@0.6.5