Closed: BNT-6 - Point-of-Sale Payment Dapp

Would be amazing if we could add paying with NFC from a phone as well for a future bounty.

Forgot to mention that is now live: https://icrc-api.internetcomputer.org/api/v1/ledgers/mc6ru-gyaaa-aaaar-qaaaq-cai

3 Likes

Fun idea! Could even work without a native app: Web NFC API - Web APIs | MDN

But this bounty was purposefully low-tech :slight_smile:

3 Likes

Hey! I wanted to share a short update of Ez-POS, work still in progress.



Most features work, the major thing that remains are the async notifications. But I don’t see that as a big blocker. Then there are some minor UI issues and some codebase cleanup and documentation left. Oh, and QR scanning remains also.

Try it out and send any feedback my way! Frontend is deployed here: https://hngac-6aaaa-aaaal-qb6tq-cai.icp0.io/

Is the 9th a hard deadline? I might have a difficult time meeting it as I have some family vacation planned since long this week and next.

4 Likes

We’d be open to extending the deadline for another week.

1 Like

Great, thanks! I found some time today and updated the UI wit QR scanning etc. I believe it covers all aspects of the spec now. Background notifications only thing that remains.

Two questions:

it is published! ic_ledger_types - Rust

1 Like

I believe that is for the main IC ledger, not for the ckBTC/ICRC ledger.

icp ledger also follows icrc1 standard. so this will work for sure.

I mean these types, for instance the response to get_transactions:

#[derive(CandidType, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct GetTransactionsResponse {
    pub log_length: Nat,
    pub first_index: BlockIndex,
    pub transactions: Vec<Transaction>,
    pub archived_transactions: Vec<ArchivedRange<QueryTxArchiveFn>>,
}

Or the transaction object itself:

#[derive(CandidType, Deserialize, Clone, Debug, PartialEq, Eq)]
pub struct Transaction {
    pub kind: String,
    pub mint: Option<Mint>,
    pub burn: Option<Burn>,
    pub transfer: Option<Transfer>,
    pub approve: Option<Approve>,
    pub transfer_from: Option<TransferFrom>,
    pub timestamp: u64,
}

But it is cool, types don’t need to be on crates.io, I guess they can be imported from GitHub.

Update: We extended the deadline by one week.

One other thing to add. It would be very helpful if you could record a quick video walkthrough when you’re ready.

oh yeah, if you’re looking for this, it’s not available. I think these are only exclusive for ckbtc at the moment.

I checked with the dashboard team. It should take 90s max, and they identified what’s causing the latency and will fix it.

Still considerably longer than fetching from the canister direclty.

1 Like

This was a fun project to build, got to learn some Motoko in the process when realizing Rust canisters cannot make async calls on timer events but Motoko canisters can. :slight_smile:

I have made the ic-pos repo public, please check out the video walkthrough published below.

Live app: https://hngac-6aaaa-aaaal-qb6tq-cai.icp0.io/

GitHub: GitHub - kristoferlund/ic-pos: Accept Bitcoin payments (ckBTC) on the Internet Computer using this simple Point of Sale (POS) application.

Notes:

  • Background notifications not yet implemented. Everything but the HTTPS Outcall is in place, canister monitors all transactions and matches with configured store settings.
  • No sound on incoming payment. Forgot that.
  • ckBTC API is still slow, will consider switching back to monitoring canisters directly but uncertain if that can be done in “anonymous” mode.

Will fix these issues when back from trip, 17/7.

12 Likes

the the UI is super cool n simple.

1 Like

Looks good! The UI seems simple and includes most of the functionality mentioned in the RFP (besides the features you included in your notes). Once enabled background notifications should be a nice addition.

Hopefully, the API will speed up, so we can have near-instant notifications.

1 Like

We’re also working on an implementation. Excited to submit it soon! Big props to @kristofer for the nice submission.

2 Likes

Great job @kristofer. I like the simple design.

I hope you enjoyed learning Motoko but Rust canisters can also make async calls on timer events, see e.g. the answers in this recent thread: How to Subscribe to Ethereum Contract Events in ICP.

Enjoy your vacation!

1 Like

Awesome! Looking forward to your submission!

1 Like

Ah, nice! Did not stumble across ic_cdk::spawn while researching.

1 Like