diff --git a/config/middlewares.ts b/config/middlewares.ts index c4a3fba..829f5c0 100644 --- a/config/middlewares.ts +++ b/config/middlewares.ts @@ -9,10 +9,4 @@ export default [ 'strapi::session', 'strapi::favicon', 'strapi::public', - { - resolve: './src/middlewares/custom/signup', - config: { - enabled: true, - }, - }, ]; diff --git a/package.json b/package.json index 4147b07..d2bbd80 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,13 @@ "lint": "eslint" }, "dependencies": { + "@solana/web3.js": "^1.95.3", "@strapi/plugin-cloud": "4.25.1", "@strapi/plugin-i18n": "4.25.1", "@strapi/plugin-users-permissions": "^4.25.6", "@strapi/strapi": "4.25.1", "better-sqlite3": "8.6.0", + "crypto": "^1.0.1", "pg": "^8.12.0", "react": "^18.0.0", "react-dom": "^18.0.0", diff --git a/src/api/profile/content-types/profile/schema.json b/src/api/profile/content-types/profile/schema.json index cfaf662..4acf87a 100644 --- a/src/api/profile/content-types/profile/schema.json +++ b/src/api/profile/content-types/profile/schema.json @@ -28,12 +28,6 @@ "relation": "oneToOne", "target": "plugin::users-permissions.user" }, - "wallet": { - "type": "relation", - "relation": "oneToOne", - "target": "api::wallet.wallet", - "mappedBy": "profile" - }, "points": { "type": "integer", "required": true, diff --git a/src/api/profile/services/profile.ts b/src/api/profile/services/profile.ts index 2b966c2..bbaffcc 100644 --- a/src/api/profile/services/profile.ts +++ b/src/api/profile/services/profile.ts @@ -3,5 +3,50 @@ */ import { factories } from '@strapi/strapi'; +import {Keypair} from '@solana/web3.js'; +import crypto from 'crypto'; -export default factories.createCoreService('api::profile.profile'); +import {encryptPrivateKey} from '../../../utils/crypto'; +import {SupportedBlockchains} from '../../../utils/types'; + +export default factories.createCoreService('api::profile.profile', { + addProfileAndWallet: async (userId: string) => { + try { + const now = new Date().getTime(); + + // Create a profile for the new user + await strapi.entityService.create('api::profile.profile', { + data: { + first_name: '', + las_name: '', + points: 0, + users_permissions_user: userId, + createdAt: now, + publishedAt: now, + }, + }); + + // Create a wallet for the new user + const wallet = Keypair.generate(); + const iv = crypto.randomBytes(16); + const privateKey = wallet.secretKey.toString(); + await strapi.entityService.create('api::wallet.wallet', { + data: { + public_key: wallet.publicKey.toString(), + encrypted_private_key: encryptPrivateKey(privateKey, iv), + address: wallet.publicKey.toBase58(), + blockchain: SupportedBlockchains.Solana, + encryption_metadata: {}, + users_permissions_user: userId, + createdAt: now, + publishedAt: now, + }, + }); + + strapi.log.info(`Profile and wallet created for user ${userId}`); + } catch (error) { + strapi.log.error('Error during profile or wallet creation:', error); + // @todo we should delete the user and inform the client about the error + } + }, +}); diff --git a/src/api/wallet/content-types/wallet/schema.json b/src/api/wallet/content-types/wallet/schema.json index 4f642e2..7c78cc3 100644 --- a/src/api/wallet/content-types/wallet/schema.json +++ b/src/api/wallet/content-types/wallet/schema.json @@ -12,23 +12,35 @@ }, "pluginOptions": {}, "attributes": { + "public_key": { + "type": "string", + "required": true, + "unique": true + }, + "encrypted_private_key": { + "type": "json", + "required": true + }, "address": { "type": "string", "required": true }, - "balance": { - "type": "biginteger", - "default": "0", + "encryption_metadata": { + "type": "json", "required": true }, - "seed": { - "type": "string", + "blockchain": { + "type": "enumeration", + "enum": [ + "Solana", + "Klayr" + ], "required": true }, - "profile": { + "users_permissions_user": { "type": "relation", "relation": "oneToOne", - "target": "api::profile.profile", + "target": "plugin::users-permissions.user", "inversedBy": "wallet" } } diff --git a/src/extensions/users-permissions/content-types/user/schema.json b/src/extensions/users-permissions/content-types/user/schema.json index a89804a..311f62c 100644 --- a/src/extensions/users-permissions/content-types/user/schema.json +++ b/src/extensions/users-permissions/content-types/user/schema.json @@ -95,6 +95,12 @@ "relation": "oneToMany", "target": "api::contribution.contribution", "mappedBy": "users_permissions_user" + }, + "wallet": { + "type": "relation", + "relation": "oneToOne", + "target": "api::wallet.wallet", + "mappedBy": "users_permissions_user" } } } diff --git a/src/index.ts b/src/index.ts index 9fca261..14dc4c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,5 +14,11 @@ export default { * This gives you an opportunity to set up your data model, * run jobs, or perform some special logic. */ - bootstrap(/*{ strapi }*/) {}, + bootstrap({ strapi }) { + strapi.db.lifecycles.subscribe((event) => { + if (event.action === 'afterCreate' && event.model.collectionName === 'up_users') { + strapi.service('api::profile.profile').addProfileAndWallet(event.result.id); + } + }); + }, }; diff --git a/src/extensions/.gitkeep b/src/middlewares/.gitkeep similarity index 100% rename from src/extensions/.gitkeep rename to src/middlewares/.gitkeep diff --git a/src/middlewares/custom/signup.ts b/src/middlewares/custom/signup.ts deleted file mode 100644 index 5d9487a..0000000 --- a/src/middlewares/custom/signup.ts +++ /dev/null @@ -1,35 +0,0 @@ -// src/middlewares/custom/signup.ts - -export default (config, { strapi }) => { - return async (ctx, next) => { - if ( - ctx.request.url === '/api/auth/local/register' && - ctx.request.method.toLowerCase() === 'post' - ) { - // Extract user information from the request body - const { email } = ctx.request.body; - - try { - // Create a profile for the new user - const profile = await strapi.entityService.create( - 'api::profile.profile', - { - data: { - first_name: email, // Set first_name to email as requested - }, - }, - ); - - strapi.log.info(`Profile created for user ${profile.id}`); - } catch (error) { - strapi.log.error('Error during profile creation:', error); - return ctx.internalServerError( - 'An error occurred during profile creation', - ); - } - } - - // Proceed to the next middleware or route handler - await next(); - }; -}; diff --git a/src/utils/crypto.ts b/src/utils/crypto.ts new file mode 100644 index 0000000..ebd6085 --- /dev/null +++ b/src/utils/crypto.ts @@ -0,0 +1,18 @@ +import crypto from 'crypto'; + +const algorithm = 'aes-256-cbc'; +const PVK_ENCRYPTION_SALT = process.env.PVK_ENCRYPTION_SALT; +const pvkEncryptionSalt = Buffer.from(PVK_ENCRYPTION_SALT, 'hex'); + +export const encryptPrivateKey = (privateKey: string, iv: Buffer) => { + if (!PVK_ENCRYPTION_SALT) { + throw new Error('Error: The env variable PVK_ENCRYPTION_SALT is missing'); + } + + const cipher = crypto.createCipheriv(algorithm, pvkEncryptionSalt, iv); + const encrypted = Buffer.concat([cipher.update(privateKey), cipher.final()]); + return { + iv: iv.toString('hex'), + encryptedData: encrypted.toString('hex'), + }; +}; diff --git a/src/utils/types.ts b/src/utils/types.ts new file mode 100644 index 0000000..918c414 --- /dev/null +++ b/src/utils/types.ts @@ -0,0 +1,3 @@ +export enum SupportedBlockchains { + Solana = 'Solana', +} diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 70013f3..6f79921 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -749,6 +749,11 @@ export interface PluginUsersPermissionsUser extends Schema.CollectionType { 'oneToMany', 'api::contribution.contribution' >; + wallet: Attribute.Relation< + 'plugin::users-permissions.user', + 'oneToOne', + 'api::wallet.wallet' + >; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; createdBy: Attribute.Relation< @@ -1080,11 +1085,6 @@ export interface ApiProfileProfile extends Schema.CollectionType { 'oneToOne', 'plugin::users-permissions.user' >; - wallet: Attribute.Relation< - 'api::profile.profile', - 'oneToOne', - 'api::wallet.wallet' - >; points: Attribute.Integer & Attribute.Required & Attribute.SetMinMax< @@ -1414,15 +1414,15 @@ export interface ApiWalletWallet extends Schema.CollectionType { draftAndPublish: true; }; attributes: { + public_key: Attribute.String & Attribute.Required & Attribute.Unique; + encrypted_private_key: Attribute.JSON & Attribute.Required; address: Attribute.String & Attribute.Required; - balance: Attribute.BigInteger & - Attribute.Required & - Attribute.DefaultTo<'0'>; - seed: Attribute.String & Attribute.Required; - profile: Attribute.Relation< + encryption_metadata: Attribute.JSON & Attribute.Required; + blockchain: Attribute.Enumeration<['Solana', 'Klayr']> & Attribute.Required; + users_permissions_user: Attribute.Relation< 'api::wallet.wallet', 'oneToOne', - 'api::profile.profile' + 'plugin::users-permissions.user' >; createdAt: Attribute.DateTime; updatedAt: Attribute.DateTime; diff --git a/yarn.lock b/yarn.lock index b9f17d1..f4b5d42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -155,6 +155,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.25.0": + version: 7.25.6 + resolution: "@babel/runtime@npm:7.25.6" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: ee1a69d3ac7802803f5ee6a96e652b78b8addc28c6a38c725a4ad7d61a059d9e6cb9f6550ed2f63cce67a1bd82e0b1ef66a1079d895be6bfb536a5cfbd9ccc32 + languageName: node + linkType: hard + "@babel/template@npm:^7.24.7": version: 7.24.7 resolution: "@babel/template@npm:7.24.7" @@ -1323,6 +1332,22 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:^1.4.2": + version: 1.6.0 + resolution: "@noble/curves@npm:1.6.0" + dependencies: + "@noble/hashes": 1.5.0 + checksum: 258f3feb2a6098cf35521562ecb7d452fd728e8a008ff9f1ef435184f9d0c782ceb8f7b7fa8df3317c3be7a19f53995ee124cd05c8080b130bd42e3cb072f24d + languageName: node + linkType: hard + +"@noble/hashes@npm:1.5.0, @noble/hashes@npm:^1.4.0": + version: 1.5.0 + resolution: "@noble/hashes@npm:1.5.0" + checksum: 9cc031d5c888c455bfeef76af649b87f75380a4511405baea633c1e4912fd84aff7b61e99716f0231d244c9cfeda1fafd7d718963e6a0c674ed705e9b1b4f76b + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -2591,6 +2616,38 @@ __metadata: languageName: node linkType: hard +"@solana/buffer-layout@npm:^4.0.1": + version: 4.0.1 + resolution: "@solana/buffer-layout@npm:4.0.1" + dependencies: + buffer: ~6.0.3 + checksum: bf846888e813187243d4008a7a9f58b49d16cbd995b9d7f1b72898aa510ed77b1ce5e8468e7b2fd26dd81e557a4e74a666e21fccb95f123c1f740d41138bbacd + languageName: node + linkType: hard + +"@solana/web3.js@npm:^1.95.3": + version: 1.95.3 + resolution: "@solana/web3.js@npm:1.95.3" + dependencies: + "@babel/runtime": ^7.25.0 + "@noble/curves": ^1.4.2 + "@noble/hashes": ^1.4.0 + "@solana/buffer-layout": ^4.0.1 + agentkeepalive: ^4.5.0 + bigint-buffer: ^1.1.5 + bn.js: ^5.2.1 + borsh: ^0.7.0 + bs58: ^4.0.1 + buffer: 6.0.3 + fast-stable-stringify: ^1.0.0 + jayson: ^4.1.1 + node-fetch: ^2.7.0 + rpc-websockets: ^9.0.2 + superstruct: ^2.0.2 + checksum: 6951eb12275de09ef9422fc65982b7496f3d11253b4cd1b09694dd2135d92aa272a04a7adf50ef0136a459b08ea40e07f6e7cbf1970cae44d6193d93fe6acc1f + languageName: node + linkType: hard + "@strapi/admin@npm:4.25.1": version: 4.25.1 resolution: "@strapi/admin@npm:4.25.1" @@ -3507,6 +3564,15 @@ __metadata: languageName: node linkType: hard +"@swc/helpers@npm:^0.5.11": + version: 0.5.13 + resolution: "@swc/helpers@npm:0.5.13" + dependencies: + tslib: ^2.4.0 + checksum: d50c2c10da6ef940af423c6b03ad9c3c94cf9de59314b1e921a7d1bcc081a6074481c9d67b655fc8fe66a73288f98b25950743792a63882bfb5793b362494fc0 + languageName: node + linkType: hard + "@swc/types@npm:^0.1.9": version: 0.1.9 resolution: "@swc/types@npm:0.1.9" @@ -3554,7 +3620,7 @@ __metadata: languageName: node linkType: hard -"@types/connect@npm:*": +"@types/connect@npm:*, @types/connect@npm:^3.4.33": version: 3.4.38 resolution: "@types/connect@npm:3.4.38" dependencies: @@ -3763,6 +3829,13 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^12.12.54": + version: 12.20.55 + resolution: "@types/node@npm:12.20.55" + checksum: e4f86785f4092706e0d3b0edff8dca5a13b45627e4b36700acd8dfe6ad53db71928c8dee914d4276c7fd3b6ccd829aa919811c9eb708a2c8e4c6eb3701178c37 + languageName: node + linkType: hard + "@types/normalize-package-data@npm:^2.4.0": version: 2.4.4 resolution: "@types/normalize-package-data@npm:2.4.4" @@ -3870,6 +3943,31 @@ __metadata: languageName: node linkType: hard +"@types/uuid@npm:^8.3.4": + version: 8.3.4 + resolution: "@types/uuid@npm:8.3.4" + checksum: 6f11f3ff70f30210edaa8071422d405e9c1d4e53abbe50fdce365150d3c698fe7bbff65c1e71ae080cbfb8fded860dbb5e174da96fdbbdfcaa3fb3daa474d20f + languageName: node + linkType: hard + +"@types/ws@npm:^7.4.4": + version: 7.4.7 + resolution: "@types/ws@npm:7.4.7" + dependencies: + "@types/node": "*" + checksum: b4c9b8ad209620c9b21e78314ce4ff07515c0cadab9af101c1651e7bfb992d7fd933bd8b9c99d110738fd6db523ed15f82f29f50b45510288da72e964dedb1a3 + languageName: node + linkType: hard + +"@types/ws@npm:^8.2.2": + version: 8.5.12 + resolution: "@types/ws@npm:8.5.12" + dependencies: + "@types/node": "*" + checksum: ddefb6ad1671f70ce73b38a5f47f471d4d493864fca7c51f002a86e5993d031294201c5dced6d5018fb8905ad46888d65c7f20dd54fc165910b69f42fba9a6d0 + languageName: node + linkType: hard + "@typescript-eslint/eslint-plugin@npm:7.14.1, @typescript-eslint/eslint-plugin@npm:^7.14.1": version: 7.14.1 resolution: "@typescript-eslint/eslint-plugin@npm:7.14.1" @@ -4245,6 +4343,18 @@ __metadata: languageName: node linkType: hard +"JSONStream@npm:^1.3.5": + version: 1.3.5 + resolution: "JSONStream@npm:1.3.5" + dependencies: + jsonparse: ^1.2.0 + through: ">=2.2.7 <3" + bin: + JSONStream: ./bin.js + checksum: 2605fa124260c61bad38bb65eba30d2f72216a78e94d0ab19b11b4e0327d572b8d530c0c9cc3b0764f727ad26d39e00bf7ebad57781ca6368394d73169c59e46 + languageName: node + linkType: hard + "abbrev@npm:^2.0.0": version: 2.0.0 resolution: "abbrev@npm:2.0.0" @@ -4323,6 +4433,15 @@ __metadata: languageName: node linkType: hard +"agentkeepalive@npm:^4.5.0": + version: 4.5.0 + resolution: "agentkeepalive@npm:4.5.0" + dependencies: + humanize-ms: ^1.2.1 + checksum: 13278cd5b125e51eddd5079f04d6fe0914ac1b8b91c1f3db2c1822f99ac1a7457869068997784342fe455d59daaff22e14fb7b8c3da4e741896e7e31faf92481 + languageName: node + linkType: hard + "aggregate-error@npm:^3.0.0": version: 3.1.0 resolution: "aggregate-error@npm:3.1.0" @@ -4759,6 +4878,15 @@ __metadata: languageName: node linkType: hard +"base-x@npm:^3.0.2": + version: 3.0.10 + resolution: "base-x@npm:3.0.10" + dependencies: + safe-buffer: ^5.0.1 + checksum: 52307739559e81d9980889de2359cb4f816cc0eb9a463028fa3ab239ab913d9044a1b47b4520f98e68453df32a457b8ba58b8d0ee7e757fc3fb971f3fa7a1482 + languageName: node + linkType: hard + "base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" @@ -4813,6 +4941,16 @@ __metadata: languageName: node linkType: hard +"bigint-buffer@npm:^1.1.5": + version: 1.1.5 + resolution: "bigint-buffer@npm:1.1.5" + dependencies: + bindings: ^1.3.0 + node-gyp: latest + checksum: d010c9f57758bcdaccb435d88b483ffcc95fe8bbc6e7fb3a44fb5221f29c894ffaf4a3c5a4a530e0e7d6608203c2cde9b79ee4f2386cd6d4462d1070bc8c9f4e + languageName: node + linkType: hard + "binary-extensions@npm:^2.0.0": version: 2.3.0 resolution: "binary-extensions@npm:2.3.0" @@ -4820,7 +4958,7 @@ __metadata: languageName: node linkType: hard -"bindings@npm:^1.5.0": +"bindings@npm:^1.3.0, bindings@npm:^1.5.0": version: 1.5.0 resolution: "bindings@npm:1.5.0" dependencies: @@ -4847,6 +4985,13 @@ __metadata: languageName: node linkType: hard +"bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": + version: 5.2.1 + resolution: "bn.js@npm:5.2.1" + checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 + languageName: node + linkType: hard + "boolbase@npm:^1.0.0": version: 1.0.0 resolution: "boolbase@npm:1.0.0" @@ -4854,6 +4999,17 @@ __metadata: languageName: node linkType: hard +"borsh@npm:^0.7.0": + version: 0.7.0 + resolution: "borsh@npm:0.7.0" + dependencies: + bn.js: ^5.2.0 + bs58: ^4.0.0 + text-encoding-utf-8: ^1.0.2 + checksum: e98bfb5f7cfb820819c2870b884dac58dd4b4ce6a86c286c8fbf5c9ca582e73a8c6094df67e81a28c418ff07a309c6b118b2e27fdfea83fd92b8100c741da0b5 + languageName: node + linkType: hard + "boxen@npm:5.1.2": version: 5.1.2 resolution: "boxen@npm:5.1.2" @@ -4971,6 +5127,15 @@ __metadata: languageName: node linkType: hard +"bs58@npm:^4.0.0, bs58@npm:^4.0.1": + version: 4.0.1 + resolution: "bs58@npm:4.0.1" + dependencies: + base-x: ^3.0.2 + checksum: b3c5365bb9e0c561e1a82f1a2d809a1a692059fae016be233a6127ad2f50a6b986467c3a50669ce4c18929dcccb297c5909314dd347a25a68c21b68eb3e95ac2 + languageName: node + linkType: hard + "buffer-equal-constant-time@npm:1.0.1": version: 1.0.1 resolution: "buffer-equal-constant-time@npm:1.0.1" @@ -4985,6 +5150,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:6.0.3, buffer@npm:^6.0.3, buffer@npm:~6.0.3": + version: 6.0.3 + resolution: "buffer@npm:6.0.3" + dependencies: + base64-js: ^1.3.1 + ieee754: ^1.2.1 + checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9 + languageName: node + linkType: hard + "buffer@npm:^5.1.0, buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -4995,6 +5170,16 @@ __metadata: languageName: node linkType: hard +"bufferutil@npm:^4.0.1": + version: 4.0.8 + resolution: "bufferutil@npm:4.0.8" + dependencies: + node-gyp: latest + node-gyp-build: ^4.3.0 + checksum: 7e9a46f1867dca72fda350966eb468eca77f4d623407b0650913fadf73d5750d883147d6e5e21c56f9d3b0bdc35d5474e80a600b9f31ec781315b4d2469ef087 + languageName: node + linkType: hard + "buildmail@npm:3.10.0": version: 3.10.0 resolution: "buildmail@npm:3.10.0" @@ -5621,7 +5806,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^2.20.0": +"commander@npm:^2.20.0, commander@npm:^2.20.3": version: 2.20.3 resolution: "commander@npm:2.20.3" checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e @@ -5933,6 +6118,13 @@ __metadata: languageName: node linkType: hard +"crypto@npm:^1.0.1": + version: 1.0.1 + resolution: "crypto@npm:1.0.1" + checksum: 087fe3165bd94c333a49e6ed66a0193911f63eac38a24f379b3001a5fe260a59c413646e53a0f67875ba13902b2686d81dc703cb2c147a4ec727dcdc04e5645e + languageName: node + linkType: hard + "css-color-keywords@npm:^1.0.0": version: 1.0.0 resolution: "css-color-keywords@npm:1.0.0" @@ -6256,6 +6448,13 @@ __metadata: languageName: node linkType: hard +"delay@npm:^5.0.0": + version: 5.0.0 + resolution: "delay@npm:5.0.0" + checksum: 62f151151ecfde0d9afbb8a6be37a6d103c4cb24f35a20ef3fe56f920b0d0d0bb02bc9c0a3084d0179ef669ca332b91155f2ee4d9854622cd2cdba5fc95285f9 + languageName: node + linkType: hard + "delayed-stream@npm:~1.0.0": version: 1.0.0 resolution: "delayed-stream@npm:1.0.0" @@ -6706,6 +6905,22 @@ __metadata: languageName: node linkType: hard +"es6-promise@npm:^4.0.3": + version: 4.2.8 + resolution: "es6-promise@npm:4.2.8" + checksum: 95614a88873611cb9165a85d36afa7268af5c03a378b35ca7bda9508e1d4f1f6f19a788d4bc755b3fd37c8ebba40782018e02034564ff24c9d6fa37e959ad57d + languageName: node + linkType: hard + +"es6-promisify@npm:^5.0.0": + version: 5.0.0 + resolution: "es6-promisify@npm:5.0.0" + dependencies: + es6-promise: ^4.0.3 + checksum: fbed9d791598831413be84a5374eca8c24800ec71a16c1c528c43a98e2dadfb99331483d83ae6094ddb9b87e6f799a15d1553cebf756047e0865c753bc346b92 + languageName: node + linkType: hard + "esbuild-loader@npm:^2.21.0": version: 2.21.0 resolution: "esbuild-loader@npm:2.21.0" @@ -7334,6 +7549,13 @@ __metadata: languageName: node linkType: hard +"eyes@npm:^0.1.8": + version: 0.1.8 + resolution: "eyes@npm:0.1.8" + checksum: c31703a92bf36ba75ee8d379ee7985c24ee6149f3a6175f44cec7a05b178c38bce9836d3ca48c9acb0329a960ac2c4b2ead4e60cdd4fe6e8c92cad7cd6913687 + languageName: node + linkType: hard + "fast-deep-equal@npm:3.1.3, fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -7389,6 +7611,13 @@ __metadata: languageName: node linkType: hard +"fast-stable-stringify@npm:^1.0.0": + version: 1.0.0 + resolution: "fast-stable-stringify@npm:1.0.0" + checksum: ef1203d246a7e8ac15e2bfbda0a89fa375947bccf9f7910be0ea759856dbe8ea5024a0d8cc2cceabe18a9cb67e95927b78bb6173a3ae37ec55a518cf36e5244b + languageName: node + linkType: hard + "fastq@npm:^1.6.0": version: 1.17.1 resolution: "fastq@npm:1.17.1" @@ -8587,6 +8816,15 @@ __metadata: languageName: node linkType: hard +"humanize-ms@npm:^1.2.1": + version: 1.2.1 + resolution: "humanize-ms@npm:1.2.1" + dependencies: + ms: ^2.0.0 + checksum: 9c7a74a2827f9294c009266c82031030eae811ca87b0da3dceb8d6071b9bde22c9f3daef0469c3c533cc67a97d8a167cd9fc0389350e5f415f61a79b171ded16 + languageName: node + linkType: hard + "husk-async@npm:~1.0.2": version: 1.0.3 resolution: "husk-async@npm:1.0.3" @@ -8696,7 +8934,7 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13": +"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e @@ -9357,6 +9595,15 @@ __metadata: languageName: node linkType: hard +"isomorphic-ws@npm:^4.0.1": + version: 4.0.1 + resolution: "isomorphic-ws@npm:4.0.1" + peerDependencies: + ws: "*" + checksum: d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a + languageName: node + linkType: hard + "isstream@npm:^0.1.2, isstream@npm:~0.1.2": version: 0.1.2 resolution: "isstream@npm:0.1.2" @@ -9377,6 +9624,28 @@ __metadata: languageName: node linkType: hard +"jayson@npm:^4.1.1": + version: 4.1.2 + resolution: "jayson@npm:4.1.2" + dependencies: + "@types/connect": ^3.4.33 + "@types/node": ^12.12.54 + "@types/ws": ^7.4.4 + JSONStream: ^1.3.5 + commander: ^2.20.3 + delay: ^5.0.0 + es6-promisify: ^5.0.0 + eyes: ^0.1.8 + isomorphic-ws: ^4.0.1 + json-stringify-safe: ^5.0.1 + uuid: ^8.3.2 + ws: ^7.5.10 + bin: + jayson: bin/jayson.js + checksum: 10d6a0ce55045a1098b9b0d1d9b4b898f034e70696e57240ba76d67eddaabd703e1f59477c667b57e39f6f1fc54dbb87b1327a8a4edef39a37a17b70c79bb6e4 + languageName: node + linkType: hard + "jest-worker@npm:^27.4.5": version: 27.5.1 resolution: "jest-worker@npm:27.5.1" @@ -9492,6 +9761,13 @@ __metadata: languageName: node linkType: hard +"json-stringify-safe@npm:^5.0.1": + version: 5.0.1 + resolution: "json-stringify-safe@npm:5.0.1" + checksum: 48ec0adad5280b8a96bb93f4563aa1667fd7a36334f79149abd42446d0989f2ddc58274b479f4819f1f00617957e6344c886c55d05a4e15ebb4ab931e4a6a8ee + languageName: node + linkType: hard + "json5@npm:^2.1.2, json5@npm:^2.2.0": version: 2.2.3 resolution: "json5@npm:2.2.3" @@ -9526,6 +9802,13 @@ __metadata: languageName: node linkType: hard +"jsonparse@npm:^1.2.0": + version: 1.3.1 + resolution: "jsonparse@npm:1.3.1" + checksum: 6514a7be4674ebf407afca0eda3ba284b69b07f9958a8d3113ef1005f7ec610860c312be067e450c569aab8b89635e332cee3696789c750692bb60daba627f4d + languageName: node + linkType: hard + "jsonwebtoken@npm:9.0.0": version: 9.0.0 resolution: "jsonwebtoken@npm:9.0.0" @@ -10762,7 +11045,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.1.1": +"ms@npm:^2.0.0, ms@npm:^2.1.1": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -10792,6 +11075,7 @@ __metadata: dependencies: "@eslint/eslintrc": ^3.1.0 "@eslint/js": ^9.6.0 + "@solana/web3.js": ^1.95.3 "@strapi/plugin-cloud": 4.25.1 "@strapi/plugin-i18n": 4.25.1 "@strapi/plugin-users-permissions": ^4.25.6 @@ -10799,6 +11083,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^7.14.1 "@typescript-eslint/parser": ^7.14.1 better-sqlite3: 8.6.0 + crypto: ^1.0.1 eslint: 9.x eslint-config-prettier: ^9.1.0 eslint-plugin-prettier: ^5.1.3 @@ -10942,7 +11227,7 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.7.0": +"node-fetch@npm:2.7.0, node-fetch@npm:^2.7.0": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -10956,6 +11241,17 @@ __metadata: languageName: node linkType: hard +"node-gyp-build@npm:^4.3.0": + version: 4.8.2 + resolution: "node-gyp-build@npm:4.8.2" + bin: + node-gyp-build: bin.js + node-gyp-build-optional: optional.js + node-gyp-build-test: build-test.js + checksum: 1a57bba8c4c193f808bd8ad1484d4ebdd8106dd9f04a3e82554dc716e3a2d87d7e369e9503c145e0e6a7e2c663fec0d8aaf52bd8156342ec7fc388195f37824e + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 10.1.0 resolution: "node-gyp@npm:10.1.0" @@ -13179,6 +13475,28 @@ __metadata: languageName: node linkType: hard +"rpc-websockets@npm:^9.0.2": + version: 9.0.4 + resolution: "rpc-websockets@npm:9.0.4" + dependencies: + "@swc/helpers": ^0.5.11 + "@types/uuid": ^8.3.4 + "@types/ws": ^8.2.2 + buffer: ^6.0.3 + bufferutil: ^4.0.1 + eventemitter3: ^5.0.1 + utf-8-validate: ^5.0.2 + uuid: ^8.3.2 + ws: ^8.5.0 + dependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: d5efe3a1e7fbd9858886342fb766c05ac69c645bfb3c39a907425163db33e237ae2a601b62e17451040584c06d8699152fb2311a7d6cded2a7e7d4e0e74f0c1a + languageName: node + linkType: hard + "run-applescript@npm:^5.0.0": version: 5.0.0 resolution: "run-applescript@npm:5.0.0" @@ -14138,6 +14456,13 @@ __metadata: languageName: node linkType: hard +"superstruct@npm:^2.0.2": + version: 2.0.2 + resolution: "superstruct@npm:2.0.2" + checksum: a5f75b72cb8b14b86f4f7f750dae8c5ab0e4e1d92414b55e7625bae07bbcafad81c92486e7e32ccacd6ae1f553caff2b92a50ff42ad5093fd35b9cb7f4e5ec86 + languageName: node + linkType: hard + "supports-color@npm:^2.0.0": version: 2.0.0 resolution: "supports-color@npm:2.0.0" @@ -14349,6 +14674,13 @@ __metadata: languageName: node linkType: hard +"text-encoding-utf-8@npm:^1.0.2": + version: 1.0.2 + resolution: "text-encoding-utf-8@npm:1.0.2" + checksum: ec4c15d50e738c5dba7327ad432ebf0725ec75d4d69c0bd55609254c5a3bc5341272d7003691084a0a73d60d981c8eb0e87603676fdb6f3fed60f4c9192309f9 + languageName: node + linkType: hard + "text-hex@npm:1.0.x": version: 1.0.0 resolution: "text-hex@npm:1.0.0" @@ -14407,7 +14739,7 @@ __metadata: languageName: node linkType: hard -"through@npm:^2.3.6": +"through@npm:>=2.2.7 <3, through@npm:^2.3.6": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: a38c3e059853c494af95d50c072b83f8b676a9ba2818dcc5b108ef252230735c54e0185437618596c790bbba8fcdaef5b290405981ffa09dce67b1f1bf190cbd @@ -14965,6 +15297,16 @@ __metadata: languageName: node linkType: hard +"utf-8-validate@npm:^5.0.2": + version: 5.0.10 + resolution: "utf-8-validate@npm:5.0.10" + dependencies: + node-gyp: latest + node-gyp-build: ^4.3.0 + checksum: 5579350a023c66a2326752b6c8804cc7b39dcd251bb088241da38db994b8d78352e388dcc24ad398ab98385ba3c5ffcadb6b5b14b2637e43f767869055e46ba6 + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -15369,7 +15711,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^7.3.1": +"ws@npm:^7.3.1, ws@npm:^7.5.10": version: 7.5.10 resolution: "ws@npm:7.5.10" peerDependencies: @@ -15384,6 +15726,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:^8.5.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 91d4d35bc99ff6df483bdf029b9ea4bfd7af1f16fc91231a96777a63d263e1eabf486e13a2353970efc534f9faa43bdbf9ee76525af22f4752cbc5ebda333975 + languageName: node + linkType: hard + "xdg-app-paths@npm:8.3.0": version: 8.3.0 resolution: "xdg-app-paths@npm:8.3.0"