mirror of
https://github.com/luxfi/cli.git
synced 2026-10-30 17:01:20 +00:00
35 lines
811 B
Go
35 lines
811 B
Go
// Copyright (C) 2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
package tokentransferrercmd
|
|
|
|
import (
|
|
_ "embed"
|
|
"fmt"
|
|
|
|
"github.com/luxfi/cli/v2/pkg/models"
|
|
"github.com/luxfi/ids"
|
|
)
|
|
|
|
func validateSubnet(network models.Network, subnetName string) error {
|
|
sc, err := app.LoadSidecar(subnetName)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if sc.Networks[network.Name()].BlockchainID == ids.Empty {
|
|
return fmt.Errorf("subnet %s not deployed into %s", subnetName, network.Name())
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func getNativeTokenSymbol(subnetName string, isCChain bool) (string, error) {
|
|
nativeTokenSymbol := "LUX"
|
|
if !isCChain {
|
|
sc, err := app.LoadSidecar(subnetName)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
nativeTokenSymbol = sc.TokenSymbol
|
|
}
|
|
return nativeTokenSymbol, nil
|
|
}
|