diff --git a/packages/graphql/database/1.sql b/packages/graphql/database/1.sql index 4fe7f2be..30843eab 100644 --- a/packages/graphql/database/1.sql +++ b/packages/graphql/database/1.sql @@ -2,6 +2,7 @@ create table indexer.assets_contracts ( asset_id text not null, contract_id text not null, transaction_id text not null, + sub_id text, name text, symbol text, decimals integer, diff --git a/packages/graphql/src/application/uc/IndexAsset.ts b/packages/graphql/src/application/uc/IndexAsset.ts index ed6a7eb9..1fa992f6 100644 --- a/packages/graphql/src/application/uc/IndexAsset.ts +++ b/packages/graphql/src/application/uc/IndexAsset.ts @@ -19,6 +19,7 @@ export default class IndexAsset { assetId, contractId: receipt.id, transactionId: transaction.id, + subId: receipt.subId, name: null, symbol: null, decimals: null, @@ -50,11 +51,12 @@ export default class IndexAsset { } try { connection.query( - 'insert into indexer.assets_contracts (asset_id, contract_id, transaction_id, name, symbol, decimals, error) values ($1, $2, $3, $4, $5, $6, $7) on conflict do nothing', + 'insert into indexer.assets_contracts (asset_id, contract_id, transaction_id, sub_id, name, symbol, decimals, error) values ($1, $2, $3, $4, $5, $6, $7, $8) on conflict do nothing', [ asset.assetId, asset.contractId, asset.transactionId, + asset.subId, asset.name, asset.symbol, asset.decimals, diff --git a/packages/graphql/src/graphql/generated/mocks.ts b/packages/graphql/src/graphql/generated/mocks.ts index bcf5d9cb..ab786ee5 100644 --- a/packages/graphql/src/graphql/generated/mocks.ts +++ b/packages/graphql/src/graphql/generated/mocks.ts @@ -9,6 +9,7 @@ export const anAsset = (overrides?: Partial): { __typename: 'Asset' } icon: overrides && overrides.hasOwnProperty('icon') ? overrides.icon! : 'explicabo', name: overrides && overrides.hasOwnProperty('name') ? overrides.name! : 'dolorem', networks: overrides && overrides.hasOwnProperty('networks') ? overrides.networks! : [anAssetNetworkEthereum()], + subId: overrides && overrides.hasOwnProperty('subId') ? overrides.subId! : 'omnis', symbol: overrides && overrides.hasOwnProperty('symbol') ? overrides.symbol! : 'quaerat', verified: overrides && overrides.hasOwnProperty('verified') ? overrides.verified! : false, }; diff --git a/packages/graphql/src/graphql/generated/sdk-provider.ts b/packages/graphql/src/graphql/generated/sdk-provider.ts index d16c329d..1e1292cf 100644 --- a/packages/graphql/src/graphql/generated/sdk-provider.ts +++ b/packages/graphql/src/graphql/generated/sdk-provider.ts @@ -86,6 +86,7 @@ export type GQLAsset = { icon?: Maybe; name?: Maybe; networks?: Maybe>>; + subId?: Maybe; symbol?: Maybe; verified?: Maybe; }; diff --git a/packages/graphql/src/graphql/generated/sdk.ts b/packages/graphql/src/graphql/generated/sdk.ts index 689b02c8..668d4290 100644 --- a/packages/graphql/src/graphql/generated/sdk.ts +++ b/packages/graphql/src/graphql/generated/sdk.ts @@ -86,6 +86,7 @@ export type GQLAsset = { icon?: Maybe; name?: Maybe; networks?: Maybe>>; + subId?: Maybe; symbol?: Maybe; verified?: Maybe; }; @@ -5128,6 +5129,7 @@ export const AssetDocument = gql` asset(assetId: $assetId) { assetId contractId + subId name symbol decimals diff --git a/packages/graphql/src/graphql/queries/sdk/asset.graphql b/packages/graphql/src/graphql/queries/sdk/asset.graphql index d75d17c1..556e6e92 100644 --- a/packages/graphql/src/graphql/queries/sdk/asset.graphql +++ b/packages/graphql/src/graphql/queries/sdk/asset.graphql @@ -2,6 +2,7 @@ query asset($assetId: String!){ asset (assetId: $assetId) { assetId contractId + subId name symbol decimals diff --git a/packages/graphql/src/graphql/schemas/explorer.graphql b/packages/graphql/src/graphql/schemas/explorer.graphql index 11ddb77c..66767c46 100644 --- a/packages/graphql/src/graphql/schemas/explorer.graphql +++ b/packages/graphql/src/graphql/schemas/explorer.graphql @@ -255,6 +255,7 @@ type BlocksDashboardConnection { type Asset { assetId: String contractId: String + subId: String name: String symbol: String decimals: U64 diff --git a/packages/graphql/src/infra/dao/AssetDAO.ts b/packages/graphql/src/infra/dao/AssetDAO.ts index 7817369a..e5a410ec 100644 --- a/packages/graphql/src/infra/dao/AssetDAO.ts +++ b/packages/graphql/src/infra/dao/AssetDAO.ts @@ -20,6 +20,7 @@ export default class BlockDAO { return { assetId: assetData.asset_id, contractId: assetData.contract_id, + subId: assetData.sub_id, name: assetData.name, symbol: assetData.symbol, decimals: assetData.decimals,