cardano_wallet 0.3.12 → 0.3.14
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/lib/cardano_wallet/byron.rb +35 -0
- data/lib/cardano_wallet/shelley.rb +45 -0
- data/lib/cardano_wallet/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: db8533e403d0e47ad79f2a1f747ff748da7f23f5cfb7a2f8401f8ce5d7c17bfb
         | 
| 4 | 
            +
              data.tar.gz: 7fd7466533875ca3414a28ae940eac4c0fee0543114e4b26713bdf1321689b7d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d63b186f82b6f5abd16c0e336e6a137ea2607ce911641d5270af80f791e2c83e75e5213ec16af5a5b0ad867700fcc62fd752804320bc0d03fa005ebaaf8e6f5f
         | 
| 7 | 
            +
              data.tar.gz: e18d2611da373ee8b7c2ad0702405a9d5cf51dc0badd0c744349fabbf2d4644f561d10fbb3a102a4e8a62ced3844ea74f2fbd580c992b836e0fa12fd44482fa6
         | 
    
        data/.rubocop.yml
    CHANGED
    
    
    
        data/lib/cardano_wallet/byron.rb
    CHANGED
    
    | @@ -210,6 +210,41 @@ module CardanoWallet | |
| 210 210 | 
             
                # Byron transactions
         | 
| 211 211 | 
             
                # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postByronTransactionFee
         | 
| 212 212 | 
             
                class Transactions < Base
         | 
| 213 | 
            +
                  # Construct transaction
         | 
| 214 | 
            +
                  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructByronTransaction
         | 
| 215 | 
            +
                  # @param wid [String] source wallet id
         | 
| 216 | 
            +
                  # @param payments [Array of Hashes] full payments payload with assets
         | 
| 217 | 
            +
                  # @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
         | 
| 218 | 
            +
                  # @param mint [Array of Hashes] mint object
         | 
| 219 | 
            +
                  # @param validity_interval [Hash] validity_interval object
         | 
| 220 | 
            +
                  def construct(wid, payments = nil, metadata = nil, mint = nil, validity_interval = nil)
         | 
| 221 | 
            +
                    payload = {}
         | 
| 222 | 
            +
                    payload[:payments] = payments if payments
         | 
| 223 | 
            +
                    payload[:metadata] = metadata if metadata
         | 
| 224 | 
            +
                    payload[:mint] = mint if mint
         | 
| 225 | 
            +
                    payload[:validity_interval] = validity_interval if validity_interval
         | 
| 226 | 
            +
             | 
| 227 | 
            +
                    self.class.post("/byron-wallets/#{wid}/transactions-construct",
         | 
| 228 | 
            +
                                    body: payload.to_json,
         | 
| 229 | 
            +
                                    headers: { 'Content-Type' => 'application/json' })
         | 
| 230 | 
            +
                  end
         | 
| 231 | 
            +
             | 
| 232 | 
            +
                  # Sign transaction
         | 
| 233 | 
            +
                  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signByronTransaction
         | 
| 234 | 
            +
                  # @param wid [String] source wallet id
         | 
| 235 | 
            +
                  # @param passphrase [String] wallet's passphrase
         | 
| 236 | 
            +
                  # @param passphrase [String] CBOR transaction data
         | 
| 237 | 
            +
                  def sign(wid, passphrase, transaction)
         | 
| 238 | 
            +
                    payload = {
         | 
| 239 | 
            +
                      'passphrase' => passphrase,
         | 
| 240 | 
            +
                      'transaction' => transaction
         | 
| 241 | 
            +
                    }
         | 
| 242 | 
            +
             | 
| 243 | 
            +
                    self.class.post("/byron-wallets/#{wid}/transactions-sign",
         | 
| 244 | 
            +
                                    body: payload.to_json,
         | 
| 245 | 
            +
                                    headers: { 'Content-Type' => 'application/json' })
         | 
| 246 | 
            +
                  end
         | 
| 247 | 
            +
             | 
| 213 248 | 
             
                  # Get tx by id
         | 
| 214 249 | 
             
                  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getByronTransaction
         | 
| 215 250 | 
             
                  def get(wid, tx_id)
         | 
| @@ -258,6 +258,51 @@ module CardanoWallet | |
| 258 258 | 
             
                # API for Transactions
         | 
| 259 259 | 
             
                # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Transactions
         | 
| 260 260 | 
             
                class Transactions < Base
         | 
| 261 | 
            +
                  # Construct transaction
         | 
| 262 | 
            +
                  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructTransaction
         | 
| 263 | 
            +
                  # @param wid [String] source wallet id
         | 
| 264 | 
            +
                  # @param payments [Array of Hashes] full payments payload with assets
         | 
| 265 | 
            +
                  # @param withdrawal [String or Array] 'self' or mnemonic sentence
         | 
| 266 | 
            +
                  # @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
         | 
| 267 | 
            +
                  # @param mint [Array of Hashes] mint object
         | 
| 268 | 
            +
                  # @param delegations [Array of Hashes] delegations object
         | 
| 269 | 
            +
                  # @param validity_interval [Hash] validity_interval object
         | 
| 270 | 
            +
                  def construct(wid,
         | 
| 271 | 
            +
                                payments = nil,
         | 
| 272 | 
            +
                                withdrawal = nil,
         | 
| 273 | 
            +
                                metadata = nil,
         | 
| 274 | 
            +
                                delegations = nil,
         | 
| 275 | 
            +
                                mint = nil,
         | 
| 276 | 
            +
                                validity_interval = nil)
         | 
| 277 | 
            +
                    payload = {}
         | 
| 278 | 
            +
                    payload[:payments] = payments if payments
         | 
| 279 | 
            +
                    payload[:withdrawal] = withdrawal if withdrawal
         | 
| 280 | 
            +
                    payload[:metadata] = metadata if metadata
         | 
| 281 | 
            +
                    payload[:mint] = mint if mint
         | 
| 282 | 
            +
                    payload[:delegations] = delegations if delegations
         | 
| 283 | 
            +
                    payload[:validity_interval] = validity_interval if validity_interval
         | 
| 284 | 
            +
             | 
| 285 | 
            +
                    self.class.post("/wallets/#{wid}/transactions-construct",
         | 
| 286 | 
            +
                                    body: payload.to_json,
         | 
| 287 | 
            +
                                    headers: { 'Content-Type' => 'application/json' })
         | 
| 288 | 
            +
                  end
         | 
| 289 | 
            +
             | 
| 290 | 
            +
                  # Sign transaction
         | 
| 291 | 
            +
                  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signTransaction
         | 
| 292 | 
            +
                  # @param wid [String] source wallet id
         | 
| 293 | 
            +
                  # @param passphrase [String] wallet's passphrase
         | 
| 294 | 
            +
                  # @param passphrase [String] CBOR transaction data
         | 
| 295 | 
            +
                  def sign(wid, passphrase, transaction)
         | 
| 296 | 
            +
                    payload = {
         | 
| 297 | 
            +
                      'passphrase' => passphrase,
         | 
| 298 | 
            +
                      'transaction' => transaction
         | 
| 299 | 
            +
                    }
         | 
| 300 | 
            +
             | 
| 301 | 
            +
                    self.class.post("/wallets/#{wid}/transactions-sign",
         | 
| 302 | 
            +
                                    body: payload.to_json,
         | 
| 303 | 
            +
                                    headers: { 'Content-Type' => 'application/json' })
         | 
| 304 | 
            +
                  end
         | 
| 305 | 
            +
             | 
| 261 306 | 
             
                  # Get tx by id
         | 
| 262 307 | 
             
                  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getTransaction
         | 
| 263 308 | 
             
                  def get(wid, tx_id)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cardano_wallet
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.3. | 
| 4 | 
            +
              version: 0.3.14
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Piotr Stachyra
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021-07- | 
| 11 | 
            +
            date: 2021-07-29 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: httparty
         |