Skip to content

Commit

Permalink
[panthalassa] Added updated lib
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoestarrona committed Sep 30, 2018
1 parent 248d432 commit 7aa509e
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 0 deletions.
Binary file added android/panthalassa/panthalassa.aar
Binary file not shown.
1 change: 1 addition & 0 deletions ios/Frameworks/panthalassa.framework/Headers
1 change: 1 addition & 0 deletions ios/Frameworks/panthalassa.framework/Modules
1 change: 1 addition & 0 deletions ios/Frameworks/panthalassa.framework/Panthalassa
1 change: 1 addition & 0 deletions ios/Frameworks/panthalassa.framework/Resources
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

// Objective-C API for talking to the following Go packages
//
// github.com/Bit-Nation/panthalassa
//
// File is generated by gomobile bind. Do not edit.
#ifndef __Panthalassa_FRAMEWORK_H__
#define __Panthalassa_FRAMEWORK_H__

#include "Panthalassa.objc.h"
#include "universe.objc.h"

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// Objective-C API for talking to github.com/Bit-Nation/panthalassa Go package.
// gobind -lang=objc github.com/Bit-Nation/panthalassa
//
// File is generated by gobind. Do not edit.

#ifndef __Panthalassa_H__
#define __Panthalassa_H__

@import Foundation;
#include "Universe.objc.h"


@class PanthalassaPanthalassa;
@class PanthalassaStartConfig;
@protocol PanthalassaUpStream;
@class PanthalassaUpStream;

@protocol PanthalassaUpStream <NSObject>
- (void)send:(NSString*)data;
@end

@interface PanthalassaPanthalassa : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) id _ref;

- (instancetype)initWithRef:(id)ref;
- (instancetype)init;
/**
* add friend to peer store
*/
- (BOOL)addContact:(NSString*)pubKey error:(NSError**)error;
/**
* Export account with the given password
*/
- (NSString*)export:(NSString*)pw pwConfirm:(NSString*)pwConfirm error:(NSError**)error;
/**
* Stop the panthalassa instance
this becomes interesting when we start
to use the mesh network
*/
- (BOOL)stop:(NSError**)error;
@end

@interface PanthalassaStartConfig : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) id _ref;

- (instancetype)initWithRef:(id)ref;
- (instancetype)init;
- (NSString*)encryptedKeyManager;
- (void)setEncryptedKeyManager:(NSString*)v;
- (NSString*)signedProfile;
- (void)setSignedProfile:(NSString*)v;
- (NSString*)ethWsEndpoint;
- (void)setEthWsEndpoint:(NSString*)v;
- (BOOL)enableDebugging;
- (void)setEnableDebugging:(BOOL)v;
- (NSString*)privChatEndpoint;
- (void)setPrivChatEndpoint:(NSString*)v;
- (NSString*)privChatBearerToken;
- (void)setPrivChatBearerToken:(NSString*)v;
@end

FOUNDATION_EXPORT BOOL PanthalassaAddUsersToGroupChat(NSString* users, long chatID, NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaAllChats(NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaCall(NSString* command, NSString* payload, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaCallDAppFunction(NSString* signingKey, long id_, NSString* args, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaConnectLogger(NSString* address, NSError** error);

/**
* connect the host to DApp development server
*/
FOUNDATION_EXPORT BOOL PanthalassaConnectToDAppDevHost(NSString* address, NSError** error);

/**
* return chatID
*/
FOUNDATION_EXPORT BOOL PanthalassaCreateGroupChat(NSString* users, NSString* name, long* ret0_, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaCreatePrivateChat(NSString* partnerStr, long* ret0_, NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaDApps(NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaEthAddress(NSError** error);

/**
* Eth Private key
*/
FOUNDATION_EXPORT NSString* PanthalassaEthPrivateKey(NSError** error);

/**
* converts an ethereum public key to address
*/
FOUNDATION_EXPORT NSString* PanthalassaEthPubToAddress(NSString* pub, NSError** error);

/**
* Export the current account store with given password
*/
FOUNDATION_EXPORT NSString* PanthalassaExportAccountStore(NSString* pw, NSString* pwConfirm, NSError** error);

/**
* fetch the identity public key of the
*/
FOUNDATION_EXPORT NSString* PanthalassaGetIdentityPublicKey(NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaGetMnemonic(NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaIdentityPublicKey(NSError** error);

/**
* Check if mnemonic is valid
*/
FOUNDATION_EXPORT BOOL PanthalassaIsValidMnemonic(NSString* mne);

FOUNDATION_EXPORT BOOL PanthalassaMarkMessagesAsRead(long chatID, NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaMessages(long chatID, NSString* startStr, long amount, NSError** error);

/**
* Creates an new set of encrypted account key's
*/
FOUNDATION_EXPORT NSString* PanthalassaNewAccountKeys(NSString* pw, NSString* pwConfirm, NSError** error);

/**
* Create new account store from mnemonic
This can e.g. be used in case you need to recover your account
*/
FOUNDATION_EXPORT NSString* PanthalassaNewAccountKeysFromMnemonic(NSString* mne, NSString* pw, NSString* pwConfirm, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaOpenDApp(NSString* id_, NSString* context, NSError** error);

// skipped function RegisterContactCalls with unsupported parameter or return types


// skipped function RegisterDocumentCalls with unsupported parameter or return types


FOUNDATION_EXPORT NSString* PanthalassaRenderMessage(NSString* signingKey, NSString* payload, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaSendMessage(long chatID, NSString* message, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaSendResponse(NSString* id_, NSString* data, NSString* responseError, long timeout, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaSetLogger(NSString* level, NSError** error);

FOUNDATION_EXPORT NSString* PanthalassaSignProfile(NSString* name, NSString* location, NSString* image, NSError** error);

/**
* sign profile
*/
FOUNDATION_EXPORT NSString* PanthalassaSignProfileStandAlone(NSString* name, NSString* location, NSString* image, NSString* keyManagerStore, NSString* password, NSError** error);

/**
* start panthalassa
*/
FOUNDATION_EXPORT BOOL PanthalassaStart(NSString* dbDir, NSString* config, NSString* password, id<PanthalassaUpStream> client, id<PanthalassaUpStream> uiUpstream, NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaStartDApp(NSString* dAppSingingKeyStr, long timeout, NSError** error);

/**
* create a new panthalassa instance with the mnemonic
*/
FOUNDATION_EXPORT BOOL PanthalassaStartFromMnemonic(NSString* dbDir, NSString* config, NSString* mnemonic, id<PanthalassaUpStream> client, id<PanthalassaUpStream> uiUpstream, NSError** error);

/**
* Stop panthalassa
*/
FOUNDATION_EXPORT BOOL PanthalassaStop(NSError** error);

FOUNDATION_EXPORT BOOL PanthalassaStopDApp(NSString* dAppSingingKeyStr, NSError** error);

@class PanthalassaUpStream;

@interface PanthalassaUpStream : NSObject <goSeqRefInterface, PanthalassaUpStream> {
}
@property(strong, readonly) id _ref;

- (instancetype)initWithRef:(id)ref;
- (void)send:(NSString*)data;
@end

#endif
35 changes: 35 additions & 0 deletions ios/Frameworks/panthalassa.framework/Versions/A/Headers/ref.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#ifndef __GO_REF_HDR__
#define __GO_REF_HDR__

#include <Foundation/Foundation.h>

// GoSeqRef is an object tagged with an integer for passing back and
// forth across the language boundary. A GoSeqRef may represent either
// an instance of a Go object, or an Objective-C object passed to Go.
// The explicit allocation of a GoSeqRef is used to pin a Go object
// when it is passed to Objective-C. The Go seq package maintains a
// reference to the Go object in a map keyed by the refnum along with
// a reference count. When the reference count reaches zero, the Go
// seq package will clear the corresponding entry in the map.
@interface GoSeqRef : NSObject {
}
@property(readonly) int32_t refnum;
@property(strong) id obj; // NULL when representing a Go object.

// new GoSeqRef object to proxy a Go object. The refnum must be
// provided from Go side.
- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj;

- (int32_t)incNum;

@end

@protocol goSeqRefInterface
-(GoSeqRef*) _ref;
@end

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Objective-C API for talking to Go package.
// gobind -lang=objc
//
// File is generated by gobind. Do not edit.

#ifndef __Universe_H__
#define __Universe_H__

@import Foundation;

@protocol Universeerror;
@class Universeerror;

@protocol Universeerror <NSObject>
- (NSString*)error;
@end

@class Universeerror;

@interface Universeerror : NSError <goSeqRefInterface, Universeerror> {
}
@property(strong, readonly) id _ref;

- (instancetype)initWithRef:(id)ref;
- (NSString*)error;
@end

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
framework module "Panthalassa" {
header "ref.h"
header "Panthalassa.objc.h"
header "universe.objc.h"
header "Panthalassa.h"

export *
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
1 change: 1 addition & 0 deletions ios/Frameworks/panthalassa.framework/Versions/Current

0 comments on commit 7aa509e

Please sign in to comment.