@alephium/web3 0.2.0-rc.22 → 0.2.0-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -115,7 +115,6 @@ export declare abstract class SignerWithNodeProvider implements SignerProvider {
|
|
|
115
115
|
abstract setActiveAccount(input: string | number): Promise<void>;
|
|
116
116
|
abstract getActiveAccount(): Promise<Account>;
|
|
117
117
|
constructor(alwaysSubmitTx: boolean);
|
|
118
|
-
private defaultSignerAddress;
|
|
119
118
|
submitTransaction(unsignedTx: string, signerAddress?: string): Promise<SubmissionResult>;
|
|
120
119
|
private shouldSubmitTx;
|
|
121
120
|
private usePublicKey;
|
|
@@ -77,15 +77,12 @@ class SignerWithNodeProvider {
|
|
|
77
77
|
return account;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
async defaultSignerAddress() {
|
|
81
|
-
return (await this.getAccounts())[0].address;
|
|
82
|
-
}
|
|
83
80
|
async submitTransaction(unsignedTx, signerAddress) {
|
|
84
81
|
const decoded = await __1.web3
|
|
85
82
|
.getCurrentNodeProvider()
|
|
86
83
|
.transactions.postTransactionsDecodeUnsignedTx({ unsignedTx: unsignedTx });
|
|
87
84
|
const txId = decoded.unsignedTx.txId;
|
|
88
|
-
const address = typeof signerAddress !== 'undefined' ? signerAddress : await this.
|
|
85
|
+
const address = typeof signerAddress !== 'undefined' ? signerAddress : (await this.getActiveAccount()).address;
|
|
89
86
|
const signature = await this.signRaw(address, txId);
|
|
90
87
|
const params = { unsignedTx: unsignedTx, signature: signature };
|
|
91
88
|
return __1.web3.getCurrentNodeProvider().transactions.postTransactionsSubmit(params);
|
package/package.json
CHANGED
package/src/signer/signer.ts
CHANGED
|
@@ -186,17 +186,13 @@ export abstract class SignerWithNodeProvider implements SignerProvider {
|
|
|
186
186
|
this.alwaysSubmitTx = alwaysSubmitTx
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
private async defaultSignerAddress(): Promise<string> {
|
|
190
|
-
return (await this.getAccounts())[0].address
|
|
191
|
-
}
|
|
192
|
-
|
|
193
189
|
async submitTransaction(unsignedTx: string, signerAddress?: string): Promise<SubmissionResult> {
|
|
194
190
|
const decoded = await web3
|
|
195
191
|
.getCurrentNodeProvider()
|
|
196
192
|
.transactions.postTransactionsDecodeUnsignedTx({ unsignedTx: unsignedTx })
|
|
197
193
|
const txId = decoded.unsignedTx.txId
|
|
198
194
|
|
|
199
|
-
const address = typeof signerAddress !== 'undefined' ? signerAddress : await this.
|
|
195
|
+
const address = typeof signerAddress !== 'undefined' ? signerAddress : (await this.getActiveAccount()).address
|
|
200
196
|
const signature = await this.signRaw(address, txId)
|
|
201
197
|
const params: node.SubmitTransaction = { unsignedTx: unsignedTx, signature: signature }
|
|
202
198
|
return web3.getCurrentNodeProvider().transactions.postTransactionsSubmit(params)
|