diff --git a/docker-compose/aeternity.yaml b/docker-compose/aeternity.yaml
index f9342b50c..c22942c3d 100644
--- a/docker-compose/aeternity.yaml
+++ b/docker-compose/aeternity.yaml
@@ -14,7 +14,7 @@ chain:
"1": 0
"6": 1
genesis_accounts:
- ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E: 10000000000000000000000
+ ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E: 1000000000000000000000000
# TODO: remove after solving https://github.com/aeternity/ae_mdw/issues/1760
fork_management:
diff --git a/docker-compose/init-state.mjs b/docker-compose/init-state.mjs
index 7a406d639..fbe36ea6e 100755
--- a/docker-compose/init-state.mjs
+++ b/docker-compose/init-state.mjs
@@ -3,6 +3,7 @@
import { execSync } from 'child_process';
import {
Node, AeSdk, MemoryAccount, generateSaveHDWalletFromSeed, getSaveHDWalletAccounts,
+ encode, Encoding,
} from '@aeternity/aepp-sdk-next';
import { mnemonicToSeed } from '@aeternity/bip39';
@@ -30,13 +31,47 @@ const aeSdk = new AeSdk({
const seed = mnemonicToSeed('cross cat upper state flame wire inner betray almost party agree endorse');
const wallet = generateSaveHDWalletFromSeed(seed, '');
-const [{ publicKey, secretKey }] = getSaveHDWalletAccounts(wallet, '', 1);
+const [{ secretKey }, { secretKey: secretKey2 }] = getSaveHDWalletAccounts(wallet, '', 2);
+const account1 = new MemoryAccount(secretKey);
+const account2 = new MemoryAccount(secretKey2);
-await aeSdk.spend(1e20, publicKey);
+await aeSdk.spend(200e18, account1.address);
+await aeSdk.spend(100e18, account2.address);
+console.log('Wallet 1 ready');
await (async function prepareTransactionHistory() {
- const onAccount = new MemoryAccount(secretKey);
for (let i = 0; i < 15; i += 1) {
- await aeSdk.spend(1e14, aeSdk.address, { onAccount });
+ await aeSdk.spend(0.0001e18, aeSdk.address, { onAccount: account1 });
}
+ console.log('Transaction history ready');
+})();
+
+await (async function prepareNames() {
+ await aeSdk.aensClaim('engine.chain', 0);
+ await aeSdk.aensBid('engine.chain', 60e18, { onAccount: account1 });
+ await aeSdk.aensBid('engine.chain', 65e18);
+ await aeSdk.aensClaim('visual.chain', 0);
+ await aeSdk.aensBid('visual.chain', 60e18, { onAccount: account1 });
+ await aeSdk.aensClaim('inspector.chain', 0);
+ await aeSdk.aensClaim('мир.chain', 0);
+ await aeSdk.aensClaim('understanding.chain', 0, { onAccount: account1 });
+ await aeSdk.aensClaim('entertainment.chain', 0, { onAccount: account2 });
+ await aeSdk.aensUpdate('entertainment.chain', {
+ 'account_pubkey': account2.address,
+ 'contract_pubkey': account1.address.replace('ak_', 'ct_'),
+ 'second account': account1.address,
+ 'raw': encode(Buffer.from('test'), Encoding.Bytearray),
+ }, { onAccount: account2 });
+ console.log('Names ready');
+})();
+
+await (async function wallet2() {
+ const seed = mnemonicToSeed('sun dish cousin double youth year path fix away pig spring upset');
+ const wallet = generateSaveHDWalletFromSeed(seed, '');
+ const [{ secretKey }, { publicKey: publicKey2 }] = getSaveHDWalletAccounts(wallet, '', 2);
+ const acc = new MemoryAccount(secretKey);
+ await aeSdk.spend(100e18, acc.address);
+ await aeSdk.spend(100e18, publicKey2);
+ await aeSdk.aensClaim('investigation.chain', 0, { onAccount: acc });
+ console.log('Wallet 2 ready');
})();
diff --git a/src/components/AeInputName.js b/src/components/AeInputName.js
index 4595d95ee..b9d38827a 100644
--- a/src/components/AeInputName.js
+++ b/src/components/AeInputName.js
@@ -1,13 +1,13 @@
+import { isNameValid } from '@aeternity/aepp-sdk-next';
import withFormatting from '../lib/withFormatting';
import { AENS_DOMAIN } from '../lib/constants';
import AeInput from './AeInput.vue';
-const nameRegExp = new RegExp(`^[a-zA-Z0-9]+\\${AENS_DOMAIN}$`);
-const notNameCharsRegExp = /[^a-zA-Z0-9]/g;
+const notNameCharsRegExp = /[^\p{General_Category=Letter}0-9-]/gu;
export const formatDisplayValueAndCursor = ({ value, cursor }, previousValue) => {
if (!value || value === AENS_DOMAIN) return { value: '', cursor: 0 };
- if (nameRegExp.test(value)) return { value, cursor };
+ if (isNameValid(value)) return { value, cursor };
if (!previousValue) {
const cleared = value
.replace(new RegExp(`\\${AENS_DOMAIN}$`), '')
@@ -17,7 +17,7 @@ export const formatDisplayValueAndCursor = ({ value, cursor }, previousValue) =>
cursor,
};
}
- if (nameRegExp.test(value + AENS_DOMAIN) && !value.endsWith(AENS_DOMAIN.slice(1))) {
+ if (isNameValid(value + AENS_DOMAIN) && !value.endsWith(AENS_DOMAIN.slice(1))) {
return { value: value + AENS_DOMAIN, cursor };
}
return {
diff --git a/src/components/__tests__/AeInputAccount.js b/src/components/__tests__/AeInputAccount.js
index f9cfbbd01..1593d1fe0 100644
--- a/src/components/__tests__/AeInputAccount.js
+++ b/src/components/__tests__/AeInputAccount.js
@@ -47,28 +47,28 @@ describe('AeInputAccount', () => {
input: {
value: 'test',
displayed: testName,
- emmited: testName,
+ emitted: testName,
},
}, {
name: 'removes non-base58 symbols in addresses',
input: {
value: 'ak_019AHIJNOPZaklmzяя',
displayed: 'ak_ 19A HJN PZa kmz',
- emmited: 'ak_19AHJNPZakmz',
+ emitted: 'ak_19AHJNPZakmz',
},
}, {
name: 'removes unknown symbols in names',
input: {
- value: 'ka_019AHIJNOPZaklmzяя.ch',
- displayed: 'ka019AHIJNOPZaklmzch.chain',
- emmited: 'ka019AHIJNOPZaklmzch.chain',
+ value: 'ka_019AHIJNOPZaklmzяя-#$.ch',
+ displayed: 'ka019AHIJNOPZaklmzяя-ch.chain',
+ emitted: 'ka019AHIJNOPZaklmzяя-ch.chain',
},
}, {
name: 'removes unknown symbols in names preserving AENS domain',
input: {
- value: 'ka_019AHIJNOPZaklmzяя.chain',
- displayed: 'ka019AHIJNOPZaklmz.chain',
- emmited: 'ka019AHIJNOPZaklmz.chain',
+ value: 'ka_019AHIJNOPZaklmzяя-#$.chain',
+ displayed: 'ka019AHIJNOPZaklmzяя-.chain',
+ emitted: 'ka019AHIJNOPZaklmzяя-.chain',
},
}, {
name: 'emits input event contains address without space symbols',
@@ -76,7 +76,7 @@ describe('AeInputAccount', () => {
value: testAddress,
cursor: 10,
displayed: testAddressFormatted,
- emmited: testAddress,
+ emitted: testAddress,
},
}, {
name: 'limits address length',
@@ -84,7 +84,7 @@ describe('AeInputAccount', () => {
value: `${testAddressFormatted}test`,
cursor: 25,
displayed: testAddressFormatted,
- emmited: testAddress,
+ emitted: testAddress,
},
}, {
name: 'can paste a name ending with domain without dot',
@@ -138,7 +138,7 @@ describe('AeInputAccount', () => {
input: {
value: '_',
displayed: '',
- emmited: '',
+ emitted: '',
},
}].forEach((test) => it(test.name, () => {
const inputListener = jest.fn();
@@ -156,8 +156,8 @@ describe('AeInputAccount', () => {
textarea.element.setSelectionRange(cursor, cursor);
textarea.trigger('input');
expect(wrapper.find('textarea').element.value).toBe(test.input.displayed);
- if (test.input.emmited !== undefined) {
- expect(inputListener.mock.calls[0][0]).toEqual(test.input.emmited);
+ if (test.input.emitted !== undefined) {
+ expect(inputListener.mock.calls[0][0]).toEqual(test.input.emitted);
}
}
}));
diff --git a/src/lib/methods.js b/src/lib/methods.js
index 319761f9c..fcac75e06 100644
--- a/src/lib/methods.js
+++ b/src/lib/methods.js
@@ -1,4 +1,5 @@
-// eslint-disable-next-line import/prefer-default-export
+import Swagger from 'swagger-client';
+
export async function resetConfirm() {
await this.$store.dispatch('modals/open', {
name: 'confirm',
@@ -9,3 +10,21 @@ export async function resetConfirm() {
});
await this.$store.dispatch('reset');
}
+
+export async function fetchAuctions(handler) {
+ const { state: { sdk: sdkPromise }, getters: { currentNetwork } } = this.$store;
+ const sdk = await Promise.resolve(sdkPromise);
+ const res = await sdk.middleware2.api.getNamesAuctions({ limit: 100 });
+ let { next } = res;
+ handler(res.data);
+ while (next) {
+ const url = currentNetwork.middlewareUrl + next;
+ const r = sdk.middleware2.responseInterceptor(
+ // eslint-disable-next-line no-await-in-loop
+ await Swagger.serializeRes(await fetch(url), url),
+ ).body;
+ handler(r.data);
+ next = r.next;
+ }
+ handler();
+}
diff --git a/src/lib/networksRegistry.js b/src/lib/networksRegistry.js
index cd51f7b51..dab2269fe 100644
--- a/src/lib/networksRegistry.js
+++ b/src/lib/networksRegistry.js
@@ -1,12 +1,12 @@
const mainNetwork = {
- name: `${Date.now() < 1715072400000 ? 'Iris' : 'Ceres'}-net`,
+ name: 'Ceres-net',
url: 'https://mainnet.aeternity.io',
middlewareUrl: 'https://mainnet.aeternity.io/mdw',
explorerUrl: 'https://aescan.io',
};
const testNetwork = {
- name: `Testnet${Date.now() < 1713947400000 ? ' (Iris)' : ''}`,
+ name: 'Testnet',
url: 'https://testnet.aeternity.io',
middlewareUrl: 'https://testnet.aeternity.io/mdw',
explorerUrl: 'https://testnet.aescan.io',
diff --git a/src/locales/cn.json b/src/locales/cn.json
index dbef90d65..6424fe4e9 100644
--- a/src/locales/cn.json
+++ b/src/locales/cn.json
@@ -440,7 +440,7 @@
"personal-explanation": "点击“+”按钮来申请并与您的帐号关联.",
"no-auctions": "There are no auctions matching these criteria.",
"registered": "注册名称",
- "active-bids": "Active Bids"
+ "active-auctions": "Active Auctions"
},
"details": {
@@ -476,8 +476,8 @@
"confirm-transfering-to-same-account": "The account you are transferring to and the account, which owns the name you are transferring, are the same account. Are you sure you would like to complete this transaction?",
"notification":{
- "succeed": "{name} was successfully transfered",
- "failed": "{name} was not transfered for unknown reason"
+ "succeed": "{name} was successfully transferred",
+ "failed": "{name} was not transferred for unknown reason"
}
},
diff --git a/src/locales/en.json b/src/locales/en.json
index a2b74b94f..a89e682ba 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -440,7 +440,7 @@
"personal-explanation": "Tap the “+” button below to claim a name and associate it with one of your accounts.",
"no-auctions": "There are no auctions matching these criteria.",
"registered": "Registered Names",
- "active-bids": "Active Bids"
+ "active-auctions": "Active Auctions"
},
"details": {
@@ -476,8 +476,8 @@
"confirm-transfering-to-same-account": "The account you are transferring to and the account, which owns the name you are transferring, are the same account. Are you sure you would like to complete this transaction?",
"notification":{
- "succeed": "{name} was successfully transfered",
- "failed": "{name} was not transfered for unknown reason"
+ "succeed": "{name} was successfully transferred",
+ "failed": "{name} was not transferred for unknown reason"
}
},
diff --git a/src/locales/es.json b/src/locales/es.json
index 0fc12014b..c7b537f60 100644
--- a/src/locales/es.json
+++ b/src/locales/es.json
@@ -440,7 +440,7 @@
"personal-explanation": "Toque el botón “+” a continuación para reclamar un nombre y asociarlo con una de sus cuentas",
"no-auctions": "There are no auctions matching these criteria.",
"registered": "Nombres registrados",
- "active-bids": "Active Bids"
+ "active-auctions": "Active Auctions"
},
"details": {
@@ -476,8 +476,8 @@
"confirm-transfering-to-same-account": "The account you are transferring to and the account, which owns the name you are transferring, are the same account. Are you sure you would like to complete this transaction?",
"notification":{
- "succeed": "{name} was successfully transfered",
- "failed": "{name} was not transfered for unknown reason"
+ "succeed": "{name} was successfully transferred",
+ "failed": "{name} was not transferred for unknown reason"
}
},
diff --git a/src/locales/ru.json b/src/locales/ru.json
index 136d2135c..c40c814f2 100644
--- a/src/locales/ru.json
+++ b/src/locales/ru.json
@@ -440,7 +440,7 @@
"personal-explanation": "Нажмите кнопку «+» ниже, чтобы запросить имя и связать его с одним из ваших аккаунтов.",
"no-auctions": "Нет аукционов, соответствующих этим критериям.",
"registered": "Зарегистрированные имена",
- "active-bids": "Активные ставки"
+ "active-auctions": "Активные аукционы"
},
"details": {
diff --git a/src/pages/aens/AuctionBid.vue b/src/pages/aens/AuctionBid.vue
index 3135a505c..83fb29304 100644
--- a/src/pages/aens/AuctionBid.vue
+++ b/src/pages/aens/AuctionBid.vue
@@ -41,7 +41,7 @@
v-validate="{
required: true,
decimal: MAGNITUDE,
- min_value_currency: lastBid ? lastBid.multipliedBy(1.05).toString() : 0,
+ min_value_currency: highestBid ? highestBid.multipliedBy(1.05).toString() : 0,
}"
:error="errors.has('amount')"
:footer="errors.first('amount') && errors.first('amount').toString() || ' '"
@@ -52,23 +52,23 @@
{{ $t('next') }}
@@ -108,8 +108,8 @@ export default {
return {
busy: false,
internalName: this.name,
- lastBid: null,
- auctionEnd: 0,
+ highestBid: null,
+ endsAt: 0,
amount: '',
MAGNITUDE,
};
@@ -117,10 +117,10 @@ export default {
computed: {
...mapGetters('accounts', ['activeColor']),
backTo() {
- if (!this.name && !this.auctionEnd) return { name: 'name-list' };
+ if (!this.name && !this.endsAt) return { name: 'name-list' };
return {
name: 'auction-bid',
- params: { name: this.auctionEnd ? this.internalName : this.name },
+ params: { name: this.endsAt ? this.internalName : this.name },
};
},
},
@@ -134,14 +134,11 @@ export default {
(name) => {
if (promise) promise.cancel();
promise = (async () => {
- this.auctionEnd = 0;
- this.lastBid = null;
- const sdk = await Promise.resolve(this.$store.state.sdk);
- const res = await sdk.middleware.api.getNameById(name);
- if (res.status !== 'auction') throw new Error(`Unexpected name status: ${res.status}`);
- const { auctionEnd, lastBid } = res.info;
- this.auctionEnd = auctionEnd;
- this.lastBid = new BigNumber(lastBid.tx.nameFee).shiftedBy(-MAGNITUDE);
+ this.endsAt = 0;
+ this.highestBid = null;
+ const { endsAt, highestBid } = await this.$store.getters.node.getAuctionEntryByName(name);
+ this.endsAt = endsAt;
+ this.highestBid = new BigNumber(highestBid).shiftedBy(-MAGNITUDE);
})();
},
{ immediate: true },
diff --git a/src/pages/aens/AuctionDetails.vue b/src/pages/aens/AuctionDetails.vue
index bf5cac3c1..2781b8026 100644
--- a/src/pages/aens/AuctionDetails.vue
+++ b/src/pages/aens/AuctionDetails.vue
@@ -13,7 +13,7 @@
{{ $t('name.expiration') }}
- {{ blocksToRelativeTime(auctionEnd - topBlockHeight) }}
+ {{ blocksToRelativeTime(endsAt - topBlockHeight) }}
{{ $t('name.details.current-bid') }}
@@ -44,7 +44,7 @@
diff --git a/src/pages/aens/NameDetails.vue b/src/pages/aens/NameDetails.vue
index 5614f0ca3..fdb404f80 100644
--- a/src/pages/aens/NameDetails.vue
+++ b/src/pages/aens/NameDetails.vue
@@ -37,7 +37,7 @@
diff --git a/src/pages/aens/NameNew.vue b/src/pages/aens/NameNew.vue
index 5c736164d..f7f5bb765 100644
--- a/src/pages/aens/NameNew.vue
+++ b/src/pages/aens/NameNew.vue
@@ -74,15 +74,13 @@ export default {
let claimTxHash;
try {
- const { status } = await this.$store.state.sdk.middleware.api.getNameById(this.name);
- if (status === 'auction') {
- await this.$store.dispatch('modals/open', {
- name: 'confirm',
- text: this.$t('name.new.confirm-bidding', { name: this.name }),
- });
- this.$router.push({ name: 'auction-bid-amount', params: { name: this.name } });
- return;
- }
+ await this.$store.getters.node.getAuctionEntryByName(this.name);
+ await this.$store.dispatch('modals/open', {
+ name: 'confirm',
+ text: this.$t('name.new.confirm-bidding', { name: this.name }),
+ });
+ this.$router.push({ name: 'auction-bid-amount', params: { name: this.name } });
+ return;
} catch (e) {
if (e.message === 'Cancelled by user') {
this.busy = false;
diff --git a/src/pages/aens/NameTransfer.vue b/src/pages/aens/NameTransfer.vue
index 337762da0..79f8c0b3b 100644
--- a/src/pages/aens/NameTransfer.vue
+++ b/src/pages/aens/NameTransfer.vue
@@ -61,6 +61,7 @@