-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from algorandfoundation/chore/avm-provider-ENG…
…-510 chore(demo): add basic avm-provider
- Loading branch information
Showing
14 changed files
with
366 additions
and
282 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { MessageState } from "@/store.ts"; | ||
import Card from "@mui/material/Card"; | ||
import { CardHeader } from "@mui/material"; | ||
import Typography from "@mui/material/Typography"; | ||
import CardContent from "@mui/material/CardContent"; | ||
|
||
export function ArcMessage(state: MessageState) { | ||
return ( | ||
<Card sx={{ flex: 1, margin: 1.25 }} raised> | ||
<CardHeader | ||
title={state.message.reference} | ||
subheader={state.message.id} | ||
/> | ||
<CardContent> | ||
<Typography variant="h5" color="text.secondary"> | ||
{state.status} | ||
</Typography> | ||
<Typography variant="body1" color="text.secondary"> | ||
{JSON.stringify(state.message)} | ||
</Typography> | ||
</CardContent> | ||
</Card> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {decode} from 'cbor-x' | ||
import { decodeUnsignedTransaction } from "algosdk"; | ||
import { IARC0001Transaction, ResponseMessage, Results, fromBase64Url } from "@algorandfoundation/provider"; | ||
|
||
export function attachEncodedSignature(address: string, txn: string, signature: string){ | ||
return decodeUnsignedTransaction(fromBase64Url(txn)) | ||
.attachSignature(address, fromBase64Url(signature)); | ||
} | ||
|
||
export function attachSignedTransactionsFromResult(address: string, result: Results, txns: IARC0001Transaction[]){ | ||
let stxns = []; | ||
for(let i = 0; i < txns.length; i++){ | ||
stxns.push(attachEncodedSignature(address, txns[i].txn, result.stxns[i]!!)) | ||
} | ||
return stxns | ||
} | ||
|
||
export function fromResult(result: string): ResponseMessage { | ||
return decode(fromBase64Url(result)) as ResponseMessage | ||
} | ||
|
Oops, something went wrong.