import { Operation } from './operation';
+ import { Address } from './address';
+import { Operation } from './operation';
import xdr from './xdr';
+import { StrKey } from './strkey';
/**
* Create a new Contract object.
@@ -53,23 +55,50 @@ js-stellar-base/src/contract.js
* @constructor
*
* @param {string} contractId - ID of the contract (ex.
+ * `CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE`, or as a
+ * 32-byte hex string
* `000000000000000000000000000000000000000000000000000000000000000001`).
*/
// TODO: Support contract deployment, maybe?
export class Contract {
- // TODO: Figure out contract owner/id stuff here. How should we represent that?
constructor(contractId) {
- // TODO: Add methods based on the contractSpec (or do that elsewhere?)
- this._id = Buffer.from(contractId, 'hex');
+ try {
+ // First, try it as a strkey
+ this._id = StrKey.decodeContract(contractId);
+ } catch (_) {
+ // If that fails, try it as a hex string
+ // TODO: Add methods based on the contractSpec (or do that elsewhere?)
+ const b = Buffer.from(contractId, 'hex');
+ if (b.length !== 32) {
+ throw new Error('Invalid contract ID');
+ }
+ this._id = b;
+ }
}
/**
- * Returns Stellar contract ID as a hex string, ex.
+ * Returns Stellar contract ID as a strkey, or hex string, ex.
* `000000000000000000000000000000000000000000000000000000000000000001`.
+ * @param {'hex'|'strkey'} format - format of output, defaults to 'strkey'
* @returns {string}
*/
- contractId() {
- return this._id.toString('hex');
+ contractId(format = 'strkey') {
+ switch (format) {
+ case 'strkey':
+ return StrKey.encodeContract(this._id);
+ case 'hex':
+ return this._id.toString('hex');
+ default:
+ throw new Error(`Invalid format: ${format}`);
+ }
+ }
+
+ /**
+ * Returns the address of this contract as an Address type.
+ * @returns {Address}
+ */
+ address() {
+ return Address.contract(this._id);
}
/**
@@ -139,7 +168,7 @@ js-stellar-base/src/contract.js
diff --git a/js-stellar-base_src_fee_bump_transaction.js.html b/js-stellar-base_src_fee_bump_transaction.js.html
index fbabd3db..4307858d 100644
--- a/js-stellar-base_src_fee_bump_transaction.js.html
+++ b/js-stellar-base_src_fee_bump_transaction.js.html
@@ -24,7 +24,7 @@
@@ -166,7 +166,7 @@ js-stellar-base/src/fee_bump_transaction.js
diff --git a/js-stellar-base_src_get_liquidity_pool_id.js.html b/js-stellar-base_src_get_liquidity_pool_id.js.html
index 174a7fc7..c855374c 100644
--- a/js-stellar-base_src_get_liquidity_pool_id.js.html
+++ b/js-stellar-base_src_get_liquidity_pool_id.js.html
@@ -24,7 +24,7 @@
@@ -105,7 +105,7 @@ js-stellar-base/src/get_liquidity_pool_id.js
diff --git a/js-stellar-base_src_keypair.js.html b/js-stellar-base_src_keypair.js.html
index 100272ed..e663615a 100644
--- a/js-stellar-base_src_keypair.js.html
+++ b/js-stellar-base_src_keypair.js.html
@@ -24,7 +24,7 @@
@@ -329,7 +329,7 @@ js-stellar-base/src/keypair.js
diff --git a/js-stellar-base_src_liquidity_pool_asset.js.html b/js-stellar-base_src_liquidity_pool_asset.js.html
index 908597cb..498cec91 100644
--- a/js-stellar-base_src_liquidity_pool_asset.js.html
+++ b/js-stellar-base_src_liquidity_pool_asset.js.html
@@ -24,7 +24,7 @@
@@ -171,7 +171,7 @@ js-stellar-base/src/liquidity_pool_asset.js
diff --git a/js-stellar-base_src_liquidity_pool_id.js.html b/js-stellar-base_src_liquidity_pool_id.js.html
index d36d3088..6d91b32a 100644
--- a/js-stellar-base_src_liquidity_pool_id.js.html
+++ b/js-stellar-base_src_liquidity_pool_id.js.html
@@ -24,7 +24,7 @@
@@ -129,7 +129,7 @@ js-stellar-base/src/liquidity_pool_id.js
diff --git a/js-stellar-base_src_memo.js.html b/js-stellar-base_src_memo.js.html
index ba51ac71..39373f10 100644
--- a/js-stellar-base_src_memo.js.html
+++ b/js-stellar-base_src_memo.js.html
@@ -24,7 +24,7 @@
@@ -299,7 +299,7 @@ js-stellar-base/src/memo.js
diff --git a/js-stellar-base_src_muxed_account.js.html b/js-stellar-base_src_muxed_account.js.html
index f060ad57..cd2a1c36 100644
--- a/js-stellar-base_src_muxed_account.js.html
+++ b/js-stellar-base_src_muxed_account.js.html
@@ -24,7 +24,7 @@
@@ -190,7 +190,7 @@ js-stellar-base/src/muxed_account.js
diff --git a/js-stellar-base_src_network.js.html b/js-stellar-base_src_network.js.html
index bea0c042..90d0e819 100644
--- a/js-stellar-base_src_network.js.html
+++ b/js-stellar-base_src_network.js.html
@@ -24,7 +24,7 @@
@@ -64,7 +64,7 @@ js-stellar-base/src/network.js
diff --git a/js-stellar-base_src_operation.js.html b/js-stellar-base_src_operation.js.html
index ea818b54..b828e4d2 100644
--- a/js-stellar-base_src_operation.js.html
+++ b/js-stellar-base_src_operation.js.html
@@ -24,7 +24,7 @@
@@ -704,7 +704,7 @@ js-stellar-base/src/operation.js
diff --git a/js-stellar-base_src_operations_account_merge.js.html b/js-stellar-base_src_operations_account_merge.js.html
index 10221804..18cd8ddc 100644
--- a/js-stellar-base_src_operations_account_merge.js.html
+++ b/js-stellar-base_src_operations_account_merge.js.html
@@ -24,7 +24,7 @@
@@ -80,7 +80,7 @@ js-stellar-base/src/operations/account_merge.js
diff --git a/js-stellar-base_src_operations_allow_trust.js.html b/js-stellar-base_src_operations_allow_trust.js.html
index 7df72639..5150782d 100644
--- a/js-stellar-base_src_operations_allow_trust.js.html
+++ b/js-stellar-base_src_operations_allow_trust.js.html
@@ -24,7 +24,7 @@
@@ -107,7 +107,7 @@ js-stellar-base/src/operations/allow_trust.js
diff --git a/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html b/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html
index 6243ffec..d421bea9 100644
--- a/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html
+++ b/js-stellar-base_src_operations_begin_sponsoring_future_reserves.js.html
@@ -24,7 +24,7 @@
@@ -84,7 +84,7 @@ js-stellar-base/src/operations/begin_sponsoring_future_re
diff --git a/js-stellar-base_src_operations_bump_sequence.js.html b/js-stellar-base_src_operations_bump_sequence.js.html
index d550f404..a1f2d8a7 100644
--- a/js-stellar-base_src_operations_bump_sequence.js.html
+++ b/js-stellar-base_src_operations_bump_sequence.js.html
@@ -24,7 +24,7 @@
@@ -89,7 +89,7 @@ js-stellar-base/src/operations/bump_sequence.js
diff --git a/js-stellar-base_src_operations_change_trust.js.html b/js-stellar-base_src_operations_change_trust.js.html
index 9692959c..7ca36d1d 100644
--- a/js-stellar-base_src_operations_change_trust.js.html
+++ b/js-stellar-base_src_operations_change_trust.js.html
@@ -24,7 +24,7 @@
@@ -104,7 +104,7 @@ js-stellar-base/src/operations/change_trust.js
diff --git a/js-stellar-base_src_operations_claim_claimable_balance.js.html b/js-stellar-base_src_operations_claim_claimable_balance.js.html
index c4f0b7e9..c3e8a05e 100644
--- a/js-stellar-base_src_operations_claim_claimable_balance.js.html
+++ b/js-stellar-base_src_operations_claim_claimable_balance.js.html
@@ -24,7 +24,7 @@
@@ -92,7 +92,7 @@ js-stellar-base/src/operations/claim_claimable_balance.js
diff --git a/js-stellar-base_src_operations_clawback.js.html b/js-stellar-base_src_operations_clawback.js.html
index b8548c70..a77f1c33 100644
--- a/js-stellar-base_src_operations_clawback.js.html
+++ b/js-stellar-base_src_operations_clawback.js.html
@@ -24,7 +24,7 @@
@@ -93,7 +93,7 @@ js-stellar-base/src/operations/clawback.js
diff --git a/js-stellar-base_src_operations_clawback_claimable_balance.js.html b/js-stellar-base_src_operations_clawback_claimable_balance.js.html
index e47b13d7..0f959d90 100644
--- a/js-stellar-base_src_operations_clawback_claimable_balance.js.html
+++ b/js-stellar-base_src_operations_clawback_claimable_balance.js.html
@@ -24,7 +24,7 @@
@@ -88,7 +88,7 @@ js-stellar-base/src/operations/clawback_claimable_balance
diff --git a/js-stellar-base_src_operations_create_account.js.html b/js-stellar-base_src_operations_create_account.js.html
index 0b6c6c92..b430327e 100644
--- a/js-stellar-base_src_operations_create_account.js.html
+++ b/js-stellar-base_src_operations_create_account.js.html
@@ -24,7 +24,7 @@
@@ -88,7 +88,7 @@ js-stellar-base/src/operations/create_account.js
diff --git a/js-stellar-base_src_operations_create_claimable_balance.js.html b/js-stellar-base_src_operations_create_claimable_balance.js.html
index 526e7179..3c53f45f 100644
--- a/js-stellar-base_src_operations_create_claimable_balance.js.html
+++ b/js-stellar-base_src_operations_create_claimable_balance.js.html
@@ -24,7 +24,7 @@
@@ -118,7 +118,7 @@ js-stellar-base/src/operations/create_claimable_balance.j
diff --git a/js-stellar-base_src_operations_create_passive_sell_offer.js.html b/js-stellar-base_src_operations_create_passive_sell_offer.js.html
index c2f763f0..20cbb355 100644
--- a/js-stellar-base_src_operations_create_passive_sell_offer.js.html
+++ b/js-stellar-base_src_operations_create_passive_sell_offer.js.html
@@ -24,7 +24,7 @@
@@ -94,7 +94,7 @@ js-stellar-base/src/operations/create_passive_sell_offer.
diff --git a/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html b/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html
index ad92719b..a936489d 100644
--- a/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html
+++ b/js-stellar-base_src_operations_end_sponsoring_future_reserves.js.html
@@ -24,7 +24,7 @@
@@ -72,7 +72,7 @@ js-stellar-base/src/operations/end_sponsoring_future_rese
diff --git a/js-stellar-base_src_operations_inflation.js.html b/js-stellar-base_src_operations_inflation.js.html
index 4dda5f52..31d242e9 100644
--- a/js-stellar-base_src_operations_inflation.js.html
+++ b/js-stellar-base_src_operations_inflation.js.html
@@ -24,7 +24,7 @@
@@ -67,7 +67,7 @@ js-stellar-base/src/operations/inflation.js
diff --git a/js-stellar-base_src_operations_invoke_host_function.js.html b/js-stellar-base_src_operations_invoke_host_function.js.html
index 671e4215..d6539cc0 100644
--- a/js-stellar-base_src_operations_invoke_host_function.js.html
+++ b/js-stellar-base_src_operations_invoke_host_function.js.html
@@ -24,7 +24,7 @@
@@ -105,7 +105,7 @@ js-stellar-base/src/operations/invoke_host_function.js
diff --git a/js-stellar-base_src_operations_liquidity_pool_deposit.js.html b/js-stellar-base_src_operations_liquidity_pool_deposit.js.html
index 5ea4dd4a..2cc8c370 100644
--- a/js-stellar-base_src_operations_liquidity_pool_deposit.js.html
+++ b/js-stellar-base_src_operations_liquidity_pool_deposit.js.html
@@ -24,7 +24,7 @@
@@ -112,7 +112,7 @@ js-stellar-base/src/operations/liquidity_pool_deposit.js<
diff --git a/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html b/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html
index 997fd8ca..77f1b6fa 100644
--- a/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html
+++ b/js-stellar-base_src_operations_liquidity_pool_withdraw.js.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ js-stellar-base/src/operations/liquidity_pool_withdraw.js
diff --git a/js-stellar-base_src_operations_manage_buy_offer.js.html b/js-stellar-base_src_operations_manage_buy_offer.js.html
index 49673960..5f4bcbb5 100644
--- a/js-stellar-base_src_operations_manage_buy_offer.js.html
+++ b/js-stellar-base_src_operations_manage_buy_offer.js.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ js-stellar-base/src/operations/manage_buy_offer.js
diff --git a/js-stellar-base_src_operations_manage_data.js.html b/js-stellar-base_src_operations_manage_data.js.html
index f6292d1a..6c65cbc8 100644
--- a/js-stellar-base_src_operations_manage_data.js.html
+++ b/js-stellar-base_src_operations_manage_data.js.html
@@ -24,7 +24,7 @@
@@ -98,7 +98,7 @@ js-stellar-base/src/operations/manage_data.js
diff --git a/js-stellar-base_src_operations_manage_sell_offer.js.html b/js-stellar-base_src_operations_manage_sell_offer.js.html
index 8cf71e66..94aff533 100644
--- a/js-stellar-base_src_operations_manage_sell_offer.js.html
+++ b/js-stellar-base_src_operations_manage_sell_offer.js.html
@@ -24,7 +24,7 @@
@@ -99,7 +99,7 @@ js-stellar-base/src/operations/manage_sell_offer.js
diff --git a/js-stellar-base_src_operations_path_payment_strict_receive.js.html b/js-stellar-base_src_operations_path_payment_strict_receive.js.html
index 3c4903e6..b1a50bd8 100644
--- a/js-stellar-base_src_operations_path_payment_strict_receive.js.html
+++ b/js-stellar-base_src_operations_path_payment_strict_receive.js.html
@@ -24,7 +24,7 @@
@@ -117,7 +117,7 @@ js-stellar-base/src/operations/path_payment_strict_receiv
diff --git a/js-stellar-base_src_operations_path_payment_strict_send.js.html b/js-stellar-base_src_operations_path_payment_strict_send.js.html
index 4aa7baa2..064c0f60 100644
--- a/js-stellar-base_src_operations_path_payment_strict_send.js.html
+++ b/js-stellar-base_src_operations_path_payment_strict_send.js.html
@@ -24,7 +24,7 @@
@@ -116,7 +116,7 @@ js-stellar-base/src/operations/path_payment_strict_send.j
diff --git a/js-stellar-base_src_operations_payment.js.html b/js-stellar-base_src_operations_payment.js.html
index 20dadf57..595f04eb 100644
--- a/js-stellar-base_src_operations_payment.js.html
+++ b/js-stellar-base_src_operations_payment.js.html
@@ -24,7 +24,7 @@
@@ -96,7 +96,7 @@ js-stellar-base/src/operations/payment.js
diff --git a/js-stellar-base_src_operations_revoke_sponsorship.js.html b/js-stellar-base_src_operations_revoke_sponsorship.js.html
index 55f1eb44..88ef989e 100644
--- a/js-stellar-base_src_operations_revoke_sponsorship.js.html
+++ b/js-stellar-base_src_operations_revoke_sponsorship.js.html
@@ -24,7 +24,7 @@
@@ -368,7 +368,7 @@ js-stellar-base/src/operations/revoke_sponsorship.js
diff --git a/js-stellar-base_src_operations_set_options.js.html b/js-stellar-base_src_operations_set_options.js.html
index c736690e..74d4e2e5 100644
--- a/js-stellar-base_src_operations_set_options.js.html
+++ b/js-stellar-base_src_operations_set_options.js.html
@@ -24,7 +24,7 @@
@@ -238,7 +238,7 @@ js-stellar-base/src/operations/set_options.js
diff --git a/js-stellar-base_src_operations_set_trustline_flags.js.html b/js-stellar-base_src_operations_set_trustline_flags.js.html
index 595b8c60..c4e064bc 100644
--- a/js-stellar-base_src_operations_set_trustline_flags.js.html
+++ b/js-stellar-base_src_operations_set_trustline_flags.js.html
@@ -24,7 +24,7 @@
@@ -137,7 +137,7 @@ js-stellar-base/src/operations/set_trustline_flags.js
diff --git a/js-stellar-base_src_signerkey.js.html b/js-stellar-base_src_signerkey.js.html
index e5b6666d..88726930 100644
--- a/js-stellar-base_src_signerkey.js.html
+++ b/js-stellar-base_src_signerkey.js.html
@@ -24,7 +24,7 @@
@@ -143,7 +143,7 @@ js-stellar-base/src/signerkey.js
diff --git a/js-stellar-base_src_signing.js.html b/js-stellar-base_src_signing.js.html
index da7efb17..67e6135f 100644
--- a/js-stellar-base_src_signing.js.html
+++ b/js-stellar-base_src_signing.js.html
@@ -24,7 +24,7 @@
@@ -158,7 +158,7 @@ js-stellar-base/src/signing.js
diff --git a/js-stellar-base_src_strkey.js.html b/js-stellar-base_src_strkey.js.html
index 35144bce..37b47a5a 100644
--- a/js-stellar-base_src_strkey.js.html
+++ b/js-stellar-base_src_strkey.js.html
@@ -24,7 +24,7 @@
@@ -412,7 +412,7 @@ js-stellar-base/src/strkey.js
diff --git a/js-stellar-base_src_transaction.js.html b/js-stellar-base_src_transaction.js.html
index 758755ee..6c4eaef5 100644
--- a/js-stellar-base_src_transaction.js.html
+++ b/js-stellar-base_src_transaction.js.html
@@ -24,7 +24,7 @@
@@ -421,7 +421,7 @@ js-stellar-base/src/transaction.js
diff --git a/js-stellar-base_src_transaction_base.js.html b/js-stellar-base_src_transaction_base.js.html
index 24247125..c87922be 100644
--- a/js-stellar-base_src_transaction_base.js.html
+++ b/js-stellar-base_src_transaction_base.js.html
@@ -24,7 +24,7 @@
@@ -279,7 +279,7 @@ js-stellar-base/src/transaction_base.js
diff --git a/js-stellar-base_src_transaction_builder.js.html b/js-stellar-base_src_transaction_builder.js.html
index 5ac92b45..c45e57ae 100644
--- a/js-stellar-base_src_transaction_builder.js.html
+++ b/js-stellar-base_src_transaction_builder.js.html
@@ -24,7 +24,7 @@
@@ -778,7 +778,7 @@ js-stellar-base/src/transaction_builder.js
diff --git a/js-stellar-base_src_util_decode_encode_muxed_account.js.html b/js-stellar-base_src_util_decode_encode_muxed_account.js.html
index ee08ac51..085f2a6a 100644
--- a/js-stellar-base_src_util_decode_encode_muxed_account.js.html
+++ b/js-stellar-base_src_util_decode_encode_muxed_account.js.html
@@ -24,7 +24,7 @@
@@ -177,7 +177,7 @@ js-stellar-base/src/util/decode_encode_muxed_account.js
diff --git a/lib_axios.js.html b/lib_axios.js.html
index 36afc824..3fd3e02d 100644
--- a/lib_axios.js.html
+++ b/lib_axios.js.html
@@ -24,7 +24,7 @@
@@ -125,7 +125,7 @@ lib/axios.js
diff --git a/lib_jsonrpc.js.html b/lib_jsonrpc.js.html
index 75e59f60..94534315 100644
--- a/lib_jsonrpc.js.html
+++ b/lib_jsonrpc.js.html
@@ -24,7 +24,7 @@
@@ -101,7 +101,7 @@ lib/jsonrpc.js
diff --git a/lib_server.js.html b/lib_server.js.html
index cffd74a7..d9d97eca 100644
--- a/lib_server.js.html
+++ b/lib_server.js.html
@@ -24,7 +24,7 @@
@@ -150,7 +150,7 @@ lib/server.js
* Reads the current value of contract data ledger entries directly.
*
* @example
- * const contractId = "0000000000000000000000000000000000000000000000000000000000000001";
+ * const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
* const key = xdr.ScVal.scvSymbol("counter");
* server.getContractData(contractId, key).then(data => {
* console.log("value:", data.xdr);
@@ -160,13 +160,13 @@ lib/server.js
*
* Allows you to directly inspect the current state of a contract. This is a backup way to access your contract data which may not be available via events or simulateTransaction.
*
- * @param {string} contractId - The contract ID containing the data to load. Encoded as a hex string.
+ * @param {string} contractId - The contract ID containing the data to load. Encoded as Stellar Contract Address e.g. `CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5` or a hex string for backwards compatibility, but will likely be deprecated in the future.
* @param {xdr.ScVal} key - The key of the contract data to load.
* @returns {Promise<SorobanRpc.LedgerEntryResult>} Returns a promise to the {@link SorobanRpc.LedgerEntryResult} object with the current value.
*/
async getContractData(contractId, key) {
const contractKey = _stellarBase.xdr.LedgerKey.contractData(new _stellarBase.xdr.LedgerKeyContractData({
- contractId: Buffer.from(contractId, "hex"),
+ contractId: new _stellarBase.Contract(contractId).address().toBuffer(),
key
})).toXDR("base64");
const getLedgerEntriesResponse = await jsonrpc.post(this.serverURL.toString(), "getLedgerEntries", [contractKey]);
@@ -628,7 +628,7 @@ lib/server.js
Returns:
diff --git a/Address.html b/Address.html index 2c06ca1a..14612cde 100644 --- a/Address.html +++ b/Address.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Asset.html b/Asset.html index a83e4f74..a8b11ba6 100644 --- a/Asset.html +++ b/Asset.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Claimant.html b/Claimant.html index 22b73f0b..f52017fd 100644 --- a/Claimant.html +++ b/Claimant.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Contract.html b/Contract.html index 1576dfe6..dfa0f60d 100644 --- a/Contract.html +++ b/Contract.html @@ -24,7 +24,7 @@
new Contract<
Source:
@@ -165,6 +165,8 @@ Parameters:
ID of the contract (ex.
+CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE
, or as a
+32-byte hex string
000000000000000000000000000000000000000000000000000000000000000001
).
@@ -217,6 +219,110 @@ Methods
+
+
+
+
+ address() → {Address}
+
+
+
+
+
+
+ Returns the address of this contract as an Address type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+ -
+ Type:
+
+ -
+
+
Address
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -264,7 +370,7 @@ callSource:
@@ -449,14 +555,14 @@ Returns:
- contractId() → {string}
+ contractId(format) → {string}
- Returns Stellar contract ID as a hex string, ex.
+
Returns Stellar contract ID as a strkey, or hex string, ex.
000000000000000000000000000000000000000000000000000000000000000001
.
@@ -493,7 +599,7 @@ contractId<
Source:
@@ -512,6 +618,69 @@ contractId<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ format
+
+
+
+
+
+'hex'
+|
+
+'strkey'
+
+
+
+
+
+
+
+
+
+
+ strkey
+
+
+
+
+
+ format of output, defaults to 'strkey'
+
+
+
+
+
+
+
+
+
@@ -599,7 +768,7 @@ getFootpr
Source:
@@ -676,7 +845,7 @@ Returns:
diff --git a/FeeBumpTransaction.html b/FeeBumpTransaction.html
index 6d7c31e6..e7f68619 100644
--- a/FeeBumpTransaction.html
+++ b/FeeBumpTransaction.html
@@ -24,7 +24,7 @@
@@ -2040,7 +2040,7 @@ Returns:
diff --git a/Keypair.html b/Keypair.html
index 87ebe609..d577d98d 100644
--- a/Keypair.html
+++ b/Keypair.html
@@ -24,7 +24,7 @@
@@ -2462,7 +2462,7 @@ Returns:
diff --git a/LiquidityPoolAsset.html b/LiquidityPoolAsset.html
index cf2207ca..43d4fd72 100644
--- a/LiquidityPoolAsset.html
+++ b/LiquidityPoolAsset.html
@@ -24,7 +24,7 @@
@@ -919,7 +919,7 @@ Returns:
diff --git a/LiquidityPoolId.html b/LiquidityPoolId.html
index 7e11c059..3b511902 100644
--- a/LiquidityPoolId.html
+++ b/LiquidityPoolId.html
@@ -24,7 +24,7 @@
@@ -867,7 +867,7 @@ Returns:
diff --git a/Memo.html b/Memo.html
index 9ff5826c..47e14a17 100644
--- a/Memo.html
+++ b/Memo.html
@@ -24,7 +24,7 @@
@@ -1386,7 +1386,7 @@ Returns:
diff --git a/MuxedAccount.html b/MuxedAccount.html
index 81618a43..9c8d8b7d 100644
--- a/MuxedAccount.html
+++ b/MuxedAccount.html
@@ -24,7 +24,7 @@
@@ -985,7 +985,7 @@ Returns:
diff --git a/Operation.html b/Operation.html
index a0ae50cc..14642d4e 100644
--- a/Operation.html
+++ b/Operation.html
@@ -24,7 +24,7 @@
@@ -11675,7 +11675,7 @@ Returns:
diff --git a/Server.html b/Server.html
index 42aca4a3..774e7045 100644
--- a/Server.html
+++ b/Server.html
@@ -24,7 +24,7 @@
@@ -670,7 +670,7 @@ Parameters:
- The contract ID containing the data to load. Encoded as a hex string.
+ The contract ID containing the data to load. Encoded as Stellar Contract Address e.g. CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5
or a hex string for backwards compatibility, but will likely be deprecated in the future.
@@ -748,7 +748,7 @@ Returns:
Example
- const contractId = "0000000000000000000000000000000000000000000000000000000000000001";
+ const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
const key = xdr.ScVal.scvSymbol("counter");
server.getContractData(contractId, key).then(data => {
console.log("value:", data.xdr);
@@ -2553,7 +2553,7 @@ Example
diff --git a/SignerKey.html b/SignerKey.html
index 71730d12..99770917 100644
--- a/SignerKey.html
+++ b/SignerKey.html
@@ -24,7 +24,7 @@
@@ -497,7 +497,7 @@ Returns:
diff --git a/StrKey.html b/StrKey.html
index faa7a4cb..77aaedce 100644
--- a/StrKey.html
+++ b/StrKey.html
@@ -24,7 +24,7 @@
@@ -3145,7 +3145,7 @@ Returns:
diff --git a/Transaction.html b/Transaction.html
index a46dd0c2..12023799 100644
--- a/Transaction.html
+++ b/Transaction.html
@@ -24,7 +24,7 @@
@@ -2960,7 +2960,7 @@ Returns:
diff --git a/TransactionBuilder.html b/TransactionBuilder.html
index d36baa7c..38c50087 100644
--- a/TransactionBuilder.html
+++ b/TransactionBuilder.html
@@ -24,7 +24,7 @@
@@ -3313,7 +3313,7 @@ Returns:
diff --git a/global.html b/global.html
index e60ed843..f52ab191 100644
--- a/global.html
+++ b/global.html
@@ -24,7 +24,7 @@
@@ -3008,7 +3008,7 @@ Returns:
diff --git a/index.html b/index.html
index 9c2ece23..1b0f7dff 100644
--- a/index.html
+++ b/index.html
@@ -24,7 +24,7 @@
@@ -222,7 +222,7 @@ License
diff --git a/js-stellar-base_src_account.js.html b/js-stellar-base_src_account.js.html
index a110d67b..dca08ed5 100644
--- a/js-stellar-base_src_account.js.html
+++ b/js-stellar-base_src_account.js.html
@@ -24,7 +24,7 @@
@@ -114,7 +114,7 @@ js-stellar-base/src/account.js
diff --git a/js-stellar-base_src_address.js.html b/js-stellar-base_src_address.js.html
index 20dabbb0..e771bad4 100644
--- a/js-stellar-base_src_address.js.html
+++ b/js-stellar-base_src_address.js.html
@@ -24,7 +24,7 @@
@@ -189,7 +189,7 @@ js-stellar-base/src/address.js
diff --git a/js-stellar-base_src_asset.js.html b/js-stellar-base_src_asset.js.html
index 22b73929..f3057d15 100644
--- a/js-stellar-base_src_asset.js.html
+++ b/js-stellar-base_src_asset.js.html
@@ -24,7 +24,7 @@
@@ -316,7 +316,7 @@ js-stellar-base/src/asset.js
diff --git a/js-stellar-base_src_claimant.js.html b/js-stellar-base_src_claimant.js.html
index c88594ef..75618157 100644
--- a/js-stellar-base_src_claimant.js.html
+++ b/js-stellar-base_src_claimant.js.html
@@ -24,7 +24,7 @@
@@ -223,7 +223,7 @@ js-stellar-base/src/claimant.js
diff --git a/js-stellar-base_src_contract.js.html b/js-stellar-base_src_contract.js.html
index d4c4b9a5..6b1e86ea 100644
--- a/js-stellar-base_src_contract.js.html
+++ b/js-stellar-base_src_contract.js.html
@@ -24,7 +24,7 @@
@@ -39,8 +39,10 @@ js-stellar-base/src/contract.js
-
ID of the contract (ex.
+CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE
, or as a
+32-byte hex string
000000000000000000000000000000000000000000000000000000000000000001
).
address() → {Address}
+ + + + + +Returns the address of this contract as an Address type.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Returns:
+ + + +-
+
- + Type: + +
-
+
+
Address
+ + +
+
callSource:
@@ -449,14 +555,14 @@ Returns:
- contractId() → {string}
+ contractId(format) → {string}
- Returns Stellar contract ID as a hex string, ex.
+
Returns Stellar contract ID as a strkey, or hex string, ex.
000000000000000000000000000000000000000000000000000000000000000001
.
@@ -493,7 +599,7 @@ contractId<
Source:
@@ -512,6 +618,69 @@ contractId<
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ format
+
+
+
+
+
+'hex'
+|
+
+'strkey'
+
+
+
+
+
+
+
+
+
+
+ strkey
+
+
+
+
+
+ format of output, defaults to 'strkey'
+
+
+
+
+
+
+
+
+
@@ -599,7 +768,7 @@ getFootpr
Source:
@@ -676,7 +845,7 @@ Returns:
diff --git a/FeeBumpTransaction.html b/FeeBumpTransaction.html
index 6d7c31e6..e7f68619 100644
--- a/FeeBumpTransaction.html
+++ b/FeeBumpTransaction.html
@@ -24,7 +24,7 @@
@@ -2040,7 +2040,7 @@ Returns:
diff --git a/Keypair.html b/Keypair.html
index 87ebe609..d577d98d 100644
--- a/Keypair.html
+++ b/Keypair.html
@@ -24,7 +24,7 @@
@@ -2462,7 +2462,7 @@ Returns:
diff --git a/LiquidityPoolAsset.html b/LiquidityPoolAsset.html
index cf2207ca..43d4fd72 100644
--- a/LiquidityPoolAsset.html
+++ b/LiquidityPoolAsset.html
@@ -24,7 +24,7 @@
@@ -919,7 +919,7 @@ Returns:
diff --git a/LiquidityPoolId.html b/LiquidityPoolId.html
index 7e11c059..3b511902 100644
--- a/LiquidityPoolId.html
+++ b/LiquidityPoolId.html
@@ -24,7 +24,7 @@
@@ -867,7 +867,7 @@ Returns:
diff --git a/Memo.html b/Memo.html
index 9ff5826c..47e14a17 100644
--- a/Memo.html
+++ b/Memo.html
@@ -24,7 +24,7 @@
@@ -1386,7 +1386,7 @@ Returns:
diff --git a/MuxedAccount.html b/MuxedAccount.html
index 81618a43..9c8d8b7d 100644
--- a/MuxedAccount.html
+++ b/MuxedAccount.html
@@ -24,7 +24,7 @@
@@ -985,7 +985,7 @@ Returns:
diff --git a/Operation.html b/Operation.html
index a0ae50cc..14642d4e 100644
--- a/Operation.html
+++ b/Operation.html
@@ -24,7 +24,7 @@
@@ -11675,7 +11675,7 @@ Returns:
diff --git a/Server.html b/Server.html
index 42aca4a3..774e7045 100644
--- a/Server.html
+++ b/Server.html
@@ -24,7 +24,7 @@
@@ -670,7 +670,7 @@ Parameters:
- The contract ID containing the data to load. Encoded as a hex string.
+ The contract ID containing the data to load. Encoded as Stellar Contract Address e.g. CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5
or a hex string for backwards compatibility, but will likely be deprecated in the future.
@@ -748,7 +748,7 @@ Returns:
Example
- const contractId = "0000000000000000000000000000000000000000000000000000000000000001";
+ const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
const key = xdr.ScVal.scvSymbol("counter");
server.getContractData(contractId, key).then(data => {
console.log("value:", data.xdr);
@@ -2553,7 +2553,7 @@ Example
diff --git a/SignerKey.html b/SignerKey.html
index 71730d12..99770917 100644
--- a/SignerKey.html
+++ b/SignerKey.html
@@ -24,7 +24,7 @@
@@ -497,7 +497,7 @@ Returns:
diff --git a/StrKey.html b/StrKey.html
index faa7a4cb..77aaedce 100644
--- a/StrKey.html
+++ b/StrKey.html
@@ -24,7 +24,7 @@
@@ -3145,7 +3145,7 @@ Returns:
diff --git a/Transaction.html b/Transaction.html
index a46dd0c2..12023799 100644
--- a/Transaction.html
+++ b/Transaction.html
@@ -24,7 +24,7 @@
@@ -2960,7 +2960,7 @@ Returns:
diff --git a/TransactionBuilder.html b/TransactionBuilder.html
index d36baa7c..38c50087 100644
--- a/TransactionBuilder.html
+++ b/TransactionBuilder.html
@@ -24,7 +24,7 @@
@@ -3313,7 +3313,7 @@ Returns:
diff --git a/global.html b/global.html
index e60ed843..f52ab191 100644
--- a/global.html
+++ b/global.html
@@ -24,7 +24,7 @@
@@ -3008,7 +3008,7 @@ Returns:
diff --git a/index.html b/index.html
index 9c2ece23..1b0f7dff 100644
--- a/index.html
+++ b/index.html
@@ -24,7 +24,7 @@
@@ -222,7 +222,7 @@ License
diff --git a/js-stellar-base_src_account.js.html b/js-stellar-base_src_account.js.html
index a110d67b..dca08ed5 100644
--- a/js-stellar-base_src_account.js.html
+++ b/js-stellar-base_src_account.js.html
@@ -24,7 +24,7 @@
@@ -114,7 +114,7 @@ js-stellar-base/src/account.js
diff --git a/js-stellar-base_src_address.js.html b/js-stellar-base_src_address.js.html
index 20dabbb0..e771bad4 100644
--- a/js-stellar-base_src_address.js.html
+++ b/js-stellar-base_src_address.js.html
@@ -24,7 +24,7 @@
@@ -189,7 +189,7 @@ js-stellar-base/src/address.js
diff --git a/js-stellar-base_src_asset.js.html b/js-stellar-base_src_asset.js.html
index 22b73929..f3057d15 100644
--- a/js-stellar-base_src_asset.js.html
+++ b/js-stellar-base_src_asset.js.html
@@ -24,7 +24,7 @@
@@ -316,7 +316,7 @@ js-stellar-base/src/asset.js
diff --git a/js-stellar-base_src_claimant.js.html b/js-stellar-base_src_claimant.js.html
index c88594ef..75618157 100644
--- a/js-stellar-base_src_claimant.js.html
+++ b/js-stellar-base_src_claimant.js.html
@@ -24,7 +24,7 @@
@@ -223,7 +223,7 @@ js-stellar-base/src/claimant.js
diff --git a/js-stellar-base_src_contract.js.html b/js-stellar-base_src_contract.js.html
index d4c4b9a5..6b1e86ea 100644
--- a/js-stellar-base_src_contract.js.html
+++ b/js-stellar-base_src_contract.js.html
@@ -24,7 +24,7 @@
@@ -39,8 +39,10 @@ js-stellar-base/src/contract.js
-
Returns Stellar contract ID as a hex string, ex. +
Returns Stellar contract ID as a strkey, or hex string, ex.
000000000000000000000000000000000000000000000000000000000000000001
.
contractId<
+ Parameters:
+
+
+
format
'hex'
+|
+
+'strkey'
+
+
+
+ format of output, defaults to 'strkey'
+ +Returns:
diff --git a/FeeBumpTransaction.html b/FeeBumpTransaction.html index 6d7c31e6..e7f68619 100644 --- a/FeeBumpTransaction.html +++ b/FeeBumpTransaction.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Keypair.html b/Keypair.html index 87ebe609..d577d98d 100644 --- a/Keypair.html +++ b/Keypair.html @@ -24,7 +24,7 @@
Returns:
diff --git a/LiquidityPoolAsset.html b/LiquidityPoolAsset.html index cf2207ca..43d4fd72 100644 --- a/LiquidityPoolAsset.html +++ b/LiquidityPoolAsset.html @@ -24,7 +24,7 @@
Returns:
diff --git a/LiquidityPoolId.html b/LiquidityPoolId.html index 7e11c059..3b511902 100644 --- a/LiquidityPoolId.html +++ b/LiquidityPoolId.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Memo.html b/Memo.html index 9ff5826c..47e14a17 100644 --- a/Memo.html +++ b/Memo.html @@ -24,7 +24,7 @@
Returns:
diff --git a/MuxedAccount.html b/MuxedAccount.html index 81618a43..9c8d8b7d 100644 --- a/MuxedAccount.html +++ b/MuxedAccount.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Operation.html b/Operation.html index a0ae50cc..14642d4e 100644 --- a/Operation.html +++ b/Operation.html @@ -24,7 +24,7 @@
Returns:
diff --git a/Server.html b/Server.html index 42aca4a3..774e7045 100644 --- a/Server.html +++ b/Server.html @@ -24,7 +24,7 @@
Parameters:
The contract ID containing the data to load. Encoded as a hex string.
+The contract ID containing the data to load. Encoded as Stellar Contract Address e.g. CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5
or a hex string for backwards compatibility, but will likely be deprecated in the future.
Returns:
Example
-const contractId = "0000000000000000000000000000000000000000000000000000000000000001";
+ const contractId = "CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5";
const key = xdr.ScVal.scvSymbol("counter");
server.getContractData(contractId, key).then(data => {
console.log("value:", data.xdr);
@@ -2553,7 +2553,7 @@ Example
diff --git a/SignerKey.html b/SignerKey.html
index 71730d12..99770917 100644
--- a/SignerKey.html
+++ b/SignerKey.html
@@ -24,7 +24,7 @@
@@ -497,7 +497,7 @@ Returns:
diff --git a/StrKey.html b/StrKey.html
index faa7a4cb..77aaedce 100644
--- a/StrKey.html
+++ b/StrKey.html
@@ -24,7 +24,7 @@
@@ -3145,7 +3145,7 @@ Returns:
diff --git a/Transaction.html b/Transaction.html
index a46dd0c2..12023799 100644
--- a/Transaction.html
+++ b/Transaction.html
@@ -24,7 +24,7 @@
@@ -2960,7 +2960,7 @@ Returns:
diff --git a/TransactionBuilder.html b/TransactionBuilder.html
index d36baa7c..38c50087 100644
--- a/TransactionBuilder.html
+++ b/TransactionBuilder.html
@@ -24,7 +24,7 @@
@@ -3313,7 +3313,7 @@ Returns:
diff --git a/global.html b/global.html
index e60ed843..f52ab191 100644
--- a/global.html
+++ b/global.html
@@ -24,7 +24,7 @@
@@ -3008,7 +3008,7 @@ Returns:
diff --git a/index.html b/index.html
index 9c2ece23..1b0f7dff 100644
--- a/index.html
+++ b/index.html
@@ -24,7 +24,7 @@
@@ -222,7 +222,7 @@ License
diff --git a/js-stellar-base_src_account.js.html b/js-stellar-base_src_account.js.html
index a110d67b..dca08ed5 100644
--- a/js-stellar-base_src_account.js.html
+++ b/js-stellar-base_src_account.js.html
@@ -24,7 +24,7 @@
@@ -114,7 +114,7 @@ js-stellar-base/src/account.js
diff --git a/js-stellar-base_src_address.js.html b/js-stellar-base_src_address.js.html
index 20dabbb0..e771bad4 100644
--- a/js-stellar-base_src_address.js.html
+++ b/js-stellar-base_src_address.js.html
@@ -24,7 +24,7 @@
@@ -189,7 +189,7 @@ js-stellar-base/src/address.js
diff --git a/js-stellar-base_src_asset.js.html b/js-stellar-base_src_asset.js.html
index 22b73929..f3057d15 100644
--- a/js-stellar-base_src_asset.js.html
+++ b/js-stellar-base_src_asset.js.html
@@ -24,7 +24,7 @@
@@ -316,7 +316,7 @@ js-stellar-base/src/asset.js
diff --git a/js-stellar-base_src_claimant.js.html b/js-stellar-base_src_claimant.js.html
index c88594ef..75618157 100644
--- a/js-stellar-base_src_claimant.js.html
+++ b/js-stellar-base_src_claimant.js.html
@@ -24,7 +24,7 @@
@@ -223,7 +223,7 @@ js-stellar-base/src/claimant.js
diff --git a/js-stellar-base_src_contract.js.html b/js-stellar-base_src_contract.js.html
index d4c4b9a5..6b1e86ea 100644
--- a/js-stellar-base_src_contract.js.html
+++ b/js-stellar-base_src_contract.js.html
@@ -24,7 +24,7 @@
@@ -39,8 +39,10 @@ js-stellar-base/src/contract.js
-