Welcome to the Player Profile, brought to you by Star Atlas! This open protocol empowers developers to seamlessly create and manage decentralized profiles on the Solana blockchain. Dive into a world where game and application profiles are not bound by central control, ensuring greater trust, transparency, and user autonomy.
The Player Profile Program allows users to manage their identity and access keys. Users can create a list of public keys associated with their profile and set permissions for each key. Identity is no longer tied to a key and is instead tied to a profile, allowing for key rotation, complex ownership structures, and more. No CPI is required to check a key that signs on behalf of a profile.
Package
Description
Version
Docs
@staratlas/player-profile
TypeScript bindings for the player-profile program
From the Star-Atlas-Cookbook and for https://build.staratlas.com/
TypeScript Code Explanation
This is a TypeScript code example demonstrating how to interact with the Solana blockchain using the @project-serum/anchor and @solana/web3.js libraries. The code fetches player profiles from a Solana account using the readAllFromRPC function.
Importing Libraries
import { Program } from "@project-serum/anchor";
import { Connection, Keypair } from "@solana/web3.js";
The code imports the following libraries:
@project-serum/anchor: a library for building Solana applications using TypeScript.
@solana/web3.js: a library for interacting with the Solana blockchain.
Importing Custom Functions
import { readAllFromRPC } from "@staratlas/data-source";
import { PLAYER_PROFILE_IDL, PlayerProfile } from "@staratlas/player-profile";
The code imports custom functions and types:
readAllFromRPC: a function for reading data from Solana accounts.
PLAYER_PROFILE_IDL and PlayerProfile: types related to player profiles.
Importing Shared Functions
import { newConnection, newAnchorProvider } from "../../shared/anchor-setup";
import { loadKeypair } from "../../shared/wallet-setup";
The code imports shared functions:
newConnection and newAnchorProvider: functions for creating a Solana connection and anchor provider.
loadKeypair: a function for loading a Keypair from a file.