Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
release: update docs for v1.0.0-beta.2 (#142)
Browse files Browse the repository at this point in the history
docs: update docs for v1.0.0-beta.2
  • Loading branch information
nattb8 authored Dec 1, 2022
1 parent 1787145 commit da434c4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
tags:
- "v*.*.*"
workflow_dispatch:

jobs:
release:
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ for new features.

### Changed

* `Signer` `signTransaction` method to `sendTransaction`
for changes in existing functionality.

### Deprecated

Expand All @@ -27,6 +27,13 @@ for now removed features.

for any bug fixes.

## [1.0.0-beta.2] - 2022-12-01

### Changed

* `Signer` `signTransaction` method to `sendTransaction`
* `StarkKey.generateLegacyStarkPrivateKey` to take in a `signer` instead of the seed and address

## [1.0.0-beta.1] - 2022-11-28

### Added
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,40 @@ Utility functions that will chain necessary API calls to complete a process or p

In order to call authorised API and use workflow functions, you will need to pass in the connected wallet provider. This means you will need to implement your own Wallet L1 [Signer](https://github.com/immutable/imx-core-sdk-kotlin-jvm/blob/main/imx-core-sdk-kotlin-jvm/src/main/kotlin/com/immutable/sdk/Signer.kt) and L2 [StarkSigner](https://github.com/immutable/imx-core-sdk-kotlin-jvm/blob/main/imx-core-sdk-kotlin-jvm/src/main/kotlin/com/immutable/sdk/Signer.kt).

#### L1 Signer

Example implementation of the L1 Signer using [web3j](https://github.com/web3j/web3j):

```kt
class L1Signer(private val credentials: Credentials) : Signer {

val web3j = Web3j.build(HttpService(NODE_URL))

override fun getAddress(): CompletableFuture<String> {
return CompletableFuture.completedFuture(credentials.address)
}

override fun signMessage(message: String): CompletableFuture<String> {
val signatureData = Sign.signPrefixedMessage(message.toByteArray(), credentials.ecKeyPair)
val retval = ByteArray(65)
System.arraycopy(signatureData.r, 0, retval, 0, 32)
System.arraycopy(signatureData.s, 0, retval, 32, 32)
System.arraycopy(signatureData.v, 0, retval, 64, 1)
val signed = Numeric.toHexString(retval)
return CompletableFuture.completedFuture(signed)
}

@Suppress("TooGenericExceptionCaught")
override fun sendTransaction(rawTransaction: RawTransaction): CompletableFuture<String> {
val signedTransaction = TransactionEncoder.signMessage(rawTransaction, credentials)
return web3j.ethSendRawTransaction(Numeric.toHexString(signedTransaction)).sendAsync()
.thenApply { it.transactionHash }
}
}
```

#### L2 StarkSigner

Use `StarkKey.generateStarkPrivateKey()` to create an instance of `StandardStarkSigner`, an implementation of `StarkSigner`.
#### 🚨🚨🚨 Warning 🚨🚨🚨
> You will have to persist the Stark private key. The key is [randomly generated](/src/utils/stark/starkCurve.ts#L99) so **_cannot_** be deterministically re-generated.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.immutable.sdk;
public class BuildConfig {
public static String VERSION = "1.0.0-beta.1";
public static String VERSION = "1.0.0-beta.2";
}
2 changes: 1 addition & 1 deletion version.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 1.0.0-beta.1
version: 1.0.0-beta.2

0 comments on commit da434c4

Please sign in to comment.