Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisDemyanko committed Jun 12, 2023
1 parent 89470aa commit dc7a5e3
Show file tree
Hide file tree
Showing 46 changed files with 1,762 additions and 789 deletions.
536 changes: 264 additions & 272 deletions BeamWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions BeamWallet/BeamSDK/AppModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ typedef void(^ExportCSVBlock)(NSString * _Nonnull data, NSURL * _Nonnull url);
-(BOOL)isToken:(NSString*_Nullable)address;
-(void)generateWithdrawAddress:(NewAddressGeneratedBlock _Nonnull )block;

-(void)generateNewWalletAddressWithBlockAndAmount:(int)assetId amount:(double)amount result:(NewAddressGeneratedBlock _Nonnull)block;
-(void)generateOfflineAddress:(NSString*_Nonnull)walleetId assetId:(int)assetId amount:(double)amount result:(PublicAddressBlock _Nonnull)block;
-(NSString*_Nonnull)generateRegularAddress:(NSString*_Nonnull)walleetId assetId:(int)assetId amount:(double)amount isPermanentAddress:(BOOL)isPermanentAddress;
-(void)generateMaxPrivacyAddress:(NSString*_Nonnull)walleetId assetId:(int)assetId amount:(double)amount result:(PublicAddressBlock _Nonnull)block;
Expand Down Expand Up @@ -321,6 +322,7 @@ typedef void(^ExportCSVBlock)(NSString * _Nonnull data, NSURL * _Nonnull url);
-(void)sendDAOApiResult:(NSString*_Nonnull)json;
-(void)approveContractInfo:(NSString*_Nonnull)json info:(NSString*_Nonnull)info
amounts:(NSString*_Nonnull)amounts;
-(void)getAssetInfoAsync:(int)assetId;

-(BMApp*_Nonnull)DAOBeamXApp;
-(BMApp*_Nonnull)daoGalleryApp;
Expand Down
280 changes: 178 additions & 102 deletions BeamWallet/BeamSDK/AppModel.mm

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions BeamWallet/BeamSDK/AssetsManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ -(id)init{
}

-(NSString*_Nonnull)getAssetColor:(int)value {
if(value == 31 && [Settings.sharedManager target] == Masternet) {
if(value == 3 && [Settings.sharedManager target] == Masternet) {
return @"#977dff";
}
else if(value == 12 && [Settings.sharedManager target] == Testnet) {
Expand All @@ -107,6 +107,8 @@ -(BMAsset*_Nullable)getAsset:(int)assetId {
}
}

[[AppModel sharedManager] getAssetInfoAsync:assetId];

return nil;
}

Expand Down Expand Up @@ -135,13 +137,18 @@ -(BMTransaction*_Nullable)getLastTransaction:(int)assetId {
}

-(void)changeAssets {
NSMutableArray *notif = [NSMutableArray arrayWithArray:self->_assets];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@try {
NSMutableArray *notif = [NSMutableArray arrayWithArray:self->_assets];
NSError *error = nil;
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:notif requiringSecureCoding:YES error:&error];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:assetsKey];
[[NSUserDefaults standardUserDefaults] synchronize];
});
}
@catch (NSException *exception) {

}
@finally {
}
}

-(double)getRealAvailableAmount:(int)assetId {
Expand Down
2 changes: 2 additions & 0 deletions BeamWallet/BeamSDK/Objects/BMAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ typedef int BMAddressType;

@property (nonatomic,strong) NSString * _Nullable displayAddress;

-(NSString* _Nonnull)getSBBSAddress;

-(BOOL)isExpired;
-(UInt64)getExpirationTime;
-(NSString* _Nonnull)formattedDate;
Expand Down
7 changes: 7 additions & 0 deletions BeamWallet/BeamSDK/Objects/BMAddress.mm
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ -(NSString*_Nonnull) getWalletId {
}

-(NSString*_Nonnull) getMainId {
// if(_address != nil && [_address length] > 0) {
// return _address;
// }
return _walletId;
// return _walletId;
}

-(NSString* _Nonnull)getSBBSAddress {
return _walletId;
}

-(NSString*_Nonnull)expiredFormattedDate{
NSDateFormatter *f = [self shortFormatter];
Expand Down
21 changes: 10 additions & 11 deletions BeamWallet/BeamSDK/Objects/BMAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,20 @@

#import <Foundation/Foundation.h>

@interface BMAsset : NSObject <NSSecureCoding> {
@interface BMAsset : NSObject <NSSecureCoding, NSCopying> {


}

@property (nonatomic,strong) NSString *unitName;
@property (nonatomic,strong) NSString *nthUnitName;
@property (nonatomic,strong) NSString *shortName;
@property (nonatomic,strong) NSString *shortDesc;
@property (nonatomic,strong) NSString *longDesc;
@property (nonatomic,strong) NSString *name;
@property (nonatomic,strong) NSString *color;
@property (nonatomic,strong) NSString *site;
@property (nonatomic,strong) NSString *paper;

@property (nonatomic,strong) NSString * _Nonnull unitName;
@property (nonatomic,strong) NSString * _Nonnull nthUnitName;
@property (nonatomic,strong) NSString * _Nonnull shortName;
@property (nonatomic,strong) NSString * _Nonnull shortDesc;
@property (nonatomic,strong) NSString * _Nonnull longDesc;
@property (nonatomic,strong) NSString * _Nonnull name;
@property (nonatomic,strong) NSString * _Nonnull color;
@property (nonatomic,strong) NSString * _Nullable site;
@property (nonatomic,strong) NSString * _Nullable paper;
@property (nonatomic,assign) UInt64 assetId;

@property (nonatomic,assign) UInt64 available;
Expand Down
29 changes: 23 additions & 6 deletions BeamWallet/BeamSDK/Objects/BMAsset.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,23 @@

@implementation BMAsset

- (id)copyWithZone:(NSZone *)zone {
BMAsset *copy = [[[self class] allocWithZone:zone] init];
copy.unitName = self.unitName;
copy.nthUnitName = self.nthUnitName;
copy.shortName = self.shortName;
copy.shortDesc = self.shortDesc;
copy.longDesc = self.longDesc;
copy.name = self.name;
copy.color = self.color;
copy.site = self.site;
copy.paper = self.paper;
copy.assetId = self.assetId;
return copy;
}

+ (BOOL)supportsSecureCoding {
return NO;
return YES;
}

- (void)encodeWithCoder:(NSCoder *)encoder
Expand Down Expand Up @@ -55,8 +70,8 @@ - (void)encodeWithCoder:(NSCoder *)encoder
[encoder encodeObject:_longDesc forKey: @"longDesc"];
[encoder encodeObject:_name forKey: @"name"];
[encoder encodeObject:_color forKey: @"color"];
[encoder encodeObject:_site forKey: @"site"];
[encoder encodeObject:_paper forKey: @"paper"];
// [encoder encodeObject:_site forKey: @"site"];
// [encoder encodeObject:_paper forKey: @"paper"];
}

-(id)initWithCoder:(NSCoder *)decoder
Expand All @@ -71,8 +86,10 @@ -(id)initWithCoder:(NSCoder *)decoder
self.longDesc = [decoder decodeObjectForKey: @"longDesc"];
self.name = [decoder decodeObjectForKey: @"name"];
self.color = [decoder decodeObjectForKey: @"color"];
self.site = [decoder decodeObjectForKey: @"site"];
self.paper = [decoder decodeObjectForKey: @"paper"];
// self.site = [decoder decodeObjectForKey: @"site"];
// self.paper = [decoder decodeObjectForKey: @"paper"];
self.site = @"";
self.paper = @"";

self.available = [[decoder decodeObjectForKey: @"available"] longLongValue];
self.receiving = [[decoder decodeObjectForKey: @"receiving"] longLongValue];
Expand Down Expand Up @@ -127,7 +144,7 @@ -(BOOL)isBeam {
}

-(BOOL)isBeamX {
if(_assetId == 31 && [Settings.sharedManager target] == Masternet) {
if(_assetId == 3 && [Settings.sharedManager target] == Masternet) {
return TRUE;
}
else if(_assetId == 12 && [Settings.sharedManager target] == Testnet) {
Expand Down
2 changes: 1 addition & 1 deletion BeamWallet/BeamSDK/Objects/BMCurrency.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@implementation BMCurrency

+ (BOOL)supportsSecureCoding {
return NO;
return YES;
}

- (void)encodeWithCoder:(NSCoder *)encoder
Expand Down
2 changes: 1 addition & 1 deletion BeamWallet/BeamSDK/Objects/BMNotification.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@implementation BMNotification

+ (BOOL)supportsSecureCoding {
return NO;
return YES;
}

- (void)encodeWithCoder:(NSCoder *)encoder
Expand Down
4 changes: 4 additions & 0 deletions BeamWallet/BeamSDK/Objects/BMTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ typedef UInt64 BMTransactionType;
@property (nonatomic,strong) NSString * _Nullable minConfirmations;
@property (nonatomic,strong) NSString * _Nullable minConfirmationsProgress;

@property (nonatomic,strong) NSMutableArray<BMAsset*> * _Nullable multiAssets;


-(NSString*_Nonnull)amountString;
-(UIImage*_Nonnull)statusIcon;
Expand All @@ -109,6 +111,7 @@ typedef UInt64 BMTransactionType;
-(BOOL)isNew;
-(BOOL)isExpired;
-(BOOL)canSaveContact;
-(BOOL)isMultiAssets;

-(NSString*_Nonnull)details;
-(NSString*_Nonnull)csvLine;
Expand All @@ -117,6 +120,7 @@ typedef UInt64 BMTransactionType;
-(NSString*_Nonnull)source;

-(NSMutableAttributedString*_Nonnull)searchString:(NSString*_Nonnull)searchText;
-(NSMutableAttributedString*_Nullable)attributedAmountString;

@end

Loading

0 comments on commit dc7a5e3

Please sign in to comment.