@digitalworld/digital-world-sdk 16.0.0 → 16.0.1
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/README.md +5 -5
- package/dist/digital-world-sdk-axios.js +52 -47
- package/dist/digital-world-sdk-axios.js.map +1 -1
- package/dist/digital-world-sdk-axios.min.js +1 -1
- package/dist/digital-world-sdk-axios.min.js.map +1 -1
- package/dist/digital-world-sdk.js +52 -47
- package/dist/digital-world-sdk.js.map +1 -1
- package/dist/digital-world-sdk.min.js +6 -6
- package/dist/digital-world-sdk.min.js.map +1 -1
- package/lib/axios/cjs/base/contract.js +2 -2
- package/lib/axios/cjs/base/contract.js.map +1 -1
- package/lib/axios/cjs/base/invocation.js.map +1 -1
- package/lib/axios/cjs/base/numbers/sc_int.js +1 -1
- package/lib/axios/cjs/base/numbers/sc_int.js.map +1 -1
- package/lib/axios/cjs/base/operation.js +1 -1
- package/lib/axios/cjs/base/operation.js.map +1 -1
- package/lib/axios/cjs/base/operations/invoke_host_function.js +2 -2
- package/lib/axios/cjs/base/operations/invoke_host_function.js.map +1 -1
- package/lib/axios/cjs/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/axios/cjs/bindings/config.js +4 -4
- package/lib/axios/cjs/bindings/config.js.map +1 -1
- package/lib/axios/cjs/bindings/generator.js +4 -4
- package/lib/axios/cjs/bindings/generator.js.map +1 -1
- package/lib/axios/cjs/bindings/types.js.map +1 -1
- package/lib/axios/cjs/bindings/utils.js +2 -2
- package/lib/axios/cjs/bindings/utils.js.map +1 -1
- package/lib/axios/cjs/bindings/wasm_fetcher.js +2 -2
- package/lib/axios/cjs/bindings/wasm_fetcher.js.map +1 -1
- package/lib/axios/cjs/contract/assembled_transaction.js.map +1 -1
- package/lib/axios/cjs/contract/spec.js +1 -1
- package/lib/axios/cjs/contract/spec.js.map +1 -1
- package/lib/axios/cjs/contract/types.js.map +1 -1
- package/lib/axios/cjs/gateway/gateway_axios_client.js +1 -1
- package/lib/axios/cjs/gateway/server_api.js.map +1 -1
- package/lib/axios/cjs/rpc/api.js.map +1 -1
- package/lib/axios/cjs/rpc/axios.js +1 -1
- package/lib/axios/cjs/rpc/server.js +32 -27
- package/lib/axios/cjs/rpc/server.js.map +1 -1
- package/lib/axios/cjs/webauth/utils.js.map +1 -1
- package/lib/axios/esm/base/contract.d.ts +4 -4
- package/lib/axios/esm/base/contract.js +2 -2
- package/lib/axios/esm/base/contract.js.map +1 -1
- package/lib/axios/esm/base/invocation.d.ts +2 -2
- package/lib/axios/esm/base/invocation.js.map +1 -1
- package/lib/axios/esm/base/numbers/sc_int.d.ts +2 -2
- package/lib/axios/esm/base/numbers/sc_int.js +1 -1
- package/lib/axios/esm/base/numbers/sc_int.js.map +1 -1
- package/lib/axios/esm/base/operation.d.ts +2 -2
- package/lib/axios/esm/base/operation.js +2 -2
- package/lib/axios/esm/base/operation.js.map +1 -1
- package/lib/axios/esm/base/operations/index.d.ts +1 -1
- package/lib/axios/esm/base/operations/invoke_host_function.d.ts +5 -5
- package/lib/axios/esm/base/operations/invoke_host_function.js +2 -2
- package/lib/axios/esm/base/operations/invoke_host_function.js.map +1 -1
- package/lib/axios/esm/base/operations/revoke_sponsorship.d.ts +1 -1
- package/lib/axios/esm/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/axios/esm/base/operations/types.d.ts +2 -2
- package/lib/axios/esm/bindings/config.js +4 -4
- package/lib/axios/esm/bindings/config.js.map +1 -1
- package/lib/axios/esm/bindings/generator.d.ts +7 -7
- package/lib/axios/esm/bindings/generator.js +4 -4
- package/lib/axios/esm/bindings/generator.js.map +1 -1
- package/lib/axios/esm/bindings/types.d.ts +1 -1
- package/lib/axios/esm/bindings/types.js.map +1 -1
- package/lib/axios/esm/bindings/utils.d.ts +4 -4
- package/lib/axios/esm/bindings/utils.js +2 -2
- package/lib/axios/esm/bindings/utils.js.map +1 -1
- package/lib/axios/esm/bindings/wasm_fetcher.js +2 -2
- package/lib/axios/esm/bindings/wasm_fetcher.js.map +1 -1
- package/lib/axios/esm/contract/assembled_transaction.d.ts +1 -1
- package/lib/axios/esm/contract/assembled_transaction.js.map +1 -1
- package/lib/axios/esm/contract/spec.js +1 -1
- package/lib/axios/esm/contract/spec.js.map +1 -1
- package/lib/axios/esm/contract/types.d.ts +2 -2
- package/lib/axios/esm/contract/types.js.map +1 -1
- package/lib/axios/esm/gateway/gateway_axios_client.js +1 -1
- package/lib/axios/esm/gateway/server_api.d.ts +2 -2
- package/lib/axios/esm/gateway/server_api.js.map +1 -1
- package/lib/axios/esm/rpc/api.d.ts +1 -1
- package/lib/axios/esm/rpc/api.js.map +1 -1
- package/lib/axios/esm/rpc/axios.js +1 -1
- package/lib/axios/esm/rpc/browser.d.ts +1 -1
- package/lib/axios/esm/rpc/server.d.ts +26 -26
- package/lib/axios/esm/rpc/server.js +32 -27
- package/lib/axios/esm/rpc/server.js.map +1 -1
- package/lib/axios/esm/webauth/utils.d.ts +2 -2
- package/lib/axios/esm/webauth/utils.js.map +1 -1
- package/lib/cjs/base/contract.js +2 -2
- package/lib/cjs/base/contract.js.map +1 -1
- package/lib/cjs/base/invocation.js.map +1 -1
- package/lib/cjs/base/numbers/sc_int.js +1 -1
- package/lib/cjs/base/numbers/sc_int.js.map +1 -1
- package/lib/cjs/base/operation.js +1 -1
- package/lib/cjs/base/operation.js.map +1 -1
- package/lib/cjs/base/operations/invoke_host_function.js +2 -2
- package/lib/cjs/base/operations/invoke_host_function.js.map +1 -1
- package/lib/cjs/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/cjs/bindings/config.js +4 -4
- package/lib/cjs/bindings/config.js.map +1 -1
- package/lib/cjs/bindings/generator.js +4 -4
- package/lib/cjs/bindings/generator.js.map +1 -1
- package/lib/cjs/bindings/types.js.map +1 -1
- package/lib/cjs/bindings/utils.js +2 -2
- package/lib/cjs/bindings/utils.js.map +1 -1
- package/lib/cjs/bindings/wasm_fetcher.js +2 -2
- package/lib/cjs/bindings/wasm_fetcher.js.map +1 -1
- package/lib/cjs/contract/assembled_transaction.js.map +1 -1
- package/lib/cjs/contract/spec.js +1 -1
- package/lib/cjs/contract/spec.js.map +1 -1
- package/lib/cjs/contract/types.js.map +1 -1
- package/lib/cjs/gateway/gateway_axios_client.js +1 -1
- package/lib/cjs/gateway/server_api.js.map +1 -1
- package/lib/cjs/rpc/api.js.map +1 -1
- package/lib/cjs/rpc/axios.js +1 -1
- package/lib/cjs/rpc/server.js +32 -27
- package/lib/cjs/rpc/server.js.map +1 -1
- package/lib/cjs/webauth/utils.js.map +1 -1
- package/lib/esm/base/contract.d.ts +4 -4
- package/lib/esm/base/contract.js +2 -2
- package/lib/esm/base/contract.js.map +1 -1
- package/lib/esm/base/invocation.d.ts +2 -2
- package/lib/esm/base/invocation.js.map +1 -1
- package/lib/esm/base/numbers/sc_int.d.ts +2 -2
- package/lib/esm/base/numbers/sc_int.js +1 -1
- package/lib/esm/base/numbers/sc_int.js.map +1 -1
- package/lib/esm/base/operation.d.ts +2 -2
- package/lib/esm/base/operation.js +2 -2
- package/lib/esm/base/operation.js.map +1 -1
- package/lib/esm/base/operations/index.d.ts +1 -1
- package/lib/esm/base/operations/invoke_host_function.d.ts +5 -5
- package/lib/esm/base/operations/invoke_host_function.js +2 -2
- package/lib/esm/base/operations/invoke_host_function.js.map +1 -1
- package/lib/esm/base/operations/revoke_sponsorship.d.ts +1 -1
- package/lib/esm/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/esm/base/operations/types.d.ts +2 -2
- package/lib/esm/bindings/config.js +4 -4
- package/lib/esm/bindings/config.js.map +1 -1
- package/lib/esm/bindings/generator.d.ts +7 -7
- package/lib/esm/bindings/generator.js +4 -4
- package/lib/esm/bindings/generator.js.map +1 -1
- package/lib/esm/bindings/types.d.ts +1 -1
- package/lib/esm/bindings/types.js.map +1 -1
- package/lib/esm/bindings/utils.d.ts +4 -4
- package/lib/esm/bindings/utils.js +2 -2
- package/lib/esm/bindings/utils.js.map +1 -1
- package/lib/esm/bindings/wasm_fetcher.js +2 -2
- package/lib/esm/bindings/wasm_fetcher.js.map +1 -1
- package/lib/esm/contract/assembled_transaction.d.ts +1 -1
- package/lib/esm/contract/assembled_transaction.js.map +1 -1
- package/lib/esm/contract/spec.js +1 -1
- package/lib/esm/contract/spec.js.map +1 -1
- package/lib/esm/contract/types.d.ts +2 -2
- package/lib/esm/contract/types.js.map +1 -1
- package/lib/esm/gateway/gateway_axios_client.js +1 -1
- package/lib/esm/gateway/server_api.d.ts +2 -2
- package/lib/esm/gateway/server_api.js.map +1 -1
- package/lib/esm/rpc/api.d.ts +1 -1
- package/lib/esm/rpc/api.js.map +1 -1
- package/lib/esm/rpc/axios.js +1 -1
- package/lib/esm/rpc/browser.d.ts +1 -1
- package/lib/esm/rpc/server.d.ts +26 -26
- package/lib/esm/rpc/server.js +32 -27
- package/lib/esm/rpc/server.js.map +1 -1
- package/lib/esm/webauth/utils.d.ts +2 -2
- package/lib/esm/webauth/utils.js.map +1 -1
- package/package.json +41 -39
|
@@ -16082,7 +16082,7 @@
|
|
|
16082
16082
|
...opts.auth !== void 0 && { auth: opts.auth }
|
|
16083
16083
|
});
|
|
16084
16084
|
}
|
|
16085
|
-
function
|
|
16085
|
+
function createDigitalWorldAssetContract(opts) {
|
|
16086
16086
|
let asset = opts.asset;
|
|
16087
16087
|
if (typeof asset === "string") {
|
|
16088
16088
|
const parts = asset.split(":");
|
|
@@ -16460,7 +16460,7 @@
|
|
|
16460
16460
|
static restoreFootprint = restoreFootprint;
|
|
16461
16461
|
// These are not `xdr.Operation`s directly, but proxies for common
|
|
16462
16462
|
// versions of `Operation.invokeHostFunction`
|
|
16463
|
-
static
|
|
16463
|
+
static createDigitalWorldAssetContract = createDigitalWorldAssetContract;
|
|
16464
16464
|
static invokeContractFunction = invokeContractFunction;
|
|
16465
16465
|
static createCustomContract = createCustomContract;
|
|
16466
16466
|
static uploadContractWasm = uploadContractWasm;
|
|
@@ -17531,7 +17531,7 @@
|
|
|
17531
17531
|
}
|
|
17532
17532
|
}
|
|
17533
17533
|
/**
|
|
17534
|
-
* Returns
|
|
17534
|
+
* Returns Digital World contract ID as a strkey, ex.
|
|
17535
17535
|
* `CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE`.
|
|
17536
17536
|
*/
|
|
17537
17537
|
contractId() {
|
|
@@ -17554,7 +17554,7 @@
|
|
|
17554
17554
|
* @see Operation.invokeHostFunction
|
|
17555
17555
|
* @see Operation.invokeContractFunction
|
|
17556
17556
|
* @see Operation.createCustomContract
|
|
17557
|
-
* @see Operation.
|
|
17557
|
+
* @see Operation.createDigitalWorldAssetContract
|
|
17558
17558
|
* @see Operation.uploadContractWasm
|
|
17559
17559
|
*/
|
|
17560
17560
|
call(method, ...params) {
|
|
@@ -17916,7 +17916,7 @@
|
|
|
17916
17916
|
class ScInt extends XdrLargeInt {
|
|
17917
17917
|
/**
|
|
17918
17918
|
* @param value - a single, integer-like value which will
|
|
17919
|
-
* be interpreted in the smallest appropriate XDR type supported by
|
|
17919
|
+
* be interpreted in the smallest appropriate XDR type supported by Digital World
|
|
17920
17920
|
* (64, 128, or 256 bit integer values). signed values are supported, though
|
|
17921
17921
|
* they are sanity-checked against `opts.type`. if you need 32-bit values,
|
|
17922
17922
|
* you can construct them directly without needing this wrapper, e.g.
|
|
@@ -20886,7 +20886,7 @@ ${value}`, dataLines++;
|
|
|
20886
20886
|
return doc && typeof doc == "object" && "baseURI" in doc && typeof doc.baseURI == "string" ? doc.baseURI : void 0;
|
|
20887
20887
|
}
|
|
20888
20888
|
|
|
20889
|
-
const version$1 = "16.0.
|
|
20889
|
+
const version$1 = "16.0.1";
|
|
20890
20890
|
const SERVER_TIME_MAP = {};
|
|
20891
20891
|
function toSeconds(ms) {
|
|
20892
20892
|
return Math.floor(ms / 1e3);
|
|
@@ -22813,7 +22813,7 @@ ${value}`, dataLines++;
|
|
|
22813
22813
|
Api2.isSimulationRaw = isSimulationRaw;
|
|
22814
22814
|
})(Api || (Api = {}));
|
|
22815
22815
|
|
|
22816
|
-
const version = "16.0.
|
|
22816
|
+
const version = "16.0.1";
|
|
22817
22817
|
function createHttpClient(headers) {
|
|
22818
22818
|
return createFetchClient({
|
|
22819
22819
|
headers: {
|
|
@@ -23184,7 +23184,7 @@ ${value}`, dataLines++;
|
|
|
23184
23184
|
}
|
|
23185
23185
|
}
|
|
23186
23186
|
/**
|
|
23187
|
-
* Fetch a minimal set of current info about a
|
|
23187
|
+
* Fetch a minimal set of current info about a Digital World account.
|
|
23188
23188
|
*
|
|
23189
23189
|
* Needed to get the current sequence number for the account so you can build
|
|
23190
23190
|
* a successful transaction with {@link TransactionBuilder}.
|
|
@@ -23208,7 +23208,7 @@ ${value}`, dataLines++;
|
|
|
23208
23208
|
return new Account(address, entry.seqNum().toString());
|
|
23209
23209
|
}
|
|
23210
23210
|
/**
|
|
23211
|
-
* Fetch the full account entry for a
|
|
23211
|
+
* Fetch the full account entry for a Digital World account.
|
|
23212
23212
|
*
|
|
23213
23213
|
* @param address - The public address of the account to load.
|
|
23214
23214
|
* @returns Resolves to the full on-chain account
|
|
@@ -23239,7 +23239,7 @@ ${value}`, dataLines++;
|
|
|
23239
23239
|
}
|
|
23240
23240
|
}
|
|
23241
23241
|
/**
|
|
23242
|
-
* Fetch the full trustline entry for a
|
|
23242
|
+
* Fetch the full trustline entry for a Digital World account.
|
|
23243
23243
|
*
|
|
23244
23244
|
* @param account - The public address of the account whose trustline it is
|
|
23245
23245
|
* @param asset - The trustline's asset
|
|
@@ -23279,7 +23279,7 @@ ${value}`, dataLines++;
|
|
|
23279
23279
|
}
|
|
23280
23280
|
}
|
|
23281
23281
|
/**
|
|
23282
|
-
* Fetch the full claimable balance entry for a
|
|
23282
|
+
* Fetch the full claimable balance entry for a Digital World account.
|
|
23283
23283
|
*
|
|
23284
23284
|
* @param id - The strkey (`B...`) or hex (`00000000abcde...`) (both
|
|
23285
23285
|
* IDs with and without the 000... version prefix are accepted) of the
|
|
@@ -23909,15 +23909,15 @@ ${value}`, dataLines++;
|
|
|
23909
23909
|
* @example
|
|
23910
23910
|
* ```ts
|
|
23911
23911
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
23912
|
-
* const contract = new
|
|
23912
|
+
* const contract = new DigitalWorldSdk.Contract(contractId);
|
|
23913
23913
|
*
|
|
23914
23914
|
* // Right now, this is just the default fee for this example.
|
|
23915
|
-
* const fee =
|
|
23916
|
-
* const transaction = new
|
|
23915
|
+
* const fee = DigitalWorldSdk.BASE_FEE;
|
|
23916
|
+
* const transaction = new DigitalWorldSdk.TransactionBuilder(account, { fee })
|
|
23917
23917
|
* // Uncomment the following line to build transactions for the live network. Be
|
|
23918
23918
|
* // sure to also change the horizon hostname.
|
|
23919
|
-
* //.setNetworkPassphrase(
|
|
23920
|
-
* .setNetworkPassphrase(
|
|
23919
|
+
* //.setNetworkPassphrase(DigitalWorldSdk.Networks.PUBLIC)
|
|
23920
|
+
* .setNetworkPassphrase(DigitalWorldSdk.Networks.FUTURENET)
|
|
23921
23921
|
* .setTimeout(30) // valid for the next 30s
|
|
23922
23922
|
* // Add an operation to call increment() on the contract
|
|
23923
23923
|
* .addOperation(contract.call("increment"))
|
|
@@ -23993,15 +23993,15 @@ ${value}`, dataLines++;
|
|
|
23993
23993
|
* @example
|
|
23994
23994
|
* ```ts
|
|
23995
23995
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
23996
|
-
* const contract = new
|
|
23996
|
+
* const contract = new DigitalWorldSdk.Contract(contractId);
|
|
23997
23997
|
*
|
|
23998
23998
|
* // Right now, this is just the default fee for this example.
|
|
23999
|
-
* const fee =
|
|
24000
|
-
* const transaction = new
|
|
23999
|
+
* const fee = DigitalWorldSdk.BASE_FEE;
|
|
24000
|
+
* const transaction = new DigitalWorldSdk.TransactionBuilder(account, { fee })
|
|
24001
24001
|
* // Uncomment the following line to build transactions for the live network. Be
|
|
24002
24002
|
* // sure to also change the horizon hostname.
|
|
24003
|
-
* //.setNetworkPassphrase(
|
|
24004
|
-
* .setNetworkPassphrase(
|
|
24003
|
+
* //.setNetworkPassphrase(DigitalWorldSdk.Networks.PUBLIC)
|
|
24004
|
+
* .setNetworkPassphrase(DigitalWorldSdk.Networks.FUTURENET)
|
|
24005
24005
|
* .setTimeout(30) // valid for the next 30s
|
|
24006
24006
|
* // Add an operation to call increment() on the contract
|
|
24007
24007
|
* .addOperation(contract.call("increment"))
|
|
@@ -24012,8 +24012,8 @@ ${value}`, dataLines++;
|
|
|
24012
24012
|
* // Sign this transaction with the secret key
|
|
24013
24013
|
* // NOTE: signing is transaction is network specific. Test network transactions
|
|
24014
24014
|
* // won't work in the public network. To switch networks, use the Network object
|
|
24015
|
-
* // as explained above (look for
|
|
24016
|
-
* const sourceKeypair =
|
|
24015
|
+
* // as explained above (look for DigitalWorldSdk.Network).
|
|
24016
|
+
* const sourceKeypair = DigitalWorldSdk.Keypair.fromSecret(sourceSecretKey);
|
|
24017
24017
|
* preparedTransaction.sign(sourceKeypair);
|
|
24018
24018
|
*
|
|
24019
24019
|
* server.sendTransaction(transaction).then(result => {
|
|
@@ -24031,7 +24031,7 @@ ${value}`, dataLines++;
|
|
|
24031
24031
|
return assembleTransaction(tx, simResponse).build();
|
|
24032
24032
|
}
|
|
24033
24033
|
/**
|
|
24034
|
-
* Submit a real transaction to the
|
|
24034
|
+
* Submit a real transaction to the Digital World network.
|
|
24035
24035
|
*
|
|
24036
24036
|
* Unlike Horizon, RPC does not wait for transaction completion. It
|
|
24037
24037
|
* simply validates the transaction and enqueues it. Clients should call
|
|
@@ -24048,15 +24048,15 @@ ${value}`, dataLines++;
|
|
|
24048
24048
|
* @example
|
|
24049
24049
|
* ```ts
|
|
24050
24050
|
* const contractId = 'CA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAXE';
|
|
24051
|
-
* const contract = new
|
|
24051
|
+
* const contract = new DigitalWorldSdk.Contract(contractId);
|
|
24052
24052
|
*
|
|
24053
24053
|
* // Right now, this is just the default fee for this example.
|
|
24054
|
-
* const fee =
|
|
24055
|
-
* const transaction = new
|
|
24054
|
+
* const fee = DigitalWorldSdk.BASE_FEE;
|
|
24055
|
+
* const transaction = new DigitalWorldSdk.TransactionBuilder(account, { fee })
|
|
24056
24056
|
* // Uncomment the following line to build transactions for the live network. Be
|
|
24057
24057
|
* // sure to also change the horizon hostname.
|
|
24058
|
-
* //.setNetworkPassphrase(
|
|
24059
|
-
* .setNetworkPassphrase(
|
|
24058
|
+
* //.setNetworkPassphrase(DigitalWorldSdk.Networks.PUBLIC)
|
|
24059
|
+
* .setNetworkPassphrase(DigitalWorldSdk.Networks.FUTURENET)
|
|
24060
24060
|
* .setTimeout(30) // valid for the next 30s
|
|
24061
24061
|
* // Add an operation to call increment() on the contract
|
|
24062
24062
|
* .addOperation(contract.call("increment"))
|
|
@@ -24065,8 +24065,8 @@ ${value}`, dataLines++;
|
|
|
24065
24065
|
* // Sign this transaction with the secret key
|
|
24066
24066
|
* // NOTE: signing is transaction is network specific. Test network transactions
|
|
24067
24067
|
* // won't work in the public network. To switch networks, use the Network object
|
|
24068
|
-
* // as explained above (look for
|
|
24069
|
-
* const sourceKeypair =
|
|
24068
|
+
* // as explained above (look for DigitalWorldSdk.Network).
|
|
24069
|
+
* const sourceKeypair = DigitalWorldSdk.Keypair.fromSecret(sourceSecretKey);
|
|
24070
24070
|
* transaction.sign(sourceKeypair);
|
|
24071
24071
|
*
|
|
24072
24072
|
* server.sendTransaction(transaction).then((result) => {
|
|
@@ -24122,6 +24122,11 @@ ${value}`, dataLines++;
|
|
|
24122
24122
|
*/
|
|
24123
24123
|
async requestAirdrop(address, faucetUrl) {
|
|
24124
24124
|
const account = typeof address === "string" ? address : address.accountId();
|
|
24125
|
+
if (!StrKey.isValidEd25519PublicKey(account) && !StrKey.isValidContract(account)) {
|
|
24126
|
+
throw new Error(
|
|
24127
|
+
`Invalid address: ${account}. Expected a Digital World account (G...) or contract (C...) address.`
|
|
24128
|
+
);
|
|
24129
|
+
}
|
|
24125
24130
|
faucetUrl = faucetUrl || (await this.getNetwork()).friendbotUrl;
|
|
24126
24131
|
if (!faucetUrl) {
|
|
24127
24132
|
throw new Error("No faucet URL configured for current network");
|
|
@@ -24159,10 +24164,10 @@ ${value}`, dataLines++;
|
|
|
24159
24164
|
*
|
|
24160
24165
|
* This method supports both account (G...) and contract (C...) addresses.
|
|
24161
24166
|
*
|
|
24162
|
-
* @param address - The address to fund. Can be either a
|
|
24167
|
+
* @param address - The address to fund. Can be either a Digital World
|
|
24163
24168
|
* account (G...) or contract (C...) address.
|
|
24164
24169
|
* @param faucetUrl - (optional) Optionally, an explicit faucet URL
|
|
24165
|
-
* (by default: this calls the
|
|
24170
|
+
* (by default: this calls the Digital World RPC
|
|
24166
24171
|
* {@link rpc.Server.getNetwork | getNetwork} method to try to
|
|
24167
24172
|
* discover this network's faucet url).
|
|
24168
24173
|
* @returns The transaction
|
|
@@ -24189,7 +24194,7 @@ ${value}`, dataLines++;
|
|
|
24189
24194
|
async fundAddress(address, faucetUrl) {
|
|
24190
24195
|
if (!StrKey.isValidEd25519PublicKey(address) && !StrKey.isValidContract(address)) {
|
|
24191
24196
|
throw new Error(
|
|
24192
|
-
`Invalid address: ${address}. Expected a
|
|
24197
|
+
`Invalid address: ${address}. Expected a Digital World account (G...) or contract (C...) address.`
|
|
24193
24198
|
);
|
|
24194
24199
|
}
|
|
24195
24200
|
faucetUrl = faucetUrl || (await this.getNetwork()).friendbotUrl;
|
|
@@ -25551,7 +25556,7 @@ ${JSON.stringify(sentTransaction)}`
|
|
|
25551
25556
|
MuxedAddress: {
|
|
25552
25557
|
type: "string",
|
|
25553
25558
|
format: "address",
|
|
25554
|
-
description: "
|
|
25559
|
+
description: "Digital World public key with M prefix combining a G address and unique ID"
|
|
25555
25560
|
},
|
|
25556
25561
|
ScString: {
|
|
25557
25562
|
type: "string",
|
|
@@ -26736,13 +26741,13 @@ ${JSON.stringify(sentTransaction)}`
|
|
|
26736
26741
|
if (stellarContractImports.length > 0) {
|
|
26737
26742
|
const uniqueContractImports = Array.from(new Set(stellarContractImports));
|
|
26738
26743
|
importLines.push(
|
|
26739
|
-
`import {${uniqueContractImports.join(", ")}} from '@
|
|
26744
|
+
`import {${uniqueContractImports.join(", ")}} from '@digitalworld/digital-world-sdk/contract';`
|
|
26740
26745
|
);
|
|
26741
26746
|
}
|
|
26742
26747
|
if (stellarImports.length > 0) {
|
|
26743
26748
|
const uniqueStellarImports = Array.from(new Set(stellarImports));
|
|
26744
26749
|
importLines.push(
|
|
26745
|
-
`import {${uniqueStellarImports.join(", ")}} from '@
|
|
26750
|
+
`import {${uniqueStellarImports.join(", ")}} from '@digitalworld/digital-world-sdk';`
|
|
26746
26751
|
);
|
|
26747
26752
|
}
|
|
26748
26753
|
if (imports.needsBufferImport) {
|
|
@@ -26952,7 +26957,7 @@ ${indent} */
|
|
|
26952
26957
|
const generatedPackageJson = {
|
|
26953
26958
|
name: contractName.toLowerCase().replace(/[^a-z0-9-]/g, "-"),
|
|
26954
26959
|
version: "0.0.1",
|
|
26955
|
-
description: `Generated TypeScript bindings for ${contractName}
|
|
26960
|
+
description: `Generated TypeScript bindings for ${contractName} Digital World contract`,
|
|
26956
26961
|
type: "module",
|
|
26957
26962
|
main: "dist/index.js",
|
|
26958
26963
|
types: "dist/index.d.ts",
|
|
@@ -26960,7 +26965,7 @@ ${indent} */
|
|
|
26960
26965
|
build: "tsc"
|
|
26961
26966
|
},
|
|
26962
26967
|
dependencies: {
|
|
26963
|
-
"@stellar/stellar-sdk": `^${"16.0.
|
|
26968
|
+
"@stellar/stellar-sdk": `^${"16.0.1"}`,
|
|
26964
26969
|
buffer: "6.0.3"
|
|
26965
26970
|
},
|
|
26966
26971
|
devDependencies: {
|
|
@@ -27024,7 +27029,7 @@ ${indent} */
|
|
|
27024
27029
|
const readme = [
|
|
27025
27030
|
`# ${contractName} Contract Bindings`,
|
|
27026
27031
|
"",
|
|
27027
|
-
`TypeScript bindings for the ${contractName}
|
|
27032
|
+
`TypeScript bindings for the ${contractName} Digital World smart contract.`,
|
|
27028
27033
|
"",
|
|
27029
27034
|
"## Installation",
|
|
27030
27035
|
"",
|
|
@@ -27061,7 +27066,7 @@ ${indent} */
|
|
|
27061
27066
|
"- `tsconfig.json` - TypeScript configuration",
|
|
27062
27067
|
"- `package.json` - NPM package configuration",
|
|
27063
27068
|
"",
|
|
27064
|
-
"This package was generated using the
|
|
27069
|
+
"This package was generated using the Digital World JS SDK contract binding generator."
|
|
27065
27070
|
].join("\n");
|
|
27066
27071
|
return readme;
|
|
27067
27072
|
}
|
|
@@ -27416,7 +27421,7 @@ export class Client extends ContractClient {
|
|
|
27416
27421
|
throw new WasmFetchError("Failed to fetch WASM from hash", error);
|
|
27417
27422
|
}
|
|
27418
27423
|
}
|
|
27419
|
-
function
|
|
27424
|
+
function isDigitalWorldAssetContract(instance) {
|
|
27420
27425
|
return instance.executable().switch() === types.ContractExecutableType.contractExecutableStellarAsset();
|
|
27421
27426
|
}
|
|
27422
27427
|
async function fetchWasmFromContract(server, contractAddress) {
|
|
@@ -27432,7 +27437,7 @@ export class Client extends ContractClient {
|
|
|
27432
27437
|
}
|
|
27433
27438
|
const contractData = entry.val.contractData();
|
|
27434
27439
|
const instance = contractData.val().instance();
|
|
27435
|
-
if (
|
|
27440
|
+
if (isDigitalWorldAssetContract(instance)) {
|
|
27436
27441
|
return { type: "stellar-asset-contract" };
|
|
27437
27442
|
}
|
|
27438
27443
|
const wasmHash = instance.executable().wasmHash();
|
|
@@ -27533,12 +27538,12 @@ export class Client extends ContractClient {
|
|
|
27533
27538
|
/**
|
|
27534
27539
|
* Creates a BindingGenerator by fetching WASM from the network using its hash.
|
|
27535
27540
|
*
|
|
27536
|
-
* Retrieves the WASM bytecode from
|
|
27541
|
+
* Retrieves the WASM bytecode from Digital World RPC using the WASM hash,
|
|
27537
27542
|
* then parses the contract specification from it. Useful when you know
|
|
27538
27543
|
* the hash of an installed WASM but don't have the binary locally.
|
|
27539
27544
|
*
|
|
27540
27545
|
* @param wasmHash - The hex-encoded hash of the installed WASM blob
|
|
27541
|
-
* @param rpcServer - The
|
|
27546
|
+
* @param rpcServer - The Digital World RPC server instance
|
|
27542
27547
|
* @returns A Promise resolving to a new BindingGenerator instance
|
|
27543
27548
|
* @throws If the WASM cannot be fetched or doesn't contain a valid spec
|
|
27544
27549
|
*
|
|
@@ -27562,11 +27567,11 @@ export class Client extends ContractClient {
|
|
|
27562
27567
|
* Creates a BindingGenerator by fetching contract info from a deployed contract ID.
|
|
27563
27568
|
*
|
|
27564
27569
|
* Retrieves the contract's WASM from the network using the contract ID,
|
|
27565
|
-
* then parses the specification. If the contract is a
|
|
27570
|
+
* then parses the specification. If the contract is a Digital World Asset Contract (SAC),
|
|
27566
27571
|
* returns a generator with the standard SAC specification.
|
|
27567
27572
|
*
|
|
27568
27573
|
* @param contractId - The contract ID (C... address) of the deployed contract
|
|
27569
|
-
* @param rpcServer - The
|
|
27574
|
+
* @param rpcServer - The Digital World RPC server instance
|
|
27570
27575
|
* @returns A Promise resolving to a new BindingGenerator instance
|
|
27571
27576
|
* @throws If the contract cannot be found or fetched
|
|
27572
27577
|
*
|