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
It would be nice if this library also had sat functions like going between number, name, degree, percentile. Also calculating sat ranges and rarity if its a block 9 etc.
Once we have sat functions we can update the sat endpoint functions to take any value of sat. When we made the sat endpoint I suggested to raph we should take away the ability to pass it notation and sat name so explorers won't have the potential to not support them and break inscriptions. ordinals/ord#2732
If we implement this logic on this library then we simplify the logic of ordinals explorers while still getting the ability to interact with the sat endpoint with sat names/notation/degree.
Here is a Sat class I started
classSat{staticSUPPLY=BigInt(2099999997690000);constructor(value){this.value=BigInt(value);}name(){letx=Sat.SUPPLY-this.value;letname='';while(x>0){name+='abcdefghijklmnopqrstuvwxyz'[Number((x-BigInt(1))%BigInt(26))].toString();x=(x-BigInt(1))/BigInt(26);}returnname.split('').reverse().join('');}staticfromName(s){letx=BigInt(0);for(leti=0;i<s.length;i++){constc=s[i];if(c>='a'&&c<='z'){x=x*BigInt(26)+BigInt(c.codePointAt(0)-'a'.codePointAt(0)+1);}else{thrownewError(`invalid character in sat name: ${c}`);}}if(x>Sat.SUPPLY){thrownewError('sat name out of range');}returnnewSat(Sat.SUPPLY-x);}}
The text was updated successfully, but these errors were encountered:
It would be nice if this library also had sat functions like going between number, name, degree, percentile. Also calculating sat ranges and rarity if its a block 9 etc.
Once we have sat functions we can update the sat endpoint functions to take any value of sat. When we made the sat endpoint I suggested to raph we should take away the ability to pass it notation and sat name so explorers won't have the potential to not support them and break inscriptions. ordinals/ord#2732
If we implement this logic on this library then we simplify the logic of ordinals explorers while still getting the ability to interact with the sat endpoint with sat names/notation/degree.
Here is a Sat class I started
The text was updated successfully, but these errors were encountered: