From efca37231581500ae6bc34e43ba93a258acb2f1e Mon Sep 17 00:00:00 2001 From: GG <863867759@qq.com> Date: Mon, 9 Dec 2024 22:26:02 +0800 Subject: [PATCH] fix: unaligned 64-bit atomic operation. --- core/aptos/dapp.go | 14 +++++----- core/aptos/token.go | 7 +++-- core/base/nft.go | 13 ++++----- core/base/reach_monitor.go | 6 ++--- core/base/transaction.go | 7 ++--- core/btc/brc20_mint.go | 24 ++++++++--------- core/btc/brc20_token.go | 48 +++++++++++++++++----------------- core/btc/brc20_transfer.go | 10 +++---- core/btc/brc20_types.go | 12 ++++----- core/btc/transaction_decode.go | 5 ++-- core/cosmos/account.go | 2 +- core/doge/transaction.go | 2 +- core/eth/ethchain.go | 2 +- core/eth/ethchain_zksync.go | 6 ++--- core/eth/nft.go | 5 ++-- core/eth/types.go | 2 +- core/solana/spltoken.go | 2 +- core/sui/chain.go | 3 +-- core/sui/chain_stake.go | 28 ++++++++++---------- core/sui/merge_split.go | 7 ++--- core/sui/sui_cat_types.go | 10 +++---- core/sui/transaction.go | 4 +-- pkg/httpUtil/httpReq.go | 2 +- 23 files changed, 111 insertions(+), 110 deletions(-) diff --git a/core/aptos/dapp.go b/core/aptos/dapp.go index 620da18..73704cc 100644 --- a/core/aptos/dapp.go +++ b/core/aptos/dapp.go @@ -13,24 +13,24 @@ import ( ) type SignMessagePayload struct { + // A nonce the dApp should generate + Nonce int64 `json:"nonce"` + // The message to be signed and displayed to the user + Message string `json:"message"` // Should we include the address of the account in the message Address bool `json:"address,omitempty"` // Should we include the domain of the dApp Application bool `json:"application,omitempty"` // Should we include the current chain id the wallet is connected to ChainId bool `json:"chainId,omitempty"` - // The message to be signed and displayed to the user - Message string `json:"message"` - // A nonce the dApp should generate - Nonce int64 `json:"nonce"` } type SignMessageResponse struct { - Address string `json:"address,omitempty"` - Application string `json:"application,omitempty"` ChainId int64 `json:"chainId,omitempty"` - Message string `json:"message"` // The message passed in by the user Nonce int64 `json:"nonce"` + Address string `json:"address,omitempty"` + Application string `json:"application,omitempty"` + Message string `json:"message"` // The message passed in by the user Prefix string `json:"prefix"` // Should always be APTOS FullMessage string `json:"fullMessage"` // The message that was generated to sign Signature string `json:"signature"` // The signed full message diff --git a/core/aptos/token.go b/core/aptos/token.go index 2ac13d4..0e03852 100644 --- a/core/aptos/token.go +++ b/core/aptos/token.go @@ -18,9 +18,8 @@ const ( ) type Token struct { - chain *Chain - token txbuilder.TypeTagStruct + chain *Chain } func NewMainToken(chain *Chain) *Token { @@ -34,7 +33,7 @@ func NewToken(chain *Chain, tag string) (*Token, error) { if err != nil { return nil, err } - return &Token{chain, *token}, nil + return &Token{*token, chain}, nil } // MARK - Implement the protocol Token @@ -59,9 +58,9 @@ func (t *Token) TokenInfo() (*base.TokenInfo, error) { return nil, err } info := struct { - Decimals int16 `json:"decimals"` Name string `json:"name"` Symbol string `json:"symbol"` + Decimals int16 `json:"decimals"` }{} err = json.Unmarshal(jsonData, &info) if err != nil { diff --git a/core/base/nft.go b/core/base/nft.go index 164050c..e3d46b7 100644 --- a/core/base/nft.go +++ b/core/base/nft.go @@ -10,7 +10,13 @@ import ( ) type NFT struct { - Timestamp int64 `json:"timestamp"` + Timestamp int64 `json:"timestamp"` + + // Aptos token's largest_property_version + AptTokenVersion int64 `json:"apt_token_version"` + // Aptos token's amount + AptAmount int64 `json:"apt_amount"` + HashString string `json:"hashString"` Id string `json:"id"` @@ -22,11 +28,6 @@ type NFT struct { ContractAddress string `json:"contract_address"` RelatedUrl string `json:"related_url"` - - // Aptos token's largest_property_version - AptTokenVersion int64 `json:"apt_token_version"` - // Aptos token's amount - AptAmount int64 `json:"apt_amount"` } func (n *NFT) GroupName() string { diff --git a/core/base/reach_monitor.go b/core/base/reach_monitor.go index 7616bcc..ff6f3fb 100644 --- a/core/base/reach_monitor.go +++ b/core/base/reach_monitor.go @@ -10,9 +10,9 @@ import ( const reachFailedTime int64 = -1 type RpcLatency struct { - RpcUrl string `json:"rpcUrl"` Latency int64 `json:"latency"` Height int64 `json:"height"` + RpcUrl string `json:"rpcUrl"` } // You can customize the test latency method of rpc @@ -31,12 +31,12 @@ type ReachMonitorDelegate interface { } type ReachMonitor struct { - // The number of network connectivity tests to be performed per rpc. 0 means infinite, default is 1 - ReachCount int // Timeout for each connectivity test (ms). default 20000ms Timeout int64 // Time interval between two network connectivity tests (ms). default 1500ms Delay int64 + // The number of network connectivity tests to be performed per rpc. 0 means infinite, default is 1 + ReachCount int reachability RpcReachability diff --git a/core/base/transaction.go b/core/base/transaction.go index 5f24bdf..63cd80b 100644 --- a/core/base/transaction.go +++ b/core/base/transaction.go @@ -27,6 +27,10 @@ const ( // Transaction details that can be fetched from the chain type TransactionDetail struct { + // transaction completion timestamp (s), 0 if Status is in Pending + FinishTimestamp int64 + Status TransactionStatus + // hash string on chain HashString string @@ -40,9 +44,6 @@ type TransactionDetail struct { // receiver's address ToAddress string - Status TransactionStatus - // transaction completion timestamp (s), 0 if Status is in Pending - FinishTimestamp int64 // failure message FailureMessage string diff --git a/core/btc/brc20_mint.go b/core/btc/brc20_mint.go index 1f935f2..31d70fe 100644 --- a/core/btc/brc20_mint.go +++ b/core/btc/brc20_mint.go @@ -13,6 +13,12 @@ import ( ) type Brc20MintTransaction struct { + NetworkFee int64 `json:"network_fee"` + SatpointFee int64 `json:"satpoint_fee"` + ServiceFee int64 `json:"service_fee"` + CommitFee int64 `json:"commit_fee"` + CommitVsize int64 `json:"commit_vsize"` + CommitId string `json:"commit_id"` Commit string `json:"commit"` Reveal *base.StringArray `json:"reveal"` @@ -20,12 +26,6 @@ type Brc20MintTransaction struct { CommitCustom *Brc20CommitCustom `json:"commit_custom"` - NetworkFee int64 `json:"network_fee"` - SatpointFee int64 `json:"satpoint_fee"` - ServiceFee int64 `json:"service_fee"` - CommitFee int64 `json:"commit_fee"` - CommitVsize int64 `json:"commit_vsize"` - signedTxn *SignedPsbtTransaction } @@ -159,18 +159,18 @@ func (c *Chain) BuildBrc20MintWithPostage(sender, receiver string, op, ticker, a } var r struct { + NetworkFee int64 `json:"network_fee"` + SatpointFee int64 `json:"satpoint_fee"` + ServiceFee int64 `json:"service_fee"` + CommitFee int64 `json:"commit_fee"` + CommitVsize int64 `json:"commit_vsize"` + CommitId string `json:"commit_id"` CommitPsbt string `json:"commit_psbt"` RevealTxs *base.StringArray `json:"reveal_txs"` RevealIds *base.StringArray `json:"reveal_ids"` CommitCustom *Brc20CommitCustom `json:"commit_custom"` - - NetworkFee int64 `json:"network_fee"` - SatpointFee int64 `json:"satpoint_fee"` - ServiceFee int64 `json:"service_fee"` - CommitFee int64 `json:"commit_fee"` - CommitVsize int64 `json:"commit_vsize"` } err = json.Unmarshal(resp.Body, &r) if err != nil { diff --git a/core/btc/brc20_token.go b/core/btc/brc20_token.go index 7396677..b47d52e 100644 --- a/core/btc/brc20_token.go +++ b/core/btc/brc20_token.go @@ -98,30 +98,30 @@ func (t *Brc20Token) FullTokenInfo() (info *Brc20TokenInfo, err error) { } type Brc20TokenInfo struct { - Ticker string `json:"ticker"` - HoldersCount int64 `json:"holdersCount"` - HistoryCount int64 `json:"historyCount"` - InscriptionNumber int64 `json:"inscriptionNumber"` - InscriptionId string `json:"inscriptionId"` - Max string `json:"max"` - Limit string `json:"limit"` - Minted string `json:"minted"` - TotalMinted string `json:"totalMinted"` - ConfirmedMinted string `json:"confirmedMinted"` - ConfirmedMinted1h string `json:"confirmedMinted1H"` - ConfirmedMinted24h string `json:"confirmedMinted24H"` - MintTimes int64 `json:"mintTimes"` - Decimal int16 `json:"decimal"` - Creator string `json:"creator"` - Txid string `json:"txid"` - DeployHeight int64 `json:"deployHeight"` - DeployBlocktime int64 `json:"deployBlocktime"` - CompleteHeight int64 `json:"completeHeight"` - CompleteBlocktime int64 `json:"completeBlocktime"` - InscriptionNumberStart int64 `json:"inscriptionNumberStart"` - InscriptionNumberEnd int64 `json:"inscriptionNumberEnd"` - - Price float64 `json:"price"` + Price float64 `json:"price"` + HoldersCount int64 `json:"holdersCount"` + HistoryCount int64 `json:"historyCount"` + InscriptionNumber int64 `json:"inscriptionNumber"` + MintTimes int64 `json:"mintTimes"` + DeployHeight int64 `json:"deployHeight"` + DeployBlocktime int64 `json:"deployBlocktime"` + CompleteHeight int64 `json:"completeHeight"` + CompleteBlocktime int64 `json:"completeBlocktime"` + InscriptionNumberStart int64 `json:"inscriptionNumberStart"` + InscriptionNumberEnd int64 `json:"inscriptionNumberEnd"` + + Ticker string `json:"ticker"` + InscriptionId string `json:"inscriptionId"` + Max string `json:"max"` + Limit string `json:"limit"` + Minted string `json:"minted"` + TotalMinted string `json:"totalMinted"` + ConfirmedMinted string `json:"confirmedMinted"` + ConfirmedMinted1h string `json:"confirmedMinted1H"` + ConfirmedMinted24h string `json:"confirmedMinted24H"` + Decimal int16 `json:"decimal"` + Creator string `json:"creator"` + Txid string `json:"txid"` } func (j *Brc20TokenInfo) JsonString() (*base.OptionalString, error) { diff --git a/core/btc/brc20_transfer.go b/core/btc/brc20_transfer.go index daff90b..42410fb 100644 --- a/core/btc/brc20_transfer.go +++ b/core/btc/brc20_transfer.go @@ -13,11 +13,11 @@ import ( ) type Brc20TransferTransaction struct { - Transaction string `json:"transaction"` NetworkFee int64 `json:"network_fee"` - CommitId string `json:"commit_id"` CommitFee int64 `json:"commit_fee"` CommitVsize int64 `json:"commit_vsize"` + Transaction string `json:"transaction"` + CommitId string `json:"commit_id"` CommitCustom *Brc20CommitCustom `json:"commit_custom"` } @@ -82,12 +82,12 @@ func (c *Chain) BuildBrc20TransferTransaction( } var r struct { - Commit_id string `json:"commit_id"` - Commit_psbt string `json:"commit_psbt"` Commit_fee int64 `json:"commit_fee"` Commit_vsize int64 `json:"commit_vsize"` - Commit_custom *Brc20CommitCustom `json:"commit_custom"` Network_fee int64 `json:"network_fee"` + Commit_id string `json:"commit_id"` + Commit_psbt string `json:"commit_psbt"` + Commit_custom *Brc20CommitCustom `json:"commit_custom"` } err = json.Unmarshal(resp.Body, &r) if err != nil { diff --git a/core/btc/brc20_types.go b/core/btc/brc20_types.go index 5e61f54..645bd9a 100644 --- a/core/btc/brc20_types.go +++ b/core/btc/brc20_types.go @@ -62,16 +62,16 @@ type rawBrc20TokenBalancePage struct { // - MARK - type Brc20Inscription struct { - InscriptionId string `json:"inscriptionId"` InscriptionNumber int64 `json:"inscriptionNumber"` - Address string `json:"address"` OutputValue int64 `json:"outputValue"` + ContentLength int64 `json:"contentLength"` + Timestamp int64 `json:"timestamp"` + InscriptionId string `json:"inscriptionId"` + Address string `json:"address"` Preview string `json:"preview"` Content string `json:"content"` - ContentLength int64 `json:"contentLength"` ContentType string `json:"contentType"` ContentBody string `json:"contentBody"` - Timestamp int64 `json:"timestamp"` GenesisTransaction string `json:"genesisTransaction"` Location string `json:"location"` Output string `json:"output"` @@ -141,8 +141,8 @@ func (bp *Brc20InscriptionPage) AsNFTPage() *NFTPage { } type Brc20TransferableInscription struct { - InscriptionId string `json:"inscriptionId"` InscriptionNumber int64 `json:"inscriptionNumber"` + InscriptionId string `json:"inscriptionId"` Amount string `json:"amount"` Ticker string `json:"ticker"` Unconfirmed bool `json:"unconfirmed,omitempty"` @@ -174,8 +174,8 @@ type unisatTokenSummary struct { } type Brc20UTXO struct { - Txid string `json:"txid"` Index int64 `json:"index"` + Txid string `json:"txid"` } func NewBrc20UTXO(txid string, index int64) *Brc20UTXO { diff --git a/core/btc/transaction_decode.go b/core/btc/transaction_decode.go index b2a5d72..0144e81 100644 --- a/core/btc/transaction_decode.go +++ b/core/btc/transaction_decode.go @@ -14,10 +14,9 @@ import ( ) type TxOut struct { - Hash string `json:"hash,omitempty"` - Index int64 `json:"index,omitempty"` - Value int64 `json:"value,omitempty"` + Index int64 `json:"index,omitempty"` + Hash string `json:"hash,omitempty"` Address string `json:"address,omitempty"` } diff --git a/core/cosmos/account.go b/core/cosmos/account.go index 8f38056..29dc443 100644 --- a/core/cosmos/account.go +++ b/core/cosmos/account.go @@ -10,8 +10,8 @@ import ( ) type Account struct { - privKey types.PrivKey Cointype int64 + privKey types.PrivKey AddressPrefix string } diff --git a/core/doge/transaction.go b/core/doge/transaction.go index 64c963d..4b3d5d0 100644 --- a/core/doge/transaction.go +++ b/core/doge/transaction.go @@ -19,12 +19,12 @@ type TransactionOutput struct { type Transaction struct { // Demo: https://api.blockcypher.com/v1/doge/main/txs/7bc313903372776e1eb81d321e3fe27c9721ce8e71a9bcfee1bde6baea31b5c2 + Confirmations int64 `json:"confirmations"` HashString string `json:"hash"` Total *big.Int `json:"total"` Fees *big.Int `json:"fees"` Received *time.Time `json:"received"` Confirmed *time.Time `json:"confirmed"` - Confirmations int64 `json:"confirmations"` Inputs []*TransactionInput `json:"inputs"` Outputs []*TransactionOutput `json:"outputs"` OpReturn string `json:"data_protocol"` diff --git a/core/eth/ethchain.go b/core/eth/ethchain.go index a0477ad..60c31e9 100644 --- a/core/eth/ethchain.go +++ b/core/eth/ethchain.go @@ -11,8 +11,8 @@ import ( ) type EthChain struct { - RemoteRpcClient *ethclient.Client timeout time.Duration + RemoteRpcClient *ethclient.Client chainId *big.Int rpcUrl string } diff --git a/core/eth/ethchain_zksync.go b/core/eth/ethchain_zksync.go index 3c5834a..cbf59f2 100644 --- a/core/eth/ethchain_zksync.go +++ b/core/eth/ethchain_zksync.go @@ -15,11 +15,13 @@ const zksync_chainid = 324 const zksync_chainid_testnet = 280 type zksync_Transaction struct { + Gas hexutil.Uint64 `json:"gas"` + Nonce hexutil.Uint64 `json:"nonce"` + TxType hexutil.Uint64 `json:"type"` BlockHash common.Hash `json:"blockHash"` BlockNumber *hexutil.Big `json:"blockNumber"` ChainID hexutil.Big `json:"chainId"` From common.Address `json:"from"` - Gas hexutil.Uint64 `json:"gas"` GasPrice hexutil.Big `json:"gasPrice"` Hash common.Hash `json:"hash"` Data hexutil.Bytes `json:"input"` @@ -27,10 +29,8 @@ type zksync_Transaction struct { L1BatchTxIndex hexutil.Big `json:"l1BatchTxIndex"` MaxFeePerGas hexutil.Big `json:"maxFeePerGas"` MaxPriorityFeePerGas hexutil.Big `json:"maxPriorityFeePerGas"` - Nonce hexutil.Uint64 `json:"nonce"` To common.Address `json:"to"` TransactionIndex hexutil.Uint `json:"transactionIndex"` - TxType hexutil.Uint64 `json:"type"` Value hexutil.Big `json:"value"` V hexutil.Big `json:"v"` R hexutil.Big `json:"r"` diff --git a/core/eth/nft.go b/core/eth/nft.go index 857fce0..c9d44d8 100644 --- a/core/eth/nft.go +++ b/core/eth/nft.go @@ -35,6 +35,8 @@ type RSS3Metadata struct { } type RSS3NoteAction struct { + Timestamp int64 + From string `json:"address_from"` To string `json:"address_to"` Tag string `json:"tag"` @@ -43,16 +45,15 @@ type RSS3NoteAction struct { Metadata *RSS3Metadata `json:"metadata"` RelatedUrls []string `json:"related_urls"` - Timestamp int64 HashString string } type RSS3Note struct { Timestamp time.Time `json:"timestamp"` HashString string `json:"hash"` - Success bool `json:"success"` Network string `json:"network"` Actions []*RSS3NoteAction `json:"actions"` + Success bool `json:"success"` } func (a *RSS3NoteAction) IsNftAction() bool { diff --git a/core/eth/types.go b/core/eth/types.go index aef0620..028f18d 100644 --- a/core/eth/types.go +++ b/core/eth/types.go @@ -24,8 +24,8 @@ type CallMethodOpts struct { Value string GasPrice string // MaxFeePerGas GasLimit string - IsPredictError bool MaxPriorityFeePerGas string + IsPredictError bool } type CallMethodOptsBigInt struct { diff --git a/core/solana/spltoken.go b/core/solana/spltoken.go index ac12985..567e63a 100644 --- a/core/solana/spltoken.go +++ b/core/solana/spltoken.go @@ -297,9 +297,9 @@ const ( ) type TokenAccount struct { + Amount uint64 Address string Owner string - Amount uint64 AccountType string // "Random" or "Associated" } diff --git a/core/sui/chain.go b/core/sui/chain.go index cac8b98..99cc407 100644 --- a/core/sui/chain.go +++ b/core/sui/chain.go @@ -30,10 +30,9 @@ const ( ) type Chain struct { + gasPrice uint64 rpcClient *client.Client RpcUrl string - - gasPrice uint64 } func NewChainWithRpcUrl(rpcUrl string) *Chain { diff --git a/core/sui/chain_stake.go b/core/sui/chain_stake.go index 8f4dff6..07a0822 100644 --- a/core/sui/chain_stake.go +++ b/core/sui/chain_stake.go @@ -24,7 +24,10 @@ const maxGasBudgetForStake = 12000000 type ValidatorState struct { // The current epoch in Sui. An epoch takes approximately 24 hours and runs in checkpoints. - Epoch int64 `json:"epoch"` + Epoch int64 `json:"epoch"` + EpochStartTimestampMs int64 `json:"epochStartTimestampMs"` + EpochDurationMs int64 `json:"epochDurationMs"` + // Array of `Validator` elements Validators *ValidatorArray `json:"validators"` @@ -32,9 +35,6 @@ type ValidatorState struct { TotalStaked string `json:"totalStaked"` // The amount of rewards won by all Sui validators in the last epoch. TotalRewards string `json:"lastEpochReward"` - - EpochStartTimestampMs int64 `json:"epochStartTimestampMs"` - EpochDurationMs int64 `json:"epochDurationMs"` } func (s *ValidatorState) JsonString() (*base.OptionalString, error) { @@ -64,21 +64,21 @@ func NewValidatorStateWithJsonString(str string) (*ValidatorState, error) { } type Validator struct { - Address string `json:"address"` - Name string `json:"name"` - Desc string `json:"desc"` - ImageUrl string `json:"imageUrl"` - ProjectUrl string `json:"projectUrl"` APY float64 `json:"apy"` + PoolShare float64 `json:"poolShare"` + Commission int64 `json:"commission"` + GasPrice int64 `json:"gasPrice"` + + Address string `json:"address"` + Name string `json:"name"` + Desc string `json:"desc"` + ImageUrl string `json:"imageUrl"` + ProjectUrl string `json:"projectUrl"` - Commission int64 `json:"commission"` TotalStaked string `json:"totalStaked"` DelegatedStaked string `json:"delegatedStaked"` SelfStaked string `json:"selfStaked"` TotalRewards string `json:"totalRewards"` - GasPrice int64 `json:"gasPrice"` - - PoolShare float64 `json:"poolShare"` } type ValidatorArray struct { @@ -116,10 +116,10 @@ const ( ) type DelegatedStake struct { + RequestEpoch int64 `json:"requestEpoch"` StakeId string `json:"stakeId"` ValidatorAddress string `json:"validatorAddress"` Principal string `json:"principal"` - RequestEpoch int64 `json:"requestEpoch"` Status DelegationStatus `json:"status"` DelegationId string `json:"delegationId"` diff --git a/core/sui/merge_split.go b/core/sui/merge_split.go index 41f8faf..866c2c1 100644 --- a/core/sui/merge_split.go +++ b/core/sui/merge_split.go @@ -26,17 +26,18 @@ type MergeCoinRequest struct { } type MergeCoinPreview struct { + EstimateGasFee int64 + // The original request Request *MergeCoinRequest // The merge coins transaction Transaction *Transaction - // Did the simulated transaction execute successfully? - SimulateSuccess bool - EstimateGasFee int64 // If the transaction is executed, owner will receive a coin amount that is not less than this. EstimateAmount string + // Did the simulated transaction execute successfully? + SimulateSuccess bool // Due to the results obtained through simulated execution, we may know that the balance may increase and the value of this state may be inconsistent with the value in the request. WillBeAchieved bool } diff --git a/core/sui/sui_cat_types.go b/core/sui/sui_cat_types.go index a57034d..9a00fd5 100644 --- a/core/sui/sui_cat_types.go +++ b/core/sui/sui_cat_types.go @@ -27,10 +27,10 @@ const ( type SuiCatGlobalData struct { TotalMinted int64 `json:"total_minted"` Supply int64 `json:"supply"` - PricePublic string `json:"price_public"` - PriceWhitelist string `json:"price_whitelist"` StartTimeMs int64 `json:"start_time"` DurationMs int64 `json:"duration"` + PricePublic string `json:"price_public"` + PriceWhitelist string `json:"price_whitelist"` } func (j *SuiCatGlobalData) JsonString() (*base.OptionalString, error) { @@ -43,17 +43,17 @@ func NewSuiCatGlobalDataWithJsonString(str string) (*SuiCatGlobalData, error) { } type rawSuiCatGlobalData struct { - Creator string `json:"creator"` - Duration string `json:"duration"` MintedPublic uint64 `json:"minted_public"` MintedWhitelist uint64 `json:"minted_whitelist"` Supply uint64 `json:"supply"` + TeamReserve uint64 `json:"team_reserve"` + Creator string `json:"creator"` + Duration string `json:"duration"` Balance string `json:"balance"` Beneficiary string `json:"beneficiary"` PricePublic string `json:"price_public"` PriceWhitelist string `json:"price_whitelist"` StartTime string `json:"start_time"` - TeamReserve uint64 `json:"team_reserve"` Whitelist struct { Fields struct { diff --git a/core/sui/transaction.go b/core/sui/transaction.go index 83ee029..a913bbd 100644 --- a/core/sui/transaction.go +++ b/core/sui/transaction.go @@ -10,11 +10,11 @@ import ( ) type Transaction struct { + EstimateGasFee int64 + Txn types.TransactionBytes TxnBytes lib.Base64Data - - EstimateGasFee int64 } func (t *Transaction) TransactionBytes() []byte { diff --git a/pkg/httpUtil/httpReq.go b/pkg/httpUtil/httpReq.go index 2cbea6f..398b3de 100644 --- a/pkg/httpUtil/httpReq.go +++ b/pkg/httpUtil/httpReq.go @@ -25,9 +25,9 @@ type Res struct { } type RequestParams struct { + Timeout time.Duration Header map[string]string Body []byte - Timeout time.Duration } func Get(baseUrl string, param map[string]string) (body []byte, err error) {