stacker.news/wallets/blink/index.js

72 lines
2.2 KiB
JavaScript
Raw Normal View History

2024-10-25 19:10:37 +00:00
import { string } from '@/lib/yup'
import { galoyBlinkDashboardUrl } from '@/wallets/blink/common'
export const name = 'blink'
export const walletType = 'BLINK'
export const walletField = 'walletBlink'
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}).\nPlease 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'
},
{
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)',
placeholder: 'BTC',
2024-11-05 15:27:48 +00:00
defaultValue: 'BTC',
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}).\nPlease 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'
}
]
export const card = {
title: 'Blink',
subtitle: 'use [Blink](https://blink.sv/) for payments',
image: { src: '/wallets/blink.svg' }
}