mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 09:42:51 +02:00
148 lines
9.3 KiB
Plaintext
148 lines
9.3 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"metadata": {},
|
|
"cell_type": "markdown",
|
|
"source": "## Creating a new Kind 1 post"
|
|
},
|
|
{
|
|
"metadata": {
|
|
"jupyter": {
|
|
"is_executing": true
|
|
}
|
|
},
|
|
"cell_type": "code",
|
|
"source": [
|
|
"USE {\n",
|
|
" dependencies(\"fr.acinq.secp256k1:secp256k1-kmp-jni-jvm:0.17.3\")\n",
|
|
" dependencies(\"com.goterl:lazysodium-java:5.1.4\")\n",
|
|
" dependencies(\"net.java.dev.jna:jna:5.17.0\")\n",
|
|
"\n",
|
|
" import(\"com.vitorpamplona.quartz.*\")\n",
|
|
"}"
|
|
],
|
|
"outputs": [],
|
|
"execution_count": null
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"metadata": {
|
|
"collapsed": true,
|
|
"ExecuteTime": {
|
|
"end_time": "2025-06-03T14:42:40.051027Z",
|
|
"start_time": "2025-06-03T14:42:40.023052Z"
|
|
}
|
|
},
|
|
"source": [
|
|
"import fr.acinq.secp256k1.Secp256k1\n",
|
|
"\n",
|
|
"import com.vitorpamplona.quartz.nip01Core.crypto.KeyPair\n",
|
|
"import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerInternal\n",
|
|
"import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerSync\n",
|
|
"import com.vitorpamplona.quartz.nip10Notes.TextNoteEvent\n",
|
|
"\n",
|
|
"val signer = NostrSignerSync()\n",
|
|
"val kind1Template = TextNoteEvent.build(\"New kind 1 Post\")\n",
|
|
"val signedEvent = signer.sign(kind1Template)\n",
|
|
"\n",
|
|
"println(signedEvent)"
|
|
],
|
|
"outputs": [
|
|
{
|
|
"ename": "org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException",
|
|
"evalue": "at Cell In[5], line 3, column 43: Unresolved reference: crypto\nat Cell In[5], line 4, column 43: Unresolved reference: signers\nat Cell In[5], line 5, column 43: Unresolved reference: signers\nat Cell In[5], line 6, column 33: Unresolved reference: nip10Notes\nat Cell In[5], line 8, column 14: Unresolved reference: NostrSignerSync\nat Cell In[5], line 9, column 21: Unresolved reference: TextNoteEvent\nat Cell In[5], line 12, column 1: Overload resolution ambiguity: \npublic inline fun println(message: Any?): Unit defined in kotlin.io\npublic inline fun println(message: Boolean): Unit defined in kotlin.io\npublic inline fun println(message: Byte): Unit defined in kotlin.io\npublic inline fun println(message: Char): Unit defined in kotlin.io\npublic inline fun println(message: CharArray): Unit defined in kotlin.io\npublic inline fun println(message: Double): Unit defined in kotlin.io\npublic inline fun println(message: Float): Unit defined in kotlin.io\npublic inline fun println(message: Int): Unit defined in kotlin.io\npublic inline fun println(message: Long): Unit defined in kotlin.io\npublic inline fun println(message: Short): Unit defined in kotlin.io",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException: at Cell In[5], line 3, column 43: Unresolved reference: crypto",
|
|
"at Cell In[5], line 4, column 43: Unresolved reference: signers",
|
|
"at Cell In[5], line 5, column 43: Unresolved reference: signers",
|
|
"at Cell In[5], line 6, column 33: Unresolved reference: nip10Notes",
|
|
"at Cell In[5], line 8, column 14: Unresolved reference: NostrSignerSync",
|
|
"at Cell In[5], line 9, column 21: Unresolved reference: TextNoteEvent",
|
|
"at Cell In[5], line 12, column 1: Overload resolution ambiguity: ",
|
|
"public inline fun println(message: Any?): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Boolean): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Byte): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Char): Unit defined in kotlin.io",
|
|
"public inline fun println(message: CharArray): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Double): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Float): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Int): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Long): Unit defined in kotlin.io",
|
|
"public inline fun println(message: Short): Unit defined in kotlin.io",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:208)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:126)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:80)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:78)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withHost(ReplForJupyterImpl.kt:791)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute-L4Nmkdk(CellExecutorImpl.kt:78)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.execution.CellExecutor$DefaultImpls.execute-L4Nmkdk$default(CellExecutor.kt:13)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evaluateUserCode-wNURfNM(ReplForJupyterImpl.kt:613)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalExImpl(ReplForJupyterImpl.kt:471)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.access$evalExImpl(ReplForJupyterImpl.kt:143)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl$evalEx$1.invoke(ReplForJupyterImpl.kt:464)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl$evalEx$1.invoke(ReplForJupyterImpl.kt:463)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withEvalContext(ReplForJupyterImpl.kt:444)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalEx(ReplForJupyterImpl.kt:463)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1$1.invoke(IdeCompatibleMessageRequestProcessor.kt:159)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1$1.invoke(IdeCompatibleMessageRequestProcessor.kt:158)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedIn(IdeCompatibleMessageRequestProcessor.kt:335)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.access$withForkedIn(IdeCompatibleMessageRequestProcessor.kt:54)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$evalWithIO$1$1.invoke(IdeCompatibleMessageRequestProcessor.kt:349)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedErr(IdeCompatibleMessageRequestProcessor.kt:324)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.access$withForkedErr(IdeCompatibleMessageRequestProcessor.kt:54)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$evalWithIO$1.invoke(IdeCompatibleMessageRequestProcessor.kt:348)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedOut(IdeCompatibleMessageRequestProcessor.kt:316)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO(IdeCompatibleMessageRequestProcessor.kt:347)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1.invoke(IdeCompatibleMessageRequestProcessor.kt:158)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor$processExecuteRequest$1$response$1.invoke(IdeCompatibleMessageRequestProcessor.kt:157)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$Task.execute(JupyterExecutorImpl.kt:41)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$executorThread$1.invoke(JupyterExecutorImpl.kt:83)",
|
|
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$executorThread$1.invoke(JupyterExecutorImpl.kt:80)",
|
|
"\tat kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)",
|
|
""
|
|
]
|
|
}
|
|
],
|
|
"execution_count": 5
|
|
},
|
|
{
|
|
"metadata": {},
|
|
"cell_type": "code",
|
|
"source": "",
|
|
"outputs": [],
|
|
"execution_count": null
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Kotlin",
|
|
"language": "kotlin",
|
|
"name": "kotlin"
|
|
},
|
|
"language_info": {
|
|
"name": "kotlin",
|
|
"version": "1.9.23",
|
|
"mimetype": "text/x-kotlin",
|
|
"file_extension": ".kt",
|
|
"pygments_lexer": "kotlin",
|
|
"codemirror_mode": "text/x-kotlin",
|
|
"nbconvert_exporter": ""
|
|
},
|
|
"ktnbPluginMetadata": {
|
|
"projectDependencies": [
|
|
"Amethyst.amethyst.unitTest"
|
|
],
|
|
"projectLibraries": false
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 0
|
|
}
|