Skip to content

Commit

Permalink
Merge pull request #1250 from Web3Auth/update-aptos-ios
Browse files Browse the repository at this point in the history
Modified the Aptos iOS example to use the latest Aptos Swift SDK
  • Loading branch information
AyushBherwani1998 authored Sep 18, 2024
2 parents ad58401 + a1adbbf commit 4b9f12a
Show file tree
Hide file tree
Showing 9 changed files with 369 additions and 126 deletions.
38 changes: 22 additions & 16 deletions ios/ios-aptos-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,34 @@

[Join our Community Portal](https://community.web3auth.io/) to get support and stay up to date with the latest news and updates.

This example demonstrates how to use Web3Auth to get create a Aptos account, connect and interact with Aptos chain in iOS.
This example demonstrates how to use Web3Auth to create an Aptos account, connect to the Aptos chain, and interact with it in an iOS application using the [Web3Auth PnP Swift SDK](https://web3auth.io/docs/sdk/pnp/ios) and the [Aptos Swift SDK](https://github.com/ALCOVE-LAB/aptos-swift-sdk).

## How to Use

### Download Manually
### Installation

```bash
npx degit Web3Auth/web3auth-pnp-examples/ios/ios-aptos-example w3a-ios-aptos
```
1. **Download the Example Project**

Install & Run:
```bash
npx degit Web3Auth/web3auth-pnp-examples/ios/ios-aptos-example w3a-ios-aptos
```

```bash
cd w3a-ios-aptos
# Run project in Xcode
```
2. **Open the Project in Xcode**

Run the project in Xcode:

```bash
open ios-aptos-example.xcodeproj
```

## Important Links

- [Website](https://web3auth.io)
- [Docs](https://web3auth.io/docs)
- [Guides](https://web3auth.io/docs/guides)
- [SDK / API References](https://web3auth.io/docs/sdk)
- [Pricing](https://web3auth.io/pricing.html)
- [Community Portal](https://community.web3auth.io)
- [Web3Auth PnP Swift SDK Documentation](https://web3auth.io/docs/sdk/pnp/ios)
- [Aptos Swift SDK GitHub](https://github.com/ALCOVE-LAB/aptos-swift-sdk)
- [Aptos SDK Documentation](https://aptos.dev/en/build/sdks/community-sdks/swift-sdk)
- [Web3Auth Website](https://web3auth.io)
- [Web3Auth Docs](https://web3auth.io/docs)
- [Web3Auth Guides](https://web3auth.io/docs/guides)
- [Web3Auth SDK / API References](https://web3auth.io/docs/sdk)
- [Web3Auth Pricing](https://web3auth.io/pricing.html)
- [Web3Auth Community Portal](https://community.web3auth.io)
38 changes: 27 additions & 11 deletions ios/ios-aptos-example/ios-aptos-example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
280AFE1D2C00B3530007AA03 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AFE1C2C00B3530007AA03 /* LoginView.swift */; };
280AFE1F2C00B35E0007AA03 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AFE1E2C00B35E0007AA03 /* HomeView.swift */; };
280AFE232C00B47C0007AA03 /* AptosHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AFE222C00B47C0007AA03 /* AptosHelper.swift */; };
280AFE262C00B4C20007AA03 /* AptosKit in Frameworks */ = {isa = PBXBuildFile; productRef = 280AFE252C00B4C20007AA03 /* AptosKit */; };
280AFE282C019E810007AA03 /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 280AFE272C019E810007AA03 /* Extension.swift */; };
A4DCEE712C8B36670048A663 /* Aptos in Frameworks */ = {isa = PBXBuildFile; productRef = A4DCEE702C8B36670048A663 /* Aptos */; };
A4DCEE732C8B36670048A663 /* BIP32 in Frameworks */ = {isa = PBXBuildFile; productRef = A4DCEE722C8B36670048A663 /* BIP32 */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -65,8 +66,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A4DCEE732C8B36670048A663 /* BIP32 in Frameworks */,
A4DCEE712C8B36670048A663 /* Aptos in Frameworks */,
280AFE142C00AF2C0007AA03 /* Web3Auth in Frameworks */,
280AFE262C00B4C20007AA03 /* AptosKit in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -94,6 +96,7 @@
280AFDF82C00AEFE0007AA03 /* ios-aptos-exampleTests */,
280AFE022C00AEFE0007AA03 /* ios-aptos-exampleUITests */,
280AFDE62C00AEFC0007AA03 /* Products */,
A45EB4E82C8AEB21008CDCF8 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -173,6 +176,13 @@
path = Views;
sourceTree = "<group>";
};
A45EB4E82C8AEB21008CDCF8 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -191,7 +201,8 @@
name = "ios-aptos-example";
packageProductDependencies = (
280AFE132C00AF2C0007AA03 /* Web3Auth */,
280AFE252C00B4C20007AA03 /* AptosKit */,
A4DCEE702C8B36670048A663 /* Aptos */,
A4DCEE722C8B36670048A663 /* BIP32 */,
);
productName = "ios-aptos-example";
productReference = 280AFDE52C00AEFC0007AA03 /* ios-aptos-example.app */;
Expand Down Expand Up @@ -267,7 +278,7 @@
mainGroup = 280AFDDC2C00AEFC0007AA03;
packageReferences = (
280AFE122C00AF2C0007AA03 /* XCRemoteSwiftPackageReference "web3auth-swift-sdk" */,
280AFE242C00B4C20007AA03 /* XCRemoteSwiftPackageReference "AptosKit" */,
A4DCEE6F2C8B36670048A663 /* XCRemoteSwiftPackageReference "aptos-swift-sdk" */,
);
productRefGroup = 280AFDE62C00AEFC0007AA03 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -658,12 +669,12 @@
minimumVersion = 9.0.0;
};
};
280AFE242C00B4C20007AA03 /* XCRemoteSwiftPackageReference "AptosKit" */ = {
A4DCEE6F2C8B36670048A663 /* XCRemoteSwiftPackageReference "aptos-swift-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/OpenDive/AptosKit";
repositoryURL = "https://github.com/ALCOVE-LAB/aptos-swift-sdk.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.2.0;
branch = main;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand All @@ -674,10 +685,15 @@
package = 280AFE122C00AF2C0007AA03 /* XCRemoteSwiftPackageReference "web3auth-swift-sdk" */;
productName = Web3Auth;
};
280AFE252C00B4C20007AA03 /* AptosKit */ = {
A4DCEE702C8B36670048A663 /* Aptos */ = {
isa = XCSwiftPackageProductDependency;
package = A4DCEE6F2C8B36670048A663 /* XCRemoteSwiftPackageReference "aptos-swift-sdk" */;
productName = Aptos;
};
A4DCEE722C8B36670048A663 /* BIP32 */ = {
isa = XCSwiftPackageProductDependency;
package = 280AFE242C00B4C20007AA03 /* XCRemoteSwiftPackageReference "AptosKit" */;
productName = AptosKit;
package = A4DCEE6F2C8B36670048A663 /* XCRemoteSwiftPackageReference "aptos-swift-sdk" */;
productName = BIP32;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "03da4cfa3c7e05349f3b3541f73bf56847f6351d236935a7aa254ffccbcde798",
"originHash" : "c5d16b0968e4fbe28d85effde140f5fd8b458629cafc7911d79915d17535e9c2",
"pins" : [
{
"identity" : "aptoskit",
"identity" : "aptos-swift-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/OpenDive/AptosKit",
"location" : "https://github.com/ALCOVE-LAB/aptos-swift-sdk.git",
"state" : {
"revision" : "307c6b3e71dfbac72818964c45b21a52aa67b13a",
"version" : "1.2.0"
"branch" : "main",
"revision" : "bf2aa0681ebb24f59ade2f6cf1f5fc6978eb86e8"
}
},
{
Expand Down Expand Up @@ -38,21 +38,30 @@
}
},
{
"identity" : "ed25519swift",
"identity" : "keychain-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pebble8888/ed25519swift.git",
"location" : "https://github.com/evgenyneu/keychain-swift.git",
"state" : {
"revision" : "1e821f5516049f5b83aca8cb3b982910cf8c028c",
"version" : "1.2.8"
"revision" : "d108a1fa6189e661f91560548ef48651ed8d93b9",
"version" : "20.0.0"
}
},
{
"identity" : "keychain-swift",
"identity" : "mnemonicswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/evgenyneu/keychain-swift.git",
"location" : "https://github.com/Electric-Coin-Company/MnemonicSwift.git",
"state" : {
"revision" : "d108a1fa6189e661f91560548ef48651ed8d93b9",
"version" : "20.0.0"
"revision" : "716a2c32ac2bbd8a1499ac834077df42b75edc85",
"version" : "2.2.4"
}
},
{
"identity" : "secp256k1.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/GigaBitcoin/secp256k1.swift.git",
"state" : {
"revision" : "9683e8e311c76d8114cd308b697dad2f9fc58fed",
"version" : "0.17.0"
}
},
{
Expand All @@ -65,21 +74,48 @@
}
},
{
"identity" : "swiftyjson",
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "60f13f60c4d093691934dc6cfdf5f508ada1f894",
"version" : "2.6.0"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types.git",
"state" : {
"revision" : "ae67c8178eb46944fd85e4dc6dd970e1f3ed6ccd",
"version" : "1.3.0"
}
},
{
"identity" : "swift-openapi-runtime",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyJSON/SwiftyJSON.git",
"location" : "https://github.com/apple/swift-openapi-runtime",
"state" : {
"revision" : "2b6054efa051565954e1d2b9da831680026cd768",
"version" : "4.3.0"
"revision" : "26e8ae3515d1ff3607e924ac96fc0094775f55e8",
"version" : "1.5.0"
}
},
{
"identity" : "uint256",
"identity" : "swift-openapi-urlsession",
"kind" : "remoteSourceControl",
"location" : "https://github.com/hyugit/UInt256.git",
"location" : "https://github.com/apple/swift-openapi-urlsession.git",
"state" : {
"revision" : "1a499a1bf08afd10b9fcd0fd6d90b6dd9196be50",
"version" : "0.2.2"
"revision" : "9bf4c712ad7989d6a91dbe68748b8829a50837e4",
"version" : "1.0.2"
}
},
{
Expand Down
Loading

0 comments on commit 4b9f12a

Please sign in to comment.