Skip to content

Commit

Permalink
fix: id duplicate issue (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
loatheb authored Oct 21, 2024
1 parent c28fd4c commit 4e4f091
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default (params: IEIP712Params) => ({
{ name: 'name', type: 'string' },
],
NestedArray: [
{ name: 'nestedItems', type: 'SingleItem[][]' },
{ name: 'items', type: 'SingleItem[][]' },
],
SingleItem: [
{ name: 'id', type: 'uint256' },
Expand All @@ -25,34 +25,22 @@ export default (params: IEIP712Params) => ({
version: '1',
},
message: {
nestedItems: [
items: [
[
{
items: [
{ id: 1, value: 'Item1-1' },
{ id: 2, value: 'Item1-2' },
],
},
{
items: [
{ id: 3, value: 'Item2-1' },
{ id: 4, value: 'Item2-2' },
],
},
{ id: 1, value: 'Item1-1' },
{ id: 2, value: 'Item1-2' },
],
[
{
items: [
{ id: 5, value: 'Item3-1' },
{ id: 6, value: 'Item3-2' },
],
},
{
items: [
{ id: 7, value: 'Item4-1' },
{ id: 8, value: 'Item4-2' },
],
},
{ id: 3, value: 'Item2-1' },
{ id: 4, value: 'Item2-2' },
],
[
{ id: 5, value: 'Item3-1' },
{ id: 6, value: 'Item3-2' },
],
[
{ id: 7, value: 'Item4-1' },
{ id: 8, value: 'Item4-2' },
],
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IEIP712Params } from '../../types';

export default (params: IEIP712Params) => ({
id: 'signTypedDataV4',
id: 'signTypedDataV4-normal',
name: '默认类型: signTypedDataV4',
description: 'SignTypedDataV4 Normal',
value: JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IEIP712Params } from '../../types';

export default (params: IEIP712Params) => ({
id: 'signTypedDataV4-uniswap-swap',
id: 'signTypedDataV4-permitBatch',
name: 'permit2: PermitBatch 代币批量授权',
description: 'permit2: PermitBatch 代币批量授权,一次授权两个代币信息',
value: JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IEIP712Params } from '../../types';

export default (params: IEIP712Params) => ({
id: 'signTypedDataV4-uniswap-swap',
id: 'signTypedDataV4-permitSingle',
name: 'permit2: PermitSingle 方法 Swap USDC => Matic',
description: '模仿 UniSwap Swap,数据来自 Polygon USDC => Matic',
value: JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IEIP712Params } from '../../types';

export default (params: IEIP712Params) => ({
id: 'signTypedDataV5-permitwitnessTransferFrom',
id: 'signTypedDataV5-permitWitnessTransferFrom',
name: '默认类型: PermitWitnessTransferFrom 方法',
description: '模仿 UniSwap 现价单,数据来自 ETH 主网 USDC => ETH',
value: JSON.stringify({
Expand Down

0 comments on commit 4e4f091

Please sign in to comment.