From 642a8cb6c5bf09dc8c9a3b7e1611264927220f61 Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Mon, 26 Feb 2024 22:18:57 -0800 Subject: [PATCH 1/3] Bump max duration on all endpoints --- vercel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 25d3984..655e336 100644 --- a/vercel.json +++ b/vercel.json @@ -1,6 +1,6 @@ { "functions": { - "pages/api/fund.ts": { + "pages/api/**/*.ts": { "maxDuration": 60 } } From 157a2e49fa20fae356d6edcfc7730d04c5dcb39e Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Mon, 26 Feb 2024 22:27:36 -0800 Subject: [PATCH 2/3] fix hash/sig algorithm IDs --- lib/crypto.ts | 14 ++++---------- modules.d.ts | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/crypto.ts b/lib/crypto.ts index c47108c..84e19c1 100644 --- a/lib/crypto.ts +++ b/lib/crypto.ts @@ -1,9 +1,3 @@ -import { - ECDSA_P256, - ECDSA_secp256k1, - SHA2_256, - SHA3_256, -} from "@onflow/util-encode-key" import {createHash} from "crypto" import {ec as EC} from "elliptic" import {SHA3} from "sha3" @@ -12,13 +6,13 @@ export type SigAlgoTypes = "ECDSA_P256" | "ECDSA_secp256k1" export type HashAlgoTypes = "SHA2_256" | "SHA3_256" export const SigAlgos: Record = { - ECDSA_P256: ECDSA_P256, - ECDSA_secp256k1: ECDSA_secp256k1, + ECDSA_P256: 1, + ECDSA_secp256k1: 2, } export const HashAlgos: Record = { - SHA2_256: SHA2_256, - SHA3_256: SHA3_256, + SHA2_256: 1, + SHA3_256: 3, } const hashSHA2 = (msg: string) => { diff --git a/modules.d.ts b/modules.d.ts index 7903dce..999e163 100644 --- a/modules.d.ts +++ b/modules.d.ts @@ -102,5 +102,4 @@ declare module "*.cdc" { export default content } -declare module "@onflow/util-encode-key" declare module "@onflow/types" From 51c909ed5505fdf14152b525865a07e632487ed6 Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Mon, 26 Feb 2024 22:40:16 -0800 Subject: [PATCH 3/3] remove util-encode-key --- package-lock.json | 21 --------------------- package.json | 1 - 2 files changed, 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2c26bee..21d2600 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,6 @@ "@hcaptcha/react-hcaptcha": "^0.3.4", "@onflow/fcl": "1.9.0", "@onflow/types": "1.2.1", - "@onflow/util-encode-key": "1.2.1", "@prisma/client": "^4.2.1", "@theme-ui/match-media": "^0.9.1", "clipboard-copy": "^4.0.1", @@ -1601,16 +1600,6 @@ "@babel/runtime": "^7.18.6" } }, - "node_modules/@onflow/util-encode-key": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@onflow/util-encode-key/-/util-encode-key-1.2.1.tgz", - "integrity": "sha512-Blqpi0Xox4sHjxM+Qcu1RP8Li5DbTMSMxnK8+VPjHibbeQXlg+bva7mskgtMcJyjZfemqhRuubjNwTMbwGiOrw==", - "dependencies": { - "@babel/runtime": "^7.18.6", - "@onflow/rlp": "^1.2.1", - "@onflow/util-invariant": "^1.2.1" - } - }, "node_modules/@onflow/util-invariant": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@onflow/util-invariant/-/util-invariant-1.2.1.tgz", @@ -9243,16 +9232,6 @@ "@babel/runtime": "^7.18.6" } }, - "@onflow/util-encode-key": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@onflow/util-encode-key/-/util-encode-key-1.2.1.tgz", - "integrity": "sha512-Blqpi0Xox4sHjxM+Qcu1RP8Li5DbTMSMxnK8+VPjHibbeQXlg+bva7mskgtMcJyjZfemqhRuubjNwTMbwGiOrw==", - "requires": { - "@babel/runtime": "^7.18.6", - "@onflow/rlp": "^1.2.1", - "@onflow/util-invariant": "^1.2.1" - } - }, "@onflow/util-invariant": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@onflow/util-invariant/-/util-invariant-1.2.1.tgz", diff --git a/package.json b/package.json index 1b677ab..9d225a4 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "@hcaptcha/react-hcaptcha": "^0.3.4", "@onflow/fcl": "1.9.0", "@onflow/types": "1.2.1", - "@onflow/util-encode-key": "1.2.1", "@prisma/client": "^4.2.1", "@theme-ui/match-media": "^0.9.1", "clipboard-copy": "^4.0.1",