(koiosType: string)
| 54 | * - 3 = PlutusV3 |
| 55 | */ |
| 56 | export function getScriptRefTag(koiosType: string): number { |
| 57 | const typeMap: Record<string, number> = { |
| 58 | 'native': 0, |
| 59 | 'timelock': 0, |
| 60 | 'multisig': 0, |
| 61 | 'plutusv1': 1, |
| 62 | 'plutusv2': 2, |
| 63 | 'plutusv3': 3, |
| 64 | }; |
| 65 | return typeMap[koiosType.toLowerCase()] ?? 3; // default to PlutusV3 if unknown |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Checks if the bytes are already in ScriptRef format (2-element CBOR array with valid tag) |
no outgoing calls
no test coverage detected