Skip to content
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
11 changes: 11 additions & 0 deletions packages/@magic-ext/bitcoin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ export class BitcoinExtension extends MultichainExtension<'bitcoin'> {
* inputs (the UTXOs to spend, each with its value) and outputs; coin selection,
* fee, and change are the caller's responsibility. Resolves with the
* broadcast-ready signed transaction.
*
* Input and output values are non-negative BTC amounts with at most eight
* decimal places; tiny floating-point arithmetic errors (up to 0.001 sat)
* are tolerated. Calculate fees and change in integer satoshis, then convert
* to BTC for this method. Total outputs must not exceed total inputs; the
* difference is the fee. There is no minimum or maximum
* signing fee, and no dust threshold is enforced. The caller must check the
* fee rate (sats/vB) and output amounts against the broadcasting node's
* policy. Signing does not guarantee relay, confirmation, or UTXO availability.
* Invalid transaction parameters reject with a MagicRPCError describing the
* validation failure.
*/
public async signTransaction(
inputs: BitcoinTransactionInput[],
Expand Down
6 changes: 3 additions & 3 deletions packages/@magic-ext/bitcoin/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export enum BitcoinPayloadMethod {
}

/**
* A UTXO to spend. `value` is in BTC (not satoshis) and is required: the enclave
* needs each input's value to compute its segwit (BIP143) sighash. `tx_num` is
* A UTXO to spend. `value` is in BTC (not satoshis), with at most eight decimal
* places. The enclave needs this value to compute its segwit (BIP143) sighash. `tx_num` is
* the output index (vout) of the UTXO within its source transaction.
*/
export interface BitcoinTransactionInput {
Expand All @@ -19,7 +19,7 @@ export interface BitcoinTransactionInput {
address?: string;
}

/** A transaction output. `value` is in BTC (not satoshis). */
/** A transaction output. `value` is in BTC with at most eight decimal places. */
export interface BitcoinTransactionOutput {
address: string;
value: number;
Expand Down
66 changes: 33 additions & 33 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2980,50 +2980,50 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/bitcoin@workspace:packages/@magic-ext/bitcoin"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
languageName: unknown
linkType: soft

"@magic-ext/cosmos@workspace:packages/@magic-ext/cosmos":
version: 0.0.0-use.local
resolution: "@magic-ext/cosmos@workspace:packages/@magic-ext/cosmos"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
languageName: unknown
linkType: soft

"@magic-ext/evm@workspace:packages/@magic-ext/evm":
version: 0.0.0-use.local
resolution: "@magic-ext/evm@workspace:packages/@magic-ext/evm"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
languageName: unknown
linkType: soft

"@magic-ext/farcaster@workspace:packages/@magic-ext/farcaster":
version: 0.0.0-use.local
resolution: "@magic-ext/farcaster@workspace:packages/@magic-ext/farcaster"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
languageName: unknown
linkType: soft

"@magic-ext/gdkms@workspace:packages/@magic-ext/gdkms":
version: 0.0.0-use.local
resolution: "@magic-ext/gdkms@workspace:packages/@magic-ext/gdkms"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
languageName: unknown
linkType: soft

"@magic-ext/hedera@workspace:packages/@magic-ext/hedera":
version: 0.0.0-use.local
resolution: "@magic-ext/hedera@workspace:packages/@magic-ext/hedera"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
peerDependencies:
"@hashgraph/sdk": ^2.31.0
languageName: unknown
Expand All @@ -3033,7 +3033,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/oauth2@workspace:packages/@magic-ext/oauth2"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
"@types/crypto-js": 4.2.0
crypto-js: ^4.2.0
languageName: unknown
Expand All @@ -3043,16 +3043,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/passkey@workspace:packages/@magic-ext/passkey"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
languageName: unknown
linkType: soft

"@magic-ext/react-native-bare-oauth@workspace:packages/@magic-ext/react-native-bare-oauth":
version: 0.0.0-use.local
resolution: "@magic-ext/react-native-bare-oauth@workspace:packages/@magic-ext/react-native-bare-oauth"
dependencies:
"@magic-sdk/react-native-bare": ^34.11.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/react-native-bare": ^34.12.0
"@magic-sdk/types": ^27.13.0
"@types/crypto-js": 4.2.0
crypto-js: ^4.2.0
react-native-inappbrowser-reborn: ^3.7.0
Expand All @@ -3066,8 +3066,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/react-native-expo-oauth@workspace:packages/@magic-ext/react-native-expo-oauth"
dependencies:
"@magic-sdk/react-native-expo": ^34.11.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/react-native-expo": ^34.12.0
"@magic-sdk/types": ^27.13.0
"@react-native-async-storage/async-storage": ^2.1.2
"@types/crypto-js": ~4.2.0
crypto-js: ^4.2.0
Expand All @@ -3083,7 +3083,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/siwe@workspace:packages/@magic-ext/siwe"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
"@signinwithethereum/siwe": ^4.1.0
ethers: ^6.0.0
peerDependencies:
Expand All @@ -3095,16 +3095,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/smart-account@workspace:packages/@magic-ext/smart-account"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
languageName: unknown
linkType: soft

"@magic-ext/solana@workspace:packages/@magic-ext/solana":
version: 0.0.0-use.local
resolution: "@magic-ext/solana@workspace:packages/@magic-ext/solana"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
"@solana/web3.js": ^1.87.2
peerDependencies:
"@solana/web3.js": ^1.87.2
Expand All @@ -3115,8 +3115,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/wallet-kit@workspace:packages/@magic-ext/wallet-kit"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
"@magiclabs/ui-components": ^2.3.0
"@reown/appkit": ^1.8.0
"@reown/appkit-adapter-wagmi": ^1.8.0
Expand Down Expand Up @@ -3150,16 +3150,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "@magic-ext/webauthn@workspace:packages/@magic-ext/webauthn"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/provider": ^33.13.0
languageName: unknown
linkType: soft

"@magic-sdk/provider@^33.12.0, @magic-sdk/provider@workspace:packages/@magic-sdk/provider":
"@magic-sdk/provider@^33.13.0, @magic-sdk/provider@workspace:packages/@magic-sdk/provider":
version: 0.0.0-use.local
resolution: "@magic-sdk/provider@workspace:packages/@magic-sdk/provider"
dependencies:
"@babel/plugin-transform-modules-commonjs": ^7.9.6
"@magic-sdk/types": ^27.12.0
"@magic-sdk/types": ^27.13.0
eventemitter3: ^4.0.4
localforage: ^1.7.4
tslib: ^2.3.1
Expand All @@ -3168,13 +3168,13 @@ __metadata:
languageName: unknown
linkType: soft

"@magic-sdk/react-native-bare@^34.11.0, @magic-sdk/react-native-bare@workspace:packages/@magic-sdk/react-native-bare":
"@magic-sdk/react-native-bare@^34.12.0, @magic-sdk/react-native-bare@workspace:packages/@magic-sdk/react-native-bare":
version: 0.0.0-use.local
resolution: "@magic-sdk/react-native-bare@workspace:packages/@magic-sdk/react-native-bare"
dependencies:
"@aveq-research/localforage-asyncstorage-driver": ^3.0.1
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
"@magiclabs/react-native-device-crypto": ^0.1.1
"@react-native-async-storage/async-storage": ^2.1.2
"@react-native-community/netinfo": ">11.0.0"
Expand Down Expand Up @@ -3209,13 +3209,13 @@ __metadata:
languageName: unknown
linkType: soft

"@magic-sdk/react-native-expo@^34.11.0, @magic-sdk/react-native-expo@workspace:packages/@magic-sdk/react-native-expo":
"@magic-sdk/react-native-expo@^34.12.0, @magic-sdk/react-native-expo@workspace:packages/@magic-sdk/react-native-expo":
version: 0.0.0-use.local
resolution: "@magic-sdk/react-native-expo@workspace:packages/@magic-sdk/react-native-expo"
dependencies:
"@aveq-research/localforage-asyncstorage-driver": ^3.0.1
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
"@react-native-async-storage/async-storage": ^1.15.5
"@react-native-community/netinfo": ">11.0.0"
"@react-native/assets-registry": ^0.78.2
Expand Down Expand Up @@ -3249,7 +3249,7 @@ __metadata:
languageName: unknown
linkType: soft

"@magic-sdk/types@^27.12.0, @magic-sdk/types@workspace:packages/@magic-sdk/types":
"@magic-sdk/types@^27.13.0, @magic-sdk/types@workspace:packages/@magic-sdk/types":
version: 0.0.0-use.local
resolution: "@magic-sdk/types@workspace:packages/@magic-sdk/types"
languageName: unknown
Expand Down Expand Up @@ -17814,8 +17814,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "magic-sdk@workspace:packages/magic-sdk"
dependencies:
"@magic-sdk/provider": ^33.12.0
"@magic-sdk/types": ^27.12.0
"@magic-sdk/provider": ^33.13.0
"@magic-sdk/types": ^27.13.0
localforage: ^1.7.4
languageName: unknown
linkType: soft
Expand Down
Loading