Returns a base persona (name, sex & zodiac) for a given bitcoin or ethereum style address.
As an homage to Satoshi Nakamoto, all names (both given and family) are of a japanese origin.
Life is for one generation; A good name is forever.
npm:
npm install @octano/persona
yarn:
yarn add @octano/persona
import { getPersona } from '@octano/persona'
const persona = getPersona('0x8429ab69b8721ffb29f2e66fdf06b1c65d66eb58')
console.log(persona)
{
success: true,
sex: 'male',
name: {
given: 'Kazufumi',
family: 'Takeuchi',
},
zodiac: 'leo',
version: 1
}
Determined by odd or even state of summed hash: 'male' or 'female'
- given: Determined using sex from a total of 512 male and 512 female first names.
- family: Determined from a total of 4096 last names.
one of the following
[
'aquarius',
'aries',
'cancer',
'capricorn',
'gemini',
'leo',
'libra',
'pisces',
'sagittarius',
'scorpio',
'taurus',
'virgo',
]
import { getPersona } from '@octano/persona'
const persona = getPersona('NOT_A_VALID_ADDRESS')
{
success: false,
error: 'NOT_A_VALID_ADDRESS is not a valid Ubiq/Ethereum address'
}
Persona also supports usage with NFTs
import { getPersonaNFT } from '@octano/persona'
const contractAddress = '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
const chainId = 1
const tokenId = 6529
const persona = getPersonaNFT(contractAddress, tokenId, chainId)
console.log(persona)
{
success: true,
sex: 'female',
name: {
given: 'Mieko',
family: 'Kubota',
},
zodiac: 'sagittarius',
version: 1
}
If your NFT already handles sex you can override Persona to match your NFT.
import { getPersonaNFT } from '@octano/persona'
const contractAddress = '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB'
const chainId = 1
const tokenId = 6529
const sex = 'male'
const persona = getPersonaNFT(contractAddress, tokenId, chainId, sex)
console.log(persona)
{
success: true,
sex: 'male',
name: {
given: 'Kiyoshi',
family: 'Kubota',
},
zodiac: 'sagittarius',
version: 1
}