Skip to content

Commit

Permalink
feat: added subsocial support without kepler
Browse files Browse the repository at this point in the history
  • Loading branch information
mckrava committed Jan 9, 2024
1 parent d97b521 commit 9311717
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 31 deletions.
1 change: 1 addition & 0 deletions deployment/feature-based/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ data:
DATA_SOURCE__SUBQUERY__MOONBEAM__TRANSFER: 'QmSZNKPCNxAuiSjgDyTiK7VJBFdCcp8b11NzuUYvE7akEi'
DATA_SOURCE__SUBQUERY__MOONRIVER__TRANSFER: 'QmQnXCkFo9hhxLJHMBotCB2S8zhMR4tBkeiFHrLTBHjXja'
DATA_SOURCE__SUBQUERY__ASTAR__TRANSFER: 'QmZt47LXCtv9unSAaD9SbdEFfQQTLv9CTMHQKNKh2VDfwX'
DATA_SOURCE__SUBQUERY__SUBSOCIAL__TRANSFER: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-subsocial'

DATA_SOURCE_PROVIDER_TRANSFER: 'SUBQUERY'

Expand Down
1 change: 1 addition & 0 deletions deployment/prod/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ data:
DATA_SOURCE__SUBQUERY__MOONBEAM__TRANSFER: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonbeam'
DATA_SOURCE__SUBQUERY__MOONRIVER__TRANSFER: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-moonriver'
DATA_SOURCE__SUBQUERY__ASTAR__TRANSFER: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-astar'
DATA_SOURCE__SUBQUERY__SUBSOCIAL__TRANSFER: 'https://api.subquery.network/sq/nova-wallet/nova-wallet-subsocial'

DATA_SOURCE_PROVIDER_TRANSFER: 'SUBQUERY'

Expand Down
1 change: 1 addition & 0 deletions schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum BlockchainTag {
MOONBEAM
MOONRIVER
ASTAR
SUBSOCIAL
}

type TransferNative {
Expand Down
3 changes: 3 additions & 0 deletions src/config.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export class AppConfig {

@IsNotEmpty()
readonly DATA_SOURCE__SUBQUERY__ASTAR__TRANSFER: string;

@IsNotEmpty()
readonly DATA_SOURCE__SUBQUERY__SUBSOCIAL__TRANSFER: string;
}

@Global()
Expand Down
76 changes: 47 additions & 29 deletions src/constants/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum BlockchainTag {
MOONBEAM = 'MOONBEAM',
MOONRIVER = 'MOONRIVER',
ASTAR = 'ASTAR',
SUBSOCIAL = 'SUBSOCIAL',
}

// https://github.com/polkadot-js/apps/blob/7c12692ee34aadd815b282ff4dca3d0a4763a9ca/packages/apps-config/src/endpoints/productionRelayPolkadot.ts#L645
Expand Down Expand Up @@ -64,39 +65,56 @@ export const supportedBlockchainDetails: Omit<Blockchain, 'id'>[] = [
logo: '',
color: '#1b6dc1d9',
},
{
prefix: 28,
text: 'Subsocial',
info: 'subsocial',
tag: BlockchainTag.SUBSOCIAL,
decimal: 10,
symbols: ['SUB'],
logo: '',
color: '#1b6dc1d9',
},
];

export const blockchainDataSourceConfigs = [
// {
// tag: BlockchainTag.POLKADOT,
// events: {
// [NativeTransactionKind.TRANSFER]: null,
// // [NativeTransactionKind.REWARD]: null,
// },
// },
// {
// tag: BlockchainTag.KUSAMA,
// events: {
// [NativeTransactionKind.TRANSFER]: null,
// // [NativeTransactionKind.REWARD]: null,
// },
// },
// {
// tag: BlockchainTag.MOONBEAM,
// events: {
// [NativeTransactionKind.TRANSFER]: null,
// // [NativeTransactionKind.REWARD]: null,
// },
// },
// {
// tag: BlockchainTag.MOONRIVER,
// events: {
// [NativeTransactionKind.TRANSFER]: null,
// // [NativeTransactionKind.REWARD]: null,
// },
// },
// {
// tag: BlockchainTag.ASTAR,
// events: {
// [NativeTransactionKind.TRANSFER]: null,
// // [NativeTransactionKind.REWARD]: null,
// },
// },
{
tag: BlockchainTag.POLKADOT,
events: {
[NativeTransactionKind.TRANSFER]: null,
// [NativeTransactionKind.REWARD]: null,
},
},
{
tag: BlockchainTag.KUSAMA,
events: {
[NativeTransactionKind.TRANSFER]: null,
// [NativeTransactionKind.REWARD]: null,
},
},
{
tag: BlockchainTag.MOONBEAM,
events: {
[NativeTransactionKind.TRANSFER]: null,
// [NativeTransactionKind.REWARD]: null,
},
},
{
tag: BlockchainTag.MOONRIVER,
events: {
[NativeTransactionKind.TRANSFER]: null,
// [NativeTransactionKind.REWARD]: null,
},
},
{
tag: BlockchainTag.ASTAR,
tag: BlockchainTag.SUBSOCIAL,
events: {
[NativeTransactionKind.TRANSFER]: null,
// [NativeTransactionKind.REWARD]: null,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/dataSources/dataSourceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class DataSourceUtils extends DataSourceDecorators {
return this.decorateGetTransfersByAccountResponseFromSubQuery(
await this.subsQuery.getTransfersByAccount({
...data,
queryUrl: this.decorateQueryUrl(data.queryUrl as string),
// queryUrl: this.decorateQueryUrl(data.queryUrl as string), // TODO disabled Kepler links generation
resultPlaceholder: { historyElements: { nodes: [] } },
}),
);
Expand All @@ -64,7 +64,7 @@ export class DataSourceUtils extends DataSourceDecorators {
return this.decorateGetIndexerLastProcessedHeightFromSubQuery(
await this.subsQuery.getIndexerLastProcessedHeight({
...data,
queryUrl: this.decorateQueryUrl(data.queryUrl as string),
// queryUrl: this.decorateQueryUrl(data.queryUrl as string), // TODO disabled Kepler links generation
resultPlaceholder: { _metadata: { lastProcessedHeight: 0 } },
}),
);
Expand Down

0 comments on commit 9311717

Please sign in to comment.