Skip to content

Commit

Permalink
docs: change copyright date for header
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoDotIO committed Aug 11, 2024
1 parent 811b9e7 commit 7431142
Show file tree
Hide file tree
Showing 149 changed files with 13,838 additions and 102 deletions.
2 changes: 1 addition & 1 deletion Examples/AptosSwift/iOS_Example/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ContentView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// HomeViewModel.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Examples/AptosSwift/iOS_Example/Views/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// AccountView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// CreateCollectionView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Examples/AptosSwift/iOS_Example/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// HomeView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Examples/AptosSwift/iOS_Example/Views/MintNFTView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MintNFTView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Examples/AptosSwift/iOS_Example/Views/TransferView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TransferView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Examples/AptosSwift/iOS_Example/iOS_ExampleApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// iOS_ExampleApp.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Examples/TwoByTwoExample/TwoByTwoExample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ContentView.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TwoByTwoExampleApp.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Example.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// HelloBlockchain.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Multisig.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ReadAggregator.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SimpleNFT.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SimulateTransferCoin.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TokenClient.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TransferCoin.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 36 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{
"pins" : [
{
"identity" : "bigint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/attaswift/BigInt.git",
"state" : {
"revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6",
"version" : "5.3.0"
}
},
{
"identity" : "bip39.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tesseract-one/Bip39.swift.git",
"state" : {
"revision" : "bb2b82539d685e1457493b695cdc8e4dcff97c92",
"version" : "0.2.0"
}
},
{
"identity" : "blake2.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tesseract-one/Blake2.swift.git",
"state" : {
"revision" : "29c55c8fe42d6661e5a32cc5bbbad1fff64fd01e",
"version" : "0.2.0"
}
},
{
"identity" : "cryptoswift",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -35,6 +62,15 @@
"revision" : "1a499a1bf08afd10b9fcd0fd6d90b6dd9196be50",
"version" : "0.2.2"
}
},
{
"identity" : "uncommoncrypto.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tesseract-one/UncommonCrypto.swift.git",
"state" : {
"revision" : "075344faec47dadba98bef6a319e310c98be0820",
"version" : "0.2.1"
}
}
],
"version" : 2
Expand Down
19 changes: 14 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Package.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -38,18 +38,27 @@ let package = Package(
.package(url: "https://github.com/hyugit/UInt256.git", from: "0.2.2"),
.package(url: "https://github.com/pebble8888/ed25519swift.git", from: "1.2.7"),
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "4.0.0"),
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.4.2")
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.4.2"),
.package(url: "https://github.com/tesseract-one/Bip39.swift.git", from: "0.1.1"),
.package(url: "https://github.com/tesseract-one/Blake2.swift.git", from: "0.2.0"),
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.3.0")
],
targets: [
.target(
name: "secp256k1"
),
.target(
name: "AptosKit",
dependencies: [
.product(name: "BigInt", package: "BigInt"),
.product(name: "UInt256", package: "UInt256"),
.product(name: "ed25519swift", package: "ed25519swift"),
.product(name: "SwiftyJSON", package: "swiftyjson"),
.product(name: "CryptoSwift", package: "cryptoswift")
],
path: "Sources"
.product(name: "CryptoSwift", package: "cryptoswift"),
.product(name: "Bip39", package: "Bip39.swift"),
.product(name: "Blake2", package: "Blake2.swift"),
"secp256k1"
]
),
.testTarget(
name: "AptosKitTests",
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Extensions/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Array.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 35 additions & 1 deletion Sources/AptosKit/Extensions/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Data.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -48,4 +48,38 @@ public extension Data {
func hexEncodedString() -> String {
return map { String(format: "%02hhx", $0) }.joined()
}

func setLengthLeft(_ toBytes: UInt64, isNegative: Bool = false) -> Data? {
let existingLength = UInt64(self.count)
if existingLength == toBytes {
return Data(self)
} else if existingLength > toBytes {
return nil
}
var data: Data
if isNegative {
data = Data(repeating: UInt8(255), count: Int(toBytes - existingLength))
} else {
data = Data(repeating: UInt8(0), count: Int(toBytes - existingLength))
}
data.append(self)
return data
}

func setLengthRight(_ toBytes: UInt64, isNegative: Bool = false) -> Data? {
let existingLength = UInt64(self.count)
if existingLength == toBytes {
return Data(self)
} else if existingLength > toBytes {
return nil
}
var data: Data = Data()
data.append(self)
if isNegative {
data.append(Data(repeating: UInt8(255), count: Int(toBytes - existingLength)))
} else {
data.append(Data(repeating: UInt8(0), count: Int(toBytes - existingLength)))
}
return data
}
}
2 changes: 1 addition & 1 deletion Sources/AptosKit/Extensions/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// String.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Extensions/URLSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// URLSession.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/AptosKitProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// AptosKitProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/AuthenticatorProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// AuthenticatorProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/EncodingContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// EncodingContainer.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/EncodingProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// EncodingProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/KeyProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// KeyProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/ReadObjectProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ReadObjectProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/TransactionProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TransactionProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Sources/AptosKit/Protocols/TypeProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TypeProtocol.swift
// AptosKit
//
// Copyright (c) 2023 OpenDive
// Copyright (c) 2024 OpenDive
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 7431142

Please sign in to comment.