Skip to content

Commit 7a04a1e

Browse files
committed
chore: rename
1 parent 1ca6b92 commit 7a04a1e

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

site/vocs.config.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ export default defineConfig({
566566
link: '/api/typedData/encodeType',
567567
},
568568
{
569-
text: '.getEip712DomainTypes',
570-
link: '/api/typedData/getEip712DomainTypes',
569+
text: '.extractEip712DomainTypes',
570+
link: '/api/typedData/extractEip712DomainTypes',
571571
},
572572
{
573573
text: '.hash',

src/TypedData.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as exports from './TypedData.js'
55
test('exports', () => {
66
expect(Object.keys(exports)).toMatchInlineSnapshot(`
77
[
8-
"getTypesForEip712Domain",
8+
"extractEip712DomainTypes",
99
"serializeTypedData",
1010
"serialize",
1111
"validateTypedData",

src/TypedData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { getTypesForEip712Domain } from './internal/typedData/getTypesForEip712Domain.js'
1+
export { extractEip712DomainTypes } from './internal/typedData/extractEip712DomainTypes.js'
22

33
export {
44
serializeTypedData,

src/internal/typedData/getTypesForEip712Domain.ts renamed to src/internal/typedData/extractEip712DomainTypes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ import type { TypedDataDomain, TypedDataParameter } from 'abitype'
33
/**
44
* Gets [EIP-712 Typed Data](https://eips.ethereum.org/EIPS/eip-712) schema for EIP-721 domain.
55
*
6-
* - Docs: https://oxlib.sh/api/typedData/getTypesForEip712Domain
6+
* - Docs: https://oxlib.sh/api/typedData/extractEip712Domain
77
*
88
* @example
99
* import { TypedData } from 'ox'
1010
*
11-
* TypedData.getTypesForEip712Domain({
11+
* TypedData.extractEip712Domain({
1212
* name: 'Ether!',
1313
* version: '1',
1414
* chainId: 1,
1515
* verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
1616
* })
1717
* // [{ 'name': 'name', 'type': 'string' }, { 'name': 'version', 'type': 'string' }, { 'name': 'chainId', 'type': 'uint256' }, { 'name': 'verifyingContract', 'type': 'address' }]
1818
*/
19-
export function getTypesForEip712Domain(
19+
export function extractEip712DomainTypes(
2020
domain: TypedDataDomain | undefined,
2121
): TypedDataParameter[] {
2222
return [

src/internal/typedData/getTypesForEip712Domain.test.ts renamed to src/internal/typedData/extractEip721Domain.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from 'vitest'
22
import { padRight } from '../data/pad.js'
33
import { toHex } from '../hex/toHex.js'
4-
import { getTypesForEip712Domain } from './getTypesForEip712Domain.js'
4+
import { extractEip712DomainTypes } from './extractEip712DomainTypes.js'
55

66
const FULL_DOMAIN = {
77
name: 'example.metamask.io',
@@ -12,7 +12,7 @@ const FULL_DOMAIN = {
1212
} as const
1313

1414
test('basic', () => {
15-
expect(getTypesForEip712Domain(FULL_DOMAIN)).toMatchInlineSnapshot(`
15+
expect(extractEip712DomainTypes(FULL_DOMAIN)).toMatchInlineSnapshot(`
1616
[
1717
{
1818
"name": "name",
@@ -40,7 +40,7 @@ test('basic', () => {
4040

4141
test('partial', () => {
4242
expect(
43-
getTypesForEip712Domain({
43+
extractEip712DomainTypes({
4444
...FULL_DOMAIN,
4545
name: undefined,
4646
version: undefined,
@@ -64,5 +64,5 @@ test('partial', () => {
6464
})
6565

6666
test('empty', () => {
67-
expect(getTypesForEip712Domain({})).toMatchInlineSnapshot('[]')
67+
expect(extractEip712DomainTypes({})).toMatchInlineSnapshot('[]')
6868
})

0 commit comments

Comments
 (0)