Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reserved Name Claims #357

Merged
merged 14 commits into from
Aug 19, 2021
Merged
2 changes: 2 additions & 0 deletions app/background/node/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ export const clientStub = ipcRendererInjector => makeClient(ipcRendererInjector,
'getDir',
'getAPIKey',
'getHNSPrice',
'getDNSSECProof',
'sendRawClaim',
]);
10 changes: 10 additions & 0 deletions app/background/node/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ export class NodeService extends EventEmitter {
}
}

async getDNSSECProof(url) {
return this._execRPC('getdnssecproof', [url, true]);
}

async sendRawClaim(base64) {
return this._execRPC('sendrawclaim', [base64]);
}

async _ensureStarted() {
return new Promise((resolve, reject) => {
if (this.client) {
Expand Down Expand Up @@ -430,6 +438,8 @@ const methods = {
setNoDns: data => service.setNoDns(data),
getDir: () => service.getDir(),
getHNSPrice: () => service.getHNSPrice(),
getDNSSECProof: (url) => service.getDNSSECProof(url),
sendRawClaim: (base64) => service.sendRawClaim(base64),
};

export async function start(server) {
Expand Down
2 changes: 2 additions & 0 deletions app/background/wallet/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ export const clientStub = ipcRendererInjector => makeClient(ipcRendererInjector,
'rpcGetWalletInfo',
'listWallets',
'getStats',
'createClaim',
'sendClaim',
]);
14 changes: 14 additions & 0 deletions app/background/wallet/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,18 @@ class WalletService {
return value - amount;
};

createClaim = (name) => this._ledgerProxy(
() => this._executeRPC('createclaim', [name]),
() => this._executeRPC('createclaim', [name]),
false
);

sendClaim = (name) => this._ledgerProxy(
() => this._executeRPC('sendclaim', [name]),
() => this._executeRPC('sendclaim', [name]),
false
);

sendOpen = (name) => this._ledgerProxy(
() => this._executeRPC('createopen', [name]),
() => this._executeRPC('sendopen', [name], this.lock),
Expand Down Expand Up @@ -1386,6 +1398,8 @@ const methods = {
rpcGetWalletInfo: service.rpcGetWalletInfo,
listWallets: service.listWallets,
getStats: service.getStats,
createClaim: service.createClaim,
sendClaim: service.sendClaim,
};

export async function start(server) {
Expand Down
13 changes: 12 additions & 1 deletion app/components/Modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,22 @@ class Modal extends Component {
className: '',
};

onClose = e => {
const selected = window.getSelection().toString();
if (selected || !this.props.onClose) {
return;
}
this.props.onClose();
};

render() {
const { className, onClose, children } = this.props;

return ReactDOM.createPortal(
<div className="modal__overlay" onClick={onClose}>
<div
className="modal__overlay"
onClick={this.onClose}
>
<div className={`modal__wrapper ${className}`} onClick={e => e.stopPropagation()}>
{children}
</div>
Expand Down
Loading