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

chore: release v1.20.0 #196

Merged
merged 55 commits into from
Nov 4, 2024
Merged

chore: release v1.20.0 #196

merged 55 commits into from
Nov 4, 2024

Conversation

fedellen
Copy link
Collaborator

@fedellen fedellen commented Oct 31, 2024

This merge PR implements delegated payments into the Turbo SDK and CLI

here are CLI examples, share Credits to a valid SOL/ETH/POL/AR/KYVE address:

node lib/esm/cli/cli.js share-credits --address 2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa --value 0.008 --wallet-file ../wallets/zarweave-keyfile-jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU_dereks.json
{
  "message": "Created credit share approval!",
  "approvalDataItemId": "pdXRmDue07mX77m7GcgAz2z0esym8H_2-hshs8H454k",
  "approvedAddress": "2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa",
  "approvedWincAmount": "8000000000",
  "creationDate": "2024-10-31T15:04:15.898Z",
  "payingAddress": "jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU",
  "usedWincAmount": "0"
}

controlled winc is reflected in balance command:

> node lib/esm/cli/cli.js balance --address jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU
Turbo Balance for Native Address "jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU"
Effective Credits: 1.9325555055
Credits Shared to Other Wallets: 0.016

list all given or received approvals:

> node lib/esm/cli/cli.js list-approvals --address jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU
{
  "message": "Credit share approvals found for native address 'jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU'",
  "givenApprovals": [
    {
      "approvalDataItemId": "mwgQ-TfeLoIzyR_C864RKaq2sZmDrx-xBFqcsbDwgDA",
      "approvedAddress": "2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa",
      "approvedWincAmount": "8000000000",
      "creationDate": "2024-10-31T14:55:46.889Z",
      "payingAddress": "jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU",
      "usedWincAmount": "0"
    },
    {
      "approvalDataItemId": "pdXRmDue07mX77m7GcgAz2z0esym8H_2-hshs8H454k",
      "approvedAddress": "2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa",
      "approvedWincAmount": "8000000000",
      "creationDate": "2024-10-31T15:04:15.898Z",
      "payingAddress": "jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU",
      "usedWincAmount": "0"
    }
  ],
  "receivedApprovals": []
}

revoke all active approvals to a given address:

> node lib/esm/cli/cli.js revoke-credits --address 2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa --wallet-file ../wallets/zarweave-keyfile-jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU_dereks.json      
{
  "message": "Revoked credit share approvals!",
  "revokedApprovals": [
    {
      "approvalDataItemId": "mwgQ-TfeLoIzyR_C864RKaq2sZmDrx-xBFqcsbDwgDA",
      "approvedAddress": "2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa",
      "approvedWincAmount": "8000000000",
      "creationDate": "2024-10-31T14:55:46.889Z",
      "payingAddress": "jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU",
      "usedWincAmount": "0",
      "inactiveReason": "revoked",
      "inactiveDate": "2024-10-31T15:08:22.317Z",
      "revokeDataItemId": "rGSmUJmYALnMTdGF-V_nnwKLjxgMpqY4neNZByQSa_U"
    },
    {
      "approvalDataItemId": "pdXRmDue07mX77m7GcgAz2z0esym8H_2-hshs8H454k",
      "approvedAddress": "2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa",
      "approvedWincAmount": "8000000000",
      "creationDate": "2024-10-31T15:04:15.898Z",
      "payingAddress": "jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU",
      "usedWincAmount": "0",
      "inactiveReason": "revoked",
      "inactiveDate": "2024-10-31T15:08:22.317Z",
      "revokeDataItemId": "rGSmUJmYALnMTdGF-V_nnwKLjxgMpqY4neNZByQSa_U"
    }
  ]
}

using payment approvals, by default on upload the CLI will use any received approvals before the signer's balance. the SDK will NOT do so, but integrating apps can choose to do so. To override the paid-by behavior CLI users can supply --paid-by,

> node lib/esm/cli/cli.js upload-file -f ../uploads/460KB.txt --wallet-file ../wallets/sol.keypair.2cor8AZxm38uc9sVgGaXk4BU2EtB18FqwEq7ivwa7VUa.json --token solana --paid-by jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU

or use one of two flags,

--ignore-approvals will skip any check for approvals, using only the signer's balance
--use-signer-balance-first will put the signer at the start of the paid-by list, and then put any received approvals after. this is a helper for using the end of a user's balance (dust)

chore: main back to alpha
refactor: remove commented docker compose code,
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 96.85039% with 8 lines in your changes missing coverage. Please review.

Project coverage is 93.60%. Comparing base (4916a4b) to head (2b764c4).
Report is 58 commits behind head on main.

Files with missing lines Patch % Lines
src/common/payment.ts 82.22% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #196      +/-   ##
==========================================
+ Coverage   93.26%   93.60%   +0.34%     
==========================================
  Files          25       25              
  Lines        3250     3486     +236     
  Branches      148      159      +11     
==========================================
+ Hits         3031     3263     +232     
- Misses        219      223       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

fedellen and others added 19 commits November 1, 2024 12:28
refactor: use credit sharing in commands/methods/docs PE-6754
this is an feat empty commit to deploy alpha PE-6754
# [1.20.0-alpha.2](v1.20.0-alpha.1...v1.20.0-alpha.2) (2024-11-01)

### Features

* update credit sharing command and method names ([c3e9bd9](c3e9bd9))
Temporary patch for issues related to using `.init()` in web environments
fix(arweave): modify import of Arweave in `ArweaveToken`
# [1.20.0-alpha.3](v1.20.0-alpha.2...v1.20.0-alpha.3) (2024-11-04)

### Bug Fixes

* **arweave:** modify import of Arweave in `ArweaveToken` ([b934677](b934677))
docs: better wordsmithing in credit sharing readme PE-6754
fix: supply starknet dependency for resolving kyve-js -> keplr-wallet…
# [1.20.0-alpha.4](v1.20.0-alpha.3...v1.20.0-alpha.4) (2024-11-04)

### Bug Fixes

* supply starknet dependency for resolving kyve-js -> keplr-wallet import error ([cf5ab39](cf5ab39))
@fedellen fedellen requested review from dtfiedler, a team and arielmelendez November 4, 2024 17:30
@fedellen fedellen merged commit 18a79ef into main Nov 4, 2024
17 checks passed
@dtfiedler
Copy link
Collaborator

🎉 This PR is included in version 1.20.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants