Skip to content

Commit

Permalink
Atomic Transfer Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ffsolutions authored Jul 6, 2022
1 parent 0be65d8 commit cbe0d46
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 34 deletions.
9 changes: 4 additions & 5 deletions sdk/_namespace_based/Algorand/kmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -278,14 +278,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later

$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down
8 changes: 4 additions & 4 deletions sdk/algorand.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -500,13 +500,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down
9 changes: 4 additions & 5 deletions sdk/codeigniter setup/app/Algorand/kmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -278,14 +278,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later

$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down
9 changes: 4 additions & 5 deletions sdk/laravel setup/app/Algorand/kmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -278,14 +278,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later

$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down
9 changes: 4 additions & 5 deletions sdk/lumen setup/app/Algorand/kmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -278,14 +278,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later

$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down
9 changes: 4 additions & 5 deletions sdk/symfony setup/src/Algorand/kmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -278,14 +278,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later

$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down
9 changes: 4 additions & 5 deletions sdk/yii setup/Algorand/kmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['grp'])) { $out['txn']['grp']=strval($out['txn']['grp']); }
if(!empty($out['txn']['lv'])) { $out['txn']['lv']=intval($out['txn']['lv']); }

if(!empty($out['txn']['note'])) { $out['txn']['note']=utf8_encode(strval($out['txn']['note'])); }
if(!empty($out['txn']['note'])) { $out['txn']['note']=$msgpack->pBin(utf8_encode(strval($out['txn']['note']))); }

if(!empty($out['txn']['gp'])) { $out['txn']['gp']=strval($out['txn']['gp']); }
if(!empty($out['txn']['rekey'])) { $out['txn']['rekey']=b32::decode($out['txn']['rekey']); }
Expand Down Expand Up @@ -278,14 +278,13 @@ public function txn_encode($transaction,$opt_msgpack=false){
if(!empty($out['txn']['apar']['dc'])) { $out['txn']['apar']['dc']=intval($out['txn']['apar']['dc']); }
if(!empty($out['txn']['apar']['t'])) { $out['txn']['apar']['t']=intval($out['txn']['apar']['t']); }

//$out['txn']=array_filter($out['txn'], fn($val) => !is_null($val) AND $val !== "" AND $val !==0 AND $val !== false); // PHP 7.4 and later
$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; }); // PHP 7.2 and later

$out['txn']=array_filter($out['txn'], function($val) { return !is_null($val) AND $val !== '' AND $val !==0 AND $val !== false; });

$out=$msgpack->p($out['txn']);

$out=str_replace("6e6f7465d9","6e6f7465c4",bin2hex($out));
$out=bin2hex($out);
$out=hex2bin($out);

if($opt_msgpack==false){
$out=base64_encode($out);
}
Expand Down

0 comments on commit cbe0d46

Please sign in to comment.