UpdateGlobalVar
type ContractPrice
ContractPrice(
int pairId,
String marketPrice,
)input:
pairId: The contract pair id defined by zkLink.
marketPrice: The market price of the contract pair
type SpotPriceInfo
SpotPriceInfo(
int tokenId,
String price,
)input:
tokenId: The token id defined by zkLink.
price: The spot price of the token.
type FundingInfo
FundingInfo(
int pairId,
String price,
int fundingRate,
)type Parameter
The Parameter struct of UpdateGlobalVar.
func insuranceFundAccount
insuranceFundAccount(int accountId)func feeAccount
feeAccount(int accountId)func marginInfo
marginInfo(
int marginId,
String? symbol,
int tokenId,
int ratio,
)func contractInfo
contractInfo(
int pairId,
String symbol,
int initialMarginRate,
int maintenanceMarginRate,
)func feeAccount
feeAccount(int accountId)func fundingInfos
fundingInfos(List<FundingInfo> infos)type UpdateGlobalVar
UpdateGlobalVar transaction type.
UpdateGlobalVar(
int fromChainId,
int subAccountId,
Parameter parameter,
double serialId,
)func toJson
String toJson()Get the json str of UpdateGlobalVar
Example
var tx = UpdateGlobalVar(
fromChainId: 1,
subAccountId: 2,
parameter: Parameter.feeAccount(accountId: 8),
serialId: 101
);
print(tx.toJson());Last updated
Was this helpful?