Skip to content

Commit ea15efa

Browse files
committed
init
0 parents  commit ea15efa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10374
-0
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
macOS:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Select Xcode
17+
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer
18+
19+
- name: Build
20+
run: swift build -v
21+
22+
- name: Run tests (unit tests only, skip integration tests)
23+
run: swift test --filter 'AccountTests|AddressTests|ApplicationTransactionTests|AssetManagementTests|AssetTests|AtomicTransactionGroupTests|KeyRegistrationTests|MicroAlgosTests|MnemonicTests' -v
24+
25+
linux:
26+
runs-on: ubuntu-latest
27+
container: swift:6.0
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Fix git permissions
33+
run: git config --global --add safe.directory /__w/swift-algorand/swift-algorand
34+
35+
- name: Build
36+
run: swift build -v
37+
38+
- name: Run tests (unit tests only, skip integration tests)
39+
run: swift test --filter 'AccountTests|AddressTests|ApplicationTransactionTests|AssetManagementTests|AssetTests|AtomicTransactionGroupTests|KeyRegistrationTests|MicroAlgosTests|MnemonicTests' -v

.github/workflows/docs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
build:
14+
runs-on: macos-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Select Xcode
19+
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer
20+
21+
- name: Build Documentation
22+
run: |
23+
swift package --allow-writing-to-directory ./docs \
24+
generate-documentation --target Algorand \
25+
--disable-indexing \
26+
--transform-for-static-hosting \
27+
--hosting-base-path swift-algorand \
28+
--output-path ./docs
29+
30+
- name: Upload Pages artifact
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: ./docs
34+
35+
deploy:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: github-pages
40+
url: ${{ steps.deployment.outputs.page_url }}
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc
9+
Package.resolved
10+
*.xcodeproj

CONTRIBUTING.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Contributing to swift-algorand
2+
3+
Thank you for your interest in contributing to swift-algorand! 🎉
4+
5+
## How to Contribute
6+
7+
### Reporting Issues
8+
9+
If you find a bug or have a feature request:
10+
11+
1. Check if the issue already exists in [GitHub Issues](https://github.com/CorvidLabs/swift-algorand/issues)
12+
2. If not, create a new issue with:
13+
- A clear, descriptive title
14+
- Steps to reproduce (for bugs)
15+
- Expected vs. actual behavior
16+
- Swift version and platform information
17+
18+
### Submitting Pull Requests
19+
20+
1. **Fork the repository** and create your branch from `main`:
21+
```bash
22+
git checkout -b feature/your-feature-name
23+
```
24+
25+
2. **Make your changes**:
26+
- Write clear, concise code following Swift conventions
27+
- Add tests for new functionality
28+
- Update documentation as needed
29+
30+
3. **Ensure tests pass**:
31+
```bash
32+
# Run unit tests
33+
swift test --filter 'AccountTests|AddressTests|ApplicationTransactionTests|AssetManagementTests|AssetTests|AtomicTransactionGroupTests|KeyRegistrationTests|MicroAlgosTests|MnemonicTests'
34+
35+
# Run integration tests (requires LocalNet)
36+
docker-compose up -d
37+
ALGORAND_NETWORK=localnet swift test
38+
docker-compose down
39+
```
40+
41+
4. **Verify the build**:
42+
```bash
43+
swift build
44+
```
45+
46+
5. **Commit your changes**:
47+
- Use clear, descriptive commit messages
48+
- Reference any related issues
49+
50+
6. **Push to your fork** and submit a pull request
51+
52+
## Code Style
53+
54+
- Follow Swift API Design Guidelines
55+
- Use meaningful variable and function names
56+
- Add documentation comments for public APIs
57+
- Keep functions focused and concise
58+
- Use Swift 6 concurrency features (async/await, actors)
59+
60+
## Testing
61+
62+
- Write tests for new features
63+
- Ensure existing tests pass
64+
- Test on multiple platforms when possible (macOS, Linux)
65+
- Use LocalNet for integration testing
66+
67+
## Documentation
68+
69+
- Update README.md if adding major features
70+
- Add code examples for new functionality
71+
- Document any breaking changes
72+
73+
## Questions?
74+
75+
Feel free to open an issue for questions or discussion!
76+
77+
## License
78+
79+
By contributing, you agree that your contributions will be licensed under the MIT License.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Leif
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Package.swift

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// swift-tools-version: 6.0
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "Algorand",
6+
platforms: [
7+
.iOS(.v15),
8+
.macOS(.v11),
9+
.tvOS(.v15),
10+
.watchOS(.v8),
11+
.visionOS(.v1)
12+
],
13+
products: [
14+
.library(
15+
name: "Algorand",
16+
targets: ["Algorand"]
17+
),
18+
.executable(
19+
name: "algorand-example",
20+
targets: ["AlgorandExample"]
21+
),
22+
],
23+
dependencies: [
24+
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.0.0"),
25+
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.4.0")
26+
],
27+
targets: [
28+
.target(
29+
name: "Algorand",
30+
dependencies: [
31+
.product(name: "Crypto", package: "swift-crypto"),
32+
]
33+
),
34+
.executableTarget(
35+
name: "AlgorandExample",
36+
dependencies: ["Algorand"],
37+
path: "Sources/AlgorandExample"
38+
),
39+
.testTarget(
40+
name: "AlgorandTests",
41+
dependencies: ["Algorand"]
42+
),
43+
]
44+
)

0 commit comments

Comments
 (0)