@fuel-ts/account 0.0.0-rc-2143-20240429161457 → 0.0.0-rc-2037-20240430003658
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/README.md +15 -12
- package/dist/index.global.js +92 -8
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +215 -118
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -39
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +9 -2
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +17 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +8 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/helpers.d.ts +10 -0
- package/dist/providers/transaction-request/helpers.d.ts.map +1 -0
- package/dist/providers/transaction-request/index.d.ts +1 -0
- package/dist/providers/transaction-request/index.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +2 -0
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils/index.d.ts +1 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +2 -4
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/resources.d.ts +4 -0
- package/dist/test-utils/resources.d.ts.map +1 -0
- package/dist/test-utils/seedTestWallet.d.ts +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils/transactionRequest.d.ts +5 -0
- package/dist/test-utils/transactionRequest.d.ts.map +1 -0
- package/dist/test-utils.global.js +94 -14
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +203 -117
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +127 -44
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts +2 -2
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +15 -15
package/dist/test-utils.mjs
CHANGED
@@ -70,7 +70,7 @@ import { Address as Address2 } from "@fuel-ts/address";
|
|
70
70
|
import { ErrorCode as ErrorCode13, FuelError as FuelError13 } from "@fuel-ts/errors";
|
71
71
|
import { BN, bn as bn16 } from "@fuel-ts/math";
|
72
72
|
import {
|
73
|
-
InputType as
|
73
|
+
InputType as InputType8,
|
74
74
|
TransactionType as TransactionType8,
|
75
75
|
InputMessageCoder,
|
76
76
|
TransactionCoder as TransactionCoder5
|
@@ -853,6 +853,13 @@ var ProduceBlocksDocument = gql`
|
|
853
853
|
)
|
854
854
|
}
|
855
855
|
`;
|
856
|
+
var GetMessageByNonceDocument = gql`
|
857
|
+
query getMessageByNonce($nonce: Nonce!) {
|
858
|
+
message(nonce: $nonce) {
|
859
|
+
...messageFragment
|
860
|
+
}
|
861
|
+
}
|
862
|
+
${MessageFragmentFragmentDoc}`;
|
856
863
|
var SubmitAndAwaitDocument = gql`
|
857
864
|
subscription submitAndAwait($encodedTransaction: HexString!) {
|
858
865
|
submitAndAwait(tx: $encodedTransaction) {
|
@@ -947,6 +954,9 @@ function getSdk(requester) {
|
|
947
954
|
produceBlocks(variables, options) {
|
948
955
|
return requester(ProduceBlocksDocument, variables, options);
|
949
956
|
},
|
957
|
+
getMessageByNonce(variables, options) {
|
958
|
+
return requester(GetMessageByNonceDocument, variables, options);
|
959
|
+
},
|
950
960
|
submitAndAwait(variables, options) {
|
951
961
|
return requester(SubmitAndAwaitDocument, variables, options);
|
952
962
|
},
|
@@ -1235,7 +1245,7 @@ import { bn as bn7 } from "@fuel-ts/math";
|
|
1235
1245
|
import {
|
1236
1246
|
PolicyType,
|
1237
1247
|
TransactionCoder,
|
1238
|
-
InputType as
|
1248
|
+
InputType as InputType3,
|
1239
1249
|
OutputType as OutputType2,
|
1240
1250
|
TransactionType
|
1241
1251
|
} from "@fuel-ts/transactions";
|
@@ -1685,6 +1695,12 @@ var NoWitnessAtIndexError = class extends Error {
|
|
1685
1695
|
name = "NoWitnessAtIndexError";
|
1686
1696
|
};
|
1687
1697
|
|
1698
|
+
// src/providers/transaction-request/helpers.ts
|
1699
|
+
import { InputType as InputType2 } from "@fuel-ts/transactions";
|
1700
|
+
var isRequestInputCoin = (input) => input.type === InputType2.Coin;
|
1701
|
+
var isRequestInputMessage = (input) => input.type === InputType2.Message;
|
1702
|
+
var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
|
1703
|
+
|
1688
1704
|
// src/providers/transaction-request/witness.ts
|
1689
1705
|
import { arrayify as arrayify4, hexlify as hexlify6 } from "@fuel-ts/utils";
|
1690
1706
|
var witnessify = (value) => {
|
@@ -1875,7 +1891,7 @@ var BaseTransactionRequest = class {
|
|
1875
1891
|
*/
|
1876
1892
|
getCoinInputs() {
|
1877
1893
|
return this.inputs.filter(
|
1878
|
-
(input) => input.type ===
|
1894
|
+
(input) => input.type === InputType3.Coin
|
1879
1895
|
);
|
1880
1896
|
}
|
1881
1897
|
/**
|
@@ -1907,9 +1923,9 @@ var BaseTransactionRequest = class {
|
|
1907
1923
|
const ownerAddress = addressify(owner);
|
1908
1924
|
const found = this.inputs.find((input) => {
|
1909
1925
|
switch (input.type) {
|
1910
|
-
case
|
1926
|
+
case InputType3.Coin:
|
1911
1927
|
return hexlify7(input.owner) === ownerAddress.toB256();
|
1912
|
-
case
|
1928
|
+
case InputType3.Message:
|
1913
1929
|
return hexlify7(input.recipient) === ownerAddress.toB256();
|
1914
1930
|
default:
|
1915
1931
|
return false;
|
@@ -1924,7 +1940,7 @@ var BaseTransactionRequest = class {
|
|
1924
1940
|
* @param coin - Coin resource.
|
1925
1941
|
*/
|
1926
1942
|
addCoinInput(coin) {
|
1927
|
-
const { assetId, owner, amount } = coin;
|
1943
|
+
const { assetId, owner, amount, id, predicate } = coin;
|
1928
1944
|
let witnessIndex;
|
1929
1945
|
if (coin.predicate) {
|
1930
1946
|
witnessIndex = 0;
|
@@ -1935,13 +1951,14 @@ var BaseTransactionRequest = class {
|
|
1935
1951
|
}
|
1936
1952
|
}
|
1937
1953
|
const input = {
|
1938
|
-
|
1939
|
-
type:
|
1954
|
+
id,
|
1955
|
+
type: InputType3.Coin,
|
1940
1956
|
owner: owner.toB256(),
|
1941
1957
|
amount,
|
1942
1958
|
assetId,
|
1943
1959
|
txPointer: "0x00000000000000000000000000000000",
|
1944
|
-
witnessIndex
|
1960
|
+
witnessIndex,
|
1961
|
+
predicate
|
1945
1962
|
};
|
1946
1963
|
this.pushInput(input);
|
1947
1964
|
this.addChangeOutput(owner, assetId);
|
@@ -1953,7 +1970,7 @@ var BaseTransactionRequest = class {
|
|
1953
1970
|
* @param message - Message resource.
|
1954
1971
|
*/
|
1955
1972
|
addMessageInput(message) {
|
1956
|
-
const { recipient, sender, amount, assetId } = message;
|
1973
|
+
const { recipient, sender, amount, predicate, nonce, assetId } = message;
|
1957
1974
|
let witnessIndex;
|
1958
1975
|
if (message.predicate) {
|
1959
1976
|
witnessIndex = 0;
|
@@ -1964,12 +1981,13 @@ var BaseTransactionRequest = class {
|
|
1964
1981
|
}
|
1965
1982
|
}
|
1966
1983
|
const input = {
|
1967
|
-
|
1968
|
-
type:
|
1984
|
+
nonce,
|
1985
|
+
type: InputType3.Message,
|
1969
1986
|
sender: sender.toB256(),
|
1970
1987
|
recipient: recipient.toB256(),
|
1971
1988
|
amount,
|
1972
|
-
witnessIndex
|
1989
|
+
witnessIndex,
|
1990
|
+
predicate
|
1973
1991
|
};
|
1974
1992
|
this.pushInput(input);
|
1975
1993
|
this.addChangeOutput(recipient, assetId);
|
@@ -2153,16 +2171,27 @@ var BaseTransactionRequest = class {
|
|
2153
2171
|
toJSON() {
|
2154
2172
|
return normalizeJSON(this);
|
2155
2173
|
}
|
2174
|
+
removeWitness(index) {
|
2175
|
+
this.witnesses.splice(index, 1);
|
2176
|
+
this.adjustWitnessIndexes(index);
|
2177
|
+
}
|
2178
|
+
adjustWitnessIndexes(removedIndex) {
|
2179
|
+
this.inputs.filter(isRequestInputResource).forEach((input) => {
|
2180
|
+
if (input.witnessIndex > removedIndex) {
|
2181
|
+
input.witnessIndex -= 1;
|
2182
|
+
}
|
2183
|
+
});
|
2184
|
+
}
|
2156
2185
|
updatePredicateGasUsed(inputs) {
|
2157
2186
|
this.inputs.forEach((i) => {
|
2158
2187
|
let correspondingInput;
|
2159
2188
|
switch (i.type) {
|
2160
|
-
case
|
2161
|
-
correspondingInput = inputs.find((x) => x.type ===
|
2189
|
+
case InputType3.Coin:
|
2190
|
+
correspondingInput = inputs.find((x) => x.type === InputType3.Coin && x.owner === i.owner);
|
2162
2191
|
break;
|
2163
|
-
case
|
2192
|
+
case InputType3.Message:
|
2164
2193
|
correspondingInput = inputs.find(
|
2165
|
-
(x) => x.type ===
|
2194
|
+
(x) => x.type === InputType3.Message && x.sender === i.sender
|
2166
2195
|
);
|
2167
2196
|
break;
|
2168
2197
|
default:
|
@@ -2196,7 +2225,7 @@ import { arrayify as arrayify6, hexlify as hexlify9 } from "@fuel-ts/utils";
|
|
2196
2225
|
import { ZeroBytes32 as ZeroBytes325 } from "@fuel-ts/address/configs";
|
2197
2226
|
import { uint64ToBytesBE, sha256 } from "@fuel-ts/hasher";
|
2198
2227
|
import { bn as bn8 } from "@fuel-ts/math";
|
2199
|
-
import { TransactionType as TransactionType2, InputType as
|
2228
|
+
import { TransactionType as TransactionType2, InputType as InputType4, OutputType as OutputType3, TransactionCoder as TransactionCoder2 } from "@fuel-ts/transactions";
|
2200
2229
|
import { concat as concat2 } from "@fuel-ts/utils";
|
2201
2230
|
import { clone as clone2 } from "ramda";
|
2202
2231
|
function hashTransaction(transactionRequest, chainId) {
|
@@ -2207,7 +2236,7 @@ function hashTransaction(transactionRequest, chainId) {
|
|
2207
2236
|
transaction.inputs = transaction.inputs.map((input) => {
|
2208
2237
|
const inputClone = clone2(input);
|
2209
2238
|
switch (inputClone.type) {
|
2210
|
-
case
|
2239
|
+
case InputType4.Coin: {
|
2211
2240
|
inputClone.txPointer = {
|
2212
2241
|
blockHeight: 0,
|
2213
2242
|
txIndex: 0
|
@@ -2215,11 +2244,11 @@ function hashTransaction(transactionRequest, chainId) {
|
|
2215
2244
|
inputClone.predicateGasUsed = bn8(0);
|
2216
2245
|
return inputClone;
|
2217
2246
|
}
|
2218
|
-
case
|
2247
|
+
case InputType4.Message: {
|
2219
2248
|
inputClone.predicateGasUsed = bn8(0);
|
2220
2249
|
return inputClone;
|
2221
2250
|
}
|
2222
|
-
case
|
2251
|
+
case InputType4.Contract: {
|
2223
2252
|
inputClone.txPointer = {
|
2224
2253
|
blockHeight: 0,
|
2225
2254
|
txIndex: 0
|
@@ -2379,7 +2408,7 @@ import { Interface } from "@fuel-ts/abi-coder";
|
|
2379
2408
|
import { addressify as addressify2 } from "@fuel-ts/address";
|
2380
2409
|
import { ZeroBytes32 as ZeroBytes327 } from "@fuel-ts/address/configs";
|
2381
2410
|
import { bn as bn10 } from "@fuel-ts/math";
|
2382
|
-
import { InputType as
|
2411
|
+
import { InputType as InputType5, OutputType as OutputType5, TransactionType as TransactionType4 } from "@fuel-ts/transactions";
|
2383
2412
|
import { arrayify as arrayify8, hexlify as hexlify10 } from "@fuel-ts/utils";
|
2384
2413
|
|
2385
2414
|
// src/providers/transaction-request/scripts.ts
|
@@ -2463,7 +2492,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
|
2463
2492
|
*/
|
2464
2493
|
getContractInputs() {
|
2465
2494
|
return this.inputs.filter(
|
2466
|
-
(input) => input.type ===
|
2495
|
+
(input) => input.type === InputType5.Contract
|
2467
2496
|
);
|
2468
2497
|
}
|
2469
2498
|
/**
|
@@ -2540,7 +2569,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
|
2540
2569
|
return this;
|
2541
2570
|
}
|
2542
2571
|
const inputIndex = super.pushInput({
|
2543
|
-
type:
|
2572
|
+
type: InputType5.Contract,
|
2544
2573
|
contractId: contractAddress.toB256(),
|
2545
2574
|
txPointer: "0x00000000000000000000000000000000"
|
2546
2575
|
});
|
@@ -2582,7 +2611,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
|
2582
2611
|
|
2583
2612
|
// src/providers/transaction-request/utils.ts
|
2584
2613
|
import { ErrorCode as ErrorCode8, FuelError as FuelError8 } from "@fuel-ts/errors";
|
2585
|
-
import { TransactionType as TransactionType5, InputType as
|
2614
|
+
import { TransactionType as TransactionType5, InputType as InputType6 } from "@fuel-ts/transactions";
|
2586
2615
|
var transactionRequestify = (obj) => {
|
2587
2616
|
if (obj instanceof ScriptTransactionRequest || obj instanceof CreateTransactionRequest) {
|
2588
2617
|
return obj;
|
@@ -2602,10 +2631,10 @@ var transactionRequestify = (obj) => {
|
|
2602
2631
|
};
|
2603
2632
|
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
2604
2633
|
(acc, input) => {
|
2605
|
-
if (input.type ===
|
2634
|
+
if (input.type === InputType6.Coin && input.owner === owner) {
|
2606
2635
|
acc.utxos.push(input.id);
|
2607
2636
|
}
|
2608
|
-
if (input.type ===
|
2637
|
+
if (input.type === InputType6.Message && input.recipient === owner) {
|
2609
2638
|
acc.messages.push(input.nonce);
|
2610
2639
|
}
|
2611
2640
|
return acc;
|
@@ -2759,7 +2788,7 @@ var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
|
|
2759
2788
|
|
2760
2789
|
// src/providers/transaction-summary/input.ts
|
2761
2790
|
import { ErrorCode as ErrorCode9, FuelError as FuelError9 } from "@fuel-ts/errors";
|
2762
|
-
import { InputType as
|
2791
|
+
import { InputType as InputType7 } from "@fuel-ts/transactions";
|
2763
2792
|
function getInputsByTypes(inputs, types) {
|
2764
2793
|
return inputs.filter((i) => types.includes(i.type));
|
2765
2794
|
}
|
@@ -2767,16 +2796,16 @@ function getInputsByType(inputs, type) {
|
|
2767
2796
|
return inputs.filter((i) => i.type === type);
|
2768
2797
|
}
|
2769
2798
|
function getInputsCoin(inputs) {
|
2770
|
-
return getInputsByType(inputs,
|
2799
|
+
return getInputsByType(inputs, InputType7.Coin);
|
2771
2800
|
}
|
2772
2801
|
function getInputsMessage(inputs) {
|
2773
|
-
return getInputsByType(inputs,
|
2802
|
+
return getInputsByType(inputs, InputType7.Message);
|
2774
2803
|
}
|
2775
2804
|
function getInputsCoinAndMessage(inputs) {
|
2776
|
-
return getInputsByTypes(inputs, [
|
2805
|
+
return getInputsByTypes(inputs, [InputType7.Coin, InputType7.Message]);
|
2777
2806
|
}
|
2778
2807
|
function getInputsContract(inputs) {
|
2779
|
-
return getInputsByType(inputs,
|
2808
|
+
return getInputsByType(inputs, InputType7.Contract);
|
2780
2809
|
}
|
2781
2810
|
function getInputFromAssetId(inputs, assetId) {
|
2782
2811
|
const coinInputs = getInputsCoin(inputs);
|
@@ -2795,7 +2824,7 @@ function getInputContractFromIndex(inputs, inputIndex) {
|
|
2795
2824
|
if (!contractInput) {
|
2796
2825
|
return void 0;
|
2797
2826
|
}
|
2798
|
-
if (contractInput.type !==
|
2827
|
+
if (contractInput.type !== InputType7.Contract) {
|
2799
2828
|
throw new FuelError9(
|
2800
2829
|
ErrorCode9.INVALID_TRANSACTION_INPUT,
|
2801
2830
|
`Contract input should be of type 'contract'.`
|
@@ -2804,10 +2833,10 @@ function getInputContractFromIndex(inputs, inputIndex) {
|
|
2804
2833
|
return contractInput;
|
2805
2834
|
}
|
2806
2835
|
function getInputAccountAddress(input) {
|
2807
|
-
if (input.type ===
|
2836
|
+
if (input.type === InputType7.Coin) {
|
2808
2837
|
return input.owner.toString();
|
2809
2838
|
}
|
2810
|
-
if (input.type ===
|
2839
|
+
if (input.type === InputType7.Message) {
|
2811
2840
|
return input.recipient.toString();
|
2812
2841
|
}
|
2813
2842
|
return "";
|
@@ -4636,6 +4665,19 @@ var _Provider = class {
|
|
4636
4665
|
async getTransactionResponse(transactionId) {
|
4637
4666
|
return new TransactionResponse(transactionId, this);
|
4638
4667
|
}
|
4668
|
+
/**
|
4669
|
+
* Returns Message for given nonce.
|
4670
|
+
*
|
4671
|
+
* @param nonce - The nonce of the message to retrieve.
|
4672
|
+
* @returns A promise that resolves to the Message object.
|
4673
|
+
*/
|
4674
|
+
async getMessageByNonce(nonce) {
|
4675
|
+
const { message } = await this.operations.getMessageByNonce({ nonce });
|
4676
|
+
if (!message) {
|
4677
|
+
return null;
|
4678
|
+
}
|
4679
|
+
return message;
|
4680
|
+
}
|
4639
4681
|
};
|
4640
4682
|
var Provider = _Provider;
|
4641
4683
|
_cacheInputs = new WeakSet();
|
@@ -4644,7 +4686,7 @@ cacheInputs_fn = function(inputs) {
|
|
4644
4686
|
return;
|
4645
4687
|
}
|
4646
4688
|
inputs.forEach((input) => {
|
4647
|
-
if (input.type ===
|
4689
|
+
if (input.type === InputType8.Coin) {
|
4648
4690
|
this.cache?.set(input.id);
|
4649
4691
|
}
|
4650
4692
|
});
|
@@ -8211,16 +8253,21 @@ __publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
|
8211
8253
|
|
8212
8254
|
// src/test-utils/seedTestWallet.ts
|
8213
8255
|
import { randomBytes as randomBytes5 } from "@fuel-ts/crypto";
|
8214
|
-
var seedTestWallet = async (wallet, quantities) => {
|
8256
|
+
var seedTestWallet = async (wallet, quantities, utxosAmount = 1) => {
|
8257
|
+
const toFundAccounts = Array.isArray(wallet) ? wallet : [wallet];
|
8215
8258
|
const genesisWallet = new WalletUnlocked(
|
8216
8259
|
process.env.GENESIS_SECRET || randomBytes5(32),
|
8217
|
-
wallet
|
8260
|
+
// Connect to the same Provider as wallet
|
8261
|
+
toFundAccounts[0].provider
|
8218
8262
|
);
|
8219
8263
|
const request = new ScriptTransactionRequest();
|
8220
|
-
quantities.forEach(
|
8221
|
-
|
8222
|
-
|
8223
|
-
|
8264
|
+
quantities.map(coinQuantityfy).forEach(
|
8265
|
+
({ amount, assetId }) => toFundAccounts.forEach(({ address }) => {
|
8266
|
+
for (let i = 0; i < utxosAmount; i++) {
|
8267
|
+
request.addCoinOutput(address, amount.div(utxosAmount), assetId);
|
8268
|
+
}
|
8269
|
+
})
|
8270
|
+
);
|
8224
8271
|
const txCost = await genesisWallet.provider.getTransactionCost(request);
|
8225
8272
|
request.gasLimit = txCost.gasUsed;
|
8226
8273
|
request.maxFee = txCost.maxFee;
|
@@ -8284,7 +8331,6 @@ var launchNode = async ({
|
|
8284
8331
|
ip,
|
8285
8332
|
port,
|
8286
8333
|
args = [],
|
8287
|
-
fuelCorePath = void 0,
|
8288
8334
|
useSystemFuelCore = false,
|
8289
8335
|
loggingEnabled = true,
|
8290
8336
|
debugEnabled = false,
|
@@ -8305,7 +8351,7 @@ var launchNode = async ({
|
|
8305
8351
|
const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
|
8306
8352
|
const poaInstant = poaInstantFlagValue === "true" || poaInstantFlagValue === void 0;
|
8307
8353
|
const graphQLStartSubstring = "Binding GraphQL provider to";
|
8308
|
-
const binPath =
|
8354
|
+
const binPath = findBinPath("fuels-core", __dirname);
|
8309
8355
|
const command = useSystemFuelCore ? "fuel-core" : binPath;
|
8310
8356
|
const ipToUse = ip || "0.0.0.0";
|
8311
8357
|
const portToUse = port || (await getPortPromise({
|
@@ -8443,7 +8489,44 @@ var launchNodeAndGetWallets = async ({
|
|
8443
8489
|
};
|
8444
8490
|
return { wallets, stop: cleanup, provider };
|
8445
8491
|
};
|
8492
|
+
|
8493
|
+
// src/test-utils/transactionRequest.ts
|
8494
|
+
import { UTXO_ID_LEN as UTXO_ID_LEN4 } from "@fuel-ts/abi-coder";
|
8495
|
+
import { getRandomB256 } from "@fuel-ts/address";
|
8496
|
+
import { ZeroBytes32 as ZeroBytes329 } from "@fuel-ts/address/configs";
|
8497
|
+
import { randomBytes as randomBytes7 } from "@fuel-ts/crypto";
|
8498
|
+
import { bn as bn20 } from "@fuel-ts/math";
|
8499
|
+
import { InputType as InputType9 } from "@fuel-ts/transactions";
|
8500
|
+
import { hexlify as hexlify19 } from "@fuel-ts/utils";
|
8501
|
+
var generateFakeRequestInputCoin = (partial = {}) => ({
|
8502
|
+
id: hexlify19(randomBytes7(UTXO_ID_LEN4)),
|
8503
|
+
type: InputType9.Coin,
|
8504
|
+
owner: getRandomB256(),
|
8505
|
+
amount: bn20(100),
|
8506
|
+
assetId: ZeroBytes329,
|
8507
|
+
txPointer: "0x00000000000000000000000000000000",
|
8508
|
+
witnessIndex: 0,
|
8509
|
+
...partial
|
8510
|
+
});
|
8511
|
+
var generateFakeRequestInputMessage = (partial = {}) => ({
|
8512
|
+
nonce: getRandomB256(),
|
8513
|
+
type: InputType9.Message,
|
8514
|
+
sender: getRandomB256(),
|
8515
|
+
recipient: getRandomB256(),
|
8516
|
+
amount: bn20(100),
|
8517
|
+
witnessIndex: 0,
|
8518
|
+
...partial
|
8519
|
+
});
|
8520
|
+
var generateFakeRequestInputContract = (partial = {}) => ({
|
8521
|
+
contractId: getRandomB256(),
|
8522
|
+
type: InputType9.Contract,
|
8523
|
+
txPointer: "0x00000000000000000000000000000000",
|
8524
|
+
...partial
|
8525
|
+
});
|
8446
8526
|
export {
|
8527
|
+
generateFakeRequestInputCoin,
|
8528
|
+
generateFakeRequestInputContract,
|
8529
|
+
generateFakeRequestInputMessage,
|
8447
8530
|
generateTestWallet,
|
8448
8531
|
killNode,
|
8449
8532
|
launchNode,
|