You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am try to get large token holders of USDT.so i try it with the following code:
// Copyright 2021 github.com/gagliardetto// This file has been modified by github.com/gagliardetto//// Copyright 2020 dfuse Platform Inc.//// Licensed under the Apache License, Version 2.0 (the "License");// you may not use this file except in compliance with the License.// You may obtain a copy of the License at//// http://www.apache.org/licenses/LICENSE-2.0//// Unless required by applicable law or agreed to in writing, software// distributed under the License is distributed on an "AS IS" BASIS,// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.// See the License for the specific language governing permissions and// limitations under the License.package rpc
import (
"context""github.com/gagliardetto/solana-go"
)
// GetProgramAccounts returns all accounts owned by the provided program publicKey.func (cl*Client) GetProgramAccounts(
ctx context.Context,
publicKey solana.PublicKey,
) (outGetProgramAccountsResult, errerror) {
returncl.GetProgramAccountsWithOpts(
ctx,
publicKey,
nil,
)
}
// GetProgramAccountsWithOpts returns all accounts owned by the provided program publicKey.func (cl*Client) GetProgramAccountsWithOpts(
ctx context.Context,
publicKey solana.PublicKey,
opts*GetProgramAccountsOpts,
) (outGetProgramAccountsResult, errerror) {
obj:=M{
"encoding": "base64",
}
ifopts!=nil {
ifopts.Commitment!="" {
obj["commitment"] =string(opts.Commitment)
}
iflen(opts.Filters) !=0 {
obj["filters"] =opts.Filters
}
ifopts.Encoding!="" {
obj["encoding"] =opts.Encoding
}
ifopts.DataSlice!=nil {
obj["dataSlice"] =M{
"offset": opts.DataSlice.Offset,
"length": opts.DataSlice.Length,
}
}
}
params:= []interface{}{publicKey, obj}
err=cl.rpcClient.CallForInto(ctx, &out, "getProgramAccounts", params)
return
}
but it returns the following error:
panic: rpccallgetProgramAccounts() on https://sly-hardworking-dew.solana-mainnet.quiknode.pro/f6eb1261fe38b21326f892aabef573a7fa01a80a/ status code: 200. could not decode body to rpc response: jsonrpc.RPCResponse.Result: net/http: request canceled (Client.Timeout or context cancellation while reading body) [recovered]
panic: rpccallgetProgramAccounts() on https://sly-hardworking-dew.solana-mainnet.quiknode.pro/f6eb1261fe38b21326f892aabef573a7fa01a80a/ status code: 200. could not decode body to rpc response: jsonrpc.RPCResponse.Result: net/http: request canceled (Client.Timeout or context cancellation while reading body)goroutine35 [running]:
testing.tRunner.func1.2({0x105462300, 0x140001c0180})
/Users/mac/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.darwin-arm64/src/testing/testing.go:1631+0x1c4testing.tRunner.func1()
/Users/mac/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.darwin-arm64/src/testing/testing.go:1634+0x33cpanic({0x105462300?, 0x140001c0180?})
/Users/mac/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.darwin-arm64/src/runtime/panic.go:770+0x124meme-pos/utils.TestGetSnapShot(0x140001ad040?)
/Users/mac/GolandProjects/meme-pos/utils/solana_utils_test.go:37+0x37ctesting.tRunner(0x140001ad040, 0x1054d95e0)
/Users/mac/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.darwin-arm64/src/testing/testing.go:1689+0xeccreatedbytesting.(*T).Runingoroutine1/Users/mac/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.darwin-arm64/src/testing/testing.go:1742+0x318Processfinishedwiththeexitcode1
may I retrieve a large number of token holders through multiple paginated requests?
The text was updated successfully, but these errors were encountered:
i am try to get large token holders of USDT.so i try it with the following code:
but it returns the following error:
may I retrieve a large number of token holders through multiple paginated requests?
The text was updated successfully, but these errors were encountered: