@dfinity/ckbtc 0.0.7-next-2023-07-03 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -9
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -74,17 +74,11 @@ Parameters:
|
|
|
74
74
|
- `params`: The Bitcoin address and network to parse
|
|
75
75
|
- `params.network`: Optional. Default BtcNetwork is Mainnet
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
#### Constructors
|
|
80
|
-
|
|
81
|
-
`public`
|
|
77
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/utils/btc.utils.ts#L194)
|
|
82
78
|
|
|
83
|
-
|
|
79
|
+
### :factory: CkBTCMinterCanister
|
|
84
80
|
|
|
85
|
-
-
|
|
86
|
-
- `service`
|
|
87
|
-
- `certifiedService`
|
|
81
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L33)
|
|
88
82
|
|
|
89
83
|
#### Methods
|
|
90
84
|
|
|
@@ -102,6 +96,8 @@ Parameters:
|
|
|
102
96
|
| -------- | ------------------------------------------------------------------------ |
|
|
103
97
|
| `create` | `(options: CkBTCMinterCanisterOptions<_SERVICE>) => CkBTCMinterCanister` |
|
|
104
98
|
|
|
99
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L34)
|
|
100
|
+
|
|
105
101
|
##### :gear: getBtcAddress
|
|
106
102
|
|
|
107
103
|
Returns a BTC address for a given account.
|
|
@@ -118,6 +114,8 @@ Parameters:
|
|
|
118
114
|
- `params.owner`: The owner for which the BTC address should be generated. If not provided, the `caller` will be use instead.
|
|
119
115
|
- `params.subaccount`: An optional subaccount to compute the address.
|
|
120
116
|
|
|
117
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L55)
|
|
118
|
+
|
|
121
119
|
##### :gear: updateBalance
|
|
122
120
|
|
|
123
121
|
Notify the minter about the bitcoin transfer.
|
|
@@ -134,6 +132,8 @@ Parameters:
|
|
|
134
132
|
- `params.owner`: The owner of the address. If not provided, the `caller` will be use instead.
|
|
135
133
|
- `params.subaccount`: An optional subaccount of the address.
|
|
136
134
|
|
|
135
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L74)
|
|
136
|
+
|
|
137
137
|
##### :gear: getWithdrawalAccount
|
|
138
138
|
|
|
139
139
|
Returns the account to which the caller should deposit ckBTC before withdrawing BTC using the [retrieveBtc] endpoint.
|
|
@@ -142,6 +142,8 @@ Returns the account to which the caller should deposit ckBTC before withdrawing
|
|
|
142
142
|
| ---------------------- | ------------------------ |
|
|
143
143
|
| `getWithdrawalAccount` | `() => Promise<Account>` |
|
|
144
144
|
|
|
145
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L97)
|
|
146
|
+
|
|
145
147
|
##### :gear: retrieveBtc
|
|
146
148
|
|
|
147
149
|
Submits a request to convert ckBTC to BTC.
|
|
@@ -164,6 +166,8 @@ Parameters:
|
|
|
164
166
|
- `params.address`: The bitcoin address.
|
|
165
167
|
- `params.amount`: The ckBTC amount.
|
|
166
168
|
|
|
169
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L116)
|
|
170
|
+
|
|
167
171
|
##### :gear: estimateWithdrawalFee
|
|
168
172
|
|
|
169
173
|
Returns an estimation of the user's fee (in Satoshi) for a retrieve_btc request based on the current status of the Bitcoin network and the fee related to the minter.
|
|
@@ -178,6 +182,8 @@ Parameters:
|
|
|
178
182
|
- `params.certified`: query or update call
|
|
179
183
|
- `params.amount`: The optional amount for which the fee should be estimated.
|
|
180
184
|
|
|
185
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L135)
|
|
186
|
+
|
|
181
187
|
##### :gear: getMinterInfo
|
|
182
188
|
|
|
183
189
|
Returns internal minter parameters such as the minimal amount to retrieve BTC, minimal number of confirmations or KYT fee.
|
|
@@ -191,6 +197,8 @@ Parameters:
|
|
|
191
197
|
- `params`: The parameters to get the deposit fee.
|
|
192
198
|
- `params.certified`: query or update call
|
|
193
199
|
|
|
200
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ckbtc/src/minter.canister.ts#L149)
|
|
201
|
+
|
|
194
202
|
<!-- TSDOC_END -->
|
|
195
203
|
|
|
196
204
|
## Resources
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfinity/ckbtc",
|
|
3
|
-
"version": "0.0.7
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "A library for interfacing with ckBTC.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/cjs/index.cjs.js",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
],
|
|
39
39
|
"homepage": "https://github.com/dfinity/ic-js#readme",
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@dfinity/agent": "
|
|
42
|
-
"@dfinity/candid": "
|
|
43
|
-
"@dfinity/principal": "
|
|
44
|
-
"@dfinity/utils": "
|
|
41
|
+
"@dfinity/agent": "^0.15.4",
|
|
42
|
+
"@dfinity/candid": "^0.15.4",
|
|
43
|
+
"@dfinity/principal": "^0.15.4",
|
|
44
|
+
"@dfinity/utils": "^0.0.18"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"base58-js": "^1.0.5",
|
|
48
48
|
"bech32": "^2.0.0",
|
|
49
49
|
"js-sha256": "^0.9.0"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|