@stellar/stellar-sdk 13.0.0-rc.1 → 13.0.0-rc.2
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.
- package/CHANGELOG.md +31 -1
- package/dist/stellar-sdk-minimal.js +363 -93
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +380 -96
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +363 -93
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +380 -96
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.d.ts +75 -3
- package/lib/contract/assembled_transaction.js +123 -34
- package/lib/contract/basic_node_signer.d.ts +3 -2
- package/lib/contract/basic_node_signer.js +16 -8
- package/lib/contract/client.d.ts +13 -1
- package/lib/contract/client.js +159 -48
- package/lib/contract/types.d.ts +72 -8
- package/lib/contract/types.js +1 -0
- package/lib/horizon/call_builder.d.ts +1 -1
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server_api.d.ts +1 -0
- package/lib/horizon/server_api.js +5 -0
- package/lib/horizon/types/effects.d.ts +51 -51
- package/lib/horizon/types/trade.d.ts +3 -2
- package/lib/http-client/types.d.ts +1 -0
- package/lib/minimal/contract/assembled_transaction.d.ts +75 -3
- package/lib/minimal/contract/assembled_transaction.js +123 -34
- package/lib/minimal/contract/basic_node_signer.d.ts +3 -2
- package/lib/minimal/contract/basic_node_signer.js +16 -8
- package/lib/minimal/contract/client.d.ts +13 -1
- package/lib/minimal/contract/client.js +159 -48
- package/lib/minimal/contract/types.d.ts +72 -8
- package/lib/minimal/contract/types.js +1 -0
- package/lib/minimal/horizon/call_builder.d.ts +1 -1
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server_api.d.ts +1 -0
- package/lib/minimal/horizon/server_api.js +5 -0
- package/lib/minimal/horizon/types/effects.d.ts +51 -51
- package/lib/minimal/horizon/types/trade.d.ts +3 -2
- package/lib/minimal/http-client/types.d.ts +1 -0
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/stellartoml/index.d.ts +1 -0
- package/lib/minimal/stellartoml/index.js +2 -0
- package/lib/no-axios/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-axios/contract/assembled_transaction.js +123 -34
- package/lib/no-axios/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-axios/contract/basic_node_signer.js +16 -8
- package/lib/no-axios/contract/client.d.ts +13 -1
- package/lib/no-axios/contract/client.js +159 -48
- package/lib/no-axios/contract/types.d.ts +72 -8
- package/lib/no-axios/contract/types.js +1 -0
- package/lib/no-axios/horizon/call_builder.d.ts +1 -1
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server_api.d.ts +1 -0
- package/lib/no-axios/horizon/server_api.js +5 -0
- package/lib/no-axios/horizon/types/effects.d.ts +51 -51
- package/lib/no-axios/horizon/types/trade.d.ts +3 -2
- package/lib/no-axios/http-client/types.d.ts +1 -0
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/stellartoml/index.d.ts +1 -0
- package/lib/no-axios/stellartoml/index.js +2 -0
- package/lib/no-eventsource/contract/assembled_transaction.d.ts +75 -3
- package/lib/no-eventsource/contract/assembled_transaction.js +123 -34
- package/lib/no-eventsource/contract/basic_node_signer.d.ts +3 -2
- package/lib/no-eventsource/contract/basic_node_signer.js +16 -8
- package/lib/no-eventsource/contract/client.d.ts +13 -1
- package/lib/no-eventsource/contract/client.js +159 -48
- package/lib/no-eventsource/contract/types.d.ts +72 -8
- package/lib/no-eventsource/contract/types.js +1 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server_api.d.ts +1 -0
- package/lib/no-eventsource/horizon/server_api.js +5 -0
- package/lib/no-eventsource/horizon/types/effects.d.ts +51 -51
- package/lib/no-eventsource/horizon/types/trade.d.ts +3 -2
- package/lib/no-eventsource/http-client/types.d.ts +1 -0
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/stellartoml/index.d.ts +1 -0
- package/lib/no-eventsource/stellartoml/index.js +2 -0
- package/lib/rpc/axios.js +1 -1
- package/lib/stellartoml/index.d.ts +1 -0
- package/lib/stellartoml/index.js +2 -0
- package/package.json +1 -1
|
@@ -132,7 +132,10 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
132
132
|
signTransaction,
|
|
133
133
|
sigsNeeded,
|
|
134
134
|
timeoutInSeconds,
|
|
135
|
+
signOpts,
|
|
136
|
+
_yield$signTransactio,
|
|
135
137
|
signature,
|
|
138
|
+
error,
|
|
136
139
|
_args2 = arguments;
|
|
137
140
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
138
141
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -171,14 +174,21 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
171
174
|
timebounds: undefined,
|
|
172
175
|
sorobanData: _this.simulationData.transactionData
|
|
173
176
|
}).setTimeout(timeoutInSeconds).build();
|
|
174
|
-
|
|
175
|
-
return signTransaction(_this.built.toXDR(), {
|
|
177
|
+
signOpts = {
|
|
176
178
|
networkPassphrase: _this.options.networkPassphrase
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
};
|
|
180
|
+
if (_this.options.address) signOpts.address = _this.options.address;
|
|
181
|
+
if (_this.options.submit !== undefined) signOpts.submit = _this.options.submit;
|
|
182
|
+
if (_this.options.submitUrl) signOpts.submitUrl = _this.options.submitUrl;
|
|
183
|
+
_context2.next = 18;
|
|
184
|
+
return signTransaction(_this.built.toXDR(), signOpts);
|
|
185
|
+
case 18:
|
|
186
|
+
_yield$signTransactio = _context2.sent;
|
|
187
|
+
signature = _yield$signTransactio.signedTxXdr;
|
|
188
|
+
error = _yield$signTransactio.error;
|
|
189
|
+
_this.handleWalletError(error);
|
|
180
190
|
_this.signed = _stellarBase.TransactionBuilder.fromXDR(signature, _this.options.networkPassphrase);
|
|
181
|
-
case
|
|
191
|
+
case 23:
|
|
182
192
|
case "end":
|
|
183
193
|
return _context2.stop();
|
|
184
194
|
}
|
|
@@ -190,27 +200,37 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
190
200
|
force,
|
|
191
201
|
_ref6$signTransaction,
|
|
192
202
|
signTransaction,
|
|
203
|
+
originalSubmit,
|
|
193
204
|
_args3 = arguments;
|
|
194
205
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
195
206
|
while (1) switch (_context3.prev = _context3.next) {
|
|
196
207
|
case 0:
|
|
197
208
|
_ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, _ref6$force = _ref6.force, force = _ref6$force === void 0 ? false : _ref6$force, _ref6$signTransaction = _ref6.signTransaction, signTransaction = _ref6$signTransaction === void 0 ? _this.options.signTransaction : _ref6$signTransaction;
|
|
198
209
|
if (_this.signed) {
|
|
199
|
-
_context3.next =
|
|
210
|
+
_context3.next = 10;
|
|
200
211
|
break;
|
|
201
212
|
}
|
|
202
|
-
|
|
213
|
+
originalSubmit = _this.options.submit;
|
|
214
|
+
if (_this.options.submit) {
|
|
215
|
+
_this.options.submit = false;
|
|
216
|
+
}
|
|
217
|
+
_context3.prev = 4;
|
|
218
|
+
_context3.next = 7;
|
|
203
219
|
return _this.sign({
|
|
204
220
|
force: force,
|
|
205
221
|
signTransaction: signTransaction
|
|
206
222
|
});
|
|
207
|
-
case
|
|
223
|
+
case 7:
|
|
224
|
+
_context3.prev = 7;
|
|
225
|
+
_this.options.submit = originalSubmit;
|
|
226
|
+
return _context3.finish(7);
|
|
227
|
+
case 10:
|
|
208
228
|
return _context3.abrupt("return", _this.send());
|
|
209
|
-
case
|
|
229
|
+
case 11:
|
|
210
230
|
case "end":
|
|
211
231
|
return _context3.stop();
|
|
212
232
|
}
|
|
213
|
-
}, _callee3);
|
|
233
|
+
}, _callee3, null, [[4,, 7, 10]]);
|
|
214
234
|
})));
|
|
215
235
|
_defineProperty(this, "needsNonInvokerSigningBy", function () {
|
|
216
236
|
var _rawInvokeHostFunctio;
|
|
@@ -325,18 +345,21 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
325
345
|
_context6.t1 = entry;
|
|
326
346
|
_context6.t2 = function () {
|
|
327
347
|
var _ref11 = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(preimage) {
|
|
348
|
+
var _yield$sign, signedAuthEntry, error;
|
|
328
349
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
329
350
|
while (1) switch (_context5.prev = _context5.next) {
|
|
330
351
|
case 0:
|
|
331
|
-
_context5.
|
|
332
|
-
_context5.next = 3;
|
|
352
|
+
_context5.next = 2;
|
|
333
353
|
return sign(preimage.toXDR("base64"), {
|
|
334
|
-
|
|
354
|
+
address: address
|
|
335
355
|
});
|
|
336
|
-
case
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
356
|
+
case 2:
|
|
357
|
+
_yield$sign = _context5.sent;
|
|
358
|
+
signedAuthEntry = _yield$sign.signedAuthEntry;
|
|
359
|
+
error = _yield$sign.error;
|
|
360
|
+
_this.handleWalletError(error);
|
|
361
|
+
return _context5.abrupt("return", Buffer.from(signedAuthEntry, "base64"));
|
|
362
|
+
case 7:
|
|
340
363
|
case "end":
|
|
341
364
|
return _context5.stop();
|
|
342
365
|
}
|
|
@@ -424,6 +447,26 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
424
447
|
if (!this.built) throw new Error("Transaction has not yet been simulated; " + "call `AssembledTransaction.simulate` first.");
|
|
425
448
|
return (_this$built2 = this.built) === null || _this$built2 === void 0 ? void 0 : _this$built2.toEnvelope().toXDR('base64');
|
|
426
449
|
}
|
|
450
|
+
}, {
|
|
451
|
+
key: "handleWalletError",
|
|
452
|
+
value: function handleWalletError(error) {
|
|
453
|
+
if (!error) return;
|
|
454
|
+
var message = error.message,
|
|
455
|
+
code = error.code;
|
|
456
|
+
var fullMessage = "".concat(message).concat(error.ext ? " (".concat(error.ext.join(', '), ")") : '');
|
|
457
|
+
switch (code) {
|
|
458
|
+
case -1:
|
|
459
|
+
throw new AssembledTransaction.Errors.InternalWalletError(fullMessage);
|
|
460
|
+
case -2:
|
|
461
|
+
throw new AssembledTransaction.Errors.ExternalServiceError(fullMessage);
|
|
462
|
+
case -3:
|
|
463
|
+
throw new AssembledTransaction.Errors.InvalidClientRequest(fullMessage);
|
|
464
|
+
case -4:
|
|
465
|
+
throw new AssembledTransaction.Errors.UserRejected(fullMessage);
|
|
466
|
+
default:
|
|
467
|
+
throw new Error("Unhandled error: ".concat(fullMessage));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
427
470
|
}, {
|
|
428
471
|
key: "simulationData",
|
|
429
472
|
get: function get() {
|
|
@@ -439,7 +482,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
439
482
|
throw new AssembledTransaction.Errors.NotYetSimulated("Transaction has not yet been simulated");
|
|
440
483
|
}
|
|
441
484
|
if (_api.Api.isSimulationError(simulation)) {
|
|
442
|
-
throw new
|
|
485
|
+
throw new AssembledTransaction.Errors.SimulationFailed("Transaction simulation failed: \"".concat(simulation.error, "\""));
|
|
443
486
|
}
|
|
444
487
|
if (_api.Api.isSimulationRestore(simulation)) {
|
|
445
488
|
throw new AssembledTransaction.Errors.ExpiredState("You need to restore some contract state before you can invoke this method.\n" + 'You can set `restore` to true in the method options in order to ' + 'automatically restore the contract state when needed.');
|
|
@@ -615,41 +658,47 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
615
658
|
}
|
|
616
659
|
}, {
|
|
617
660
|
key: "build",
|
|
661
|
+
value: function build(options) {
|
|
662
|
+
var _options$args;
|
|
663
|
+
var contract = new _stellarBase.Contract(options.contractId);
|
|
664
|
+
return AssembledTransaction.buildWithOp(contract.call.apply(contract, [options.method].concat(_toConsumableArray((_options$args = options.args) !== null && _options$args !== void 0 ? _options$args : []))), options);
|
|
665
|
+
}
|
|
666
|
+
}, {
|
|
667
|
+
key: "buildWithOp",
|
|
618
668
|
value: (function () {
|
|
619
|
-
var
|
|
620
|
-
var _options$fee, _options$
|
|
621
|
-
var tx,
|
|
669
|
+
var _buildWithOp = _asyncToGenerator(_regeneratorRuntime().mark(function _callee9(operation, options) {
|
|
670
|
+
var _options$fee, _options$timeoutInSec;
|
|
671
|
+
var tx, account;
|
|
622
672
|
return _regeneratorRuntime().wrap(function _callee9$(_context10) {
|
|
623
673
|
while (1) switch (_context10.prev = _context10.next) {
|
|
624
674
|
case 0:
|
|
625
675
|
tx = new AssembledTransaction(options);
|
|
626
|
-
|
|
627
|
-
_context10.next = 4;
|
|
676
|
+
_context10.next = 3;
|
|
628
677
|
return (0, _utils.getAccount)(options, tx.server);
|
|
629
|
-
case
|
|
678
|
+
case 3:
|
|
630
679
|
account = _context10.sent;
|
|
631
680
|
tx.raw = new _stellarBase.TransactionBuilder(account, {
|
|
632
681
|
fee: (_options$fee = options.fee) !== null && _options$fee !== void 0 ? _options$fee : _stellarBase.BASE_FEE,
|
|
633
682
|
networkPassphrase: options.networkPassphrase
|
|
634
|
-
}).
|
|
683
|
+
}).setTimeout((_options$timeoutInSec = options.timeoutInSeconds) !== null && _options$timeoutInSec !== void 0 ? _options$timeoutInSec : _types.DEFAULT_TIMEOUT).addOperation(operation);
|
|
635
684
|
if (!options.simulate) {
|
|
636
|
-
_context10.next =
|
|
685
|
+
_context10.next = 8;
|
|
637
686
|
break;
|
|
638
687
|
}
|
|
639
|
-
_context10.next =
|
|
688
|
+
_context10.next = 8;
|
|
640
689
|
return tx.simulate();
|
|
641
|
-
case
|
|
690
|
+
case 8:
|
|
642
691
|
return _context10.abrupt("return", tx);
|
|
643
|
-
case
|
|
692
|
+
case 9:
|
|
644
693
|
case "end":
|
|
645
694
|
return _context10.stop();
|
|
646
695
|
}
|
|
647
696
|
}, _callee9);
|
|
648
697
|
}));
|
|
649
|
-
function
|
|
650
|
-
return
|
|
698
|
+
function buildWithOp(_x4, _x5) {
|
|
699
|
+
return _buildWithOp.apply(this, arguments);
|
|
651
700
|
}
|
|
652
|
-
return
|
|
701
|
+
return buildWithOp;
|
|
653
702
|
}())
|
|
654
703
|
}, {
|
|
655
704
|
key: "buildFootprintRestoreTransaction",
|
|
@@ -677,7 +726,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
677
726
|
}
|
|
678
727
|
}, _callee10);
|
|
679
728
|
}));
|
|
680
|
-
function buildFootprintRestoreTransaction(
|
|
729
|
+
function buildFootprintRestoreTransaction(_x6, _x7, _x8, _x9) {
|
|
681
730
|
return _buildFootprintRestoreTransaction.apply(this, arguments);
|
|
682
731
|
}
|
|
683
732
|
return buildFootprintRestoreTransaction;
|
|
@@ -748,5 +797,45 @@ _defineProperty(AssembledTransaction, "Errors", {
|
|
|
748
797
|
}
|
|
749
798
|
_inherits(FakeAccountError, _Error8);
|
|
750
799
|
return _createClass(FakeAccountError);
|
|
800
|
+
}(_wrapNativeSuper(Error)),
|
|
801
|
+
SimulationFailed: function (_Error9) {
|
|
802
|
+
function SimulationFailedError() {
|
|
803
|
+
_classCallCheck(this, SimulationFailedError);
|
|
804
|
+
return _callSuper(this, SimulationFailedError, arguments);
|
|
805
|
+
}
|
|
806
|
+
_inherits(SimulationFailedError, _Error9);
|
|
807
|
+
return _createClass(SimulationFailedError);
|
|
808
|
+
}(_wrapNativeSuper(Error)),
|
|
809
|
+
InternalWalletError: function (_Error10) {
|
|
810
|
+
function InternalWalletError() {
|
|
811
|
+
_classCallCheck(this, InternalWalletError);
|
|
812
|
+
return _callSuper(this, InternalWalletError, arguments);
|
|
813
|
+
}
|
|
814
|
+
_inherits(InternalWalletError, _Error10);
|
|
815
|
+
return _createClass(InternalWalletError);
|
|
816
|
+
}(_wrapNativeSuper(Error)),
|
|
817
|
+
ExternalServiceError: function (_Error11) {
|
|
818
|
+
function ExternalServiceError() {
|
|
819
|
+
_classCallCheck(this, ExternalServiceError);
|
|
820
|
+
return _callSuper(this, ExternalServiceError, arguments);
|
|
821
|
+
}
|
|
822
|
+
_inherits(ExternalServiceError, _Error11);
|
|
823
|
+
return _createClass(ExternalServiceError);
|
|
824
|
+
}(_wrapNativeSuper(Error)),
|
|
825
|
+
InvalidClientRequest: function (_Error12) {
|
|
826
|
+
function InvalidClientRequestError() {
|
|
827
|
+
_classCallCheck(this, InvalidClientRequestError);
|
|
828
|
+
return _callSuper(this, InvalidClientRequestError, arguments);
|
|
829
|
+
}
|
|
830
|
+
_inherits(InvalidClientRequestError, _Error12);
|
|
831
|
+
return _createClass(InvalidClientRequestError);
|
|
832
|
+
}(_wrapNativeSuper(Error)),
|
|
833
|
+
UserRejected: function (_Error13) {
|
|
834
|
+
function UserRejectedError() {
|
|
835
|
+
_classCallCheck(this, UserRejectedError);
|
|
836
|
+
return _callSuper(this, UserRejectedError, arguments);
|
|
837
|
+
}
|
|
838
|
+
_inherits(UserRejectedError, _Error13);
|
|
839
|
+
return _createClass(UserRejectedError);
|
|
751
840
|
}(_wrapNativeSuper(Error))
|
|
752
841
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Keypair } from "@stellar/stellar-base";
|
|
2
|
+
import { SignAuthEntry, SignTransaction } from "./types";
|
|
2
3
|
/**
|
|
3
4
|
* For use with {@link Client} and {@link module:contract.AssembledTransaction}.
|
|
4
5
|
* Implements `signTransaction` and `signAuthEntry` with signatures expected by
|
|
@@ -12,6 +13,6 @@ import { Keypair } from "@stellar/stellar-base";
|
|
|
12
13
|
* @param {string} networkPassphrase passphrase of network to sign for
|
|
13
14
|
*/
|
|
14
15
|
export declare const basicNodeSigner: (keypair: Keypair, networkPassphrase: string) => {
|
|
15
|
-
signTransaction:
|
|
16
|
-
signAuthEntry:
|
|
16
|
+
signTransaction: SignTransaction;
|
|
17
|
+
signAuthEntry: SignAuthEntry;
|
|
17
18
|
};
|
|
@@ -12,38 +12,46 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
|
12
12
|
var basicNodeSigner = exports.basicNodeSigner = function basicNodeSigner(keypair, networkPassphrase) {
|
|
13
13
|
return {
|
|
14
14
|
signTransaction: function () {
|
|
15
|
-
var _signTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(
|
|
15
|
+
var _signTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee(xdr, opts) {
|
|
16
16
|
var t;
|
|
17
17
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
18
18
|
while (1) switch (_context.prev = _context.next) {
|
|
19
19
|
case 0:
|
|
20
|
-
t = _stellarBase.TransactionBuilder.fromXDR(
|
|
20
|
+
t = _stellarBase.TransactionBuilder.fromXDR(xdr, (opts === null || opts === void 0 ? void 0 : opts.networkPassphrase) || networkPassphrase);
|
|
21
21
|
t.sign(keypair);
|
|
22
|
-
return _context.abrupt("return",
|
|
22
|
+
return _context.abrupt("return", {
|
|
23
|
+
signedTxXdr: t.toXDR(),
|
|
24
|
+
signerAddress: keypair.publicKey()
|
|
25
|
+
});
|
|
23
26
|
case 3:
|
|
24
27
|
case "end":
|
|
25
28
|
return _context.stop();
|
|
26
29
|
}
|
|
27
30
|
}, _callee);
|
|
28
31
|
}));
|
|
29
|
-
function signTransaction(_x) {
|
|
32
|
+
function signTransaction(_x, _x2) {
|
|
30
33
|
return _signTransaction.apply(this, arguments);
|
|
31
34
|
}
|
|
32
35
|
return signTransaction;
|
|
33
36
|
}(),
|
|
34
37
|
signAuthEntry: function () {
|
|
35
|
-
var _signAuthEntry = _asyncToGenerator(_regeneratorRuntime().mark(function _callee2(
|
|
38
|
+
var _signAuthEntry = _asyncToGenerator(_regeneratorRuntime().mark(function _callee2(authEntry) {
|
|
39
|
+
var signedAuthEntry;
|
|
36
40
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
37
41
|
while (1) switch (_context2.prev = _context2.next) {
|
|
38
42
|
case 0:
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
signedAuthEntry = keypair.sign((0, _stellarBase.hash)(Buffer.from(authEntry, "base64"))).toString("base64");
|
|
44
|
+
return _context2.abrupt("return", {
|
|
45
|
+
signedAuthEntry: signedAuthEntry,
|
|
46
|
+
signerAddress: keypair.publicKey()
|
|
47
|
+
});
|
|
48
|
+
case 2:
|
|
41
49
|
case "end":
|
|
42
50
|
return _context2.stop();
|
|
43
51
|
}
|
|
44
52
|
}, _callee2);
|
|
45
53
|
}));
|
|
46
|
-
function signAuthEntry(
|
|
54
|
+
function signAuthEntry(_x3) {
|
|
47
55
|
return _signAuthEntry.apply(this, arguments);
|
|
48
56
|
}
|
|
49
57
|
return signAuthEntry;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Spec } from "./spec";
|
|
2
2
|
import { AssembledTransaction } from "./assembled_transaction";
|
|
3
|
-
import type { ClientOptions } from "./types";
|
|
3
|
+
import type { ClientOptions, MethodOptions } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Generate a class from the contract spec that where each contract method
|
|
6
6
|
* gets included with an identical name.
|
|
@@ -18,6 +18,18 @@ import type { ClientOptions } from "./types";
|
|
|
18
18
|
export declare class Client {
|
|
19
19
|
readonly spec: Spec;
|
|
20
20
|
readonly options: ClientOptions;
|
|
21
|
+
static deploy<T = Client>(
|
|
22
|
+
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
23
|
+
args: Record<string, any> | null,
|
|
24
|
+
/** Options for initalizing a Client as well as for calling a method, with extras specific to deploying. */
|
|
25
|
+
options: MethodOptions & Omit<ClientOptions, "contractId"> & {
|
|
26
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
27
|
+
wasmHash: Buffer | string;
|
|
28
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
29
|
+
salt?: Buffer | Uint8Array;
|
|
30
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
31
|
+
format?: "hex" | "base64";
|
|
32
|
+
}): Promise<AssembledTransaction<T>>;
|
|
21
33
|
constructor(spec: Spec, options: ClientOptions);
|
|
22
34
|
/**
|
|
23
35
|
* Generates a Client instance from the provided ClientOptions and the contract's wasm hash.
|