chore: signature request shows timestamp in human readable format

This commit is contained in:
Danish Arora 2025-09-15 14:39:41 +05:30
parent 1199de84aa
commit 89b70c758e
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
2 changed files with 4 additions and 3 deletions

View File

@ -25,7 +25,8 @@ export class DelegationCrypto {
expiryTimestamp: number,
nonce: string
): string {
return `I, ${walletAddress}, authorize browser key ${browserPublicKey} until ${expiryTimestamp} (nonce: ${nonce})`;
const expiryDate = new Date(expiryTimestamp).toLocaleString();
return `I, ${walletAddress}, authorize browser key ${browserPublicKey} until ${expiryDate} (nonce: ${nonce})`;
}
/**

View File

@ -11,9 +11,9 @@ import { expect, describe, beforeEach, it } from 'vitest';
// Mock delegation proof for tests
const mockDelegationProof: DelegationProof = {
authMessage: 'I authorize browser key: test-key until 9999999999',
authMessage: 'I, test-address, authorize browser key test-key until 20/11/2286, 11:16:39 pm (nonce: test-nonce)',
walletSignature: 'mock-signature',
expiryTimestamp: 9999999999,
expiryTimestamp: 9999999999999,
walletAddress: 'test-address',
walletType: 'ethereum',
};