mirror of
https://github.com/alexgo-io/stacks-blockchain-api.git
synced 2026-01-12 16:53:19 +08:00
feat: support tenure_change in tx type filter queries (#1808)
This commit is contained in:
@@ -77,6 +77,7 @@ export function parseTxTypeStrings(values: string[]): TransactionType[] {
|
||||
case 'token_transfer':
|
||||
case 'coinbase':
|
||||
case 'poison_microblock':
|
||||
case 'tenure_change':
|
||||
return v;
|
||||
default:
|
||||
throw new Error(`Unexpected tx type: ${JSON.stringify(v)}`);
|
||||
@@ -98,6 +99,8 @@ export function getTxTypeString(typeId: DbTxTypeId): Transaction['tx_type'] {
|
||||
case DbTxTypeId.Coinbase:
|
||||
case DbTxTypeId.CoinbaseToAltRecipient:
|
||||
return 'coinbase';
|
||||
case DbTxTypeId.TenureChange:
|
||||
return 'tenure_change';
|
||||
default:
|
||||
throw new Error(`Unexpected DbTxTypeId: ${typeId}`);
|
||||
}
|
||||
@@ -139,6 +142,8 @@ export function getTxTypeId(typeString: Transaction['tx_type']): DbTxTypeId[] {
|
||||
return [DbTxTypeId.PoisonMicroblock];
|
||||
case 'coinbase':
|
||||
return [DbTxTypeId.Coinbase, DbTxTypeId.CoinbaseToAltRecipient];
|
||||
case 'tenure_change':
|
||||
return [DbTxTypeId.TenureChange];
|
||||
default:
|
||||
throw new Error(`Unexpected tx type string: ${typeString}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user