mirror of
https://github.com/apotdevin/thunderhub.git
synced 2024-11-19 01:40:03 +01:00
[UPDATE] Change the default received onchain address to taproot (#542)
* Changed the default received onchain address to taproot * Update chain.resolver.ts
This commit is contained in:
parent
edc77854f0
commit
8f9cd4a861
@ -425,7 +425,7 @@ type Mutation {
|
||||
bosRebalance(avoid: [String!], in_through: String, max_fee: Float, max_fee_rate: Float, max_rebalance: Float, node: String, out_inbound: Float, out_through: String, timeout_minutes: Float): BosRebalanceResult!
|
||||
claimBoltzTransaction(destination: String!, fee: Float!, preimage: String!, privateKey: String!, redeem: String!, transaction: String!): String!
|
||||
closeChannel(forceClose: Boolean, id: String!, targetConfirmations: Float, tokensPerVByte: Float): OpenOrCloseChannel!
|
||||
createAddress(type: String! = "p2wpkh"): String!
|
||||
createAddress(type: String! = "p2tr"): String!
|
||||
createBaseInvoice(amount: Float!): BaseInvoice!
|
||||
createBoltzReverseSwap(address: String, amount: Float!): CreateBoltzReverseSwapType!
|
||||
createInvoice(amount: Float!, description: String, includePrivate: Boolean, secondsUntil: Float): CreateInvoice!
|
||||
|
@ -65,9 +65,9 @@ const Column = styled.div`
|
||||
`;
|
||||
|
||||
const options = [
|
||||
{ label: 'p2wpkh (Default)', value: 'p2wpkh' },
|
||||
{ label: 'p2tr (Taproot)', value: 'p2tr' },
|
||||
{ label: 'np2wpkh', value: 'np2wpkh' },
|
||||
{ label: 'p2tr (Default)', value: 'p2tr' },
|
||||
{ label: 'p2wpkh (Segwit)', value: 'p2wpkh' },
|
||||
{ label: 'np2wpkh (Nested Segwit)', value: 'np2wpkh' },
|
||||
];
|
||||
|
||||
export const ReceiveOnChainCard = () => {
|
||||
|
@ -14,7 +14,7 @@ export class ChainResolver {
|
||||
constructor(
|
||||
private nodeService: NodeService,
|
||||
@Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger
|
||||
) {}
|
||||
) { }
|
||||
|
||||
@Query(() => [ChainTransaction])
|
||||
async getChainTransactions(@CurrentUser() { id }: UserId) {
|
||||
@ -36,18 +36,18 @@ export class ChainResolver {
|
||||
|
||||
@Mutation(() => String)
|
||||
async createAddress(
|
||||
@Args('type', { defaultValue: 'p2wpkh' })
|
||||
@Args('type', { defaultValue: 'p2tr' })
|
||||
type: string,
|
||||
@CurrentUser() { id }: UserId
|
||||
) {
|
||||
const isValidType = ['np2wpkh', 'p2tr', 'p2wpkh'].includes(type);
|
||||
const isValidType = ['np2wpkh', 'p2wpkh', 'p2tr'].includes(type);
|
||||
|
||||
this.logger.debug('Creating onchain address', { type });
|
||||
|
||||
const { address } = await this.nodeService.createChainAddress(
|
||||
id,
|
||||
true,
|
||||
(isValidType ? type : 'p2wpkh') as any
|
||||
(isValidType ? type : 'p2tr') as any
|
||||
);
|
||||
|
||||
return address;
|
||||
|
Loading…
Reference in New Issue
Block a user