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

feat: runes mint & etch #132

Merged
merged 10 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions example/src/components/EtchRunes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const EtchRunes = ({ addresses, network }: Props) => {
const [divisibility, setDivisibility] = useState<string>('');
const [amount, setAmount] = useState<string>('');
const [mintCap, setMintCap] = useState<string>('');
const [delegateInscription, setDelegateInscription] = useState<string>('');
const [inscriptionContentType, setInscriptionContentType] = useState<string>('');
const [inscriptionContent, setInscriptionContent] = useState<string>('');

const ordinalsAddress = useMemo(
() => addresses.find((a) => a.purpose === AddressPurpose.Ordinals)?.address || '',
Expand All @@ -35,6 +38,14 @@ const EtchRunes = ({ addresses, network }: Props) => {
symbol: symbol || undefined,
premine: preMine || undefined,
divisibility: +divisibility || undefined,
delegateInscriptionId: delegateInscription || undefined,
inscriptionDetails:
inscriptionContent && inscriptionContentType
? {
contentBase64: inscriptionContent,
contentType: inscriptionContentType,
}
: undefined,
terms:
amount || mintCap
? {
Expand All @@ -61,6 +72,14 @@ const EtchRunes = ({ addresses, network }: Props) => {
destinationAddress: ordinalsAddress,
symbol: symbol || undefined,
premine: preMine || undefined,
delegateInscriptionId: delegateInscription || undefined,
inscriptionDetails:
inscriptionContent && inscriptionContentType
? {
contentBase64: inscriptionContent,
contentType: inscriptionContentType,
}
: undefined,
terms:
amount || mintCap
? {
Expand Down Expand Up @@ -111,6 +130,30 @@ const EtchRunes = ({ addresses, network }: Props) => {
<h4>Symbol</h4>
<input type="text" value={symbol} onChange={(e) => setSymbol(e.target.value)} />
</div>
<div>
<h4>Delegate inscription</h4>
<input
type="text"
value={delegateInscription}
onChange={(e) => setDelegateInscription(e.target.value)}
/>
</div>
<div>
<h4>Inscription Content</h4>
<input
type="text"
value={inscriptionContent}
onChange={(e) => setInscriptionContent(e.target.value)}
/>
</div>
<div>
<h4>Inscription Content type</h4>
<input
type="text"
value={inscriptionContentType}
onChange={(e) => setInscriptionContentType(e.target.value)}
/>
</div>
<div>
<h4>Divisibility</h4>
<input
Expand Down
4 changes: 2 additions & 2 deletions example/src/components/MintRunes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const MintRunes = ({ addresses, network }: Props) => {
setTotalSize(response.result.totalSize);
} else {
console.error(response.error);
alert('Error Fetching Estimate. See console for details.');
alert(`Error estimating ${runeName} mint. See console for details.`);
}
};

Expand All @@ -56,7 +56,7 @@ const MintRunes = ({ addresses, network }: Props) => {
setFundTxId(response.result.fundTransactionId);
} else {
console.error(response.error);
alert('Error sending BTC. See console for details.');
alert(`Error executing ${runeName} mint. See console for details.`);
}
};

Expand Down
17 changes: 13 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
]
},
"dependencies": {
"@sats-connect/core": "0.0.11",
"@sats-connect/core": "0.0.15-c57ac78",
"@sats-connect/make-default-provider-config": "0.0.5",
"@sats-connect/ui": "0.0.6"
},
Expand Down
Loading