{"id":25588597,"url":"https://github.com/picketapi/picket-go","last_synced_at":"2025-08-26T12:15:46.007Z","repository":{"id":115244959,"uuid":"556975150","full_name":"picketapi/picket-go","owner":"picketapi","description":"The official Picket API Go library","archived":false,"fork":false,"pushed_at":"2023-04-19T00:31:21.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T17:19:33.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/picketapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-24T21:37:56.000Z","updated_at":"2022-10-24T22:54:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d43e892-f1a1-49e1-bfe9-61915a331892","html_url":"https://github.com/picketapi/picket-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/picketapi/picket-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picketapi","download_url":"https://codeload.github.com/picketapi/picket-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272219641,"owners_count":24894471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-21T08:38:57.703Z","updated_at":"2025-08-26T12:15:45.999Z","avatar_url":"https://github.com/picketapi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# picket-go\n\nThe official Picket API Go library\n\n## Installation\n\n```bash \ngo get -u github.com/picketapi/picket-go\n```\n\n## Usage - Quick Start\n\nUse the `picketapi.NewClient` to create the Picket API client. It takes a _secret API key_ as a parameter.\n\n```go\nimport (\n\tpicketapi \"github.com/picketapi/picket-go\"\n)\n\npicket := picketapi.NewClient(\"YOUR_SECRET_API_KEY\")\n```\n\n## Nonce\n\nA `nonce` is random value generated by the Picket API to that user must sign to prove ownership a wallet address. The `nonce` function can be used to implement your own wallet authentication flow. \n\nA nonce is unique to a project and wallet address. If a `nonce` doesn't exist for the project and wallet address, Picket will generate a new nonce; otherwise, Picket will return the existing nonce. A nonce is valid for two minutes before self-destructing.\n\n```go\nresp, err := picket.Nonce(picketapi.NonceArgs{\n\t\tChain:         \"solana\",\n\t\tWalletAddress: \"wAllEtadDresS\",\n})\nfmt.Printf(\"received nonce: %s\", resp.Nonce)\n```\n\n## Auth\n\n`auth` is the server-side equivalent of login. `auth` should only be used in a trusted server environment. The most common use-case for `auth` is [linking a wallet to an existing application account](https://docs.picketapi.com/picket-docs/tutorials/link-a-wallet-to-a-web-2.0-account).\n\n```go\nresp, err := picket.Auth(picketapi.AuthArgs{\n\t\tChain:         \"ethereum\",\n\t\tWalletAddress: \"0x1234567890\",\n\t\tSignature:     \"abcdefghijklmnop\",\n})\nfmt.Printf(\"received access token: %s\", resp.AccessToken)\n```\n\n## Authz (Authorize)\n`authz` stands for authorization. Unlike Auth, which handles both authentication and authorization, Authz only handles authorization. \nGiven an authenticated user's access token and authorization requirements, `authz` will issue a new access token on success (user is authorized) or, on failure, it will return a 4xx HTTP error code.\n```go\nresp, err := picket.Authz(picketapi.AuthzArgs{\n\t\tAccessToken: \"aaa.bbb.ccc\",\n\t\tRequirements: picketapi.AuthorizationRequirements{\n\t\t\tContractAddress: \"0xContract\",\n\t\t\tMinTokenBalance: \"100\",\n\t\t},\n})\nfmt.Printf(\"received updated access token: %s\", resp.AccessToken)\n```\n\n## Validate\n`validate` validates an access token. `validate` should be called, or manually access token validation should be done, server-side before trusting a request's access token. It's common to move access token validation and decoding logic to a shared middleware across API endpoints.\nIf the access token is valid, validate returns the decoded claims of the access token.\n\n```go\nresp, err := picket.Validate(picketapi.ValidateArgs{\n\t\tAccessToken: \"aaa.bbb.ccc\",\n\t\t// Authorizatopn args are optional\n\t\tRequirements: picketapi.AuthorizationRequirements{\n\t\t\tContractAddress: \"0xContract\",\n\t\t\tMinTokenBalance: \"100\",\n\t\t},\n})\nfmt.Printf(\"decoded access token: %v\", resp)\n```\n\n## Verify Token Ownership\nIf you only want to verify token ownership server side for a given wallet, `tokenOwnership` allows you to do just that.\n\n```go\nresp, err := picket.TokenOwnership(picketapi.TokenOwnershipArgs{\n\t\tChain:         \"solana\",\n\t\tWalletAddress: \"waLLeTaddrESs\",\n\t\tRequirements: picketapi.AuthorizationRequirements{\n\t\t\tCollection: \"METAPLEX_COLLECTION\",\n\t\t\tMinTokenBalance: \"3\",\n\t\t},\n})\nfmt.Printf(\"wallet has sufficient tokens: %s\", resp.Allowed)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicketapi%2Fpicket-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicketapi%2Fpicket-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicketapi%2Fpicket-go/lists"}