Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sdk-drop-dead-signature-schemas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@audius/sdk': patch
---

Remove unused EIP-712 `domains`, `types`, and `generators` exports from the internal `signatureSchemas` module and rename what remains (`getNonce`) to `nonce.ts`. None of the removed definitions were reachable from the public SDK entry point, so this is not a breaking change.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as runtime from '../../api/generated/default/runtime'
import { productionConfig } from '../../config/production'
import fetch, { Headers } from '../../utils/fetch'
import { mergeConfigWithDefaults } from '../../utils/mergeConfigs'
import { getNonce } from '../../utils/signatureSchemas'
import { getNonce } from '../../utils/nonce'
import type { AudiusWalletClient } from '../AudiusWalletClient'
import type { LoggerService } from '../Logger'

Expand Down
10 changes: 10 additions & 0 deletions packages/sdk/src/sdk/utils/nonce.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils'
import type { Hex } from 'viem'

/**
* Generates a cryptographically secure nonce, in node or the browser, for
* EIP-712 signed messages that need replay protection.
*/
export const getNonce = async () => {
return ('0x' + toHex(randomBytes(32))) as Hex
}
69 changes: 0 additions & 69 deletions packages/sdk/src/sdk/utils/signatureSchemas.ts

This file was deleted.

Loading