2024-10-25 19:10:37 +00:00
import { string } from '@/lib/yup'
2024-10-16 17:46:33 +00:00
import { galoyBlinkDashboardUrl } from 'wallets/blink/common'
2024-08-18 16:36:55 +00:00
export const name = 'blink'
2024-10-14 15:49:06 +00:00
export const walletType = 'BLINK'
export const walletField = 'walletBlink'
2024-08-18 16:36:55 +00:00
export const fields = [
{
name : 'apiKey' ,
label : 'api key' ,
type : 'password' ,
2024-10-25 19:10:37 +00:00
placeholder : 'blink_...' ,
clientOnly : true ,
validate : string ( )
2024-11-02 22:51:38 +00:00
. matches ( /^blink_[A-Za-z0-9]+$/ , { message : 'must match pattern blink_A-Za-z0-9' } ) ,
help : ` you can get an API key from [Blink Dashboard]( ${ galoyBlinkDashboardUrl } ). \n Please make sure to select ONLY the 'Read' and 'Write' scopes when generating this API key. ` ,
2024-11-05 00:39:52 +00:00
requiredWithout : 'apiKeyRecv' ,
optional : 'for sending'
2024-08-18 16:36:55 +00:00
} ,
{
name : 'currency' ,
label : 'wallet type' ,
type : 'text' ,
2024-10-22 08:52:58 +00:00
help : 'the blink wallet to use for sending (BTC or USD for stablesats)' ,
2024-08-18 16:36:55 +00:00
placeholder : 'BTC' ,
2024-11-05 15:27:48 +00:00
defaultValue : 'BTC' ,
2024-08-18 16:36:55 +00:00
clear : true ,
2024-10-25 19:10:37 +00:00
autoComplete : 'off' ,
clientOnly : true ,
validate : string ( )
. transform ( value => value ? value . toUpperCase ( ) : 'BTC' )
2024-11-02 22:51:38 +00:00
. oneOf ( [ 'USD' , 'BTC' ] , 'must be BTC or USD' ) ,
2024-11-05 00:39:52 +00:00
optional : 'for sending' ,
requiredWithout : 'currencyRecv'
2024-10-16 17:46:33 +00:00
} ,
{
name : 'apiKeyRecv' ,
2024-11-05 00:39:52 +00:00
label : 'receive api key' ,
2024-10-16 17:46:33 +00:00
type : 'password' ,
help : ` you can get an API key from [Blink Dashboard]( ${ galoyBlinkDashboardUrl } ). \n Please make sure to select ONLY the 'Read' and 'Receive' scopes when generating this API key. ` ,
placeholder : 'blink_...' ,
2024-10-22 08:51:33 +00:00
serverOnly : true ,
2024-11-02 22:51:38 +00:00
validate : string ( )
2024-11-05 00:39:52 +00:00
. matches ( /^blink_[A-Za-z0-9]+$/ , { message : 'must match pattern blink_A-Za-z0-9' } ) ,
optional : 'for receiving' ,
requiredWithout : 'apiKey'
2024-10-16 17:46:33 +00:00
} ,
{
name : 'currencyRecv' ,
2024-11-05 00:39:52 +00:00
label : 'receive wallet type' ,
2024-10-16 17:46:33 +00:00
type : 'text' ,
2024-10-22 08:52:58 +00:00
help : 'the blink wallet to use for receiving (only BTC available)' ,
2024-11-05 15:27:48 +00:00
defaultValue : 'BTC' ,
2024-10-16 17:46:33 +00:00
clear : true ,
autoComplete : 'off' ,
2024-11-05 00:39:52 +00:00
placeholder : 'BTC' ,
2024-10-16 17:46:33 +00:00
serverOnly : true ,
2024-11-02 22:51:38 +00:00
validate : string ( )
. transform ( value => value ? value . toUpperCase ( ) : 'BTC' )
2024-11-05 00:39:52 +00:00
. oneOf ( [ 'BTC' ] , 'must be BTC' ) ,
optional : 'for receiving' ,
requiredWithout : 'currency'
2024-08-18 16:36:55 +00:00
}
]
export const card = {
title : 'Blink' ,
subtitle : 'use [Blink](https://blink.sv/) for payments' ,
2024-11-02 22:51:38 +00:00
badges : [ 'send' , 'receive' ]
2024-08-18 16:36:55 +00:00
}