Skip to content

Commit 107b921

Browse files
authored
Merge pull request #351 from blocknative/fix/wallet-check-customization
Fix: Wallet Check Customization #348
2 parents 922355c + 687e9df commit 107b921

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/interfaces.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ export type AllWalletInitOptions = CommonWalletOptions &
251251

252252
export interface WalletCheckInit {
253253
checkName: string
254+
heading?: string
255+
description?: string
254256
minimumBalance?: string
255257
}
256258

src/validation.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,36 @@ function validateWalletCheck(
337337
validateWalletCheckModule(check)
338338
} else {
339339
validateType({ name: 'walletCheck item', value: check, type: 'object' })
340-
const { checkName, minimumBalance, ...otherParams } = check
340+
const {
341+
checkName,
342+
heading,
343+
description,
344+
minimumBalance,
345+
...otherParams
346+
} = check
347+
341348
invalidParams(
342349
otherParams,
343-
['checkName', 'minimumBalance'],
350+
['checkName', 'heading', 'description', 'minimumBalance'],
344351
'walletCheck item'
345352
)
353+
346354
validateType({ name: 'checkName', value: checkName, type: 'string' })
355+
356+
validateType({
357+
name: 'heading',
358+
value: heading,
359+
type: 'string',
360+
optional: true
361+
})
362+
363+
validateType({
364+
name: 'description',
365+
value: description,
366+
type: 'string',
367+
optional: true
368+
})
369+
347370
validateType({
348371
name: 'minimumBalance',
349372
value: minimumBalance,

0 commit comments

Comments
 (0)