diff --git a/app/model/profile.js b/app/model/profile.js index f2642e3..04149f5 100644 --- a/app/model/profile.js +++ b/app/model/profile.js @@ -6,6 +6,7 @@ export default class Profile extends LiquidModel { static table = 'profiles' @field('addr') addr + @field('event_id') eventId @field('canceled') canceled @field('commit_time') commitTime @field('type') type diff --git a/app/model/schema.js b/app/model/schema.js index b9109e3..ec892fb 100644 --- a/app/model/schema.js +++ b/app/model/schema.js @@ -6,15 +6,16 @@ export default appSchema({ tableSchema({ name: 'lp_events', columns: [ + { name: 'event_id', type: 'string' }, { name: 'address', type: 'string' }, { name: 'event', type: 'string' }, - { name: 'event_id', type: 'string' }, { name: 'block_number', type: 'number', isIndexed: true }, ] }), tableSchema({ name: 'profiles', columns: [ + { name: 'event_id', type: 'string' }, { name: 'addr', type: 'string' }, { name: 'canceled', type: 'boolean' }, { name: 'commit_time', type: 'number' }, diff --git a/app/utils/events.js b/app/utils/events.js index 9bd71b6..dae33df 100644 --- a/app/utils/events.js +++ b/app/utils/events.js @@ -47,10 +47,11 @@ const getPastVaultEvents = async (event, raw = false) => { const { getPledgeAdmin } = LiquidPledging.methods export const formatFundProfileEvent = async event => { const lookup = lookups[event.event] - const { returnValues: { url, idProject } } = event + const { id, returnValues: { url, idProject } } = event const idProfile = event.returnValues[lookup.id] const { addr, commitTime, name, canceled } = await getPledgeAdmin(idProfile).call() return { + id, idProfile, idProject, url,