@@ -559,11 +559,14 @@ class ProgramManager {
559
559
const tx = < Transaction > await this . buildExecutionTransaction ( options ) ;
560
560
561
561
let feeAddress ;
562
- if ( this . account !== undefined ) {
562
+
563
+ if ( typeof options . privateKey !== "undefined" ) {
564
+ feeAddress = Address . from_private_key ( options . privateKey ) ;
565
+ } else if ( this . account !== undefined ) {
563
566
feeAddress = this . account ?. address ( ) ;
564
567
} else {
565
568
throw Error (
566
- "No account set in the ProgramManager. Please set an account before executing a transaction ." ,
569
+ "No private key provided and no private key set in the ProgramManager. Please set an account or provide a private key ." ,
567
570
) ;
568
571
}
569
572
@@ -1390,7 +1393,10 @@ class ProgramManager {
1390
1393
) ;
1391
1394
1392
1395
let feeAddress ;
1393
- if ( this . account !== undefined ) {
1396
+
1397
+ if ( typeof options . privateKey !== "undefined" ) {
1398
+ feeAddress = Address . from_private_key ( options . privateKey ) ;
1399
+ } else if ( this . account !== undefined ) {
1394
1400
feeAddress = this . account ?. address ( ) ;
1395
1401
} else {
1396
1402
throw Error (
@@ -1531,7 +1537,9 @@ class ProgramManager {
1531
1537
1532
1538
let feeAddress ;
1533
1539
1534
- if ( this . account !== undefined ) {
1540
+ if ( typeof options . privateKey !== "undefined" ) {
1541
+ feeAddress = Address . from_private_key ( options . privateKey ) ;
1542
+ } else if ( this . account !== undefined ) {
1535
1543
feeAddress = this . account ?. address ( ) ;
1536
1544
} else {
1537
1545
throw Error (
@@ -1657,7 +1665,9 @@ class ProgramManager {
1657
1665
1658
1666
let feeAddress ;
1659
1667
1660
- if ( this . account !== undefined ) {
1668
+ if ( typeof options . privateKey !== "undefined" ) {
1669
+ feeAddress = Address . from_private_key ( options . privateKey ) ;
1670
+ } else if ( this . account !== undefined ) {
1661
1671
feeAddress = this . account ?. address ( ) ;
1662
1672
} else {
1663
1673
throw Error (
@@ -1774,7 +1784,9 @@ class ProgramManager {
1774
1784
1775
1785
let feeAddress ;
1776
1786
1777
- if ( this . account !== undefined ) {
1787
+ if ( typeof options . privateKey !== "undefined" ) {
1788
+ feeAddress = Address . from_private_key ( options . privateKey ) ;
1789
+ } else if ( this . account !== undefined ) {
1778
1790
feeAddress = this . account ?. address ( ) ;
1779
1791
} else {
1780
1792
throw Error (
@@ -1904,7 +1916,9 @@ class ProgramManager {
1904
1916
1905
1917
let feeAddress ;
1906
1918
1907
- if ( this . account !== undefined ) {
1919
+ if ( typeof options . privateKey !== "undefined" ) {
1920
+ feeAddress = Address . from_private_key ( options . privateKey ) ;
1921
+ } else if ( this . account !== undefined ) {
1908
1922
feeAddress = this . account ?. address ( ) ;
1909
1923
} else {
1910
1924
throw Error (
0 commit comments