Skip to content

Commit

Permalink
debounc bitauth link
Browse files Browse the repository at this point in the history
  • Loading branch information
2qx committed Aug 17, 2023
1 parent 1e9d8f0 commit 520e503
Show file tree
Hide file tree
Showing 8 changed files with 596 additions and 13 deletions.
10 changes: 5 additions & 5 deletions packages/app/src/lib/Contract.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@
const throttleUpdate = throttle(3000, async () => {
await updateBalance();
});
},{ noLeading: true, noTrailing: false });
beforeUpdate(async () => {
// This fixes a bug related to the contract switch where old contracts appear
if (instanceType && instanceType !== instance.artifact.contractName) instance = undefined;
await throttleUpdate();
if (!bitauth) {
bitauth = await instance.execute(undefined, undefined, undefined, true);
}
});
const updateBalance = async () => {
if (instance) balance = await instance.getBalance();
isFunded = balance > 0 ? true : false;
if (bitauth.length==0) {
bitauth = await instance.execute(undefined, undefined, undefined, true);
}
if (instance.contract.name === 'Annuity' || instance.contract.name === 'Perpetuity') {
if (showSeries) {
updateSeries();
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/routes/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const prerender = true;
export const ssr = false;
export async function load({ url }) {
let splash = false;
if (url.pathname === '/docs') splash = true;
if (url.pathname === '/documentation') splash = true;
let isLocal =
url.hostname.includes('localhost') || url.hostname.includes('127.0.0.1') ? true : false;
let isDevelopment = url.hostname.includes('unspent.dev') ? true : false;
Expand Down
9 changes: 6 additions & 3 deletions packages/app/src/routes/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ layout: splash

> Rich people got money and didn't spend it.
If a rich person is defined as someone who made money and didn't spend it, then the goal of this app is to make **every** everyone that use's it **rich**. It works by giving anyone in the world access to a method to save money for regular distribution over a long period of time. The core feature is a trustless irrevocable contract that anyone can customize and publish themselves.
If a rich person is defined as someone who made money and didn't spend it, then the goal of this app is to make **everybody** that uses it **rich**. It works by giving anyone in the world access to a method to save money for regular distribution over a long period of time. The core feature is a trustless irrevocable contract that anyone can customize, publish and fund themselves.

There are no fiat prices, no markets. Nothing is traded. All contracts are single party and do not co-mingle funds. Nor do contracts rely on outside data.

Expand All @@ -23,7 +23,7 @@ Once you have a Bitcoin Cash wallet, find some way to add some funds to your wal

Any funds sent to the deposit address at an exchange or third-party institution that represent some stake or interest in as a ledger entry in an omnibus account should be assumed lost forever. (Apps that hold user funds in omnibus (grouped) accounts, are not even custodial)

# Design a plan
# Design a Plan

The Unspent Phi Perpetuity contract is like a clear drop safe with a simple crank lever.

Expand All @@ -41,8 +41,11 @@ Once your plan looks right, hit the publish button.

![broadcast](images/broadcast.png "Broadcast Button")

This action should publish the details of the contract, including the parameters to unlock it and a checksum.

You may verify in a block explorer that the details were recorded.

# Fund your contract

That's it.
That's it. You won!

4 changes: 2 additions & 2 deletions packages/app/src/routes/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<path d="M0,0 L1,2 C1.5,3 1.5,3 2,3 L2,0 Z" />
</svg>
<ul>
<li class:active={$page.url.pathname.startsWith('/docs')}>
<a href="{base}/docs">Docs</a>
<li class:active={$page.url.pathname.startsWith('/documentation')}>
<a href="{base}/documentation">Docs</a>
</li>
<li class:active={$page.url.pathname === '/earn'}>
<a href="{base}/earn">Earn</a>
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/routes/documentation/+page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const prerender = true;
export const ssr = false;
Loading

0 comments on commit 520e503

Please sign in to comment.