Skip to content

Commit

Permalink
chore: sunset off-chain minting feature
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Apr 5, 2024
1 parent 949e786 commit ddb27e6
Show file tree
Hide file tree
Showing 90 changed files with 10 additions and 3,077 deletions.
66 changes: 0 additions & 66 deletions api-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ input AdminFindManyIdentityInput {
provider: IdentityProvider
}

input AdminFindManyMintInput {
communityId: String!
limit: Int = 10
page: Int = 1
search: String
}

input AdminFindManyUserInput {
limit: Int = 10
page: Int = 1
Expand All @@ -63,14 +56,6 @@ input AdminUpdateCommunityMemberInput {
role: CommunityMemberRole
}

input AdminUpdateMintInput {
decimals: Float
imageUrl: String
name: String
secretKey: String
symbol: String
}

input AdminUpdateUserInput {
avatarUrl: String
developer: Boolean
Expand Down Expand Up @@ -198,22 +183,6 @@ input LoginInput {
username: String!
}

type Mint {
createdAt: DateTime
decimals: Float!
id: String!
imageUrl: String
name: String!
publicKey: String!
symbol: String!
updatedAt: DateTime
}

type MintPaging {
data: [Mint!]!
meta: PagingMeta!
}

type Mutation {
adminCreateCommunityMember(input: AdminCreateCommunityMemberInput!): CommunityMember
adminCreateIdentity(input: AdminCreateIdentityInput!): Identity
Expand All @@ -224,14 +193,12 @@ type Mutation {
adminDeleteCommunity(communityId: String!): Boolean
adminDeleteCommunityMember(communityMemberId: String!): Boolean
adminDeleteIdentity(identityId: String!): Boolean
adminDeleteMint(mintId: String!): Boolean
adminDeletePreset(presetId: String!): Boolean
adminDeletePrice(priceId: String!): Boolean
adminDeleteUser(userId: String!): Boolean
adminDeleteWallet(walletId: String!): Boolean
adminUpdateCommunity(communityId: String!, input: AdminUpdateCommunityInput!): Community
adminUpdateCommunityMember(communityMemberId: String!, input: AdminUpdateCommunityMemberInput!): CommunityMember
adminUpdateMint(input: AdminUpdateMintInput!, mintId: String!): Mint
adminUpdatePreset(input: PresetAdminUpdateInput!, presetId: String!): Preset
adminUpdatePrice(input: PriceAdminUpdateInput!, priceId: String!): Price
adminUpdateUser(input: AdminUpdateUserInput!, userId: String!): User
Expand All @@ -243,20 +210,16 @@ type Mutation {
solanaRequestAirdrop(account: String!): JSON
userCreateCommunity(input: UserCreateCommunityInput!): Community
userCreateCommunityMember(input: UserCreateCommunityMemberInput!): CommunityMember
userCreateMint(input: UserCreateMintInput!): Mint
userCreateMintFromMinter(account: String!, communitySlug: String!): String
userCreateMintFromPreset(communitySlug: String!, presetId: String!): String
userCreateWallet(input: WalletUserCreateInput!): Wallet
userDeleteCommunity(communityId: String!): Boolean
userDeleteCommunityMember(communityMemberId: String!): Boolean
userDeleteIdentity(identityId: String!): Boolean
userDeleteMint(mintId: String!): Boolean
userDeleteWallet(walletId: String!): Boolean
userLinkIdentity(input: LinkIdentityInput!): Identity
userMintToIdentity(identityId: String!, mintId: String!): JSON
userUpdateCommunity(communityId: String!, input: UserUpdateCommunityInput!): Community
userUpdateCommunityMember(communityMemberId: String!, input: UserUpdateCommunityMemberInput!): CommunityMember
userUpdateMint(input: UserUpdateMintInput!, mintId: String!): Mint
userUpdateUser(input: UserUpdateUserInput!): User
userUpdateWallet(input: WalletUserUpdateInput!, walletId: String!): Wallet
userVerifyIdentityChallenge(input: VerifyIdentityChallengeInput!): IdentityChallenge
Expand Down Expand Up @@ -350,14 +313,12 @@ type Query {
adminFindManyCommunity(input: AdminFindManyCommunityInput!): CommunityPaging!
adminFindManyCommunityMember(input: AdminFindManyCommunityMemberInput!): CommunityMemberPaging!
adminFindManyIdentity(input: AdminFindManyIdentityInput!): [Identity!]
adminFindManyMint(input: AdminFindManyMintInput!): MintPaging!
adminFindManyPreset(input: PresetAdminFindManyInput!): PresetPaging!
adminFindManyPrice(input: PriceAdminFindManyInput!): [Price!]!
adminFindManyUser(input: AdminFindManyUserInput!): UserPaging!
adminFindManyWallet(input: WalletAdminFindManyInput!): WalletPaging!
adminFindOneCommunity(communityId: String!): Community
adminFindOneCommunityMember(communityMemberId: String!): CommunityMember
adminFindOneMint(mintId: String!): Mint
adminFindOnePreset(presetId: String!): Preset
adminFindOnePrice(priceId: String!): Price
adminFindOneUser(userId: String!): User
Expand All @@ -375,18 +336,15 @@ type Query {
userFindManyCommunity(input: UserFindManyCommunityInput!): CommunityPaging!
userFindManyCommunityMember(input: UserFindManyCommunityMemberInput!): CommunityMemberPaging!
userFindManyIdentity(input: UserFindManyIdentityInput!): [Identity!]
userFindManyMint(input: UserFindManyMintInput!): MintPaging!
userFindManyPreset(input: PresetUserFindManyInput!): PresetPaging!
userFindManyPrice(input: PriceUserFindManyInput!): [Price!]!
userFindManyUser(input: UserFindManyUserInput!): UserPaging!
userFindManyWallet(input: WalletUserFindManyInput!): WalletPaging!
userFindOneCommunity(slug: String!): Community
userFindOneCommunityMember(communityMemberId: String!): CommunityMember
userFindOneMint(mintId: String!): Mint
userFindOnePreset(presetId: String!): Preset
userFindOneUser(username: String!): User
userFindOneWallet(walletId: String!): Wallet
userGetMintAccount(mintId: String!): JSON
userGetMinter(account: String!): JSON!
userGetMinterAssets(account: String!): JSON!
userGetMinters: JSON!
Expand Down Expand Up @@ -430,15 +388,6 @@ input UserCreateCommunityMemberInput {
userId: String!
}

input UserCreateMintInput {
communityId: String!
decimals: Float
imageUrl: String
name: String!
secretKey: String
symbol: String!
}

input UserFindManyCommunityInput {
limit: Int = 10
page: Int = 1
Expand All @@ -457,13 +406,6 @@ input UserFindManyIdentityInput {
username: String!
}

input UserFindManyMintInput {
communityId: String!
limit: Int = 10
page: Int = 1
search: String
}

input UserFindManyUserInput {
limit: Int = 10
page: Int = 1
Expand Down Expand Up @@ -496,14 +438,6 @@ input UserUpdateCommunityMemberInput {
role: CommunityMemberRole
}

input UserUpdateMintInput {
decimals: Float
imageUrl: String
name: String
secretKey: String
symbol: String
}

input UserUpdateUserInput {
avatarUrl: String
developer: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,10 @@ import { Injectable, Logger } from '@nestjs/common'
import { OnEvent } from '@nestjs/event-emitter'
import { CommunityMemberRole, Prisma } from '@prisma/client'
import { ApiCoreService, slugifyId } from '@tokengator-mint/api-core-data-access'
import { getKeypairFromSecretKey, keypairToStrings } from '@tokengator-mint/api-solana-util'
import { USER_PROVISIONED } from '@tokengator-mint/api-user-data-access'
import { ApiCommunityDataService } from './api-community-data.service'

export type ProvisionCommunityInput = Omit<Prisma.CommunityCreateInput, 'slug'>
export interface ProvisionCommunityMintInput {
name: string
secretKey: string
symbol: string
uri: string
metadata: Prisma.InputJsonValue
}

function getCommunityMint({
name,
symbol,
secretKey,
uri,
metadata,
}: ProvisionCommunityMintInput): Prisma.MintCreateWithoutCommunityInput {
const keypair = keypairToStrings(getKeypairFromSecretKey(secretKey))

return {
name,
symbol,
uri,
metadata,
...keypair,
}
}

const deanslistItems: ProvisionCommunityMintInput[] = [
{
name: 'Citizenship',
symbol: 'DLCI',
metadata: [
['Community', "Dean's List"],
['Type', 'Citizenship'],
['Earning', 'Enabled'],
['Points', '0'],
],
secretKey:
'[223,16,201,135,106,128,212,126,209,40,124,48,215,215,108,244,13,254,201,49,46,177,6,170,207,103,234,246,133,76,198,78,183,55,136,230,159,97,226,22,253,212,69,142,232,204,172,84,253,18,83,249,99,221,20,92,244,242,237,218,44,242,228,172]',
uri: 'https://raw.githubusercontent.com/pubkeyapp/tokengator-assets/main/developer-portal/metadata.json',
},
{
name: 'Residency',
symbol: 'DLRE',
metadata: [
['Community', "Dean's List"],
['Type', 'Residency'],
['Earning', 'Enabled'],
['Points', '0'],
],
secretKey:
'[194,72,233,190,125,17,21,39,240,15,74,189,36,90,140,39,158,54,167,170,42,88,55,64,233,22,67,27,210,212,211,175,183,69,172,168,251,103,147,166,49,131,254,175,130,125,18,4,61,235,207,135,194,250,220,89,79,181,18,254,166,231,13,116]',
uri: 'https://raw.githubusercontent.com/pubkeyapp/tokengator-assets/main/developer-portal/metadata.json',
},
{
name: 'Business Visa',
symbol: 'DLBV',
metadata: [
['Community', "Dean's List"],
['Type', 'Business Visa'],
['Earning', 'Enabled'],
['Points', '0'],
],
secretKey:
'[251,99,202,208,235,140,66,30,219,147,254,32,131,161,130,142,138,180,229,243,228,56,180,141,35,111,228,150,245,12,166,61,183,54,36,184,223,62,183,150,122,101,131,235,57,190,167,93,100,98,117,74,201,161,179,235,103,91,61,17,220,248,188,136]',
uri: 'https://raw.githubusercontent.com/pubkeyapp/tokengator-assets/main/developer-portal/metadata.json',
},
{
name: 'Personal Visa',
symbol: 'DLPV',
metadata: [
['Community', "Dean's List"],
['Type', 'Personal Visa'],
['Earning', 'Disabled'],
['Points', '0'],
],
secretKey:
'[28,21,193,241,18,110,246,190,232,73,241,167,206,60,118,11,70,21,198,200,137,151,37,79,150,38,149,24,224,235,26,38,183,67,180,1,36,98,178,52,245,238,1,102,7,33,176,250,97,84,13,5,14,72,122,74,248,187,225,76,180,70,152,123]',
uri: 'https://raw.githubusercontent.com/pubkeyapp/tokengator-assets/main/developer-portal/metadata.json',
},
]

export const provisionCommunities: ProvisionCommunityInput[] = [
{
Expand All @@ -109,7 +28,6 @@ export const provisionCommunities: ProvisionCommunityInput[] = [
},
],
},
mints: { create: deanslistItems.map(getCommunityMint) },
},
{
name: 'PubKey',
Expand Down
22 changes: 10 additions & 12 deletions libs/api/core/feature/src/lib/api-core-feature.module.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
import { Module } from '@nestjs/common'
import { ApiAuthFeatureModule } from '@tokengator-mint/api-auth-feature'
import { ApiCoreDataAccessModule } from '@tokengator-mint/api-core-data-access'
import { ApiIdentityFeatureModule } from '@tokengator-mint/api-identity-feature'
import { ApiUserFeatureModule } from '@tokengator-mint/api-user-feature'
import { ApiCoreController } from './api-core.controller'
import { ApiCoreResolver } from './api-core.resolver'
import { ApiMintFeatureModule } from '@tokengator-mint/api-mint-feature'
import { ApiCommunityFeatureModule } from '@tokengator-mint/api-community-feature'
import { ApiCommunityMemberFeatureModule } from '@tokengator-mint/api-community-member-feature'
import { ApiSolanaFeatureModule } from '@tokengator-mint/api-solana-feature'
import { ApiCoreDataAccessModule } from '@tokengator-mint/api-core-data-access'
import { ApiIdentityFeatureModule } from '@tokengator-mint/api-identity-feature'
import { ApiMetadataFeatureModule } from '@tokengator-mint/api-metadata-feature'
import { ApiPresetFeatureModule } from '@tokengator-mint/api-preset-feature'
import { ApiPriceFeatureModule } from '@tokengator-mint/api-price-feature'
import { ApiSolanaFeatureModule } from '@tokengator-mint/api-solana-feature'
import { ApiUserFeatureModule } from '@tokengator-mint/api-user-feature'
import { ApiWalletFeatureModule } from '@tokengator-mint/api-wallet-feature'
import { ApiCoreController } from './api-core.controller'
import { ApiCoreResolver } from './api-core.resolver'

const imports = [
// The api-feature generator will add the imports here
ApiAuthFeatureModule,
ApiCoreDataAccessModule,
ApiIdentityFeatureModule,
ApiUserFeatureModule,
ApiMintFeatureModule,
ApiCommunityFeatureModule,
ApiCommunityMemberFeatureModule,
ApiSolanaFeatureModule,
ApiCoreDataAccessModule,
ApiIdentityFeatureModule,
ApiMetadataFeatureModule,
ApiPresetFeatureModule,
ApiPriceFeatureModule,
ApiSolanaFeatureModule,
ApiUserFeatureModule,
ApiWalletFeatureModule,
]

Expand Down
18 changes: 0 additions & 18 deletions libs/api/mint/data-access/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions libs/api/mint/data-access/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions libs/api/mint/data-access/jest.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions libs/api/mint/data-access/project.json

This file was deleted.

8 changes: 0 additions & 8 deletions libs/api/mint/data-access/src/index.ts

This file was deleted.

Loading

0 comments on commit ddb27e6

Please sign in to comment.