mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 13:05:49 +00:00
add hooks testnet check for autofill
This commit is contained in:
@@ -15,6 +15,7 @@ import { isEarlierVersion } from './utils'
|
||||
const LEDGER_OFFSET = 20
|
||||
const RESTRICTED_NETWORKS = 1024
|
||||
const REQUIRED_NETWORKID_VERSION = '1.11.0'
|
||||
const HOOKS_TESTNET_ID = 21338
|
||||
interface ClassicAccountAndTag {
|
||||
classicAccount: string
|
||||
tag: number | false | undefined
|
||||
@@ -44,9 +45,11 @@ async function autofill<T extends Transaction>(
|
||||
setTransactionFlagsToNumber(tx)
|
||||
const promises: Array<Promise<void>> = []
|
||||
if (this.networkID !== undefined && this.networkID > RESTRICTED_NETWORKS) {
|
||||
// autofill transaction's networkID if either the network is hooks testnet or build version is >= 1.11.0
|
||||
if (
|
||||
this.buildVersion &&
|
||||
isEarlierVersion(this.buildVersion, REQUIRED_NETWORKID_VERSION)
|
||||
(this.buildVersion &&
|
||||
isEarlierVersion(this.buildVersion, REQUIRED_NETWORKID_VERSION)) ||
|
||||
this.networkID === HOOKS_TESTNET_ID
|
||||
) {
|
||||
tx.NetworkID = undefined
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user