-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
samuel
committed
Mar 4, 2024
1 parent
b29f566
commit eb99df2
Showing
12 changed files
with
213 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"entity": { | ||
"signature": "0xa72428e25a2b9a90b0cbcd37804baae3f1a932a659f81fe57b311235a53276105f8d6058834ac544a65264d8363a9df2a6c58f3f790f7963af045ce836d8b9a31b", | ||
"data": { | ||
"addressBook": [], | ||
"credentials": [], | ||
"tokens": [], | ||
"userGroupMembers": [], | ||
"userGroups": [], | ||
"userWallets": [], | ||
"users": [], | ||
"walletGroupMembers": [], | ||
"walletGroups": [], | ||
"wallets": [] | ||
} | ||
}, | ||
"policy": { | ||
"signature": "0xc4524c13303b29a302247c2edfa9b9aa34d7c16f3890b297e30c0fa105f74d1c478138e75d03e23ca5e34a70d4d9417034f7b199fb481cba9e86bbb914ffda571b", | ||
"data": [ | ||
{ | ||
"id": "a68e8d20-0419-475c-8fcc-b17d4de8c955", | ||
"name": "Authorized any admin to transfer ERC721 or ERC1155 tokens", | ||
"when": [ | ||
{ | ||
"criterion": "checkResourceIntegrity", | ||
"args": null | ||
}, | ||
{ | ||
"criterion": "checkPrincipalRole", | ||
"args": [ | ||
"admin" | ||
] | ||
}, | ||
{ | ||
"criterion": "checkAction", | ||
"args": [ | ||
"signTransaction" | ||
] | ||
}, | ||
{ | ||
"criterion": "checkIntentType", | ||
"args": [ | ||
"transferErc721", | ||
"transferErc1155" | ||
] | ||
} | ||
], | ||
"then": "permit" | ||
} | ||
] | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { JSONFilePreset } from 'lowdb/node' | ||
import type { NextApiRequest, NextApiResponse } from 'next' | ||
|
||
export const GET = async (req: NextApiRequest, res: NextApiResponse) => { | ||
const db = await JSONFilePreset('./data-store/storage.json', { | ||
entity: { signature: '', data: {} }, | ||
policy: { signature: {}, data: [] } | ||
}) | ||
|
||
return new Response(JSON.stringify({ ...db.data })) | ||
} | ||
|
||
export const POST = async (req: NextApiRequest, res: NextApiResponse) => { | ||
const { entity, policy } = await req.json() | ||
|
||
const db = await JSONFilePreset('./data-store/storage.json', { | ||
entity: { signature: '', data: {} }, | ||
policy: { signature: {}, data: [] } | ||
}) | ||
|
||
db.data = { entity, policy } | ||
|
||
await db.write() | ||
|
||
return new Response(JSON.stringify({ ...db.data })) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"entity": { | ||
"addressBook": [], | ||
"credentials": [], | ||
"tokens": [], | ||
"userGroupMembers": [], | ||
"userGroups": [], | ||
"userWallets": [], | ||
"users": [], | ||
"walletGroupMembers": [], | ||
"walletGroups": [], | ||
"wallets": [] | ||
}, | ||
"policy": [ | ||
{ | ||
"id": "a68e8d20-0419-475c-8fcc-b17d4de8c955", | ||
"name": "Authorized any admin to transfer ERC721 or ERC1155 tokens", | ||
"when": [ | ||
{ | ||
"criterion": "checkResourceIntegrity", | ||
"args": null | ||
}, | ||
{ | ||
"criterion": "checkPrincipalRole", | ||
"args": ["admin"] | ||
}, | ||
{ | ||
"criterion": "checkAction", | ||
"args": ["signTransaction"] | ||
}, | ||
{ | ||
"criterion": "checkIntentType", | ||
"args": ["transferErc721", "transferErc1155"] | ||
} | ||
], | ||
"then": "permit" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters