UNPKG

pipebomb.js

Version:

Library for interacting with Pipe Bomb servers

46 lines (31 loc) 2.21 kB
import PipeBomb from "../dist/index.js"; const hash = PipeBomb.getCredentialHash("eyezah", "148bassett"); const keys = PipeBomb.getAccountKeys(hash); const pb = new PipeBomb("http://localhost:3000", { privateKey: keys.privateKey }); console.log("authenticating"); pb.authenticate("eyezah").then(async () => { console.log("authenticated!"); const encrypted = PipeBomb.encrypt(["damn!!"], keys.publicKey); console.log(encrypted); console.log(PipeBomb.decrypt(encrypted, keys.privateKey)); // console.log(await pb.v1.search("SoundCloud", "eyezah")); }).catch(console.error); // pb.v1.search("Youtube Music", "cool music").then(resp => { // console.log(resp.responseType, resp); // }).catch(console.error); // pb.v1.getRegistryServers("https://registry.pipebomb.net").then(console.log); // pb.v1.getPlaylist("2.pipebomb.net@89").then(playlist => { // console.log(playlist.getThumbnailUrl()); // }).catch(console.error); // pb.v1.getCharts().then(charts => { // for (let chart of charts) { // console.log(chart.thumbnail); // } // }).catch(console.error); // console.log(hash); // console.log(keys); // const payload = PipeBomb.encrypt("damn", keys.publicKey); // const unencrypted = PipeBomb.decrypt("bb33H0kf/JnPfocO6v5yn2Oovl7XTFClJME8ifx46BiSie13DhdDKzi75ol1zfEXXb4KFogcjYhT+abtii5lntLAWBz8s8yKtn4Q6xYkHHFLP0TD8zpKurmgteJLK0IY2+Bp7cW+HK8dV72NMWTCBudrDZt/iElSoGOOEy5HCNZT9j/cLQ95BsgxxUWMoa5wVbOvqmzp48UBJp1Xjx58tshxxq0zJEyDg5kq/WuQfcWTSxkYtnbG/1jQH5EFiB9MKRyCcL288XVCcyTH0DltOsMl/7ui8eUnLd1QBWKNlgrj+YaZniv7wdqdqMHL6LJ2/6aK225DsSDWfBrh+oJ03Q==?2/De/vb/j8zzc8qLpydYb1+4WJ1m6gBwKmaB+1Ml9yCupgT5If8odQtUQgaKWyRixtcARXun+NuRXrV3wb6zoQX8YBpgIzW3jbX4IVUXTu7x6bqBw8WU12gyw4Hg3EEFg0f+yPPHzKPtuZrCjAsTBrvvenn2o3RQQTURsDcxcL7IcWgzbabcU31Y7KGUOrHp3Zx1H/Rwep0+SH8KbwMW2nl86qeQtogvtJ508c0ux9YqcYiRiniNhn50/b7jrOz3fRY3e9Ma4qOCYRtlVULkLp9T52zYooBRd58Yjccsau7eDpWDu8uW7qrh2UezRXYhvXpzveVYsLApwASj4IqL4c1m6hxaY7u6rFnuxwD5pne+QlOxlpRY7Jl1enwCHFMciQDlIpR3Nnc29A22hGYTIn0+YkQJF2XffljnSADbmy1z11C16tvvHdxwIVlyUfwusTyK/CDvWNP/FHc5r6j8p29xXFX6xy1SRNqEsUDkGy8gq6M6iaWCBWoFM5MXaGqz84R/AqX9VIFhDBBaGWk+Y+uT6gpMjsMBuXwLacYGCyY=", keys.privateKey); // console.log(unencrypted);