entropyxyz / sdk

Official JavaScript SDK for Entropy blockchain.
GNU Affero General Public License v3.0
7 stars 0 forks source link

Jawn/sandbox v2 #252

Closed jawndiego closed 8 months ago

jawndiego commented 8 months ago

updated to latest version of core PR https://github.com/entropyxyz/entropy-core/pull/512

TODO: programs unit test has a socket hangs error.

all other tests pass.

frankiebee commented 8 months ago
const matchingAccount = /*{
  sigRequestKey: pair
  programModKey: pair,
}**/ genrateEntropyAccountFromSeed('seed')
const uniuqueAccount = /*{
  sigRequestKey: pair
  programModKey: pair,
}**/ genrateEntropyAccountFromSeeds({sigRequestSeed: 'seed', programModSeed'seeds'})

export interface EntropyAccout {
  sigRequestKey?: pair | string // if the sigRequestKey is a string or nothing. assume the entropy account is public 
  programModKey?: pair | string // if this is a string assume that the program modkey is externaly controlled
}

const opts = {
  account, // type EntropyAccount 
  endpoint,
} 

const entropy = new Entropy(opts)
// throws error if no default account is set & throws eeror if not accout provided
entropy.register({...normalParams, account?: EntropyAccout }) // again assume a pssed string is a public key. if nothing is provided use the default key on constructor