@@ -178,9 +178,9 @@ type Client interface {
178178 GetConfirmationStatus (Signature , Commitment ) (bool , error )
179179 GetConfirmedBlock (slot uint64 ) (* Block , error )
180180 GetConfirmedBlocksWithLimit (start , limit uint64 ) ([]uint64 , error )
181- GetConfirmedTransaction (Signature ) (ConfirmedTransaction , error )
182- GetMinimumBalanceForRentExemption (size uint64 ) (lamports uint64 , err error )
181+ GetFilteredProgramAccounts (program ed25519.PublicKey , offset uint , filterValue []byte ) ([]string , uint64 , error )
183182 GetLatestBlockhash () (Blockhash , error )
183+ GetMinimumBalanceForRentExemption (size uint64 ) (lamports uint64 , err error )
184184 GetSignatureStatus (Signature , Commitment ) (* SignatureStatus , error )
185185 GetSignatureStatuses ([]Signature ) ([]* SignatureStatus , error )
186186 GetSignaturesForAddress (owner ed25519.PublicKey , commitment Commitment , limit uint64 , before , until string ) ([]* TransactionSignature , error )
@@ -189,8 +189,6 @@ type Client interface {
189189 GetTokenAccountsByOwner (owner , mint ed25519.PublicKey ) ([]ed25519.PublicKey , error )
190190 GetTransaction (Signature , Commitment ) (ConfirmedTransaction , error )
191191 GetTransactionTokenBalances (Signature ) (TransactionTokenBalances , error )
192- GetFilteredProgramAccounts (program ed25519.PublicKey , offset uint , filterValue []byte ) ([]string , uint64 , error )
193- RequestAirdrop (ed25519.PublicKey , uint64 , Commitment ) (Signature , error )
194192 SubmitTransaction (Transaction , Commitment ) (Signature , error )
195193}
196194
@@ -528,47 +526,6 @@ func (c *client) GetConfirmedBlocksWithLimit(start, limit uint64) (slots []uint6
528526 return slots , c .call (& slots , "getConfirmedBlocksWithLimit" , start , limit )
529527}
530528
531- func (c * client ) GetConfirmedTransaction (sig Signature ) (ConfirmedTransaction , error ) {
532- type rpcResponse struct {
533- Slot uint64 `json:"slot"`
534- Transaction []string `json:"transaction"` // [val, encoding]
535- Meta * struct {
536- Err interface {} `json:"err"`
537- } `json:"meta"`
538- }
539-
540- var resp * rpcResponse
541- if err := c .call (& resp , "getConfirmedTransaction" , base58 .Encode (sig [:]), "base64" ); err != nil {
542- return ConfirmedTransaction {}, err
543- }
544-
545- if resp == nil {
546- return ConfirmedTransaction {}, ErrSignatureNotFound
547- }
548-
549- txn := ConfirmedTransaction {
550- Slot : resp .Slot ,
551- }
552-
553- var err error
554- rawTxn , err := base64 .StdEncoding .DecodeString (resp .Transaction [0 ])
555- if err != nil {
556- return txn , errors .Wrap (err , "failed to decode transaction" )
557- }
558- if err := txn .Transaction .Unmarshal (rawTxn ); err != nil {
559- return txn , errors .Wrap (err , "failed to unmarshal transaction" )
560- }
561-
562- if resp .Meta != nil {
563- txn .Err , err = ParseTransactionError (resp .Meta .Err )
564- if err != nil {
565- return txn , errors .Wrap (err , "failed to parse transaction result" )
566- }
567- }
568-
569- return txn , nil
570- }
571-
572529func (c * client ) GetTransaction (sig Signature , commitment Commitment ) (ConfirmedTransaction , error ) {
573530 type rpcResponse struct {
574531 Slot uint64 `json:"slot"`
@@ -578,11 +535,13 @@ func (c *client) GetTransaction(sig Signature, commitment Commitment) (Confirmed
578535 }
579536
580537 config := struct {
581- Commitment string `json:"commitment"`
582- Encoding string `json:"encoding"`
538+ Commitment string `json:"commitment"`
539+ Encoding string `json:"encoding"`
540+ MaxSupportedTransactionVersion int `json:"maxSupportedTransactionVersion"`
583541 }{
584- Commitment : commitment .Commitment ,
585- Encoding : "base64" ,
542+ Commitment : commitment .Commitment ,
543+ Encoding : "base64" ,
544+ MaxSupportedTransactionVersion : 0 ,
586545 }
587546
588547 var resp * rpcResponse
@@ -935,27 +894,6 @@ func (c *client) GetAccountDataAfterBlock(account ed25519.PublicKey, slot uint64
935894 return rawData , unmarshalledGetAccountInfoResp .Context .Slot , nil
936895}
937896
938- func (c * client ) RequestAirdrop (account ed25519.PublicKey , lamports uint64 , commitment Commitment ) (Signature , error ) {
939- var sigStr string
940- if err := c .call (& sigStr , "requestAirdrop" , base58 .Encode (account [:]), lamports , commitment ); err != nil {
941- return Signature {}, errors .Wrapf (err , "requestAirdrop() failed to send request" )
942- }
943-
944- sigBytes , err := base58 .Decode (sigStr )
945- if err != nil {
946- return Signature {}, errors .Wrap (err , "invalid signature in response" )
947- }
948-
949- var sig Signature
950- copy (sig [:], sigBytes )
951-
952- if sig == (Signature {}) {
953- return Signature {}, errors .New ("empty signature returned" )
954- }
955-
956- return sig , nil
957- }
958-
959897func (c * client ) GetConfirmationStatus (sig Signature , commitment Commitment ) (bool , error ) {
960898 type response struct {
961899 Value bool `json:"value"`
0 commit comments