@@ -4,16 +4,11 @@ import * as need from 'lib/need';
4import * as ob from 'urbit-ob';
4import * as ob from 'urbit-ob';
5import * as wg from 'lib/walletgen';
5import * as wg from 'lib/walletgen';
7−import { addHexPrefix } from 'lib/utils/address';
8import { convertToInt } from './convertToInt';
7import { convertToInt } from './convertToInt';
9import { ensureHexPrefix } from 'form/formatters';
8import { ensureHexPrefix } from 'form/formatters';
10import { getOutgoingPoints, maybeGetResult } from 'views/Points';
9import { getOutgoingPoints, maybeGetResult } from 'views/Points';
11−import { getTimeToNextBatch } from './utils/roller';
12−import { Invite } from 'types/Invite';
13import { isDevelopment, isRopsten } from './flags';
10import { isDevelopment, isRopsten } from './flags';
14import { isPlanet } from './utils/point';
11import { isPlanet } from './utils/point';
15−import { Just } from 'folktale/maybe';
16−import { randomHex } from 'web3-utils';
17import { ROLLER_HOSTS } from './constants';
12import { ROLLER_HOSTS } from './constants';
18import { signTransactionHash } from './authToken';
13import { signTransactionHash } from './authToken';
19import { useNetwork } from 'store/network';
14import { useNetwork } from 'store/network';
@@ -23,7 +18,6 @@ import { useRollerStore } from 'store/roller';
23import { useWallet } from 'store/wallet';
18import { useWallet } from 'store/wallet';
26− attemptNetworkSeedDerivation,
27 deriveNetworkKeys,
21 deriveNetworkKeys,
28 CRYPTO_SUITE_VERSION,
22 CRYPTO_SUITE_VERSION,
29 deriveNetworkSeedFromUrbitWallet,
23 deriveNetworkSeedFromUrbitWallet,
@@ -42,105 +36,19 @@ import {
43} from '@urbit/roller-api';
37} from '@urbit/roller-api';
44+} from './utils/roller';
46 getStoredInvites,
47 getStoredInvites,
47 setPendingInvites,
48 setPendingInvites,
48 setStoredInvites,
49 setStoredInvites,
49} from 'store/storage/roller';
50} from 'store/storage/roller';
60− ship: _point, //ship that is spawning the planet
65− address: _wallet.address,
66− ship: planet, // ship to spawn
69− const hash = await api.hashTransaction(nonce, from, 'spawn', data);
70− const sSig = signTransactionHash(hash, _wallet.privateKey);
71− return api.spawn(sSig, from, _wallet.address, data);
74−const configureKeys = async (
82− authMnemonic: string,
87− ship: _point, //ship that is spawning the planet
91− const networkSeed = await attemptNetworkSeedDerivation({
101− const seed = Just.hasInstance(networkSeed)
105− const pair = deriveNetworkKeys(seed);
108− encrypt: addHexPrefix(pair.crypt.public),
109− auth: addHexPrefix(pair.auth.public),
110− cryptoSuite: String(CRYPTO_SUITE_VERSION),
114− const hash = await api.hashTransaction(nonce, from, 'configureKeys', data);
115− const sig = signTransactionHash(hash, _wallet.privateKey);
116− return api.configureKeys(sig, from, _wallet.address, data);
119−const transferPoint = async (
128− ship: _point, //ship that is spawning the planet
137− const hash = await api.hashTransaction(nonce, from, 'transferPoint', data);
138− const sig = signTransactionHash(hash, _wallet.privateKey);
139− return api.transferPoint(sig, from, _wallet.address, data);
142−const hasPoint = (point: number) => (invite: Invite) => invite.planet === point;
144const getProxyAndNonce = (
52const getProxyAndNonce = (
145 point: L2Point,
53 point: L2Point,
146 address: string
54 address: string
@@ -277,7 +185,7 @@ export default function useRoller() {
277 const transferPointRequest = await transferPoint(
185 const transferPointRequest = await transferPoint(
282 nonceInc + 2,
190 nonceInc + 2,
283 owner.keys.address
191 owner.keys.address