stacker.news/wallets/blink/index.js

68 lines
2.1 KiB
JavaScript
Raw Normal View History

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'
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.`,
optional: 'for sending',
requiredWithout: 'apiKeyRecv'
},
{
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',
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'),
optional: 'for sending'
2024-10-16 17:46:33 +00:00
},
{
name: 'apiKeyRecv',
label: 'api key',
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_...',
optional: 'for receiving',
2024-10-22 08:51:33 +00:00
serverOnly: true,
requiredWithout: 'apiKey',
2024-11-02 22:51:38 +00:00
validate: string()
.matches(/^blink_[A-Za-z0-9]+$/, { message: 'must match pattern blink_A-Za-z0-9' })
2024-10-16 17:46:33 +00:00
},
{
name: 'currencyRecv',
label: 'wallet type',
type: 'text',
2024-10-22 08:52:58 +00:00
help: 'the blink wallet to use for receiving (only BTC available)',
2024-10-16 17:46:33 +00:00
value: 'BTC',
clear: true,
autoComplete: 'off',
optional: 'for receiving',
serverOnly: true,
2024-11-02 22:51:38 +00:00
validate: string()
.transform(value => value ? value.toUpperCase() : 'BTC')
.oneOf(['BTC'], 'must be BTC')
}
]
export const card = {
title: 'Blink',
subtitle: 'use [Blink](https://blink.sv/) for payments',
2024-11-02 22:51:38 +00:00
badges: ['send', 'receive']
}