-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/update owner for each cw721 activity ( develop ) #351
Conversation
feat: add migration to add index time to block, tx
fix: update validator as UNRECOGNIZED when not found onchain
docs: cw20
docs: cw721
* feat: reindex cw20 service * test: test cw20 reindexing * fix: idiot * refactor: code * feat: api admin
* refactor: cw20 index and add relation * refactor: code
* feat: move statistic feature from v1 to v2 (not tested yet) * feat: change job params so it can aggregate data at a specific date * fix: query fields from exact table * fix: query exact fields * feat: add logger when done * feat: finish statistic jobs (not tested) * feat: create a separate interval job that gets the current date and create statistics jobs with date * feat: update logic using dayjs and lodash lib * feat: update cron jobs logic, move api actions to its service folder * fix: query event from db and group it based on event_id and tx_id * fix: just use a single job to query all daily data * fix: move all queries in daily_stats job into a single Promise all * fix: move dayjs.extend to after import statements * fix: remove _start * fix: only count native token in account_stats job * feat: add api to sync stats from prev dates * fix: support case when user just pass startDate to api * fix: fix whitelist graphql * fix: update column in account_statistic table, update bignum top_tx_sent * fix: remove drop index in modify account statistic table --------- Co-authored-by: AnDQK <doquockhanhan@gmail.com> Co-authored-by: Phan Anh Tuan <fibonacci998@gmail.com>
#322) * refactor: migrate cw721 activity missing smart contract event * feat: api * test: test params * test: test params * test: test params * test: test params * test: test params * test: test params * refactor: code * refactor: code * refactor: code * refactor: code * refactor: code * fix: ci
* fix: get use_feegrant_grantee if has, other get tx_fee_payer * fix: remove code not used
* fix: cw721 activity missing from/to * fix: fill from/to cw721 activity * fix: fill from/to cw721 activity * fix: fill from/to cw721 activity * fix: fill from/to cw721 activity * refactor: code * fix: code * refactor: code --------- Co-authored-by: Vu Ngoc Quang <quang.vn@outlook.com>
* feat: crawl ibc tao * feat: crawl genesis ibc tao * fix: code * fix: code
* fix: cw721 activity missing from/to * fix: fill from/to cw721 activity * fix: fill from/to cw721 activity * fix: fill from/to cw721 activity * fix: fill from/to cw721 activity * refactor: code * fix: code * refactor: code --------- Co-authored-by: Vu Ngoc Quang <quang.vn@outlook.com>
* feat: crawl ibc tao * feat: crawl genesis ibc tao * fix: code * fix: code
…cope-v2 into fix/approve-cw721-activity-dev
…cope-v2 into fix/approve-cw721-activity-dev
…prove-cw721-activity-dev
…prove-cw721-activity-dev
…cope-v2 into fix/approve-cw721-activity-dev
await knex.transaction(async (trx) => { | ||
const activities = await CW721Activity.query() | ||
.joinRelated('event') | ||
.orderBy('event.block_height', 'asc') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order theo event id vì 1 block có nhiều event
.transacting(trx); | ||
const done: CW721Activity[] = []; | ||
activities.forEach((activity) => { | ||
const latestActivity = _.findLast(done, function (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lưu 1 object latest theo contract_id vào token_id, khi for qua từng event thì update vào bảng đó, lúc cần lấy ra là được
src/services/cw721/cw721.service.ts
Outdated
async getLatestOwnerForToken( | ||
cw721ContractId: number, | ||
cw721TokenId: number | null, | ||
others: CW721Activity[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sao lại tên là others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
làm như bên migration
…cope-v2 into fix/approve-cw721-activity-dev
…cope-v2 into fix/approve-cw721-activity-dev
…cope-v2 into fix/approve-cw721-activity-dev
.merge() | ||
.transacting(trx) | ||
// eslint-disable-next-line no-await-in-loop | ||
const from = await this.getLatestOwnerForToken( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
có cái foundToken
ngay trên mà nhỉ?
if (cw721Activities.length > 0) { | ||
await CW721Activity.query() | ||
.insert(cw721Activities) | ||
.onConflict(['smart_contract_event_id']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cái này mới tinh mà, làm gì có conflict
ref #349