diff --git a/package.json b/package.json index 50254e0d..f1514e65 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,11 @@ "update-gateway-settings": "yarn ts-node ./tools/cli/update-gateway-settings.ts", "get-balance": "yarn ts-node ./tools/cli/get-balance.ts", "increase-operator-stake": "yarn ts-node ./tools/cli/increase-operator-stake.ts", - "create-reserved-name": "yarn ts-node ./tools/cli/reserved-name.ts" + "create-reserved-name": "yarn ts-node ./tools/cli/reserved-name.ts", + "transfer": "yarn ts-node ./tools/cli/transfer.ts" }, "devDependencies": { - "@ar.io/sdk": "^1.0.0-alpha.12", + "@ar.io/sdk": "1.0.7-alpha.3", "@commitlint/config-conventional": "^17.7.0", "@trivago/prettier-plugin-sort-imports": "^4.0.0", "@types/jest": "^27.4.0", diff --git a/src/actions/write/createVault.test.ts b/src/actions/write/createVault.test.ts index eee1c0aa..41f463f7 100644 --- a/src/actions/write/createVault.test.ts +++ b/src/actions/write/createVault.test.ts @@ -45,7 +45,7 @@ describe('createVault', () => { const error = await createVault(initialState, { caller: 'test', input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), lockLength: badLockLength, }, }).catch((e) => e); @@ -66,7 +66,7 @@ describe('createVault', () => { const error = await createVault(initialState, { caller: 'test', input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, }).catch((e) => e); @@ -86,7 +86,7 @@ describe('createVault', () => { const { state } = await createVault(initialState, { caller: 'test', input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, }); diff --git a/src/actions/write/createVault.ts b/src/actions/write/createVault.ts index c7922cae..aa7faa68 100644 --- a/src/actions/write/createVault.ts +++ b/src/actions/write/createVault.ts @@ -2,7 +2,6 @@ import { BlockHeight, ContractWriteResult, IOState, - IOToken, PstAction, mIOToken, } from '../../types'; @@ -22,7 +21,7 @@ export class CreateVault { ); } const { qty, lockLength } = input; - this.qty = new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); this.lockLength = new BlockHeight(lockLength); } } diff --git a/src/actions/write/decreaseOperatorStake.test.ts b/src/actions/write/decreaseOperatorStake.test.ts index 3a99a28d..68afea5c 100644 --- a/src/actions/write/decreaseOperatorStake.test.ts +++ b/src/actions/write/decreaseOperatorStake.test.ts @@ -23,7 +23,7 @@ describe('decreaseOperatorStake', () => { [stubbedArweaveTxId]: stubbedGatewayData, }, balances: { - [stubbedArweaveTxId]: 10000, + [stubbedArweaveTxId]: new IOToken(10000).toMIO().valueOf(), }, }; const error = await decreaseOperatorStake(initialState, { @@ -60,7 +60,7 @@ describe('decreaseOperatorStake', () => { expect(error).toBeInstanceOf(Error); expect(error.message).toEqual( expect.stringContaining( - `Resulting stake is not enough maintain the minimum operator stake of ${MIN_OPERATOR_STAKE.toIO().valueOf()} IO`, + `Resulting stake is not enough maintain the minimum operator stake of ${MIN_OPERATOR_STAKE.valueOf()} mIO`, ), ); }); @@ -70,7 +70,7 @@ describe('decreaseOperatorStake', () => { const error = await decreaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), }, }).catch((e: any) => e); expect(error).toBeInstanceOf(Error); @@ -92,7 +92,7 @@ describe('decreaseOperatorStake', () => { const error = await decreaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), }, }).catch((e: any) => e); expect(error).toBeInstanceOf(Error); @@ -118,7 +118,7 @@ describe('decreaseOperatorStake', () => { const { state } = await decreaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: new IOToken(100).valueOf(), + qty: new IOToken(100).toMIO().valueOf(), }, }); expect(state.gateways[stubbedArweaveTxId]).toEqual({ diff --git a/src/actions/write/decreaseOperatorStake.ts b/src/actions/write/decreaseOperatorStake.ts index 10e41bae..af59e902 100644 --- a/src/actions/write/decreaseOperatorStake.ts +++ b/src/actions/write/decreaseOperatorStake.ts @@ -9,7 +9,6 @@ import { ContractWriteResult, Gateway, IOState, - IOToken, PstAction, mIOToken, } from '../../types'; @@ -30,7 +29,7 @@ export class DecreaseOperatorStake { ); } const { qty } = input; - this.qty = new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); } } @@ -57,7 +56,7 @@ export const decreaseOperatorStake = async ( if (qty.isGreaterThan(maxWithdraw)) { throw new ContractError( - `Resulting stake is not enough maintain the minimum operator stake of ${MIN_OPERATOR_STAKE.toIO().valueOf()} IO`, + `Resulting stake is not enough maintain the minimum operator stake of ${MIN_OPERATOR_STAKE.valueOf()} mIO`, ); } diff --git a/src/actions/write/delegateStake.test.ts b/src/actions/write/delegateStake.test.ts index e30af1ad..c6e1c73e 100644 --- a/src/actions/write/delegateStake.test.ts +++ b/src/actions/write/delegateStake.test.ts @@ -70,7 +70,7 @@ describe('delegateStake', () => { const error = await delegateStake(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new IOToken(100).toMIO().valueOf(), target: stubbedArweaveTxId, }, }).catch((e) => e); @@ -93,7 +93,7 @@ describe('delegateStake', () => { const error = await delegateStake(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new IOToken(100).toMIO().valueOf(), target: stubbedArweaveTxId, }, }).catch((e) => e); @@ -118,13 +118,14 @@ describe('delegateStake', () => { }, }, balances: { - test: MIN_DELEGATED_STAKE.valueOf() + 1000, + test: + MIN_DELEGATED_STAKE.valueOf() + new IOToken(1000).toMIO().valueOf(), }, }; const { state } = await delegateStake(initialState, { caller: 'test', input: { - qty: MIN_DELEGATED_STAKE.toIO().valueOf(), + qty: MIN_DELEGATED_STAKE.valueOf(), target: stubbedArweaveTxId, }, }); @@ -148,7 +149,7 @@ describe('delegateStake', () => { }, }, balances: { - test: 1000, + test: new IOToken(1000).toMIO().valueOf(), }, }); }); diff --git a/src/actions/write/delegateStake.ts b/src/actions/write/delegateStake.ts index 8d479679..c06a33ee 100644 --- a/src/actions/write/delegateStake.ts +++ b/src/actions/write/delegateStake.ts @@ -3,7 +3,6 @@ import { BlockHeight, ContractWriteResult, IOState, - IOToken, PstAction, mIOToken, } from '../../types'; @@ -22,7 +21,7 @@ export class DelegateStake { } const { target, qty } = input; this.target = target; - this.qty = new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); } } diff --git a/src/actions/write/extendVault.test.ts b/src/actions/write/extendVault.test.ts index dda0a105..a968fdc9 100644 --- a/src/actions/write/extendVault.test.ts +++ b/src/actions/write/extendVault.test.ts @@ -3,7 +3,7 @@ import { MIN_TOKEN_LOCK_BLOCK_LENGTH, } from '../../constants'; import { getBaselineState, stubbedArweaveTxId } from '../../tests/stubs'; -import { IOState } from '../../types'; +import { IOState, IOToken } from '../../types'; import { extendVault } from './extendVault'; describe('extendVault', () => { @@ -18,7 +18,7 @@ describe('extendVault', () => { vaults: { test: { [stubbedArweaveTxId]: { - balance: 100, + balance: new IOToken(100).toMIO().valueOf(), end: SmartWeave.block.height + MIN_TOKEN_LOCK_BLOCK_LENGTH, start: SmartWeave.block.height, }, @@ -58,12 +58,12 @@ describe('extendVault', () => { const initialState: IOState = { ...getBaselineState(), balances: { - test: 99, + test: new IOToken(99).toMIO().valueOf(), }, vaults: { test: { [stubbedArweaveTxId]: { - balance: 100, + balance: new IOToken(100).toMIO().valueOf(), end: SmartWeave.block.height + MIN_TOKEN_LOCK_BLOCK_LENGTH, start: SmartWeave.block.height, }, @@ -89,7 +89,7 @@ describe('extendVault', () => { vaults: { test: { [stubbedArweaveTxId]: { - balance: 100, + balance: new IOToken(100).toMIO().valueOf(), end: SmartWeave.block.height + MIN_TOKEN_LOCK_BLOCK_LENGTH, start: SmartWeave.block.height, }, @@ -110,7 +110,7 @@ describe('extendVault', () => { vaults: { test: { [stubbedArweaveTxId]: { - balance: 100, + balance: new IOToken(100).toMIO().valueOf(), end: SmartWeave.block.height + MIN_TOKEN_LOCK_BLOCK_LENGTH + diff --git a/src/actions/write/increaseOperatorStake.test.ts b/src/actions/write/increaseOperatorStake.test.ts index c4a12478..e9c75463 100644 --- a/src/actions/write/increaseOperatorStake.test.ts +++ b/src/actions/write/increaseOperatorStake.test.ts @@ -47,13 +47,13 @@ describe('increaseOperatorStake', () => { [stubbedArweaveTxId]: stubbedGatewayData, }, balances: { - [stubbedArweaveTxId]: 100, + [stubbedArweaveTxId]: new IOToken(100).toMIO().valueOf(), }, }; const error = await increaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: 101, + qty: new IOToken(101).toMIO().valueOf(), }, }).catch((e: any) => e); expect(error).toBeInstanceOf(Error); @@ -67,7 +67,7 @@ describe('increaseOperatorStake', () => { const error = await increaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), }, }).catch((e: any) => e); expect(error).toBeInstanceOf(Error); @@ -89,7 +89,7 @@ describe('increaseOperatorStake', () => { const error = await increaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: 100, + qty: new IOToken(100).toMIO().valueOf(), }, }).catch((e: any) => e); expect(error).toBeInstanceOf(Error); @@ -116,7 +116,7 @@ describe('increaseOperatorStake', () => { const { state } = await increaseOperatorStake(initialState, { caller: stubbedArweaveTxId, input: { - qty: new IOToken(1000).valueOf(), + qty: new IOToken(1000).toMIO().valueOf(), }, }); expect(state.gateways[stubbedArweaveTxId]).toEqual({ diff --git a/src/actions/write/increaseOperatorStake.ts b/src/actions/write/increaseOperatorStake.ts index f97ab333..e9dac3cf 100644 --- a/src/actions/write/increaseOperatorStake.ts +++ b/src/actions/write/increaseOperatorStake.ts @@ -4,7 +4,7 @@ import { INVALID_INPUT_MESSAGE, NETWORK_LEAVING_STATUS, } from '../../constants'; -import { ContractWriteResult, IOState, IOToken, PstAction } from '../../types'; +import { ContractWriteResult, IOState, PstAction, mIOToken } from '../../types'; import { unsafeDecrementBalance, walletHasSufficientBalance, @@ -21,7 +21,7 @@ export const increaseOperatorStake = async ( throw new ContractError(INVALID_INPUT_MESSAGE); } - const qty = new IOToken(input.qty).toMIO(); + const qty = new mIOToken(input.qty); if (!(caller in gateways)) { throw new ContractError(INVALID_GATEWAY_EXISTS_MESSAGE); diff --git a/src/actions/write/increaseVault.test.ts b/src/actions/write/increaseVault.test.ts index 753631f1..1ab92cfd 100644 --- a/src/actions/write/increaseVault.test.ts +++ b/src/actions/write/increaseVault.test.ts @@ -48,7 +48,7 @@ describe('increaseVault', () => { caller: 'test', input: { id: stubbedArweaveTxId, - qty: new IOToken(50).valueOf(), + qty: new IOToken(50).toMIO().valueOf(), }, }).catch((e) => e); expect(error).toBeInstanceOf(Error); @@ -75,7 +75,7 @@ describe('increaseVault', () => { caller: 'test', input: { id: stubbedArweaveTxId, - qty: new IOToken(100).valueOf(), + qty: new IOToken(100).toMIO().valueOf(), }, }).catch((e) => e); expect(error).toBeInstanceOf(Error); @@ -102,7 +102,7 @@ describe('increaseVault', () => { caller: 'test', input: { id: stubbedArweaveTxId, - qty: new IOToken(50).valueOf(), + qty: new IOToken(50).toMIO().valueOf(), }, }); expect(state).toEqual({ diff --git a/src/actions/write/increaseVault.ts b/src/actions/write/increaseVault.ts index b11c2072..c93be6aa 100644 --- a/src/actions/write/increaseVault.ts +++ b/src/actions/write/increaseVault.ts @@ -1,7 +1,6 @@ import { ContractWriteResult, IOState, - IOToken, PstAction, TransactionId, mIOToken, @@ -23,7 +22,7 @@ export class IncreaseVault { } const { id, qty } = input; this.id = id; - this.qty = new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); } } diff --git a/src/actions/write/joinNetwork.test.ts b/src/actions/write/joinNetwork.test.ts index 021395c3..1bb22672 100644 --- a/src/actions/write/joinNetwork.test.ts +++ b/src/actions/write/joinNetwork.test.ts @@ -23,7 +23,7 @@ const validInput = { fqdn: 'test.com', note: 'test-note', properties: stubbedArweaveTxId, - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), + qty: MIN_OPERATOR_STAKE.valueOf(), }; describe('joinNetwork', () => { @@ -245,7 +245,7 @@ describe('joinNetwork', () => { fqdn: 'test.com', note: 'test-note', properties: stubbedArweaveTxId, - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), + qty: MIN_OPERATOR_STAKE.valueOf(), }; const initialState = { diff --git a/src/actions/write/joinNetwork.ts b/src/actions/write/joinNetwork.ts index 81db09c2..8c005d33 100644 --- a/src/actions/write/joinNetwork.ts +++ b/src/actions/write/joinNetwork.ts @@ -11,7 +11,6 @@ import { import { ContractWriteResult, IOState, - IOToken, PstAction, TransactionId, mIOToken, @@ -59,7 +58,7 @@ export class JoinNetwork { delegateRewardShareRatio = 0, minDelegatedStake = MIN_DELEGATED_STAKE, } = input; - this.qty = new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); this.label = label; this.port = port; this.protocol = protocol; diff --git a/src/actions/write/submitAuctionBid.test.ts b/src/actions/write/submitAuctionBid.test.ts index 3d79f832..16f1a126 100644 --- a/src/actions/write/submitAuctionBid.test.ts +++ b/src/actions/write/submitAuctionBid.test.ts @@ -224,7 +224,7 @@ describe('submitAuctionBid', () => { ...getBaselineState(), ...stubbedAuctionState, balances: { - 'new-bidder': new IOToken(1000).valueOf(), + 'new-bidder': new IOToken(1000).toMIO().valueOf(), [SmartWeave.contract.id]: 0, }, }; @@ -234,12 +234,18 @@ describe('submitAuctionBid', () => { input: { name: 'test-auction-close', contractTxId: 'atomic', - qty: new IOToken(0.000999).valueOf(), + qty: new IOToken(0.000999).toMIO().valueOf(), }, }); }).toThrowError( new Error( - `The bid (${0.000999} IO) is less than the current required minimum bid of ${0.001} IO.`, + `The bid (${new IOToken(0.000999) + .toMIO() + .valueOf()} mIO) is less than the current required minimum bid of ${new IOToken( + 1000, + ) + .toMIO() + .valueOf()} mIO.`, ), ); }); @@ -254,7 +260,7 @@ describe('submitAuctionBid', () => { }, }, balances: { - 'new-bidder': new IOToken(1000).valueOf(), + 'new-bidder': new IOToken(1000).toMIO().valueOf(), }, }; expect(() => { @@ -273,8 +279,8 @@ describe('submitAuctionBid', () => { { contractTxId: SmartWeave.transaction.id, type: 'lease', - floorPrice: new IOToken(100).valueOf(), - startPrice: new IOToken(1000).valueOf(), + floorPrice: new IOToken(100).toMIO().valueOf(), + startPrice: new IOToken(1000).toMIO().valueOf(), }, { contractTxId: SmartWeave.transaction.id, @@ -287,8 +293,8 @@ describe('submitAuctionBid', () => { { contractTxId: SmartWeave.transaction.id, type: 'permabuy', - floorPrice: new IOToken(100).valueOf(), - startPrice: new IOToken(1000).valueOf(), + floorPrice: new IOToken(100).toMIO().valueOf(), + startPrice: new IOToken(1000).toMIO().valueOf(), }, { contractTxId: SmartWeave.transaction.id, @@ -310,8 +316,8 @@ describe('submitAuctionBid', () => { 'test-auction-close': auction, }, balances: { - initiator: 100, - 'new-bidder': 1000, + initiator: new IOToken(100).toMIO().valueOf(), + 'new-bidder': new IOToken(1000).toMIO().valueOf(), }, }; const { state } = submitAuctionBid(initialState, { @@ -327,26 +333,23 @@ describe('submitAuctionBid', () => { records: { 'test-auction-close': { contractTxId: expectedData.contractTxId, - ...{ - endTimestamp: - expectedData.type === 'lease' - ? 1 + SECONDS_IN_A_YEAR - : undefined, - }, + ...(expectedData.type === 'lease' + ? { endTimestamp: SmartWeave.block.timestamp + SECONDS_IN_A_YEAR } + : {}), type: expectedData.type, startTimestamp: expectedData.startTimestamp, undernames: expectedData.undernames, - purchasePrice: new IOToken(1000).valueOf(), + purchasePrice: new IOToken(1000).toMIO().valueOf(), }, }, demandFactoring: { ...initialState.demandFactoring, purchasesThisPeriod: 1, - revenueThisPeriod: new IOToken(1000).valueOf(), + revenueThisPeriod: new IOToken(1000).toMIO().valueOf(), }, balances: { - initiator: new IOToken(200).valueOf(), // return balance back to the initiator - [SmartWeave.contract.id]: new IOToken(1000).valueOf(), + initiator: new IOToken(200).toMIO().valueOf(), // return balance back to the initiator + [SmartWeave.contract.id]: new IOToken(1000).toMIO().valueOf(), // removes the new-bidder balance as they now have 0 tokens }, }); @@ -359,7 +362,7 @@ describe('submitAuctionBid', () => { ...stubbedAuctionState, records: {}, balances: { - initiator: 900, + initiator: new IOToken(900).toMIO().valueOf(), }, }; const { state } = submitAuctionBid(initialState, { @@ -379,16 +382,16 @@ describe('submitAuctionBid', () => { type: 'lease', startTimestamp: 1, undernames: 10, - purchasePrice: 1000, + purchasePrice: new IOToken(1000).toMIO().valueOf(), }, }, demandFactoring: { ...initialState.demandFactoring, purchasesThisPeriod: 1, - revenueThisPeriod: 1000, + revenueThisPeriod: new IOToken(1000).toMIO().valueOf(), }, balances: { - [SmartWeave.contract.id]: 1000, + [SmartWeave.contract.id]: new IOToken(1000).toMIO().valueOf(), // removes initiator balance as they now have 0 tokens }, }); diff --git a/src/actions/write/submitAuctionBid.ts b/src/actions/write/submitAuctionBid.ts index 05d37278..a8fd360e 100644 --- a/src/actions/write/submitAuctionBid.ts +++ b/src/actions/write/submitAuctionBid.ts @@ -21,7 +21,6 @@ import { ContractWriteResult, DeepReadonly, IOState, - IOToken, PstAction, Records, RegistrationType, @@ -57,7 +56,7 @@ export class AuctionBid { contractTxId = RESERVED_ATOMIC_TX_ID, } = input; this.name = name.trim().toLowerCase(); - this.qty = qty ? new IOToken(qty).toMIO() : undefined; + this.qty = qty ? new mIOToken(qty) : undefined; this.type = type; this.contractTxId = contractTxId === RESERVED_ATOMIC_TX_ID diff --git a/src/actions/write/transferToken.test.ts b/src/actions/write/transferToken.test.ts index 35e71028..b23742a1 100644 --- a/src/actions/write/transferToken.test.ts +++ b/src/actions/write/transferToken.test.ts @@ -3,7 +3,7 @@ import { INVALID_INPUT_MESSAGE, } from '../../constants'; import { getBaselineState, stubbedArweaveTxId } from '../../tests/stubs'; -import { IOToken, mIOToken } from '../../types'; +import { mIOToken } from '../../types'; import { transferTokens } from './transferTokens'; describe('transferTokens', () => { @@ -33,7 +33,7 @@ describe('transferTokens', () => { const error = await transferTokens(initialState, { caller: 'test', input: { - qty: new IOToken(100).toMIO().valueOf(), + qty: new mIOToken(100).valueOf(), target: badTarget, }, }).catch((e) => e); @@ -48,13 +48,13 @@ describe('transferTokens', () => { const initialState = { ...getBaselineState(), balances: { - test: new IOToken(99).toMIO().valueOf(), + test: new mIOToken(99).valueOf(), }, }; const error = await transferTokens(initialState, { caller: 'test', input: { - qty: new IOToken(100).toMIO().valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, }, }).catch((e) => e); @@ -68,13 +68,13 @@ describe('transferTokens', () => { const initialState = { ...getBaselineState(), balances: { - test: new IOToken(10_000).toMIO().valueOf(), + test: new mIOToken(10_000).valueOf(), }, }; const { state } = await transferTokens(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, denomination: 'IO', }, @@ -82,8 +82,8 @@ describe('transferTokens', () => { expect(state).toEqual({ ...initialState, balances: { - test: new IOToken(9900).toMIO().valueOf(), - [stubbedArweaveTxId]: new IOToken(100).toMIO().valueOf(), + test: new mIOToken(9900).valueOf(), + [stubbedArweaveTxId]: new mIOToken(100).valueOf(), }, }); }); diff --git a/src/actions/write/transferTokens.ts b/src/actions/write/transferTokens.ts index 1f8e0a1e..b5c0bb97 100644 --- a/src/actions/write/transferTokens.ts +++ b/src/actions/write/transferTokens.ts @@ -1,11 +1,5 @@ import { safeTransfer } from '../../transfer'; -import { - ContractWriteResult, - IOState, - IOToken, - PstAction, - mIOToken, -} from '../../types'; +import { ContractWriteResult, IOState, PstAction, mIOToken } from '../../types'; import { getInvalidAjvMessage } from '../../utilities'; import { validateTransferToken } from '../../validations'; @@ -20,10 +14,9 @@ export class TransferToken { getInvalidAjvMessage(validateTransferToken, input, 'transferToken'), ); } - const { target, qty, denomination = 'mIO' } = input; + const { target, qty } = input; this.target = target; - this.qty = - denomination === 'mIO' ? new mIOToken(qty) : new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); } } diff --git a/src/actions/write/updateGatewaySettings.test.ts b/src/actions/write/updateGatewaySettings.test.ts index 13cce0cb..4095563a 100644 --- a/src/actions/write/updateGatewaySettings.test.ts +++ b/src/actions/write/updateGatewaySettings.test.ts @@ -12,7 +12,7 @@ import { stubbedDelegateData, stubbedGatewayData, } from '../../tests/stubs'; -import { IOState, IOToken } from '../../types'; +import { IOState, mIOToken } from '../../types'; import { updateGatewaySettings } from './updateGatewaySettings'; describe('updateGatewaySettings', () => { @@ -217,7 +217,7 @@ describe('updateGatewaySettings', () => { (1 - GATEWAY_PERCENTAGE_OF_EPOCH_REWARD) * 100, ), minDelegatedStake: - MIN_DELEGATED_STAKE.toIO().valueOf() + new IOToken(1).valueOf(), + MIN_DELEGATED_STAKE.valueOf() + new mIOToken(1).valueOf(), autoStake: true, }; const initialState: IOState = { @@ -242,7 +242,7 @@ describe('updateGatewaySettings', () => { ...updatedGatewaySettings, minDelegatedStake: // should be converted to mIO - MIN_DELEGATED_STAKE.valueOf() + new IOToken(1).toMIO().valueOf(), + MIN_DELEGATED_STAKE.valueOf() + new mIOToken(1).valueOf(), }, }); }); diff --git a/src/actions/write/updateGatewaySettings.ts b/src/actions/write/updateGatewaySettings.ts index 21d20ab1..949e9e01 100644 --- a/src/actions/write/updateGatewaySettings.ts +++ b/src/actions/write/updateGatewaySettings.ts @@ -9,7 +9,6 @@ import { ContractWriteResult, Gateway, IOState, - IOToken, PstAction, WalletAddress, mIOToken, @@ -66,7 +65,7 @@ export class GatewaySettings { delegateRewardShareRatio, }), ...(minDelegatedStake !== undefined && { - minDelegatedStake: new IOToken(minDelegatedStake).toMIO(), + minDelegatedStake: new mIOToken(minDelegatedStake), }), }; this.observerWallet = observerWallet; diff --git a/src/actions/write/vaultedTransfer.test.ts b/src/actions/write/vaultedTransfer.test.ts index 7e46227b..1306aec9 100644 --- a/src/actions/write/vaultedTransfer.test.ts +++ b/src/actions/write/vaultedTransfer.test.ts @@ -4,7 +4,7 @@ import { MIN_TOKEN_LOCK_BLOCK_LENGTH, } from '../../constants'; import { getBaselineState, stubbedArweaveTxId } from '../../tests/stubs'; -import { IOToken } from '../../types'; +import { mIOToken } from '../../types'; import { vaultedTransfer } from './vaultedTransfer'; describe('vaultedTransfer', () => { @@ -35,7 +35,7 @@ describe('vaultedTransfer', () => { const error = await vaultedTransfer(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: badTarget, lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -51,13 +51,13 @@ describe('vaultedTransfer', () => { const initialState = { ...getBaselineState(), balances: { - test: new IOToken(99).toMIO().valueOf(), + test: new mIOToken(99).valueOf(), }, }; const error = await vaultedTransfer(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -72,13 +72,13 @@ describe('vaultedTransfer', () => { const initialState = { ...getBaselineState(), balances: { - test: new IOToken(10000).toMIO().valueOf(), + test: new mIOToken(10000).valueOf(), }, }; const { state } = await vaultedTransfer(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -86,12 +86,12 @@ describe('vaultedTransfer', () => { expect(state).toEqual({ ...initialState, balances: { - test: new IOToken(9900).toMIO().valueOf(), + test: new mIOToken(9900).valueOf(), }, vaults: { [stubbedArweaveTxId]: { [SmartWeave.transaction.id]: { - balance: new IOToken(100).toMIO().valueOf(), + balance: new mIOToken(100).valueOf(), start: 1, end: MIN_TOKEN_LOCK_BLOCK_LENGTH + 1, }, @@ -104,12 +104,12 @@ describe('vaultedTransfer', () => { const initialState = { ...getBaselineState(), balances: { - test: new IOToken(10_000).toMIO().valueOf(), + test: new mIOToken(10_000).valueOf(), }, vaults: { test: { 'existing-vault-id': { - balance: new IOToken(10).toMIO().valueOf(), + balance: new mIOToken(10).valueOf(), start: 0, end: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -119,7 +119,7 @@ describe('vaultedTransfer', () => { const { state } = await vaultedTransfer(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -127,19 +127,19 @@ describe('vaultedTransfer', () => { expect(state).toEqual({ ...initialState, balances: { - test: new IOToken(9900).toMIO().valueOf(), + test: new mIOToken(9900).valueOf(), }, vaults: { [stubbedArweaveTxId]: { [SmartWeave.transaction.id]: { - balance: new IOToken(100).toMIO().valueOf(), + balance: new mIOToken(100).valueOf(), start: 1, end: MIN_TOKEN_LOCK_BLOCK_LENGTH + 1, }, }, test: { 'existing-vault-id': { - balance: new IOToken(10).toMIO().valueOf(), + balance: new mIOToken(10).valueOf(), start: 0, end: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -152,13 +152,13 @@ describe('vaultedTransfer', () => { const initialState = { ...getBaselineState(), balances: { - test: new IOToken(10_000).toMIO().valueOf(), + test: new mIOToken(10_000).valueOf(), }, }; const { state } = await vaultedTransfer(initialState, { caller: 'test', input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -166,12 +166,12 @@ describe('vaultedTransfer', () => { expect(state).toEqual({ ...initialState, balances: { - test: new IOToken(9900).toMIO().valueOf(), + test: new mIOToken(9900).valueOf(), }, vaults: { [stubbedArweaveTxId]: { [SmartWeave.transaction.id]: { - balance: new IOToken(100).toMIO().valueOf(), + balance: new mIOToken(100).valueOf(), start: 1, end: MIN_TOKEN_LOCK_BLOCK_LENGTH + 1, }, @@ -184,12 +184,12 @@ describe('vaultedTransfer', () => { const initialState = { ...getBaselineState(), balances: { - [stubbedArweaveTxId]: new IOToken(10_000).toMIO().valueOf(), + [stubbedArweaveTxId]: new mIOToken(10_000).valueOf(), }, vaults: { [stubbedArweaveTxId]: { 'existing-vault-id': { - balance: new IOToken(10).toMIO().valueOf(), + balance: new mIOToken(10).valueOf(), start: 0, end: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -199,7 +199,7 @@ describe('vaultedTransfer', () => { const { state } = await vaultedTransfer(initialState, { caller: stubbedArweaveTxId, input: { - qty: new IOToken(100).valueOf(), + qty: new mIOToken(100).valueOf(), target: stubbedArweaveTxId, lockLength: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, @@ -207,17 +207,17 @@ describe('vaultedTransfer', () => { expect(state).toEqual({ ...initialState, balances: { - [stubbedArweaveTxId]: new IOToken(9900).toMIO().valueOf(), + [stubbedArweaveTxId]: new mIOToken(9900).valueOf(), }, vaults: { [stubbedArweaveTxId]: { [SmartWeave.transaction.id]: { - balance: new IOToken(100).toMIO().valueOf(), + balance: new mIOToken(100).valueOf(), start: 1, end: MIN_TOKEN_LOCK_BLOCK_LENGTH + 1, }, 'existing-vault-id': { - balance: new IOToken(10).toMIO().valueOf(), + balance: new mIOToken(10).valueOf(), start: 0, end: MIN_TOKEN_LOCK_BLOCK_LENGTH, }, diff --git a/src/actions/write/vaultedTransfer.ts b/src/actions/write/vaultedTransfer.ts index a3545316..a7701e51 100644 --- a/src/actions/write/vaultedTransfer.ts +++ b/src/actions/write/vaultedTransfer.ts @@ -3,7 +3,6 @@ import { BlockHeight, ContractWriteResult, IOState, - IOToken, PstAction, mIOToken, } from '../../types'; @@ -28,7 +27,7 @@ export class TransferTokensLocked { } const { target, qty, lockLength } = input; this.target = target; - this.qty = new IOToken(qty).toMIO(); + this.qty = new mIOToken(qty); this.lockLength = new BlockHeight(lockLength); } } diff --git a/src/auctions.test.ts b/src/auctions.test.ts index 7d178993..daa1b4d8 100644 --- a/src/auctions.test.ts +++ b/src/auctions.test.ts @@ -185,7 +185,7 @@ describe('calculateExistingAuctionBidForCaller function', () => { requiredMinimumBid: new mIOToken(2), }); }).toThrowError( - 'The bid (0.000001 IO) is less than the current required minimum bid of 0.000002 IO.', + 'The bid (1 mIO) is less than the current required minimum bid of 2 mIO.', ); }); }); diff --git a/src/auctions.ts b/src/auctions.ts index 8e20e688..4803d798 100644 --- a/src/auctions.ts +++ b/src/auctions.ts @@ -182,11 +182,7 @@ export function calculateExistingAuctionBidForCaller({ }): mIOToken { if (submittedBid && submittedBid.isLessThan(requiredMinimumBid)) { throw new ContractError( - `The bid (${submittedBid - .toIO() - .valueOf()} IO) is less than the current required minimum bid of ${requiredMinimumBid - .toIO() - .valueOf()} IO.`, + `The bid (${submittedBid.valueOf()} mIO) is less than the current required minimum bid of ${requiredMinimumBid.valueOf()} mIO.`, ); } if (caller === auction.initiator) { diff --git a/src/tests/stubs.ts b/src/tests/stubs.ts index e190bc2a..7ff157b3 100644 --- a/src/tests/stubs.ts +++ b/src/tests/stubs.ts @@ -14,6 +14,7 @@ import { Gateway, Gateways, IOState, + IOToken, WeightedObserver, } from '../types'; @@ -52,9 +53,9 @@ export const getBaselineState: () => IOState = (): IOState => ({ export const stubbedAuctionData: ArNSLeaseAuctionData = { startHeight: 1, - startPrice: 1_000, + startPrice: new IOToken(1000).toMIO().valueOf(), endHeight: 101, - floorPrice: 100, + floorPrice: new IOToken(100).toMIO().valueOf(), type: 'lease', initiator: 'initiator', contractTxId: 'contractTxId', diff --git a/tests/auctions.test.ts b/tests/auctions.test.ts index 93941c17..a94bb7bc 100644 --- a/tests/auctions.test.ts +++ b/tests/auctions.test.ts @@ -234,7 +234,7 @@ describe('Auctions', () => { it('should throw an error when the bid does not meet the minimum required', async () => { const auctionBid = { name: 'apple', - qty: new IOToken(100).valueOf(), // not going to win it + qty: new IOToken(100).toMIO().valueOf(), // not going to win it contractTxId: ANT_CONTRACT_IDS[0], }; // connect using another wallet @@ -253,7 +253,9 @@ describe('Auctions', () => { cachedValue.errorMessages[writeInteraction?.originalTxId], ).toEqual( expect.stringContaining( - `The bid (${100} IO) is less than the current required minimum bid`, + `The bid (${new IOToken(100) + .toMIO() + .valueOf()} mIO) is less than the current required minimum bid`, ), ); const { auctions, records, balances } = diff --git a/tests/network.test.ts b/tests/network.test.ts index 1fe1af0c..f3f625c9 100644 --- a/tests/network.test.ts +++ b/tests/network.test.ts @@ -71,7 +71,7 @@ describe('Network', () => { async (badObserverWallet) => { const joinGatewayPayload = { observerWallet: badObserverWallet, - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'Test Gateway', // friendly label fqdn: 'jest.io', port: '443', @@ -95,7 +95,7 @@ describe('Network', () => { 'should fail for invalid ports', async (badPort) => { const joinGatewayPayload = { - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'Test Gateway', // friendly label fqdn: 'jest.io', port: badPort, @@ -119,7 +119,7 @@ describe('Network', () => { 'should fail for invalid protocol', async (badProtocol) => { const joinGatewayPayload = { - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'Test Gateway', // friendly label fqdn: 'jest.io', port: 3000, @@ -146,7 +146,7 @@ describe('Network', () => { 'SUUUUUUUUUUUUUUUUUUUUUUUUUUPER LONG LABEL LONGER THAN 64 CHARS!!!!!!!!!', ])('should fail for invalid label', async (badLabel) => { const joinGatewayPayload = { - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: badLabel, // friendly label fqdn: 'jest.io', port: 3000, @@ -188,7 +188,7 @@ describe('Network', () => { '%percent.com', ])('should fail for invalid fqdn', async (badFqdn) => { const joinGatewayPayload = { - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'test gateway', // friendly label fqdn: badFqdn, port: 3000, @@ -214,7 +214,7 @@ describe('Network', () => { 'this note is way too long. please ignore this very long note. this note is way too long. please ignore this very long note. this note is way too long. please ignore this very long note. this note is way too long. please ignore this very long note. this note is way too long. please ignore this very long note.', ])('should fail for invalid note', async (badNote) => { const joinGatewayPayload = { - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'test gateway', // friendly label fqdn: 'testnet.com', port: 3000, @@ -241,7 +241,7 @@ describe('Network', () => { 'FH1aVetOoulPGqgYukj0VE0wIhDy90WiQoV3U2PeY4*', ])('should fail for invalid properties', async (badProperties) => { const joinGatewayPayload = { - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'test gateway', // friendly label fqdn: 'testnet.com', port: 3000, @@ -261,10 +261,10 @@ describe('Network', () => { }); it.each([ - MIN_OPERATOR_STAKE.toIO().valueOf() - 1, + MIN_OPERATOR_STAKE.valueOf() - 1, false, -1, - MIN_OPERATOR_STAKE.toIO().valueOf().toString(), + MIN_OPERATOR_STAKE.valueOf().toString(), ])('should fail for invalid qty', async (badQty) => { const joinGatewayPayload = { qty: badQty, // must meet the minimum @@ -290,7 +290,7 @@ describe('Network', () => { const prevBalance = prevState.balances[newGatewayOperatorAddress]; const joinGatewayPayload = { observerWallet: newGatewayOperatorAddress, - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), // must meet the minimum + qty: MIN_OPERATOR_STAKE.valueOf(), // must meet the minimum label: 'Test Gateway', // friendly label fqdn: 'jest.io', port: 3000, @@ -344,7 +344,7 @@ describe('Network', () => { prevState.gateways[newGatewayOperatorAddress].operatorStake; const writeInteraction = await contract.writeInteraction({ function: 'increaseOperatorStake', - qty: MIN_OPERATOR_STAKE.toIO().valueOf() * 2, + qty: MIN_OPERATOR_STAKE.valueOf() * 2, }); expect(writeInteraction?.originalTxId).not.toBe(undefined); const { cachedValue: newCachedValue } = await contract.readState(); @@ -388,7 +388,7 @@ describe('Network', () => { it('should decrease operator stake and create new vault', async () => { const writeInteraction = await contract.writeInteraction({ function: 'decreaseOperatorStake', - qty: MIN_OPERATOR_STAKE.toIO().valueOf(), + qty: MIN_OPERATOR_STAKE.valueOf(), }); expect(writeInteraction?.originalTxId).not.toBe(undefined); const expectedStartBlock = await getCurrentBlock(arweave); @@ -443,7 +443,8 @@ describe('Network', () => { note: 'a new note', allowDelegatedStaking: true, delegateRewardShareRatio: Math.floor((1 - 0.9) * 100), - minDelegatedStake: MIN_DELEGATED_STAKE.toIO().valueOf() + 1, + minDelegatedStake: + MIN_DELEGATED_STAKE.valueOf() + new IOToken(1).toMIO().valueOf(), autoStake: true, }; const writeInteraction = await contract.writeInteraction({ @@ -685,9 +686,9 @@ describe('Network', () => { ); it.each([ - MIN_DELEGATED_STAKE.toIO().valueOf() - 1, + MIN_DELEGATED_STAKE.valueOf() - 1, '1000', - MIN_DELEGATED_STAKE.toIO().valueOf() + 0.1, + MIN_DELEGATED_STAKE.valueOf() + 0.1, ])( 'should not modify gateway settings with invalid minDelegatedStake', async (badProperties) => { @@ -771,7 +772,7 @@ describe('Network', () => { }); it('should not join the network without right amount of funds', async () => { - const qty = WALLET_FUND_AMOUNT * 2; // This user should not have this much + const qty = WALLET_FUND_AMOUNT.valueOf() * 2; // This user should not have this much const label = 'Invalid Gateway'; // friendly label const fqdn = 'invalid.io'; const port = 3000; diff --git a/tests/transfer.test.ts b/tests/transfer.test.ts index 2410a501..9a65f223 100644 --- a/tests/transfer.test.ts +++ b/tests/transfer.test.ts @@ -43,7 +43,6 @@ describe('Transfers', () => { function: 'transfer', target: targetAddress, qty: TRANSFER_QTY.valueOf(), - denomination: 'IO', }); expect(writeInteraction?.originalTxId).not.toBe(undefined); @@ -53,10 +52,10 @@ describe('Transfers', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect(newState.balances[targetAddress]).toEqual( - prevTargetBalance + TRANSFER_QTY.toMIO().valueOf(), + prevTargetBalance + TRANSFER_QTY.valueOf(), ); }); @@ -70,7 +69,6 @@ describe('Transfers', () => { function: 'transfer', target: srcContractId, // The smartweave contract id acts as the protocol balance qty: TRANSFER_QTY.valueOf(), - denomination: 'IO', }); expect(writeInteraction?.originalTxId).not.toBe(undefined); @@ -80,10 +78,10 @@ describe('Transfers', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect(newState.balances[srcContractId]).toEqual( - prevTargetBalance + TRANSFER_QTY.toMIO().valueOf(), + prevTargetBalance + TRANSFER_QTY.valueOf(), ); }); @@ -173,7 +171,6 @@ describe('Transfers', () => { function: 'transfer', target: targetAddress, qty: TRANSFER_QTY.valueOf(), - denomination: 'IO', }); expect(writeInteraction?.originalTxId).not.toBe(undefined); @@ -183,10 +180,10 @@ describe('Transfers', () => { writeInteraction?.originalTxId, ); expect(newState.balances[callerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect(newState.balances[targetAddress]).toEqual( - prevTargetBalance + TRANSFER_QTY.toMIO().valueOf(), + prevTargetBalance + TRANSFER_QTY.valueOf(), ); }); diff --git a/tests/utils/constants.ts b/tests/utils/constants.ts index 0935eb14..d3ac74ec 100644 --- a/tests/utils/constants.ts +++ b/tests/utils/constants.ts @@ -7,8 +7,8 @@ export enum REGISTRATION_TYPES { } export const MINIMUM_ALLOWED_EVOLUTION_DELAY = 4; // 4 blocks for testing purposes, but should be 720 * 7; // 720 blocks per day times 7 days export const FOUNDATION_ACTION_PERIOD = 1; -export const FOUNDATION_STARTING_BALANCE = 10_000; -export const TRANSFER_AMOUNT = 5_000_000; +export const FOUNDATION_STARTING_BALANCE = new IOToken(10_000).toMIO(); +export const TRANSFER_AMOUNT = new IOToken(5_000_000).toMIO(); export const INTERACTION_COST = 20000; export const ANT_CONTRACT_IDS = [ 'MSFTfeBVyaJ8s9n7GxIyJNNc62jEVCKD7lbL3fV8kzU', @@ -17,9 +17,9 @@ export const ANT_CONTRACT_IDS = [ ]; export const WALLETS_TO_CREATE = 17; // The first 15 are joined to the network. export const SECONDS_IN_A_YEAR = 31_536_000; -export const WALLET_FUND_AMOUNT = 1_000_000_000_000_000; +export const WALLET_FUND_AMOUNT = new IOToken(1_000_000_000_000_000).toMIO(); export const INITIAL_STATE = initialContractState; -export const TRANSFER_QTY = new IOToken(100_000); +export const TRANSFER_QTY = new IOToken(100_000).toMIO(); export const EXAMPLE_OBSERVER_REPORT_TX_IDS = [ 'U35xQUnop2Oq1NwhpzRfTeXVSjC0M8H50MVlmo_cTJc', 'TtXk8kqgGYVqTQeHaJzst3toA2qz9UO0AGX1lUeuxvc', diff --git a/tests/utils/helper.ts b/tests/utils/helper.ts index c8cda646..dd956c41 100644 --- a/tests/utils/helper.ts +++ b/tests/utils/helper.ts @@ -4,6 +4,7 @@ import * as fs from 'fs'; import path from 'path'; import { EvaluationManifest, Tag } from 'warp-contracts'; +import { IOToken } from '../../src/types'; import { BlockHeight, Gateways, IOState } from '../../src/types'; import { ANT_CONTRACT_IDS, @@ -25,7 +26,7 @@ import { arweave } from './services'; export async function addFunds( arweave: Arweave, address: string, - amount: number = WALLET_FUND_AMOUNT, + amount: number = WALLET_FUND_AMOUNT.valueOf(), ): Promise { await arweave.api.get(`/mint/${address}/${amount}`); return true; @@ -122,7 +123,7 @@ async function createRecords(count = ARNS_LEASE_LENGTH_MAX_YEARS) { function createGateways(wallets: string[]) { const gateways: Gateways = { [wallets[0]]: { - operatorStake: 50_000, + operatorStake: new IOToken(50_000).toMIO().valueOf(), totalDelegatedStake: 0, start: 0, end: 0, @@ -145,7 +146,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[1]]: { - operatorStake: 10_000, + operatorStake: new IOToken(10_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 0, @@ -168,7 +169,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[2]]: { - operatorStake: 250_000, + operatorStake: new IOToken(250_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 0, @@ -191,7 +192,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[3]]: { - operatorStake: 15_000, + operatorStake: new IOToken(15_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 0, @@ -214,7 +215,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[4]]: { - operatorStake: 100_000, + operatorStake: new IOToken(100_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 0, @@ -237,7 +238,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[5]]: { - operatorStake: 20_000, + operatorStake: new IOToken(20_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 0, @@ -260,7 +261,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[6]]: { - operatorStake: 20_000, + operatorStake: new IOToken(20_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 0, @@ -283,7 +284,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[7]]: { - operatorStake: 10_000, + operatorStake: new IOToken(10_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_LEAVING_STATUS, start: 0, @@ -306,7 +307,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[8]]: { - operatorStake: 10_000, + operatorStake: new IOToken(10_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_JOIN_STATUS, start: 10_000, @@ -329,7 +330,7 @@ function createGateways(wallets: string[]) { }, }, [wallets[9]]: { - operatorStake: 10_000, + operatorStake: new IOToken(10_000).toMIO().valueOf(), totalDelegatedStake: 0, status: NETWORK_LEAVING_STATUS, start: 0, @@ -369,14 +370,14 @@ export async function setupInitialContractState( // create wallets and set balances state.balances = wallets.reduce((current: any, wallet) => { - current[wallet] = WALLET_FUND_AMOUNT; + current[wallet] = WALLET_FUND_AMOUNT.valueOf(); return current; }, {}); // add balance to the owner state.balances = { ...state.balances, - [owner]: WALLET_FUND_AMOUNT, // TODO: transfer this to the protocol balance + [owner]: WALLET_FUND_AMOUNT.valueOf(), // TODO: transfer this to the protocol balance }; // setup demand factor based from the current block height diff --git a/tests/vaults.test.ts b/tests/vaults.test.ts index 32de6ac6..94f79250 100644 --- a/tests/vaults.test.ts +++ b/tests/vaults.test.ts @@ -41,7 +41,7 @@ describe('Vaults', () => { const currentBlock = (await getCurrentBlock(arweave)).valueOf(); const expectedVault = { - balance: TRANSFER_QTY.toMIO().valueOf(), + balance: TRANSFER_QTY.valueOf(), start: currentBlock, end: currentBlock + MIN_TOKEN_LOCK_BLOCK_LENGTH, }; @@ -53,7 +53,7 @@ describe('Vaults', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect( newState.vaults[ownerAddress][writeInteraction?.originalTxId], @@ -66,7 +66,7 @@ describe('Vaults', () => { const prevOwnerBalance = prevState.balances[ownerAddress]; const currentBlock = (await getCurrentBlock(arweave)).valueOf(); const expectedVault = { - balance: TRANSFER_QTY.toMIO().valueOf(), + balance: TRANSFER_QTY.valueOf(), start: currentBlock + 1, end: currentBlock + MIN_TOKEN_LOCK_BLOCK_LENGTH + 1, }; @@ -83,7 +83,7 @@ describe('Vaults', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect( newState.vaults[ownerAddress][writeInteraction?.originalTxId], @@ -259,11 +259,11 @@ describe('Vaults', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect(newState.vaults[ownerAddress][existingVaultId].balance).toEqual( prevState.vaults[ownerAddress][existingVaultId].balance + - TRANSFER_QTY.toMIO().valueOf(), + TRANSFER_QTY.valueOf(), ); }); @@ -350,7 +350,7 @@ describe('Vaults', () => { const currentBlock = (await getCurrentBlock(arweave)).valueOf(); const expectedVault = { - balance: TRANSFER_QTY.toMIO().valueOf(), + balance: TRANSFER_QTY.valueOf(), start: currentBlock, end: currentBlock + MIN_TOKEN_LOCK_BLOCK_LENGTH, }; @@ -362,7 +362,7 @@ describe('Vaults', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect(newState.balances[targetAddress]).toEqual(prevTargetBalance); expect( @@ -386,7 +386,7 @@ describe('Vaults', () => { const currentBlock = (await getCurrentBlock(arweave)).valueOf(); const expectedVault = { - balance: TRANSFER_QTY.toMIO().valueOf(), + balance: TRANSFER_QTY.valueOf(), start: currentBlock, end: currentBlock + MIN_TOKEN_LOCK_BLOCK_LENGTH, }; @@ -398,7 +398,7 @@ describe('Vaults', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect(newState.balances[srcContractId]).toEqual(prevTargetBalance); expect( @@ -441,7 +441,7 @@ describe('Vaults', () => { const currentBlock = (await getCurrentBlock(arweave)).valueOf(); const expectedVault = { - balance: TRANSFER_QTY.toMIO().valueOf(), + balance: TRANSFER_QTY.valueOf(), start: currentBlock, end: currentBlock + MIN_TOKEN_LOCK_BLOCK_LENGTH, }; @@ -453,7 +453,7 @@ describe('Vaults', () => { writeInteraction?.originalTxId, ); expect(newState.balances[ownerAddress]).toEqual( - prevOwnerBalance - TRANSFER_QTY.toMIO().valueOf(), + prevOwnerBalance - TRANSFER_QTY.valueOf(), ); expect( newState.vaults[ownerAddress][writeInteraction?.originalTxId], diff --git a/tools/cli/delegate-stake.ts b/tools/cli/delegate-stake.ts index 7832e741..596aa4b4 100644 --- a/tools/cli/delegate-stake.ts +++ b/tools/cli/delegate-stake.ts @@ -1,7 +1,8 @@ +import { ArweaveSigner } from '@ar.io/sdk'; import { JWKInterface } from 'arweave/node/lib/wallet'; import inquirer from 'inquirer'; -import { IOState } from '../../src/types'; +import { IOState, mIOToken } from '../../src/types'; import { arnsContractTxId, arweave, @@ -19,15 +20,16 @@ import questions from './questions'; // Get the key file used for the distribution const wallet: JWKInterface = loadWallet(); - const walletAddress = await arweave.wallets.jwkToAddress(wallet); - - const balance = await networkContract.getBalance({ + const signer = new ArweaveSigner(wallet); + const balanceMIO = await networkContract(signer).getBalance({ address: walletAddress, }); + const balanceIO = new mIOToken(balanceMIO).toIO(); + const gatewayDetails = await inquirer.prompt( - questions.delegateStake(balance / 1000000), + questions.delegateStake(balanceIO.valueOf()), ); // get contract manifest diff --git a/tools/cli/get-balance.ts b/tools/cli/get-balance.ts index 8ad761c0..023017f7 100644 --- a/tools/cli/get-balance.ts +++ b/tools/cli/get-balance.ts @@ -1,13 +1,12 @@ +import { ArweaveSigner, mIOToken } from '@ar.io/sdk'; import { JWKInterface } from 'arweave/node/lib/wallet'; import inquirer from 'inquirer'; -import { IOState } from '../../src/types'; import { - arnsContractTxId, arweave, - getContractManifest, initialize, loadWallet, + networkContract, warp, } from '../utilities'; import questions from './questions'; @@ -19,33 +18,16 @@ import questions from './questions'; // Get the key file used for the distribution const wallet: JWKInterface = loadWallet(); - const address = await arweave.wallets.jwkToAddress(wallet); + const defaultAddress = await arweave.wallets.jwkToAddress(wallet); + const gatewayDetails = await inquirer.prompt( + questions.getBalance(defaultAddress), + ); - const gatewayDetails = await inquirer.prompt(questions.getBalance(address)); - - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, + const signer = new ArweaveSigner(wallet); + const balanceMIO = await networkContract(signer).getBalance({ + address: gatewayDetails.address, }); - // Connect the ArNS Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - - const payload = { - function: 'balance', - target: gatewayDetails.address, - }; - - const { result } = await contract.viewState< - { function: string; target: string }, - { address: string; balance: number } - >(payload); // eslint-disable-next-line; - console.log(`Balance: ${result.balance / 1_000_000} IO`); + console.log(`Balance: ${new mIOToken(balanceMIO).toIO().valueOf()} IO`); })(); diff --git a/tools/cli/increase-operator-stake.ts b/tools/cli/increase-operator-stake.ts index e912507c..e9cf9388 100644 --- a/tools/cli/increase-operator-stake.ts +++ b/tools/cli/increase-operator-stake.ts @@ -1,16 +1,8 @@ +import { ArweaveSigner, IOToken, mIOToken } from '@ar.io/sdk'; import { JWKInterface } from 'arweave/node/lib/wallet'; import inquirer from 'inquirer'; -import { IOState } from '../../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - networkContract, - warp, -} from '../utilities'; +import { arweave, initialize, loadWallet, networkContract } from '../utilities'; import questions from './questions'; (async () => { @@ -19,31 +11,17 @@ import questions from './questions'; // Get the key file used for the distribution const wallet: JWKInterface = loadWallet(); - const walletAddress = await arweave.wallets.jwkToAddress(wallet); - - const mIOBalance: number = await networkContract.getBalance({ + const signer = new ArweaveSigner(wallet); + const balanceMIO = await networkContract(signer).getBalance({ address: walletAddress, }); + const balanceIO = new mIOToken(balanceMIO).toIO(); const gatewayDetails = await inquirer.prompt( - questions.increaseOperatorStake(mIOBalance / 1000000), + questions.increaseOperatorStake(balanceIO.valueOf()), ); - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Connect the ArNS Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - const confirm = await inquirer.prompt({ name: 'confirm', type: 'confirm', @@ -53,28 +31,12 @@ import questions from './questions'; }); if (confirm.confirm) { - const payload = { - function: 'increaseOperatorStake', - qty: gatewayDetails.qty, - }; - const dryWrite = await contract.dryWrite(payload); - - if (dryWrite.type === 'error' || dryWrite.errorMessage) { - console.error( - 'Failed to increase operator stake:', - dryWrite.errorMessage, - ); - return; - } - - console.log('Submitting transaction to increase operator stake...'); - - const txId = await contract.writeInteraction(payload, { - disableBundling: true, + const { id } = await networkContract(signer).increaseOperatorStake({ + qty: new IOToken(gatewayDetails.qty).toMIO().valueOf(), }); // eslint-disable-next-line; console.log( - `Successfully submitted request to increase operator stake. TxId: ${txId?.originalTxId}`, + `Successfully submitted request to increase operator stake. TxId: ${id}`, ); } })(); diff --git a/tools/cli/join-network.ts b/tools/cli/join-network.ts index 522cc737..2c7cd1d1 100644 --- a/tools/cli/join-network.ts +++ b/tools/cli/join-network.ts @@ -1,15 +1,8 @@ +import { ArweaveSigner, IOToken, JoinNetworkParams } from '@ar.io/sdk'; import { JWKInterface } from 'arweave/node/lib/wallet'; import inquirer from 'inquirer'; -import { IOState } from '../../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - warp, -} from '../utilities'; +import { arweave, initialize, loadWallet, networkContract } from '../utilities'; import questions from './questions'; (async () => { @@ -20,25 +13,11 @@ import questions from './questions'; const wallet: JWKInterface = loadWallet(); const walletAddress = await arweave.wallets.jwkToAddress(wallet); - + const signer = new ArweaveSigner(wallet); const gatewayDetails = await inquirer.prompt( questions.gatewaySettings(walletAddress), ); - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Connect the ArNS Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - const confirm = await inquirer.prompt({ name: 'confirm', type: 'confirm', @@ -46,47 +25,27 @@ import questions from './questions'; }); if (confirm.confirm) { - const payload = { - function: 'joinNetwork', - ...(gatewayDetails.observerWallet - ? { observerWallet: gatewayDetails.observerWallet } - : {}), - ...(gatewayDetails.allowDelegatedStaking - ? { allowDelegatedStaking: gatewayDetails.allowDelegatedStaking } - : {}), - ...(gatewayDetails.delegateRewardShareRatio - ? { - delegateRewardShareRatio: gatewayDetails.delegateRewardShareRatio, - } - : {}), - ...(gatewayDetails.minDelegatedStake - ? { minDelegatedStake: gatewayDetails.minDelegatedStake } - : {}), - ...(gatewayDetails.note ? { note: gatewayDetails.note } : {}), - ...(gatewayDetails.properties - ? { properties: gatewayDetails.properties } - : {}), - ...(gatewayDetails.protocol ? { protocol: gatewayDetails.protocol } : {}), - ...(gatewayDetails.port ? { port: gatewayDetails.port } : {}), - ...(gatewayDetails.fqdn ? { fqdn: gatewayDetails.fqdn } : {}), - ...(gatewayDetails.label ? { label: gatewayDetails.label } : {}), - ...(gatewayDetails.qty ? { qty: gatewayDetails.qty } : {}), + const payload: JoinNetworkParams = { + observerWallet: gatewayDetails.observerWallet, + autoStake: gatewayDetails.autoStake, + allowDelegatedStaking: gatewayDetails.allowDelegatedStaking, + delegateRewardShareRatio: gatewayDetails.delegateRewardShareRatio, + minDelegatedStake: new IOToken(gatewayDetails.minDelegatedStake) + .toMIO() + .valueOf(), + note: gatewayDetails.note, + properties: gatewayDetails.properties, + protocol: gatewayDetails.protocol, + port: gatewayDetails.port, + fqdn: gatewayDetails.fqdn, + label: gatewayDetails.label, + qty: new IOToken(gatewayDetails.qty).toMIO().valueOf(), }; - const dryWrite = await contract.dryWrite(payload); - - if (dryWrite.type === 'error' || dryWrite.errorMessage) { - console.error('Failed to join network:', dryWrite.errorMessage); - return; - } - - console.log('Submitting transaction to join network...'); - const txId = await contract.writeInteraction(payload, { - disableBundling: true, - }); + const { id } = await networkContract(signer).joinNetwork(payload); // eslint-disable-next-line console.log( - `Successfully submitted request to join the network. TxId: ${txId?.originalTxId}`, + `Successfully submitted request to join the network. TxId: ${id}`, ); } })(); diff --git a/tools/cli/questions.ts b/tools/cli/questions.ts index 3a8d8bc0..63674419 100644 --- a/tools/cli/questions.ts +++ b/tools/cli/questions.ts @@ -4,6 +4,30 @@ import { QuestionCollection } from 'inquirer'; import { isArweaveAddress } from '../utilities'; export default { + transfer: (balance?: number): QuestionCollection => { + const questionList: QuestionCollection = [ + { + name: 'target', + type: 'input', + message: 'Enter the target address > ', + validate: (value: string) => + isArweaveAddress(value) ? true : 'Please Enter Valid Address', + }, + { + name: 'qty', + type: 'number', + message: `Enter the amount of IO tokens you want to transfer (current balance: ${ + balance || 0 + } IO tokens) > `, + default: 100, + validate: (value: number) => + value > 0 && (balance ? value <= balance : true) + ? true + : 'Please Enter Valid Amount', + }, + ]; + return questionList; + }, gatewaySettings: ( address?: string, gateway?: Gateway, @@ -36,10 +60,10 @@ export default { name: 'qty', type: 'number', message: - 'Enter the amount of tokens you want to stake against your gateway - min 10,000 IO > ', + 'Enter the amount of IO tokens you want to stake against your gateway - min 10,000 IO > ', default: 10000, validate: (value: number) => - value >= 10000 ? true : 'Please Enter Valid Amount', + value >= 10000 ? true : 'Please Enter Valid Amount of IO Tokens', } : undefined, { diff --git a/tools/cli/transfer.ts b/tools/cli/transfer.ts new file mode 100644 index 00000000..eb25d0cf --- /dev/null +++ b/tools/cli/transfer.ts @@ -0,0 +1,43 @@ +import { ArweaveSigner, IOToken, mIOToken } from '@ar.io/sdk'; +import { JWKInterface } from 'arweave/node/lib/wallet'; +import inquirer from 'inquirer'; + +import { arweave, initialize, loadWallet, networkContract } from '../utilities'; +import questions from './questions'; + +(async () => { + // simple setup script + initialize(); + + // Get the key file used for the distribution + const wallet: JWKInterface = loadWallet(); + + const walletAddress = await arweave.wallets.jwkToAddress(wallet); + const signer = new ArweaveSigner(wallet); + const balanceMIO = await networkContract(signer).getBalance({ + address: walletAddress, + }); + + const balanceIO = new mIOToken(balanceMIO).toIO(); + + const gatewayDetails = await inquirer.prompt( + questions.transfer(balanceIO.valueOf()), + ); + + const confirm = await inquirer.prompt({ + name: 'confirm', + type: 'confirm', + message: `CONFIRM TRANSFER DETAILS? ${JSON.stringify(gatewayDetails)} >`, + }); + + if (confirm.confirm) { + const { id } = await networkContract(signer).transfer({ + target: gatewayDetails.target, + qty: new IOToken(gatewayDetails.qty).toMIO().valueOf(), + }); + // eslint-disable-next-line; + console.log( + `Successfully submitted request to transfer tokens. TxId: ${id}`, + ); + } +})(); diff --git a/tools/cli/update-gateway-settings.ts b/tools/cli/update-gateway-settings.ts index 4fb19f04..0374a891 100644 --- a/tools/cli/update-gateway-settings.ts +++ b/tools/cli/update-gateway-settings.ts @@ -1,17 +1,13 @@ -import { Gateway } from '@ar.io/sdk'; +import { + ArweaveSigner, + Gateway, + IOToken, + UpdateGatewaySettingsParams, +} from '@ar.io/sdk'; import { JWKInterface } from 'arweave/node/lib/wallet'; import inquirer from 'inquirer'; -import { IOState } from '../../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - networkContract, - warp, -} from '../utilities'; +import { arweave, initialize, loadWallet, networkContract } from '../utilities'; import questions from './questions'; (async () => { @@ -22,11 +18,13 @@ import questions from './questions'; const wallet: JWKInterface = loadWallet(); const walletAddress = await arweave.wallets.jwkToAddress(wallet); + const signer = new ArweaveSigner(wallet); - const existingGatewayDetails: Gateway | undefined = - await networkContract.getGateway({ - address: walletAddress, - }); + const existingGatewayDetails: Gateway | undefined = await networkContract( + signer, + ).getGateway({ + address: walletAddress, + }); if (!existingGatewayDetails) { console.error('Gateway not found with address:', walletAddress); @@ -37,20 +35,6 @@ import questions from './questions'; questions.gatewaySettings(walletAddress, existingGatewayDetails), ); - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Connect the ArNS Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - const confirm = await inquirer.prompt({ name: 'confirm', type: 'confirm', @@ -60,50 +44,26 @@ import questions from './questions'; }); if (confirm.confirm) { - const payload = { - function: 'updateGatewaySettings', - ...(gatewayDetails.observerWallet - ? { observerWallet: gatewayDetails.observerWallet } - : {}), - ...(gatewayDetails.allowDelegatedStaking - ? { allowDelegatedStaking: gatewayDetails.allowDelegatedStaking } - : {}), - ...(gatewayDetails.delegateRewardShareRatio - ? { - delegateRewardShareRatio: gatewayDetails.delegateRewardShareRatio, - } - : {}), - ...(gatewayDetails.autoStake - ? { autoStake: gatewayDetails.autoStake } - : {}), - ...(gatewayDetails.minDelegatedStake - ? { minDelegatedStake: gatewayDetails.minDelegatedStake } - : {}), - ...(gatewayDetails.note ? { note: gatewayDetails.note } : {}), - ...(gatewayDetails.properties - ? { properties: gatewayDetails.properties } - : {}), - ...(gatewayDetails.protocol ? { protocol: gatewayDetails.protocol } : {}), - ...(gatewayDetails.port ? { port: gatewayDetails.port } : {}), - ...(gatewayDetails.fqdn ? { fqdn: gatewayDetails.fqdn } : {}), - ...(gatewayDetails.label ? { label: gatewayDetails.label } : {}), - // note: removing qty from the payload as it's not a valid field for updateGatewaySettings + const payload: UpdateGatewaySettingsParams = { + observerWallet: gatewayDetails.observerWallet, + allowDelegatedStaking: gatewayDetails.allowDelegatedStaking, + delegateRewardShareRatio: gatewayDetails.delegateRewardShareRatio, + autoStake: gatewayDetails.autoStake, + minDelegatedStake: new IOToken(gatewayDetails.minDelegatedStake) + .toMIO() + .valueOf(), + note: gatewayDetails.note, + properties: gatewayDetails.properties, + protocol: gatewayDetails.protocol, + port: gatewayDetails.port, + fqdn: gatewayDetails.fqdn, + label: gatewayDetails.label, }; - const dryWrite = await contract.dryWrite(payload); - - if (dryWrite.type === 'error' || dryWrite.errorMessage) { - console.error('Failed to update gateway:', dryWrite.errorMessage); - return; - } - - console.log('Submitting transaction to update gateway...'); - const txId = await contract.writeInteraction(payload, { - disableBundling: true, - }); + const { id } = await networkContract(signer).updateGatewaySettings(payload); // eslint-disable-next-line console.log( - `Successfully submitted request to update gateway. TxId: ${txId?.originalTxId}`, + `Successfully submitted request to update gateway. TxId: ${id}`, ); } })(); diff --git a/tools/decrease-delegate-stake.ts b/tools/decrease-delegate-stake.ts index 7dcbf176..b14a04f7 100644 --- a/tools/decrease-delegate-stake.ts +++ b/tools/decrease-delegate-stake.ts @@ -1,6 +1,6 @@ import { JWKInterface } from 'arweave/node/lib/wallet'; -import { IOState } from '../src/types'; +import { IOState, IOToken } from '../src/types'; import { arnsContractTxId, arweave, @@ -18,10 +18,10 @@ import { // simple setup script initialize(); - // The quantity of the delegated stake that is to be decreased and unlocked + // The quantity of the delegated stake in IO that is to be decreased and unlocked // This must not bring the delegated staker below the minimum amount required by the gateway // To completely withdraw delegated stake, add the full quantity amount - const qty = 500; + const qty = new IOToken(500); // the targetted gateway that the delegated stake is to be withdrawn from const target = 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ'; @@ -49,7 +49,7 @@ import { const txId = await contract.writeInteraction( { function: 'decreaseDelegateStake', - qty, + qty: qty.toMIO().valueOf(), target, }, { diff --git a/tools/decrease-operator-stake.ts b/tools/decrease-operator-stake.ts index 14f63783..082b4657 100644 --- a/tools/decrease-operator-stake.ts +++ b/tools/decrease-operator-stake.ts @@ -1,6 +1,6 @@ import { JWKInterface } from 'arweave/node/lib/wallet'; -import { IOState } from '../src/types'; +import { IOState, IOToken } from '../src/types'; import { arnsContractTxId, arweave, @@ -18,8 +18,8 @@ import { // simple setup script initialize(); - // the qty of the staked vault that is to be unlocked and decreased - const qty = 1; + // the number of IO tokens to decrease the gateway operator's stake by + const qty = new IOToken(100); // Get the key file used for the distribution const wallet: JWKInterface = loadWallet(); @@ -44,7 +44,7 @@ import { const txId = await contract.writeInteraction( { function: 'decreaseOperatorStake', - qty, + qty: qty.toMIO().valueOf(), }, { disableBundling: true, diff --git a/tools/delegate-stake.ts b/tools/delegate-stake.ts deleted file mode 100644 index 2dd9595a..00000000 --- a/tools/delegate-stake.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { JWKInterface } from 'arweave/node/lib/wallet'; - -import { IOState } from '../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - warp, -} from './utilities'; - -/* eslint-disable no-console */ -// This script will stake and delegate tokens to a gateway -// The staked tokens can earn a portion of the gateway's rewards -// Only the delegated staker's wallet owner is authorized to withdraw -(async () => { - // simple setup script - initialize(); - - // The quantity of the delegated stake that is to be added - // If this is the first stake placed with this gateway, it must be greater than the minimum amount required for this gateway - const qty = 500; - - // the targetted gateway that the delegated stake is to be added to - const target = 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ'; - - // Get the key file used for the distribution - const wallet: JWKInterface = loadWallet(); - - // wallet address - const walletAddress = await arweave.wallets.getAddress(wallet); - - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Read the ANT Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - - const txId = await contract.writeInteraction( - { - function: 'delegateStake', - qty, - target, - }, - { - disableBundling: true, - }, - ); - - console.log( - `${walletAddress} successfully submitted request to delegate stake with TX id: ${txId?.originalTxId}`, - ); -})(); diff --git a/tools/increase-operator-stake.ts b/tools/increase-operator-stake.ts deleted file mode 100644 index 4b7533ed..00000000 --- a/tools/increase-operator-stake.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { JWKInterface } from 'arweave/node/lib/wallet'; - -import { IOState } from '../src/types'; -import { arweave, initialize, loadWallet, warp } from './utilities'; - -/* eslint-disable no-console */ -// This script will stake more tokens to an existing joined gateway -// Only the gateway's wallet owner is authorized to increase its own stake -(async () => { - // simple setup script - initialize(); - - // the quantity of tokens in IO to stake - const qty = 10_000; - - // Get the key file used for the distribution - const wallet: JWKInterface = loadWallet(); - - // gate the contract txId - const contractTxId = - process.env.ARNS_CONTRACT_TX_ID ?? - 'bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U'; - - // wallet address - const walletAddress = await arweave.wallets.getAddress(wallet); - - // Read the ANT Registry Contract - const contract = warp.contract(contractTxId).connect(wallet); - - const writeInteraction = await contract.writeInteraction( - { - function: 'increaseOperatorStake', - qty, - }, - { - disableBundling: true, - }, - ); - - console.log( - `${walletAddress} successfully submitted gateway stake increase with TX id: ${writeInteraction?.originalTxId}`, - ); -})(); diff --git a/tools/join-network.ts b/tools/join-network.ts deleted file mode 100644 index 067e1892..00000000 --- a/tools/join-network.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { JWKInterface } from 'arweave/node/lib/wallet'; - -import { IOState } from '../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - warp, -} from './utilities'; - -/* eslint-disable no-console */ -// This script will join a gateway to the ar.io network, identified by the gateway operator's wallet address -// A minimum amount of tokens must be staked to join, along with other settings that must be configured -// Only the gateway's wallet owner is authorized to adjust these settings or leave the network in the future -(async () => { - // simple setup script - initialize(); - - // Get the key file used for the distribution - const wallet: JWKInterface = loadWallet(); - - // wallet address - const walletAddress = await arweave.wallets.getAddress(wallet); - - // the quantity of tokens to stake. Must be greater than the minimum - const qty = 100_000; - - // the friendly label for this gateway - const label = 'Permagate'; - - // the fully qualified domain name for this gateway eg. arweave.net - const fqdn = 'permagate.io'; - - // the port used for this gateway eg. 443 - const port = 443; - - // the application layer protocol used by this gateway eg http or https - const protocol = 'https'; - - // an optional gateway properties file located at this Arweave transaction id eg. - const properties = 'FH1aVetOoulPGqgYukj0VE0wIhDy90WiQoV3U2PeY44'; - - // an optional, short note to further describe this gateway and its status - const note = 'Owned and operated by DTF.'; - - // The observer wallet public address eg.iKryOeZQMONi2965nKz528htMMN_sBcjlhc-VncoRjA which is used to upload observation reports - const observerWallet = ''; - - // Enable or disable delegated staking. If true, other token holders can delegate their stake to this gateway - // const allowDelegatedStaking: boolean = true; - - // Number between 0-100 indicating the percent of gateway and observer rewards given to delegates eg. 30 is 30% distributed to delegates - // The default is 0 - // const delegateRewardShareRatio: number = 10; - - // The minimum stake a delegate must use for this for this gateway. Must be greater than the contracts minimum delegated stake - // The default is 100 - // const minDelegatedStake: number = 200; - - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Connect the ArNS Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - - console.log('Connected to contract with wallet: %s', walletAddress); - const txId = await contract.writeInteraction( - { - function: 'joinNetwork', - observerWallet, - qty, - label, - fqdn, - port, - protocol, - properties, - // allowDelegatedStaking, - // delegateRewardShareRatio, - // minDelegatedStake, - note, - }, - { - disableBundling: true, - }, - ); - - console.log( - `${walletAddress} successfully submitted request to join the network with TX id: ${JSON.stringify( - txId, - null, - 2, - )}`, - ); -})(); diff --git a/tools/transfer-tokens.ts b/tools/transfer-tokens.ts deleted file mode 100644 index a97afa60..00000000 --- a/tools/transfer-tokens.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { JWKInterface } from 'arweave/node/lib/wallet'; - -import { IOState } from '../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - warp, -} from './utilities'; - -/* eslint-disable no-console */ -(async () => { - // simple setup script - initialize(); - - //~~~~~~~~~~~~~~~~~~~~~~~~~~UPDATE THE BELOW~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // The recipient target of the token transfer - const target = '1H7WZIWhzwTH9FIcnuMqYkTsoyv1OTfGa_amvuYwrgo'; - - // The amount of tokens to be transferred in IO - const qty = 10_000; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // Get the key file used for the distribution - const wallet: JWKInterface = loadWallet(); - - const walletAddress = await arweave.wallets.jwkToAddress(wallet); - - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Read the ANT Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - - const interaction = await contract.writeInteraction( - { - function: 'transfer', - target, - qty, - denomination: 'IO', // by default transfer in IO - }, - { - disableBundling: true, - }, - ); - - console.log( - `Successfully transferred ${qty} IO tokens from ${walletAddress} to ${target}. Interaction TX id: ${interaction?.originalTxId}`, - ); -})(); diff --git a/tools/update-gateway-settings.ts b/tools/update-gateway-settings.ts deleted file mode 100644 index 899fef5d..00000000 --- a/tools/update-gateway-settings.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { JWKInterface } from 'arweave/node/lib/wallet'; - -import { IOState } from '../src/types'; -import { - arnsContractTxId, - arweave, - getContractManifest, - initialize, - loadWallet, - warp, -} from './utilities'; - -/* eslint-disable no-console */ -// This script will update the settings for a gateway that is already joined to the network -// Only the gateway's wallet owner is authorized to adjust these settings -(async () => { - initialize(); - - // the friendly label for this gateway - // const label = 'Test Gateway'; - - // the fully qualified domain name for this gateway eg. arweave.net - // const fqdn = 'permanence-testing.org'; - - // uncomment the below settings and update as needed - // the port used for this gateway eg. 443 - // const port = 443 - - // the application layer protocol used by this gateway eg http or https - // const protocol = 'https' - - // an optional gateway properties file located at this Arweave transaction id eg. - // const properties = 'FH1aVetOoulPGqgYukj0VE0wIhDy90WiQoV3U2PeY44' - - // an optional, short note to further describe this gateway and its status - // const note = 'Give me feedback about this gateway at my Xwitter @testgatewayguy' - - // The observer wallet public address eg.iKryOeZQMONi2965nKz528htMMN_sBcjlhc-VncoRjA which is used to upload observation reports - // const observerWallet = ''; - - // Enable or disable delegated staking. If true, other token holders can delegate their stake to this gateway - // const allowDelegatedStaking: boolean = true; - - // Number between 0-100 indicating the percent of gateway and observer rewards given to delegates eg. 30 is 30% distributed to delegates - // The default is 0 - // const delegateRewardShareRatio: number = 10; - - // The minimum stake in IO a delegate must use for this for this gateway. Must be greater than the contracts minimum delegated stake - // The default is 100 IO - // const minDelegatedStake: number = 200; - - // Get the key file used for the distribution - const wallet: JWKInterface = loadWallet(); - - // wallet address - const walletAddress = await arweave.wallets.getAddress(wallet); - - // get contract manifest - const { evaluationOptions = {} } = await getContractManifest({ - contractTxId: arnsContractTxId, - }); - - // Read the ANT Registry Contract - const contract = await warp - .contract(arnsContractTxId) - .connect(wallet) - .setEvaluationOptions(evaluationOptions) - .syncState(`https://api.arns.app/v1/contract/${arnsContractTxId}`, { - validity: true, - }); - - // Include any settings as needed below - const writeInteraction = await contract.writeInteraction( - { - function: 'updateGatewaySettings', - // label, - // fqdn, - // observerWallet, - // port, - // protocol, - // properties, - // allowDelegatedStaking, - // delegateRewardShareRatio, - // minDelegatedStake, - // note - }, - { - disableBundling: true, - }, - ); - - console.log( - `${walletAddress} successfully updated gateway settings with TX id: ${writeInteraction?.originalTxId}`, - ); -})(); diff --git a/tools/utilities.ts b/tools/utilities.ts index 8568acf1..8d6e1d35 100644 --- a/tools/utilities.ts +++ b/tools/utilities.ts @@ -1,4 +1,4 @@ -import { ArIO } from '@ar.io/sdk'; +import { ArIO, ArIOState, ArweaveSigner, WarpContract } from '@ar.io/sdk'; import Arweave from 'arweave'; import { Tag } from 'arweave/node/lib/transaction'; import { config } from 'dotenv'; @@ -53,11 +53,13 @@ export function isipV4Address(ipV4Address: string): boolean { ); } -export const networkContract = new ArIO({ - contractTxId: - process.env.ARNS_CONTRACT_TX_ID || - 'bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U', -}); +export const networkContract = (signer: ArweaveSigner) => + ArIO.init({ + contract: new WarpContract({ + contractTxId: arnsContractTxId, + }), + signer, + }); export const arweave = new Arweave({ host: 'ar-io.dev', diff --git a/yarn.lock b/yarn.lock index 125ed6f0..ad7e9ced 100644 --- a/yarn.lock +++ b/yarn.lock @@ -183,7 +183,7 @@ __metadata: version: 0.0.0-use.local resolution: "@ar-io/arns-pilot@workspace:." dependencies: - "@ar.io/sdk": ^1.0.0-alpha.12 + "@ar.io/sdk": 1.0.7-alpha.3 "@commitlint/config-conventional": ^17.7.0 "@trivago/prettier-plugin-sort-imports": ^4.0.0 "@types/jest": ^27.4.0 @@ -216,19 +216,17 @@ __metadata: languageName: unknown linkType: soft -"@ar.io/sdk@npm:^1.0.0-alpha.12": - version: 1.0.0-alpha.17 - resolution: "@ar.io/sdk@npm:1.0.0-alpha.17" +"@ar.io/sdk@npm:1.0.7-alpha.3": + version: 1.0.7-alpha.3 + resolution: "@ar.io/sdk@npm:1.0.7-alpha.3" dependencies: arbundles: 0.11.0 arweave: 1.14.4 axios: 1.4.0 - setimmediate: ^1.0.5 + bunyan: ^1.8.15 warp-arbundles: ^1.0.4 - warp-contracts: 1.4.39 - warp-contracts-plugin-deploy: ^1.0.13 - winston: ^3.11.0 - checksum: ad797c5132a44271061ab7dafb9954cbb3e658709525846dc385443a8c991d2e2c2809f4690ca5399f811d65729e9b37bb6fdc7cf9d3565c92c866c396880efa + warp-contracts: 1.4.43 + checksum: a3ef634b5af3ba9a8a23e360164409d9fae14bf965a592e4ca1940579b32ac40bc4dbb330397b1e2c1d083c1b3130150f6886403943e37e3ab485d717f854e2c languageName: node linkType: hard @@ -654,13 +652,6 @@ __metadata: languageName: node linkType: hard -"@colors/colors@npm:1.6.0, @colors/colors@npm:^1.6.0": - version: 1.6.0 - resolution: "@colors/colors@npm:1.6.0" - checksum: aa209963e0c3218e80a4a20553ba8c0fbb6fa13140540b4e5f97923790be06801fc90172c1114fc8b7e888b3d012b67298cde6b9e81521361becfaee400c662f - languageName: node - linkType: hard - "@commitlint/cli@npm:^18.6.1": version: 18.6.1 resolution: "@commitlint/cli@npm:18.6.1" @@ -863,17 +854,6 @@ __metadata: languageName: node linkType: hard -"@dabh/diagnostics@npm:^2.0.2": - version: 2.0.3 - resolution: "@dabh/diagnostics@npm:2.0.3" - dependencies: - colorspace: 1.1.x - enabled: 2.0.x - kuler: ^2.0.0 - checksum: 4879600c55c8315a0fb85fbb19057bad1adc08f0a080a8cb4e2b63f723c379bfc4283b68123a2b078d367b327dd8df12fcb27464efe791addc0a48b9df6d79a1 - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/android-arm64@npm:0.17.19" @@ -2577,13 +2557,6 @@ __metadata: languageName: node linkType: hard -"@types/triple-beam@npm:^1.3.2": - version: 1.3.5 - resolution: "@types/triple-beam@npm:1.3.5" - checksum: 519b6a1b30d4571965c9706ad5400a200b94e4050feca3e7856e3ea7ac00ec9903e32e9a10e2762d0f7e472d5d03e5f4b29c16c0bd8c1f77c8876c683b2231f1 - languageName: node - linkType: hard - "@types/yargs-parser@npm:*": version: 21.0.3 resolution: "@types/yargs-parser@npm:21.0.3" @@ -2990,13 +2963,6 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^2.0.0": - version: 2.1.1 - resolution: "ansi-regex@npm:2.1.1" - checksum: 190abd03e4ff86794f338a31795d262c1dfe8c91f7e01d04f13f646f1dcb16c5800818f886047876f1272f065570ab86b24b99089f8b68a0e11ff19aed4ca8f1 - languageName: node - linkType: hard - "ansi-regex@npm:^4.1.0": version: 4.1.1 resolution: "ansi-regex@npm:4.1.1" @@ -3186,13 +3152,6 @@ __metadata: languageName: node linkType: hard -"aproba@npm:^1.0.3": - version: 1.2.0 - resolution: "aproba@npm:1.2.0" - checksum: 0fca141966559d195072ed047658b6e6c4fe92428c385dd38e288eacfc55807e7b4989322f030faff32c0f46bb0bc10f1e0ac32ec22d25315a1e5bbc0ebb76dc - languageName: node - linkType: hard - "aproba@npm:^1.0.3 || ^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" @@ -3250,42 +3209,6 @@ __metadata: languageName: node linkType: hard -"arbundles@npm:^0.10.0": - version: 0.10.1 - resolution: "arbundles@npm:0.10.1" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/providers": ^5.7.2 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wallet": ^5.7.0 - "@irys/arweave": ^0.0.2 - "@noble/ed25519": ^1.6.1 - "@randlabs/myalgo-connect": ^1.1.2 - algosdk: ^1.13.1 - arweave-stream-tx: ^1.1.0 - base64url: ^3.0.1 - bs58: ^4.0.1 - keccak: ^3.0.2 - multistream: ^4.1.0 - secp256k1: ^5.0.0 - tmp-promise: ^3.0.2 - dependenciesMeta: - "@randlabs/myalgo-connect": - optional: true - algosdk: - optional: true - arweave-stream-tx: - optional: true - multistream: - optional: true - tmp-promise: - optional: true - checksum: 59e846b64daff142459a2800af216c4fb42451271adb83c274a700948079ef175837ebb4d57d73232ff59a2c90f6bf6f42bde240cdc77876da398885a9c98b3c - languageName: node - linkType: hard - "arbundles@npm:^0.6.19": version: 0.6.23 resolution: "arbundles@npm:0.6.23" @@ -3404,16 +3327,6 @@ __metadata: languageName: node linkType: hard -"are-we-there-yet@npm:~1.1.2": - version: 1.1.7 - resolution: "are-we-there-yet@npm:1.1.7" - dependencies: - delegates: ^1.0.0 - readable-stream: ^2.0.6 - checksum: 70d251719c969b2745bfe5ddf3ebaefa846a636e90a6d5212573676af5d6670e15457761d4725731e19cbebdce42c4ab0cbedf23ab047f2a08274985aa10a3c7 - languageName: node - linkType: hard - "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -3591,7 +3504,7 @@ __metadata: languageName: node linkType: hard -"async@npm:^3.2.3, async@npm:^3.2.4": +"async@npm:^3.2.4": version: 3.2.5 resolution: "async@npm:3.2.5" checksum: 5ec77f1312301dee02d62140a6b1f7ee0edd2a0f983b6fd2b0849b969f245225b990b47b8243e7b9ad16451a53e7f68e753700385b706198ced888beedba3af4 @@ -4076,6 +3989,29 @@ __metadata: languageName: node linkType: hard +"bunyan@npm:^1.8.15": + version: 1.8.15 + resolution: "bunyan@npm:1.8.15" + dependencies: + dtrace-provider: ~0.8 + moment: ^2.19.3 + mv: ~2 + safe-json-stringify: ~1 + dependenciesMeta: + dtrace-provider: + optional: true + moment: + optional: true + mv: + optional: true + safe-json-stringify: + optional: true + bin: + bunyan: bin/bunyan + checksum: a479e0787c3a0b6565b54bd15f0b6c729d624c5aba53523e140e49e279b7a78508df93000e758bf6d02361117d6b4e6e5fc1d5ece05366fb6c4ba41bf1ac7d52 + languageName: node + linkType: hard + "bytes@npm:3.1.2, bytes@npm:^3.1.0, bytes@npm:^3.1.2": version: 3.1.2 resolution: "bytes@npm:3.1.2" @@ -4262,7 +4198,7 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^1.1.1, chownr@npm:^1.1.4": +"chownr@npm:^1.1.1": version: 1.1.4 resolution: "chownr@npm:1.1.4" checksum: 115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d @@ -4453,13 +4389,6 @@ __metadata: languageName: node linkType: hard -"code-point-at@npm:^1.0.0": - version: 1.1.0 - resolution: "code-point-at@npm:1.1.0" - checksum: 17d5666611f9b16d64fdf48176d9b7fb1c7d1c1607a189f7e600040a11a6616982876af148230336adb7d8fe728a559f743a4e29db3747e3b1a32fa7f4529681 - languageName: node - linkType: hard - "collect-v8-coverage@npm:^1.0.0": version: 1.0.2 resolution: "collect-v8-coverage@npm:1.0.2" @@ -4467,7 +4396,7 @@ __metadata: languageName: node linkType: hard -"color-convert@npm:^1.9.0, color-convert@npm:^1.9.3": +"color-convert@npm:^1.9.0": version: 1.9.3 resolution: "color-convert@npm:1.9.3" dependencies: @@ -4492,23 +4421,13 @@ __metadata: languageName: node linkType: hard -"color-name@npm:^1.0.0, color-name@npm:~1.1.4": +"color-name@npm:~1.1.4": version: 1.1.4 resolution: "color-name@npm:1.1.4" checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 languageName: node linkType: hard -"color-string@npm:^1.6.0": - version: 1.9.1 - resolution: "color-string@npm:1.9.1" - dependencies: - color-name: ^1.0.0 - simple-swizzle: ^0.2.2 - checksum: c13fe7cff7885f603f49105827d621ce87f4571d78ba28ef4a3f1a104304748f620615e6bf065ecd2145d0d9dad83a3553f52bb25ede7239d18e9f81622f1cc5 - languageName: node - linkType: hard - "color-support@npm:^1.1.3": version: 1.1.3 resolution: "color-support@npm:1.1.3" @@ -4518,16 +4437,6 @@ __metadata: languageName: node linkType: hard -"color@npm:^3.1.3": - version: 3.2.1 - resolution: "color@npm:3.2.1" - dependencies: - color-convert: ^1.9.3 - color-string: ^1.6.0 - checksum: f81220e8b774d35865c2561be921f5652117638dcda7ca4029262046e37fc2444ac7bbfdd110cf1fd9c074a4ee5eda8f85944ffbdda26186b602dd9bb05f6400 - languageName: node - linkType: hard - "colorette@npm:2.0.16": version: 2.0.16 resolution: "colorette@npm:2.0.16" @@ -4542,16 +4451,6 @@ __metadata: languageName: node linkType: hard -"colorspace@npm:1.1.x": - version: 1.1.4 - resolution: "colorspace@npm:1.1.4" - dependencies: - color: ^3.1.3 - text-hex: 1.0.x - checksum: bb3934ef3c417e961e6d03d7ca60ea6e175947029bfadfcdb65109b01881a1c0ecf9c2b0b59abcd0ee4a0d7c1eae93beed01b0e65848936472270a0b341ebce8 - languageName: node - linkType: hard - "combined-stream@npm:^1.0.8": version: 1.0.8 resolution: "combined-stream@npm:1.0.8" @@ -4630,7 +4529,7 @@ __metadata: languageName: node linkType: hard -"console-control-strings@npm:^1.0.0, console-control-strings@npm:^1.1.0, console-control-strings@npm:~1.1.0": +"console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed @@ -4966,15 +4865,6 @@ __metadata: languageName: node linkType: hard -"debug@npm:^3.2.6": - version: 3.2.7 - resolution: "debug@npm:3.2.7" - dependencies: - ms: ^2.1.1 - checksum: b3d8c5940799914d30314b7c3304a43305fd0715581a919dacb8b3176d024a782062368405b47491516d2091d6462d4d11f2f4974a405048094f8bfebfa3071c - languageName: node - linkType: hard - "decamelize-keys@npm:^1.1.0": version: 1.1.1 resolution: "decamelize-keys@npm:1.1.1" @@ -5126,15 +5016,6 @@ __metadata: languageName: node linkType: hard -"detect-libc@npm:^1.0.3": - version: 1.0.3 - resolution: "detect-libc@npm:1.0.3" - bin: - detect-libc: ./bin/detect-libc.js - checksum: daaaed925ffa7889bd91d56e9624e6c8033911bb60f3a50a74a87500680652969dbaab9526d1e200a4c94acf80fc862a22131841145a0a8482d60a99c24f4a3e - languageName: node - linkType: hard - "detect-libc@npm:^2.0.0": version: 2.0.3 resolution: "detect-libc@npm:2.0.3" @@ -5224,6 +5105,16 @@ __metadata: languageName: node linkType: hard +"dtrace-provider@npm:~0.8": + version: 0.8.8 + resolution: "dtrace-provider@npm:0.8.8" + dependencies: + nan: ^2.14.0 + node-gyp: latest + checksum: f2dc89df6a9c443dc9bae3b53496e0685b5da89142951d451c1ce062c75d96698ffc0b3d90f621a59a6a18578be552378ad4e08210759038910ff2080be556b9 + languageName: node + linkType: hard + "duplexer@npm:~0.1.1": version: 0.1.2 resolution: "duplexer@npm:0.1.2" @@ -5310,13 +5201,6 @@ __metadata: languageName: node linkType: hard -"enabled@npm:2.0.x": - version: 2.0.0 - resolution: "enabled@npm:2.0.0" - checksum: 9d256d89f4e8a46ff988c6a79b22fa814b4ffd82826c4fdacd9b42e9b9465709d3b748866d0ab4d442dfc6002d81de7f7b384146ccd1681f6a7f868d2acca063 - languageName: node - linkType: hard - "encodeurl@npm:^1.0.2": version: 1.0.2 resolution: "encodeurl@npm:1.0.2" @@ -6019,13 +5903,6 @@ __metadata: languageName: node linkType: hard -"fecha@npm:^4.2.0": - version: 4.2.3 - resolution: "fecha@npm:4.2.3" - checksum: f94e2fb3acf5a7754165d04549460d3ae6c34830394d20c552197e3e000035d69732d74af04b9bed3283bf29fe2a9ebdcc0085e640b0be3cc3658b9726265e31 - languageName: node - linkType: hard - "figlet@npm:^1.5.2": version: 1.7.0 resolution: "figlet@npm:1.7.0" @@ -6107,13 +5984,6 @@ __metadata: languageName: node linkType: hard -"fn.name@npm:1.x.x": - version: 1.1.0 - resolution: "fn.name@npm:1.1.0" - checksum: e357144f48cfc9a7f52a82bbc6c23df7c8de639fce049cac41d41d62cabb740cdb9f14eddc6485e29c933104455bdd7a69bb14a9012cef9cd4fa252a4d0cf293 - languageName: node - linkType: hard - "follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.15.0, follow-redirects@npm:^1.15.6": version: 1.15.6 resolution: "follow-redirects@npm:1.15.6" @@ -6193,15 +6063,6 @@ __metadata: languageName: node linkType: hard -"fs-minipass@npm:^1.2.7": - version: 1.2.7 - resolution: "fs-minipass@npm:1.2.7" - dependencies: - minipass: ^2.6.0 - checksum: 40fd46a2b5dcb74b3a580269f9a0c36f9098c2ebd22cef2e1a004f375b7b665c11f1507ec3f66ee6efab5664109f72d0a74ea19c3370842214c3da5168d6fdd7 - languageName: node - linkType: hard - "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -6276,22 +6137,6 @@ __metadata: languageName: node linkType: hard -"gauge@npm:~2.7.3": - version: 2.7.4 - resolution: "gauge@npm:2.7.4" - dependencies: - aproba: ^1.0.3 - console-control-strings: ^1.0.0 - has-unicode: ^2.0.0 - object-assign: ^4.1.0 - signal-exit: ^3.0.0 - string-width: ^1.0.1 - strip-ansi: ^3.0.1 - wide-align: ^1.1.0 - checksum: a89b53cee65579b46832e050b5f3a79a832cc422c190de79c6b8e2e15296ab92faddde6ddf2d376875cbba2b043efa99b9e1ed8124e7365f61b04e3cee9d40ee - languageName: node - linkType: hard - "gensync@npm:^1.0.0-beta.2": version: 1.0.0-beta.2 resolution: "gensync@npm:1.0.0-beta.2" @@ -6395,6 +6240,19 @@ __metadata: languageName: node linkType: hard +"glob@npm:^6.0.1": + version: 6.0.4 + resolution: "glob@npm:6.0.4" + dependencies: + inflight: ^1.0.4 + inherits: 2 + minimatch: 2 || 3 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: c4946c3d015ac81f704d185f2b3a55eb670100693c2cf7bc833d0efd970ec727d860d4839a5178e46a7e594b34a34661bae2f4c3405727c9fd189f84954ca3c0 + languageName: node + linkType: hard + "glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.2.0, glob@npm:^7.2.3": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -6554,7 +6412,7 @@ __metadata: languageName: node linkType: hard -"has-unicode@npm:^2.0.0, has-unicode@npm:^2.0.1": +"has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" checksum: 1eab07a7436512db0be40a710b29b5dc21fa04880b7f63c9980b706683127e3c1b57cb80ea96d47991bdae2dfe479604f6a1ba410106ee1046a41d1bd0814400 @@ -6791,7 +6649,7 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24, iconv-lite@npm:^0.4.4": +"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" dependencies: @@ -6816,15 +6674,6 @@ __metadata: languageName: node linkType: hard -"ignore-walk@npm:^3.0.1": - version: 3.0.4 - resolution: "ignore-walk@npm:3.0.4" - dependencies: - minimatch: ^3.0.4 - checksum: 9e9c5ef6c3e0ed7ef5d797991abb554dbb7e60d5fedf6cf05c7129819689eba2b462f625c6e3561e0fc79841904eb829565513eeeab1b44f4fbec4d3146b1a8d - languageName: node - linkType: hard - "ignore@npm:^4.0.6": version: 4.0.6 resolution: "ignore@npm:4.0.6" @@ -7012,13 +6861,6 @@ __metadata: languageName: node linkType: hard -"is-arrayish@npm:^0.3.1": - version: 0.3.2 - resolution: "is-arrayish@npm:0.3.2" - checksum: 977e64f54d91c8f169b59afcd80ff19227e9f5c791fa28fa2e5bce355cbaf6c2c356711b734656e80c9dd4a854dd7efcf7894402f1031dfc5de5d620775b4d5f - languageName: node - linkType: hard - "is-buffer@npm:^2.0.5": version: 2.0.5 resolution: "is-buffer@npm:2.0.5" @@ -7049,15 +6891,6 @@ __metadata: languageName: node linkType: hard -"is-fullwidth-code-point@npm:^1.0.0": - version: 1.0.0 - resolution: "is-fullwidth-code-point@npm:1.0.0" - dependencies: - number-is-nan: ^1.0.0 - checksum: 4d46a7465a66a8aebcc5340d3b63a56602133874af576a9ca42c6f0f4bd787a743605771c5f246db77da96605fefeffb65fc1dbe862dcc7328f4b4d03edf5a57 - languageName: node - linkType: hard - "is-fullwidth-code-point@npm:^2.0.0": version: 2.0.0 resolution: "is-fullwidth-code-point@npm:2.0.0" @@ -8187,13 +8020,6 @@ __metadata: languageName: node linkType: hard -"kuler@npm:^2.0.0": - version: 2.0.0 - resolution: "kuler@npm:2.0.0" - checksum: 9e10b5a1659f9ed8761d38df3c35effabffbd19fc6107324095238e4ef0ff044392cae9ac64a1c2dda26e532426485342226b93806bd97504b174b0dcf04ed81 - languageName: node - linkType: hard - "lazystream@npm:^1.0.0": version: 1.0.1 resolution: "lazystream@npm:1.0.1" @@ -8471,20 +8297,6 @@ __metadata: languageName: node linkType: hard -"logform@npm:^2.3.2, logform@npm:^2.4.0": - version: 2.6.0 - resolution: "logform@npm:2.6.0" - dependencies: - "@colors/colors": 1.6.0 - "@types/triple-beam": ^1.3.2 - fecha: ^4.2.0 - ms: ^2.1.1 - safe-stable-stringify: ^2.3.1 - triple-beam: ^1.3.0 - checksum: b9ea74bb75e55379ad0eb3e4d65ae6e8d02bc45b431c218162878bf663997ab9258a73104c2b30e09dd2db288bb83c8bf8748e46689d75f5e7e34cf69378d6df - languageName: node - linkType: hard - "loglevel@npm:^1.6.8, loglevel@npm:^1.8.0": version: 1.9.1 resolution: "loglevel@npm:1.9.1" @@ -8823,6 +8635,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:2 || 3, minimatch@npm:^3.0.4, minimatch@npm:^3.1.1": + version: 3.1.2 + resolution: "minimatch@npm:3.1.2" + dependencies: + brace-expansion: ^1.1.7 + checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a + languageName: node + linkType: hard + "minimatch@npm:9.0.3": version: 9.0.3 resolution: "minimatch@npm:9.0.3" @@ -8832,15 +8653,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1": - version: 3.1.2 - resolution: "minimatch@npm:3.1.2" - dependencies: - brace-expansion: ^1.1.7 - checksum: c154e566406683e7bcb746e000b84d74465b3a832c45d59912b9b55cd50dee66e5c4b1e5566dba26154040e51672f9aa450a9aef0c97cfc7336b78b7afb9540a - languageName: node - linkType: hard - "minimatch@npm:^5.1.0": version: 5.1.6 resolution: "minimatch@npm:5.1.6" @@ -8952,16 +8764,6 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^2.6.0, minipass@npm:^2.9.0": - version: 2.9.0 - resolution: "minipass@npm:2.9.0" - dependencies: - safe-buffer: ^5.1.2 - yallist: ^3.0.0 - checksum: 077b66f31ba44fd5a0d27d12a9e6a86bff8f97a4978dedb0373167156b5599fadb6920fdde0d9f803374164d810e05e8462ce28e86abbf7f0bea293a93711fc6 - languageName: node - linkType: hard - "minipass@npm:^3.0.0, minipass@npm:^3.1.0, minipass@npm:^3.1.1, minipass@npm:^3.1.3": version: 3.3.6 resolution: "minipass@npm:3.3.6" @@ -8985,15 +8787,6 @@ __metadata: languageName: node linkType: hard -"minizlib@npm:^1.3.3": - version: 1.3.3 - resolution: "minizlib@npm:1.3.3" - dependencies: - minipass: ^2.9.0 - checksum: b0425c04d2ae6aad5027462665f07cc0d52075f7fa16e942b4611115f9b31f02924073b7221be6f75929d3c47ab93750c63f6dc2bbe8619ceacb3de1f77732c0 - languageName: node - linkType: hard - "minizlib@npm:^2.0.0, minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -9011,7 +8804,7 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:^0.5.1, mkdirp@npm:^0.5.5": +"mkdirp@npm:^0.5.1, mkdirp@npm:~0.5.1": version: 0.5.6 resolution: "mkdirp@npm:0.5.6" dependencies: @@ -9038,7 +8831,7 @@ __metadata: languageName: node linkType: hard -"moment@npm:^2.29.1": +"moment@npm:^2.19.3, moment@npm:^2.29.1": version: 2.30.1 resolution: "moment@npm:2.30.1" checksum: 859236bab1e88c3e5802afcf797fc801acdbd0ee509d34ea3df6eea21eb6bcc2abd4ae4e4e64aa7c986aa6cba563c6e62806218e6412a765010712e5fa121ba6 @@ -9052,7 +8845,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0, ms@npm:^2.1.1": +"ms@npm:^2.0.0": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -9076,6 +8869,26 @@ __metadata: languageName: node linkType: hard +"mv@npm:~2": + version: 2.1.1 + resolution: "mv@npm:2.1.1" + dependencies: + mkdirp: ~0.5.1 + ncp: ~2.0.0 + rimraf: ~2.4.0 + checksum: 59d4b5ebff6c265b452d6630ae8873d573c82e36fdc1ed9c34c7901a0bf2d3d357022f49db8e9bded127b743f709c7ef7befec249a2b3967578d649a8029aa06 + languageName: node + linkType: hard + +"nan@npm:^2.14.0": + version: 2.19.0 + resolution: "nan@npm:2.19.0" + dependencies: + node-gyp: latest + checksum: 29a894a003c1954c250d690768c30e69cd91017e2e5eb21b294380f7cace425559508f5ffe3e329a751307140b0bd02f83af040740fa4def1a3869be6af39600 + languageName: node + linkType: hard + "napi-build-utils@npm:^1.0.1": version: 1.0.2 resolution: "napi-build-utils@npm:1.0.2" @@ -9108,16 +8921,12 @@ __metadata: languageName: node linkType: hard -"needle@npm:^2.5.2": - version: 2.9.1 - resolution: "needle@npm:2.9.1" - dependencies: - debug: ^3.2.6 - iconv-lite: ^0.4.4 - sax: ^1.2.4 +"ncp@npm:~2.0.0": + version: 2.0.0 + resolution: "ncp@npm:2.0.0" bin: - needle: ./bin/needle - checksum: 746ae3a3782f0a057ff304a98843cc6f2009f978a0fad0c3e641a9d46d0b5702bb3e197ba08aecd48678067874a991c4f5fc320c7e51a4c041d9dd3441146cf0 + ncp: ./bin/ncp + checksum: ea9b19221da1d1c5529bdb9f8e85c9d191d156bcaae408cce5e415b7fbfd8744c288e792bd7faf1fe3b70fd44c74e22f0d43c39b209bc7ac1fb8016f70793a16 languageName: node linkType: hard @@ -9271,26 +9080,6 @@ __metadata: languageName: node linkType: hard -"node-pre-gyp@npm:^0.17.0": - version: 0.17.0 - resolution: "node-pre-gyp@npm:0.17.0" - dependencies: - detect-libc: ^1.0.3 - mkdirp: ^0.5.5 - needle: ^2.5.2 - nopt: ^4.0.3 - npm-packlist: ^1.4.8 - npmlog: ^4.1.2 - rc: ^1.2.8 - rimraf: ^2.7.1 - semver: ^5.7.1 - tar: ^4.4.13 - bin: - node-pre-gyp: bin/node-pre-gyp - checksum: 148d6d4207e031da735169d0c3b3e011ad65ba84de0a92919659d5e034a5540644a9cc58abf2cdbe66d810fd25648d316aa073887bf69c471094874f1fefa4b6 - languageName: node - linkType: hard - "node-releases@npm:^2.0.14": version: 2.0.14 resolution: "node-releases@npm:2.0.14" @@ -9333,18 +9122,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^4.0.3": - version: 4.0.3 - resolution: "nopt@npm:4.0.3" - dependencies: - abbrev: 1 - osenv: ^0.1.4 - bin: - nopt: bin/nopt.js - checksum: 66cd3b6021fc8130fc201236bc3dce614fc86988b78faa91377538b09d57aad9ba4300b5d6a01dc93d6c6f2c170f81cc893063d496d108150b65191beb4a50a4 - languageName: node - linkType: hard - "nopt@npm:^5.0.0": version: 5.0.0 resolution: "nopt@npm:5.0.0" @@ -9405,33 +9182,6 @@ __metadata: languageName: node linkType: hard -"npm-bundled@npm:^1.0.1": - version: 1.1.2 - resolution: "npm-bundled@npm:1.1.2" - dependencies: - npm-normalize-package-bin: ^1.0.1 - checksum: 6e599155ef28d0b498622f47f1ba189dfbae05095a1ed17cb3a5babf961e965dd5eab621f0ec6f0a98de774e5836b8f5a5ee639010d64f42850a74acec3d4d09 - languageName: node - linkType: hard - -"npm-normalize-package-bin@npm:^1.0.1": - version: 1.0.1 - resolution: "npm-normalize-package-bin@npm:1.0.1" - checksum: ae7f15155a1e3ace2653f12ddd1ee8eaa3c84452fdfbf2f1943e1de264e4b079c86645e2c55931a51a0a498cba31f70022a5219d5665fbcb221e99e58bc70122 - languageName: node - linkType: hard - -"npm-packlist@npm:^1.4.8": - version: 1.4.8 - resolution: "npm-packlist@npm:1.4.8" - dependencies: - ignore-walk: ^3.0.1 - npm-bundled: ^1.0.1 - npm-normalize-package-bin: ^1.0.1 - checksum: 85f764bd0fb516cff34afb4b60ea925ef218cfbdf02d05cda0c115ca30b932b9e0f78bdb186e09d26dd17f983ee1d5aee7ba44b5db84ff3c4c5e73524b537084 - languageName: node - linkType: hard - "npm-run-path@npm:^4.0.1": version: 4.0.1 resolution: "npm-run-path@npm:4.0.1" @@ -9450,18 +9200,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^4.1.2": - version: 4.1.2 - resolution: "npmlog@npm:4.1.2" - dependencies: - are-we-there-yet: ~1.1.2 - console-control-strings: ~1.1.0 - gauge: ~2.7.3 - set-blocking: ~2.0.0 - checksum: edbda9f95ec20957a892de1839afc6fb735054c3accf6fbefe767bac9a639fd5cea2baeac6bd2bcd50a85cb54924d57d9886c81c7fbc2332c2ddd19227504192 - languageName: node - linkType: hard - "npmlog@npm:^6.0.0": version: 6.0.2 resolution: "npmlog@npm:6.0.2" @@ -9474,13 +9212,6 @@ __metadata: languageName: node linkType: hard -"number-is-nan@npm:^1.0.0": - version: 1.0.1 - resolution: "number-is-nan@npm:1.0.1" - checksum: 13656bc9aa771b96cef209ffca31c31a03b507ca6862ba7c3f638a283560620d723d52e626d57892c7fff475f4c36ac07f0600f14544692ff595abff214b9ffb - languageName: node - linkType: hard - "nwsapi@npm:^2.2.0": version: 2.2.7 resolution: "nwsapi@npm:2.2.7" @@ -9488,13 +9219,6 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.1.0": - version: 4.1.1 - resolution: "object-assign@npm:4.1.1" - checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f - languageName: node - linkType: hard - "object-inspect@npm:^1.13.1": version: 1.13.1 resolution: "object-inspect@npm:1.13.1" @@ -9549,15 +9273,6 @@ __metadata: languageName: node linkType: hard -"one-time@npm:^1.0.0": - version: 1.0.0 - resolution: "one-time@npm:1.0.0" - dependencies: - fn.name: 1.x.x - checksum: fd008d7e992bdec1c67f53a2f9b46381ee12a9b8c309f88b21f0223546003fb47e8ad7c1fd5843751920a8d276c63bd4b45670ef80c61fb3e07dbccc962b5c7d - languageName: node - linkType: hard - "onetime@npm:^5.1.0, onetime@npm:^5.1.2": version: 5.1.2 resolution: "onetime@npm:5.1.2" @@ -9621,30 +9336,13 @@ __metadata: languageName: node linkType: hard -"os-homedir@npm:^1.0.0": - version: 1.0.2 - resolution: "os-homedir@npm:1.0.2" - checksum: af609f5a7ab72de2f6ca9be6d6b91a599777afc122ac5cad47e126c1f67c176fe9b52516b9eeca1ff6ca0ab8587fe66208bc85e40a3940125f03cdb91408e9d2 - languageName: node - linkType: hard - -"os-tmpdir@npm:^1.0.0, os-tmpdir@npm:~1.0.2": +"os-tmpdir@npm:~1.0.2": version: 1.0.2 resolution: "os-tmpdir@npm:1.0.2" checksum: 5666560f7b9f10182548bf7013883265be33620b1c1b4a4d405c25be2636f970c5488ff3e6c48de75b55d02bde037249fe5dbfbb4c0fb7714953d56aed062e6d languageName: node linkType: hard -"osenv@npm:^0.1.4": - version: 0.1.5 - resolution: "osenv@npm:0.1.5" - dependencies: - os-homedir: ^1.0.0 - os-tmpdir: ^1.0.0 - checksum: 779d261920f2a13e5e18cf02446484f12747d3f2ff82280912f52b213162d43d312647a40c332373cbccd5e3fb8126915d3bfea8dde4827f70f82da76e52d359 - languageName: node - linkType: hard - "p-cancelable@npm:^2.0.0": version: 2.1.1 resolution: "p-cancelable@npm:2.1.1" @@ -10191,7 +9889,7 @@ __metadata: languageName: node linkType: hard -"rc@npm:^1.2.7, rc@npm:^1.2.8": +"rc@npm:^1.2.7": version: 1.2.8 resolution: "rc@npm:1.2.8" dependencies: @@ -10235,7 +9933,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:2, readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.5, readable-stream@npm:^2.0.6, readable-stream@npm:^2.3.8": +"readable-stream@npm:2, readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.5, readable-stream@npm:^2.3.8": version: 2.3.8 resolution: "readable-stream@npm:2.3.8" dependencies: @@ -10484,17 +10182,6 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^2.7.1": - version: 2.7.1 - resolution: "rimraf@npm:2.7.1" - dependencies: - glob: ^7.1.3 - bin: - rimraf: ./bin.js - checksum: cdc7f6eacb17927f2a075117a823e1c5951792c6498ebcce81ca8203454a811d4cf8900314154d3259bb8f0b42ab17f67396a8694a54cae3283326e57ad250cd - languageName: node - linkType: hard - "rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" @@ -10517,6 +10204,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:~2.4.0": + version: 2.4.5 + resolution: "rimraf@npm:2.4.5" + dependencies: + glob: ^6.0.1 + bin: + rimraf: ./bin.js + checksum: 036793b4055d65344ad7bea73c3f4095640af7455478fe56c19783619463e6bb4374ab3556b9e6d4d6d3dd210eb677b0955ece38813e734c294fd2687201151d + languageName: node + linkType: hard + "ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": version: 2.0.2 resolution: "ripemd160@npm:2.0.2" @@ -10584,6 +10282,13 @@ __metadata: languageName: node linkType: hard +"safe-json-stringify@npm:~1": + version: 1.2.0 + resolution: "safe-json-stringify@npm:1.2.0" + checksum: 5bb32db6d6a3ceb3752df51f4043a412419cd3d4fcd5680a865dfa34cd7e575ba659c077d13f52981ced084061df9c75c7fb12e391584d4264e6914c1cd3d216 + languageName: node + linkType: hard + "safe-stable-stringify@npm:2.4.1": version: 2.4.1 resolution: "safe-stable-stringify@npm:2.4.1" @@ -10591,13 +10296,6 @@ __metadata: languageName: node linkType: hard -"safe-stable-stringify@npm:^2.3.1": - version: 2.4.3 - resolution: "safe-stable-stringify@npm:2.4.3" - checksum: 3aeb64449706ee1f5ad2459fc99648b131d48e7a1fbb608d7c628020177512dc9d94108a5cb61bbc953985d313d0afea6566d243237743e02870490afef04b43 - languageName: node - linkType: hard - "safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.1.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" @@ -10605,13 +10303,6 @@ __metadata: languageName: node linkType: hard -"sax@npm:^1.2.4": - version: 1.3.0 - resolution: "sax@npm:1.3.0" - checksum: 238ab3a9ba8c8f8aaf1c5ea9120386391f6ee0af52f1a6a40bbb6df78241dd05d782f2359d614ac6aae08c4c4125208b456548a6cf68625aa4fe178486e63ecd - languageName: node - linkType: hard - "saxes@npm:^5.0.1": version: 5.0.1 resolution: "saxes@npm:5.0.1" @@ -10652,7 +10343,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.7.1": +"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0": version: 5.7.2 resolution: "semver@npm:5.7.2" bin: @@ -10693,7 +10384,7 @@ __metadata: languageName: node linkType: hard -"set-blocking@npm:^2.0.0, set-blocking@npm:~2.0.0": +"set-blocking@npm:^2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" checksum: 6e65a05f7cf7ebdf8b7c75b101e18c0b7e3dff4940d480efed8aad3a36a4005140b660fa1d804cb8bce911cac290441dc728084a30504d3516ac2ff7ad607b02 @@ -10714,7 +10405,7 @@ __metadata: languageName: node linkType: hard -"setimmediate@npm:^1.0.4, setimmediate@npm:^1.0.5": +"setimmediate@npm:^1.0.4": version: 1.0.5 resolution: "setimmediate@npm:1.0.5" checksum: c9a6f2c5b51a2dabdc0247db9c46460152ffc62ee139f3157440bd48e7c59425093f42719ac1d7931f054f153e2d26cf37dfeb8da17a794a58198a2705e527fd @@ -10784,7 +10475,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 @@ -10816,15 +10507,6 @@ __metadata: languageName: node linkType: hard -"simple-swizzle@npm:^0.2.2": - version: 0.2.2 - resolution: "simple-swizzle@npm:0.2.2" - dependencies: - is-arrayish: ^0.3.1 - checksum: a7f3f2ab5c76c4472d5c578df892e857323e452d9f392e1b5cf74b74db66e6294a1e1b8b390b519fa1b96b5b613f2a37db6cffef52c3f1f8f3c5ea64eb2d54c0 - languageName: node - linkType: hard - "sisteransi@npm:^1.0.5": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -11066,13 +10748,6 @@ __metadata: languageName: node linkType: hard -"stack-trace@npm:0.0.x": - version: 0.0.10 - resolution: "stack-trace@npm:0.0.10" - checksum: 473036ad32f8c00e889613153d6454f9be0536d430eb2358ca51cad6b95cea08a3cc33cc0e34de66b0dad221582b08ed2e61ef8e13f4087ab690f388362d6610 - languageName: node - linkType: hard - "stack-utils@npm:^2.0.3": version: 2.0.6 resolution: "stack-utils@npm:2.0.6" @@ -11179,17 +10854,6 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.1": - version: 1.0.2 - resolution: "string-width@npm:1.0.2" - dependencies: - code-point-at: ^1.0.0 - is-fullwidth-code-point: ^1.0.0 - strip-ansi: ^3.0.0 - checksum: 5c79439e95bc3bd7233a332c5f5926ab2ee90b23816ed4faa380ce3b2576d7800b0a5bb15ae88ed28737acc7ea06a518c2eef39142dd727adad0e45c776cd37e - languageName: node - linkType: hard - "string-width@npm:^3.0.0": version: 3.1.0 resolution: "string-width@npm:3.1.0" @@ -11239,15 +10903,6 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^3.0.0, strip-ansi@npm:^3.0.1": - version: 3.0.1 - resolution: "strip-ansi@npm:3.0.1" - dependencies: - ansi-regex: ^2.0.0 - checksum: 9b974de611ce5075c70629c00fa98c46144043db92ae17748fb780f706f7a789e9989fd10597b7c2053ae8d1513fd707816a91f1879b2f71e6ac0b6a863db465 - languageName: node - linkType: hard - "strip-ansi@npm:^5.1.0, strip-ansi@npm:^5.2.0": version: 5.2.0 resolution: "strip-ansi@npm:5.2.0" @@ -11405,21 +11060,6 @@ __metadata: languageName: node linkType: hard -"tar@npm:^4.4.13": - version: 4.4.19 - resolution: "tar@npm:4.4.19" - dependencies: - chownr: ^1.1.4 - fs-minipass: ^1.2.7 - minipass: ^2.9.0 - minizlib: ^1.3.3 - mkdirp: ^0.5.5 - safe-buffer: ^5.2.1 - yallist: ^3.1.1 - checksum: 423c8259b17f8f612cef9c96805d65f90ba9a28e19be582cd9d0fcb217038219f29b7547198e8fd617da5f436376d6a74b99827acd1238d2f49cf62330f9664e - languageName: node - linkType: hard - "tar@npm:^6.0.2, tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.1 resolution: "tar@npm:6.2.1" @@ -11469,13 +11109,6 @@ __metadata: languageName: node linkType: hard -"text-hex@npm:1.0.x": - version: 1.0.0 - resolution: "text-hex@npm:1.0.0" - checksum: 1138f68adc97bf4381a302a24e2352f04992b7b1316c5003767e9b0d3367ffd0dc73d65001ea02b07cd0ecc2a9d186de0cf02f3c2d880b8a522d4ccb9342244a - languageName: node - linkType: hard - "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -11622,13 +11255,6 @@ __metadata: languageName: node linkType: hard -"triple-beam@npm:^1.3.0": - version: 1.4.1 - resolution: "triple-beam@npm:1.4.1" - checksum: 2e881a3e8e076b6f2b85b9ec9dd4a900d3f5016e6d21183ed98e78f9abcc0149e7d54d79a3f432b23afde46b0885bdcdcbff789f39bc75de796316961ec07f61 - languageName: node - linkType: hard - "ts-api-utils@npm:^1.0.1": version: 1.3.0 resolution: "ts-api-utils@npm:1.3.0" @@ -12170,23 +11796,9 @@ __metadata: languageName: node linkType: hard -"warp-contracts-plugin-deploy@npm:^1.0.13": - version: 1.0.13 - resolution: "warp-contracts-plugin-deploy@npm:1.0.13" - dependencies: - arbundles: ^0.10.0 - node-pre-gyp: ^0.17.0 - node-stdlib-browser: ^1.2.0 - peerDependencies: - warp-arbundles: ^1.0.1 - warp-contracts: ^1.4.5 - checksum: 3f00ad6155d313ba5c13e5cb02c3ed763df9810782a6bb8ef733721cd628472e1fca956308454215289823d12a6a2086ce1bddf3010aac295c54d31ac23e4c6b - languageName: node - linkType: hard - -"warp-contracts@npm:1.4.39": - version: 1.4.39 - resolution: "warp-contracts@npm:1.4.39" +"warp-contracts@npm:1.4.40": + version: 1.4.40 + resolution: "warp-contracts@npm:1.4.40" dependencies: archiver: ^5.3.0 arweave: 1.14.4 @@ -12202,13 +11814,13 @@ __metadata: warp-arbundles: ^1.0.4 warp-isomorphic: ^1.0.7 warp-wasm-metering: 1.0.1 - checksum: 0613db6d97afbae865fa057a3cc7bc86e694fcd6c58602b06e51eff9a95498cc4358c2e771ce86beb38e82639e1c533d8818b7ef45e0a0006a42fae05ac7ce3f + checksum: aab8a5b9e302a6b898844c9419500f3fc374c1034fe48883c83468209afc8e6d0a794c6260fd998edda1990777738badec23209e6fd9ae3c0d3d0618d9d0ee8d languageName: node linkType: hard -"warp-contracts@npm:1.4.40": - version: 1.4.40 - resolution: "warp-contracts@npm:1.4.40" +"warp-contracts@npm:1.4.43": + version: 1.4.43 + resolution: "warp-contracts@npm:1.4.43" dependencies: archiver: ^5.3.0 arweave: 1.14.4 @@ -12224,7 +11836,7 @@ __metadata: warp-arbundles: ^1.0.4 warp-isomorphic: ^1.0.7 warp-wasm-metering: 1.0.1 - checksum: aab8a5b9e302a6b898844c9419500f3fc374c1034fe48883c83468209afc8e6d0a794c6260fd998edda1990777738badec23209e6fd9ae3c0d3d0618d9d0ee8d + checksum: caeed2a77c233a3509cb14c6c6565434cfcfea04285aeb8a1f4ec53c39a9fb8d4740cff7d6c5c7502d2ee0082e7881f252270847fe29a8df8aa5616bc664c4ca languageName: node linkType: hard @@ -12394,7 +12006,7 @@ __metadata: languageName: node linkType: hard -"wide-align@npm:^1.1.0, wide-align@npm:^1.1.5": +"wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" dependencies: @@ -12403,36 +12015,6 @@ __metadata: languageName: node linkType: hard -"winston-transport@npm:^4.7.0": - version: 4.7.0 - resolution: "winston-transport@npm:4.7.0" - dependencies: - logform: ^2.3.2 - readable-stream: ^3.6.0 - triple-beam: ^1.3.0 - checksum: ce074b5c76a99bee5236cf2b4d30fadfaf1e551d566f654f1eba303dc5b5f77169c21545ff5c5e4fdad9f8e815fc6d91b989f1db34161ecca6e860e62fd3a862 - languageName: node - linkType: hard - -"winston@npm:^3.11.0": - version: 3.13.0 - resolution: "winston@npm:3.13.0" - dependencies: - "@colors/colors": ^1.6.0 - "@dabh/diagnostics": ^2.0.2 - async: ^3.2.3 - is-stream: ^2.0.0 - logform: ^2.4.0 - one-time: ^1.0.0 - readable-stream: ^3.4.0 - safe-stable-stringify: ^2.3.1 - stack-trace: 0.0.x - triple-beam: ^1.3.0 - winston-transport: ^4.7.0 - checksum: 66f9fbbadb58e1632701e9c89391f217310c9455462148e163e060dcd25aed21351b0413bdbbf90e5c5fe9bc945fc5de6f53875ac7c7ef3061133a354fc678c0 - languageName: node - linkType: hard - "word-wrap@npm:~1.2.3": version: 1.2.5 resolution: "word-wrap@npm:1.2.5" @@ -12578,7 +12160,7 @@ __metadata: languageName: node linkType: hard -"yallist@npm:^3.0.0, yallist@npm:^3.0.2, yallist@npm:^3.1.1": +"yallist@npm:^3.0.2": version: 3.1.1 resolution: "yallist@npm:3.1.1" checksum: 48f7bb00dc19fc635a13a39fe547f527b10c9290e7b3e836b9a8f1ca04d4d342e85714416b3c2ab74949c9c66f9cebb0473e6bc353b79035356103b47641285d