Skip to content

Commit 5cfc5ad

Browse files
authored
[Fixes] : GCP KMS + Trigger overflow issue (#174)
* updated trigger. Removed deprecated deployReleasedContract with deployPublishedContract * updated the package to nightly. updated server to not log import end-point details * sdks updated to new nightly & possible fix for GCP Auth issue
1 parent b610d90 commit 5cfc5ad

File tree

6 files changed

+29
-14
lines changed

6 files changed

+29
-14
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
"@sinclair/typebox": "^0.28",
4343
"@t3-oss/env-core": "^0.6.0",
4444
"@thirdweb-dev/chains": "^0.1.46",
45-
"@thirdweb-dev/sdk": "^3.10.63-nightly-c085d690-20230927234230",
45+
"@thirdweb-dev/sdk": "^3.10.63-nightly-eb9e9f0c-20230928174429",
4646
"@thirdweb-dev/service-utils": "^0.4.2",
47-
"@thirdweb-dev/wallets": "^1.3.1-nightly-c085d690-20230927234230",
47+
"@thirdweb-dev/wallets": "^1.3.1-nightly-eb9e9f0c-20230928174429",
4848
"body-parser": "^1.20.2",
4949
"cookie": "^0.5.0",
5050
"copyfiles": "^2.4.1",

server/api/deploy/published.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export async function deployPublished(fastify: FastifyInstance) {
6868
const accountAddress = request.headers["x-account-address"] as string;
6969

7070
const sdk = await getSdk({ chainId, walletAddress, accountAddress });
71-
const tx = await sdk.deployer.deployReleasedContract.prepare(
71+
const tx = await sdk.deployer.deployPublishedContract.prepare(
7272
publisher,
7373
contract_name,
7474
constructorParams,

server/helpers/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ const createServer = async (): Promise<FastifyInstance> => {
6464
server.addHook("preHandler", async (request, reply) => {
6565
if (
6666
!request.routerPath?.includes("static") &&
67-
!request.routerPath?.includes("json")
67+
!request.routerPath?.includes("json") &&
68+
!request.routerPath?.includes("/backend-wallet/import")
6869
) {
6970
if (request.body && Object.keys(request.body).length > 0) {
7071
request.log.info({ ...request.body }, "Request Body : ");

server/utils/wallets/createGcpKmsWallet.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export const createGcpKmsWallet = async (): Promise<string> => {
1212
const client = new KeyManagementServiceClient({
1313
credentials: {
1414
client_email: env.WALLET_CONFIGURATION.gcpApplicationCredentialEmail,
15-
private_key: env.WALLET_CONFIGURATION.gcpApplicationCredentialPrivateKey,
15+
private_key: env.WALLET_CONFIGURATION.gcpApplicationCredentialPrivateKey
16+
.split(String.raw`\n`)
17+
.join("\n"),
1618
},
1719
projectId: env.WALLET_CONFIGURATION.gcpApplicationProjectId,
1820
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- AlterTable
2+
CREATE OR REPLACE FUNCTION notify_transactions_insert()
3+
RETURNS TRIGGER
4+
LANGUAGE plpgsql
5+
AS $function$
6+
BEGIN
7+
PERFORM pg_notify('new_transaction_data', json_build_object(
8+
'id', NEW.id
9+
)::text);
10+
RETURN NEW;
11+
END;
12+
$function$;

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,10 +2828,10 @@
28282828
resolved "https://registry.yarnpkg.com/@thirdweb-dev/generated-abis/-/generated-abis-0.0.1.tgz#0d788d6aff0ac08f11e9eeb9ae4c8321845272a8"
28292829
integrity sha512-vO9/3lSLO8smyyH1QVeYravSTzFwV1nf1C/Im1NBDPdH8//YvcbhtETGGiNfHWpyCvSi0vRYwvf+/7FKdwpDGQ==
28302830

2831-
"@thirdweb-dev/sdk@3.10.63-nightly-c085d690-20230927234230", "@thirdweb-dev/sdk@^3.10.63-nightly-c085d690-20230927234230":
2832-
version "3.10.63-nightly-c085d690-20230927234230"
2833-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-3.10.63-nightly-c085d690-20230927234230.tgz#f4e6f4963252c12a975da4eb3ec08bd99b267278"
2834-
integrity sha512-A2GbH3GthBlfC9WTODsJlveMjHMB0oCZfa7nuzb1Sj2F9+RSA1AwtX8tWCXuUEhw8RpCs+6Ymt2Gcyzc9Wb0KQ==
2831+
"@thirdweb-dev/sdk@3.10.63-nightly-eb9e9f0c-20230928174429", "@thirdweb-dev/sdk@^3.10.63-nightly-eb9e9f0c-20230928174429":
2832+
version "3.10.63-nightly-eb9e9f0c-20230928174429"
2833+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-3.10.63-nightly-eb9e9f0c-20230928174429.tgz#08b5f180fe05712efbe600b0bb85137c5b860214"
2834+
integrity sha512-7gFPdxs4Li1Sk90TH/yUVuxVl0e6XrzXuKxLCnkFvKTRTc0ErGDYzuVT75O2104H/IfGZTKBzRfoiEEhPYpHwQ==
28352835
dependencies:
28362836
"@thirdweb-dev/chains" "0.1.53"
28372837
"@thirdweb-dev/contracts-js" "1.3.13"
@@ -2869,10 +2869,10 @@
28692869
form-data "^4.0.0"
28702870
uuid "^9.0.0"
28712871

2872-
"@thirdweb-dev/wallets@^1.3.1-nightly-c085d690-20230927234230":
2873-
version "1.3.1-nightly-c085d690-20230927234230"
2874-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/wallets/-/wallets-1.3.1-nightly-c085d690-20230927234230.tgz#df914f2fe0c3dc1abf930bca3da744367fe143a4"
2875-
integrity sha512-1hOJuu78pGJ7FptJg4+t9iVx8EbYLIufuUzB4326qUEVcziuTm0YR04DKkkein14zJzKUFTo1xUeULHpALPr7g==
2872+
"@thirdweb-dev/wallets@^1.3.1-nightly-eb9e9f0c-20230928174429":
2873+
version "1.3.1-nightly-eb9e9f0c-20230928174429"
2874+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/wallets/-/wallets-1.3.1-nightly-eb9e9f0c-20230928174429.tgz#a0e93b2c283740cb498a93fff70845aabde9a1e9"
2875+
integrity sha512-LM4HJ/vkDfJamUfg9t6smqh1Bojelx8WzK3PtlcEp0H9krOReeymQs7Ltq/f2xDNbBjnDH2so9TwataiZKb8cw==
28762876
dependencies:
28772877
"@account-abstraction/contracts" "^0.5.0"
28782878
"@account-abstraction/sdk" "^0.5.0"
@@ -2889,7 +2889,7 @@
28892889
"@safe-global/safe-ethers-lib" "^1.9.4"
28902890
"@thirdweb-dev/chains" "0.1.53"
28912891
"@thirdweb-dev/contracts-js" "1.3.13"
2892-
"@thirdweb-dev/sdk" "3.10.63-nightly-c085d690-20230927234230"
2892+
"@thirdweb-dev/sdk" "3.10.63-nightly-eb9e9f0c-20230928174429"
28932893
"@walletconnect/core" "^2.9.1"
28942894
"@walletconnect/ethereum-provider" "^2.9.1"
28952895
"@walletconnect/jsonrpc-utils" "^1.0.8"

0 commit comments

Comments
 (0)