-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/ibc app ics20 ( develop ) (#343)
* docs: cw721 * docs: cw20 * fix: update validator as UNSPECIFIED when not found onchain * fix: remove token and delegator_shares when validator is UNRECOGNIZED * feat: crawl ibc tao * feat: add test for unrecognized validator * feat: crawl genesis ibc tao * feat: add migration to add index time to block, tx * fix: code * fix: code * feat: ibc app * feat: ibc app * fix: allow whitelist query can have depth more than config (#312) * feat: reindex cw20 service ( main ) (#277) * feat: reindex cw20 service * test: test cw20 reindexing * fix: idiot * refactor: code * feat: api admin * refactor: cw20/cw721 index and add relation ( main ) (#306) * refactor: cw20 index and add relation * refactor: code * fix: duplicate latest migrate contract (#304) * test: ibc app * fix: review * Feat/statistics (#272) * 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 <[email protected]> Co-authored-by: Phan Anh Tuan <[email protected]> * refactor: migrate cw721 activity missing smart contract event ( main ) (#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 * feat: ibc app ics20 * Fix/account stat with feegrant (#337) * fix: get use_feegrant_grantee if has, other get tx_fee_payer * fix: remove code not used * Update api_gateway.service.ts (#336) * feat: ibc ics20 send * feat: ibc ics20 send * feat: ibc ics20 recv * feat: ibc ics20 recv * feat: handle ics20 ack * feat: handle ics20 timeout * test: test * fix: code * fix: code * feat: ibc app ics20 * feat: ibc ics20 send * feat: ibc ics20 send * feat: ibc ics20 recv * feat: ibc ics20 recv * feat: handle ics20 ack * feat: handle ics20 timeout * test: test * fix: code * fix: code * fix: cw721 activity missing from/to ( main ) (#294) * 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 <[email protected]> * feat: crawl ibc tao ( main ) (#278) * feat: crawl ibc tao * feat: crawl genesis ibc tao * fix: code * fix: code * refactor: code * fix: test * refactor: code * fix: merge code * refactor: review code * refactor: review code * Fix/lint json file (#359) * fix: display json on multiple lines * fix: update launch.json to debug jest in 1 file; use moleculer.config.ts when debug service * Feat/ibc app ( main ) (#321) * feat: crawl ibc tao * feat: crawl genesis ibc tao * fix: code * fix: code * feat: ibc app * feat: ibc app * test: ibc app * fix: review * refactor: update status * refactor: code --------- Co-authored-by: Tuan Phan Anh <[email protected]> Co-authored-by: Phan Anh Tuan <[email protected]> Co-authored-by: Vu Ngoc Quang <[email protected]> Co-authored-by: AnDQK <[email protected]>
- Loading branch information
1 parent
d591c9a
commit 724af28
Showing
13 changed files
with
1,072 additions
and
1 deletion.
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
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,21 @@ | ||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.createTable('ibc_ics20', (table) => { | ||
table.increments(); | ||
table.integer('ibc_message_id').notNullable().unique(); | ||
table.string('sender').index(); | ||
table.string('receiver').index().notNullable(); | ||
table.decimal('amount', 80, 0).notNullable(); | ||
table.string('denom').notNullable().index(); | ||
table.string('status').notNullable(); | ||
table.string('channel_id').notNullable().index(); | ||
table.foreign('ibc_message_id').references('ibc_message.id'); | ||
table.string('sequence_key').notNullable().index(); | ||
table.string('type').notNullable().index(); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.dropTableIfExists('ibc_ics20'); | ||
} |
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
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,93 @@ | ||
/* eslint-disable import/no-cycle */ | ||
import { Model } from 'objection'; | ||
import BaseModel from './base'; | ||
import { IbcMessage } from './ibc_message'; | ||
import { IbcChannel } from './ibc_channel'; | ||
|
||
export class IbcIcs20 extends BaseModel { | ||
id!: number; | ||
|
||
ibc_message_id!: number; | ||
|
||
sender!: string; | ||
|
||
receiver!: string; | ||
|
||
amount!: string; | ||
|
||
denom!: string; | ||
|
||
status!: string; | ||
|
||
channel_id!: string; | ||
|
||
ibc_message!: IbcMessage; | ||
|
||
sequence_key!: string; | ||
|
||
type!: string; | ||
|
||
static get tableName() { | ||
return 'ibc_ics20'; | ||
} | ||
|
||
static get jsonSchema() { | ||
return { | ||
type: 'object', | ||
required: [ | ||
'receiver', | ||
'amount', | ||
'denom', | ||
'ibc_message_id', | ||
'channel_id', | ||
'sequence_key', | ||
'status', | ||
'type', | ||
], | ||
properties: { | ||
receiver: { type: 'string' }, | ||
denom: { type: 'string' }, | ||
ibc_message_id: { type: 'number' }, | ||
amount: { type: 'string' }, | ||
channel_id: { type: 'string' }, | ||
sequence_key: { type: 'string' }, | ||
status: { type: 'string' }, | ||
type: { type: 'string' }, | ||
}, | ||
}; | ||
} | ||
|
||
static get relationMappings() { | ||
return { | ||
ibc_message: { | ||
relation: Model.BelongsToOneRelation, | ||
modelClass: IbcMessage, | ||
join: { | ||
from: 'ibc_ics20.ibc_message_id', | ||
to: 'ibc_message.id', | ||
}, | ||
}, | ||
channel: { | ||
relation: Model.BelongsToOneRelation, | ||
modelClass: IbcChannel, | ||
join: { | ||
from: 'ibc_ics20.channel_id', | ||
to: 'ibc_channel.channel_id', | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
static EVENT_TYPE = { | ||
TIMEOUT: 'timeout', | ||
FUNGIBLE_TOKEN_PACKET: 'fungible_token_packet', | ||
DENOM_TRACE: 'denomination_trace', | ||
}; | ||
|
||
static STATUS_TYPE = { | ||
TIMEOUT: 'timeout', | ||
ACK_ERROR: 'ack_error', | ||
ACK_SUCCESS: 'ack_success', | ||
ONGOING: 'ongoing', | ||
}; | ||
} |
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
Oops, something went wrong.