feat: create chat sdk

This commit is contained in:
kaichaosun 2025-05-09 13:56:39 +08:00
commit 75a22367b9
No known key found for this signature in database
GPG Key ID: 223E0F992F4F03BF
5 changed files with 44 additions and 0 deletions

12
chat_sdk.nimble Normal file
View File

@ -0,0 +1,12 @@
# Package
version = "0.0.1"
author = "Waku Chat Team"
description = "Chat features over Waku"
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 2.0.0"

7
src/chat_sdk.nim Normal file
View File

@ -0,0 +1,7 @@
# This is just an example to get you started. A typical library package
# exports the main API in this file. Note that you cannot rename this file
# but you can remove it if you wish.
proc add*(x, y: int): int =
## Adds two numbers together.
return x + y

View File

@ -0,0 +1,12 @@
# This is just an example to get you started. Users of your library will
# import this file by writing ``import chat_sdk/submodule``. Feel free to rename or
# remove this file altogether. You may create additional modules alongside
# this file as required.
type
Submodule* = object
name*: string
proc initSubmodule*(): Submodule =
## Initialises a new ``Submodule`` object.
Submodule(name: "Anonymous")

1
tests/config.nims Normal file
View File

@ -0,0 +1 @@
switch("path", "$projectDir/../src")

12
tests/test1.nim Normal file
View File

@ -0,0 +1,12 @@
# This is just an example to get you started. You may wish to put all of your
# tests into a single file, or separate them into multiple `test1`, `test2`
# etc. files (better names are recommended, just make sure the name starts with
# the letter 't').
#
# To run these tests, simply execute `nimble test`.
import unittest
import chat_sdk
test "can add":
check add(5, 5) == 10