Skip to content

Commit 163ce8c

Browse files
authored
Updated SDK (#407)
* Updated SDK * sdk updates + new SDK configs * config upds
1 parent 635faeb commit 163ce8c

File tree

4 files changed

+38
-26
lines changed

4 files changed

+38
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@t3-oss/env-core": "^0.6.0",
4444
"@thirdweb-dev/auth": "^4.1.27",
4545
"@thirdweb-dev/chains": "0.1.70",
46-
"@thirdweb-dev/sdk": "4.0.35-nightly-53786fc3-20240210010923",
46+
"@thirdweb-dev/sdk": "0.0.0-dev-d3311a1-20240210064223",
4747
"@thirdweb-dev/service-utils": "^0.4.2",
4848
"@thirdweb-dev/wallets": "^2.1.5",
4949
"body-parser": "^1.20.2",

src/utils/cache/getSdk.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export const getSdk = async ({
112112
sdk = new ThirdwebSDK(chain!, {
113113
secretKey: env.THIRDWEB_API_SECRET_KEY,
114114
supportedChains: config.chainOverrides ? RPC_OVERRIDES : undefined,
115+
rpcBatchSettings: {
116+
sizeLimit: env.SDK_BATCH_SIZE_LIMIT,
117+
timeLimit: env.SDK_BATCH_TIME_LIMIT,
118+
},
115119
});
116120
} else {
117121
const wallet = await getWallet({
@@ -123,6 +127,10 @@ export const getSdk = async ({
123127
sdk = await ThirdwebSDK.fromWallet(wallet, chainId, {
124128
secretKey: env.THIRDWEB_API_SECRET_KEY,
125129
supportedChains: config.chainOverrides ? RPC_OVERRIDES : undefined,
130+
rpcBatchSettings: {
131+
sizeLimit: env.SDK_BATCH_SIZE_LIMIT,
132+
timeLimit: env.SDK_BATCH_TIME_LIMIT,
133+
},
126134
});
127135
}
128136

src/utils/env.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export const env = createEnv({
7171
ENABLE_HTTPS: boolSchema("false"),
7272
HTTPS_PASSPHRASE: z.string().default("thirdweb-engine"),
7373
PRUNE_TRANSACTIONS: boolSchema("true"),
74+
SDK_BATCH_TIME_LIMIT: z.coerce.number().default(0),
75+
SDK_BATCH_SIZE_LIMIT: z.coerce.number().default(100),
7476
},
7577
clientPrefix: "NEVER_USED",
7678
client: {},
@@ -88,6 +90,8 @@ export const env = createEnv({
8890
ENABLE_HTTPS: process.env.ENABLE_HTTPS,
8991
HTTPS_PASSPHRASE: process.env.HTTPS_PASSPHRASE,
9092
PRUNE_TRANSACTIONS: process.env.PRUNE_TRANSACTIONS,
93+
SDK_BATCH_TIME_LIMIT: process.env.SDK_BATCH_TIME_LIMIT,
94+
SDK_BATCH_SIZE_LIMIT: process.env.SDK_BATCH_SIZE_LIMIT,
9195
},
9296
onValidationError: (error: ZodError) => {
9397
console.error(

yarn.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3522,10 +3522,10 @@
35223522
resolved "https://registry.yarnpkg.com/@thirdweb-dev/chains/-/chains-0.1.70.tgz#b3a83314146753c494be3ca59a832df05f366e6b"
35233523
integrity sha512-VP+JE70wNpbFa0rnKifTxxCXZwbKROf54z7qclxfb9tT1SY0/aIhVee0PYSxPXMd82NTkFkEidGFWS7TbYoldg==
35243524

3525-
"@thirdweb-dev/chains@0.1.72-nightly-53786fc3-20240210010923":
3526-
version "0.1.72-nightly-53786fc3-20240210010923"
3527-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/chains/-/chains-0.1.72-nightly-53786fc3-20240210010923.tgz#ac2f0ab0c37c4bb71d3fd4096e3279ab5b2f70cb"
3528-
integrity sha512-1s/WaOLRAuFEeDyZ5XtrSg31Ox69LlRqPsL/x7Nqqun+1OOB8iWor/yAb7xv34W2RT7f8FUcmvqPXkcFpd/Aiw==
3525+
"@thirdweb-dev/chains@0.1.72":
3526+
version "0.1.72"
3527+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/chains/-/chains-0.1.72.tgz#ff3a54a1ba6d7cbf3814d84345c1106678a8e2ab"
3528+
integrity sha512-IAq66KT8HgsmP85p0ykpUZNCwSGubmadlgvCG5We8sgOFBlerX/CuFZwHh9szVbptLX6yDAg6ueN5WwgLOGyHg==
35293529

35303530
"@thirdweb-dev/contracts-js@1.3.16":
35313531
version "1.3.16"
@@ -3573,62 +3573,62 @@
35733573
buffer-reverse "^1.0.1"
35743574
treeify "^1.1.0"
35753575

3576-
"@thirdweb-dev/sdk@4.0.13":
3577-
version "4.0.13"
3578-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-4.0.13.tgz#8e960271d019bfdcce553c8665b5dd2874d27f83"
3579-
integrity sha512-466UxsdqS6j+UW7gim64g8dOBZ4XVp/p7uV7bKdFNgYC2fM8OQk3aidg0BfL3J00VwzKabjJmdA8gR506NTACQ==
3576+
"@thirdweb-dev/sdk@0.0.0-dev-d3311a1-20240210064223":
3577+
version "0.0.0-dev-d3311a1-20240210064223"
3578+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-0.0.0-dev-d3311a1-20240210064223.tgz#7187bbb24938795048d1e141ee7185857f59acd3"
3579+
integrity sha512-zTzyhwruhCy+y4bZNaKcN6E21UetzOjuIWcgTGBHmp1ePzckg/KlCU3GMUnJM+ETyeMivIkLALImUvWBHoW2tA==
35803580
dependencies:
3581-
"@thirdweb-dev/chains" "0.1.58"
3581+
"@thirdweb-dev/chains" "0.1.72"
35823582
"@thirdweb-dev/contracts-js" "1.3.16"
3583+
"@thirdweb-dev/crypto" "0.2.0"
35833584
"@thirdweb-dev/generated-abis" "0.0.1"
3584-
"@thirdweb-dev/storage" "2.0.4"
3585+
"@thirdweb-dev/merkletree" "0.2.0"
3586+
"@thirdweb-dev/storage" "2.0.9"
35853587
abitype "^0.2.5"
35863588
bn.js "^5.2.1"
35873589
bs58 "^5.0.0"
35883590
buffer "^6.0.3"
35893591
eventemitter3 "^5.0.1"
35903592
fast-deep-equal "^3.1.3"
3591-
merkletreejs "^0.2.24"
35923593
tiny-invariant "^1.2.0"
35933594
tweetnacl "^1.0.3"
35943595
uuid "^9.0.1"
35953596
yaml "^2.3.1"
35963597
zod "^3.22.3"
35973598

3598-
"@thirdweb-dev/sdk@4.0.30":
3599-
version "4.0.30"
3600-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-4.0.30.tgz#260604ec23ae3b99e1c025c773e5170efcc5fe82"
3601-
integrity sha512-fpXwvfDCid2Ra/Dfqf/1jUVpAP+8GAPYichetKAL1VIjQ8ub2c31qtRkWS4aSz9asf/cW5nxS7N2hfvdXLPWNg==
3599+
"@thirdweb-dev/sdk@4.0.13":
3600+
version "4.0.13"
3601+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-4.0.13.tgz#8e960271d019bfdcce553c8665b5dd2874d27f83"
3602+
integrity sha512-466UxsdqS6j+UW7gim64g8dOBZ4XVp/p7uV7bKdFNgYC2fM8OQk3aidg0BfL3J00VwzKabjJmdA8gR506NTACQ==
36023603
dependencies:
3603-
"@thirdweb-dev/chains" "0.1.67"
3604+
"@thirdweb-dev/chains" "0.1.58"
36043605
"@thirdweb-dev/contracts-js" "1.3.16"
3605-
"@thirdweb-dev/crypto" "0.2.0"
36063606
"@thirdweb-dev/generated-abis" "0.0.1"
3607-
"@thirdweb-dev/merkletree" "0.2.0"
3608-
"@thirdweb-dev/storage" "2.0.8"
3607+
"@thirdweb-dev/storage" "2.0.4"
36093608
abitype "^0.2.5"
36103609
bn.js "^5.2.1"
36113610
bs58 "^5.0.0"
36123611
buffer "^6.0.3"
36133612
eventemitter3 "^5.0.1"
36143613
fast-deep-equal "^3.1.3"
3614+
merkletreejs "^0.2.24"
36153615
tiny-invariant "^1.2.0"
36163616
tweetnacl "^1.0.3"
36173617
uuid "^9.0.1"
36183618
yaml "^2.3.1"
36193619
zod "^3.22.3"
36203620

3621-
"@thirdweb-dev/sdk@4.0.35-nightly-53786fc3-20240210010923":
3622-
version "4.0.35-nightly-53786fc3-20240210010923"
3623-
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-4.0.35-nightly-53786fc3-20240210010923.tgz#b599affbf051787212d45728e15c637f88522b64"
3624-
integrity sha512-/P+FeRIQBX9AYxE5D3go3xGatd6475ezxJfMzmaeTfw+YUt2UZsFD0IlcdBlmD+3t/whGrWclIxXWc4RKa2kpA==
3621+
"@thirdweb-dev/sdk@4.0.30":
3622+
version "4.0.30"
3623+
resolved "https://registry.yarnpkg.com/@thirdweb-dev/sdk/-/sdk-4.0.30.tgz#260604ec23ae3b99e1c025c773e5170efcc5fe82"
3624+
integrity sha512-fpXwvfDCid2Ra/Dfqf/1jUVpAP+8GAPYichetKAL1VIjQ8ub2c31qtRkWS4aSz9asf/cW5nxS7N2hfvdXLPWNg==
36253625
dependencies:
3626-
"@thirdweb-dev/chains" "0.1.72-nightly-53786fc3-20240210010923"
3626+
"@thirdweb-dev/chains" "0.1.67"
36273627
"@thirdweb-dev/contracts-js" "1.3.16"
36283628
"@thirdweb-dev/crypto" "0.2.0"
36293629
"@thirdweb-dev/generated-abis" "0.0.1"
36303630
"@thirdweb-dev/merkletree" "0.2.0"
3631-
"@thirdweb-dev/storage" "2.0.9"
3631+
"@thirdweb-dev/storage" "2.0.8"
36323632
abitype "^0.2.5"
36333633
bn.js "^5.2.1"
36343634
bs58 "^5.0.0"

0 commit comments

Comments
 (0)