Skip to content

Commit

Permalink
Revert "Handle duration"
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbogle authored May 21, 2022
1 parent 9222d4e commit c95133e
Show file tree
Hide file tree
Showing 12 changed files with 617 additions and 155 deletions.
25 changes: 0 additions & 25 deletions api/img-generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,31 +311,6 @@ export async function getImage(
bottomLeft += 0.075 * WIDTH;
}

const durationSeconds =
tokenData.timeInvalidatorData?.parsed?.durationSeconds;
if (durationSeconds && durationSeconds.toNumber()) {
const dateTime = new Date(
(Date.now() / 1000 + durationSeconds.toNumber()) * 1000
);
bottomLeftCtx.font = `${0.055 * WIDTH}px SFPro`;
bottomLeftCtx.fillStyle = "white";
bottomLeftCtx.fillText(
`${dateTime.toLocaleDateString(["en-US"], {
month: "2-digit",
day: "2-digit",
year: "2-digit",
})} ${dateTime.toLocaleTimeString(["en-US"], {
hour: "2-digit",
minute: "2-digit",
timeZone: "UTC",
timeZoneName: "short",
})}`,
PADDING,
HEIGHT - bottomLeft
);
bottomLeft += 0.075 * WIDTH;
}

const usages =
tokenData.useInvalidatorData?.parsed?.usages ||
tokenData?.certificateData?.parsed?.usages;
Expand Down
14 changes: 0 additions & 14 deletions api/metadata-generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,6 @@ export async function getMetadata(
};
}

if (tokenData.timeInvalidatorData?.parsed?.durationSeconds) {
response = {
...response,
attributes: [
...(response.attributes || []),
{
trait_type: "duration",
value: `${tokenData.timeInvalidatorData?.parsed?.durationSeconds.toNumber()}`,
display_type: "Duration",
},
],
};
}

// // certificate
// if (
// tokenData.certificateData?.parsed.usages &&
Expand Down
11 changes: 5 additions & 6 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
"dependencies": {
"@cardinal/certificates": "^1.2.6",
"@cardinal/common": "^1.0.6",
"@cardinal/namespaces": "^3.0.32",
"@cardinal/namespaces": "=3.0.32",
"@cardinal/quest-pool": "^1.1.3",
"@cardinal/stake-pool": "^1.1.1",
"@cardinal/token-manager": "^1.3.10",
"@cardinal/token-manager": "=1.1.0",
"@metaplex/js": "^4.2.1",
"@rushstack/eslint-patch": "^1.1.0",
"@project-serum/anchor": "^0.24.2",
"@saberhq/anchor-contrib": "^1.12.44",
"@saberhq/solana-contrib": "^1.12.44",
"@project-serum/anchor": "=0.21.0",
"@saberhq/anchor-contrib": "=1.12.48",
"@saberhq/solana-contrib": "^1.11",
"@saberhq/token-utils": "^1.12.48",
"@solana/spl-token": "^0.1.8",
"bignumber.js": "^9.0.2",
Expand Down
12 changes: 6 additions & 6 deletions api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ custom:
domainName: nft.cardinal.so
dev:
domainName: dev-nft.cardinal.so
# customDomain:
# domainName: ${self:custom.domains.${opt:stage}.domainName}
# certificateName: "*.cardinal.so"
# createRoute53Record: true
# autoDomain: true
customDomain:
domainName: ${self:custom.domains.${opt:stage}.domainName}
certificateName: "*.cardinal.so"
createRoute53Record: true
autoDomain: true

plugins:
# - serverless-domain-manager
- serverless-domain-manager
- serverless-apigw-binary
- serverless-apigwy-binary
- serverless-plugin-typescript
Expand Down
125 changes: 21 additions & 104 deletions api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
tiny-invariant "^1.2.0"
tslib "^2.3.1"

"@cardinal/namespaces@^2.0.42":
version "2.0.59"
resolved "https://registry.yarnpkg.com/@cardinal/namespaces/-/namespaces-2.0.59.tgz#9e251c3a38f78faca58e208d1c5f2e10fa8c829b"
integrity sha512-2waZMfLyzAKi5y7bWBPzuqP/FDSjLS5u9VhsBLfEQbNOR3BHmHrSwrYPpAfV+IrULNBSSg8jobxoD5b94C3GEQ==
"@cardinal/namespaces@=3.0.32":
version "3.0.32"
resolved "https://registry.yarnpkg.com/@cardinal/namespaces/-/namespaces-3.0.32.tgz#b3f89694f70542a1dc89bff954029d783c782ee5"
integrity sha512-ZJrw3wxYfzJ3g2tmnqoesX5tTAfdXLHhr+Ix+SF91b16b5XZahb1YkTPc5rhwTa63D1OUwgqckuXHZ4zUVmziA==
dependencies:
"@cardinal/certificates" "^1.2.3"
"@cardinal/namespaces" "^2.0.42"
Expand All @@ -85,10 +85,10 @@
"@solana/spl-token" "^0.1.8"
typescript "^4.5.4"

"@cardinal/namespaces@^3.0.32":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@cardinal/namespaces/-/namespaces-3.1.0.tgz#bee4acdf3d2bcf63aa5c02502f61fb8024ac4039"
integrity sha512-eX44mI0EFZrzvIHKGS/j0iUJPmCrl1av89jfSqWf6ldYYwLyENQysyOQv2az718pbJd9H5IQb+kJX0JLlQCo/w==
"@cardinal/namespaces@^2.0.42":
version "2.0.59"
resolved "https://registry.yarnpkg.com/@cardinal/namespaces/-/namespaces-2.0.59.tgz#9e251c3a38f78faca58e208d1c5f2e10fa8c829b"
integrity sha512-2waZMfLyzAKi5y7bWBPzuqP/FDSjLS5u9VhsBLfEQbNOR3BHmHrSwrYPpAfV+IrULNBSSg8jobxoD5b94C3GEQ==
dependencies:
"@cardinal/certificates" "^1.2.3"
"@cardinal/namespaces" "^2.0.42"
Expand Down Expand Up @@ -132,17 +132,16 @@
ts-mocha "^8.0.0"
typescript "^4.5.5"

"@cardinal/token-manager@^1.3.10":
version "1.3.10"
resolved "https://registry.yarnpkg.com/@cardinal/token-manager/-/token-manager-1.3.10.tgz#f8e0bc23f80fb2d8479394837d6feccbabc3e904"
integrity sha512-yMG32kl+JKvvtCUmQ+ZE/WMk5hMq1gy1AVr7SMb9wTbAFoJmKuen/MBbF8IuGn3sjzqn/EIirbW6h+LlCAtqgw==
"@cardinal/token-manager@=1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@cardinal/token-manager/-/token-manager-1.1.0.tgz#5c64e2cdeaea0e7455ebca96f3d86180dc5c45e4"
integrity sha512-632KWT2fSB+3s/+vc5RCiFXPLjvUbnaFS/0NMa9h7dlZ7gVG1pV2A8ICv+IAhMAAN4jTt+Lr4d6M6244mlWRTg==
dependencies:
"@metaplex-foundation/mpl-token-metadata" "^1.2.3"
"@solana/buffer-layout" "^4.0.0"
"@solana/spl-token" "^0.1.8"
borsh "^0.7.0"
bs58 "^4.0.1"
superstruct "^0.15.4"
tiny-invariant "^1.2.0"
tslib "^2.3.1"

Expand Down Expand Up @@ -642,7 +641,7 @@
snake-case "^3.0.4"
toml "^3.0.0"

"@project-serum/[email protected]":
"@project-serum/[email protected]", "@project-serum/anchor@=0.21.0":
version "0.21.0"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.21.0.tgz#ad5fb33744991ec1900cdb2fd22707c908b12b5f"
integrity sha512-flRuW/F+iC8mitNokx82LOXyND7Dyk6n5UUPJpQv/+NfySFrNFlzuQZaBZJ4CG5g9s8HS/uaaIz1nVkDR8V/QA==
Expand Down Expand Up @@ -684,26 +683,6 @@
snake-case "^3.0.4"
toml "^3.0.0"

"@project-serum/anchor@^0.24.2":
version "0.24.2"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.24.2.tgz#a3c52a99605c80735f446ca9b3a4885034731004"
integrity sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA==
dependencies:
"@project-serum/borsh" "^0.2.5"
"@solana/web3.js" "^1.36.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.2"
camelcase "^5.3.1"
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
toml "^3.0.0"

"@project-serum/borsh@^0.2.2", "@project-serum/borsh@^0.2.4", "@project-serum/borsh@^0.2.5":
version "0.2.5"
resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.5.tgz#6059287aa624ecebbfc0edd35e4c28ff987d8663"
Expand Down Expand Up @@ -765,21 +744,16 @@
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=

"@rushstack/eslint-patch@^1.1.0":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz#6801033be7ff87a6b7cadaf5b337c9f366a3c4b0"
integrity sha512-WiBSI6JBIhC6LRIsB2Kwh8DsGTlbBU+mLRxJmAe3LjHTdkDpwIbEOZgoXBbZilk/vlfjK8i6nKRAvIRn1XaIMw==

"@saberhq/anchor-contrib@^1.12.44":
version "1.13.15"
resolved "https://registry.yarnpkg.com/@saberhq/anchor-contrib/-/anchor-contrib-1.13.15.tgz#d45906deb196bfae70f23960d98b86d120710769"
integrity sha512-/n9cP7CiUr8g9h1TQXI/S+lfpD8efVEZFmqqF0LtWfLb6zNoOR+WQ9AMcl+XD+sz1pcsbUh0ncZIIma7uC3Q1w==
"@saberhq/anchor-contrib@=1.12.48":
version "1.12.48"
resolved "https://registry.yarnpkg.com/@saberhq/anchor-contrib/-/anchor-contrib-1.12.48.tgz#76f577df2fd3405086c80f2b9d7b30ca91e2ace0"
integrity sha512-UPITsnMazZXfCv4rI3Zx5aAxXZc2wPX09j2Bf5M6zVT1wYTbTEGp0yNLY4f926LBda+EngMkc19SrOYu94ODfw==
dependencies:
"@saberhq/solana-contrib" "^1.13.15"
"@saberhq/solana-contrib" "^1.12.48"
eventemitter3 "^4.0.7"
lodash.camelcase "^4.3.0"
lodash.mapvalues "^4.6.0"
tslib "^2.4.0"
tslib "^2.3.1"

"@saberhq/anchor-contrib@^1.12.47", "@saberhq/anchor-contrib@^1.12.48":
version "1.12.66"
Expand All @@ -792,7 +766,7 @@
lodash.mapvalues "^4.6.0"
tslib "^2.4.0"

"@saberhq/solana-contrib@^1.12.23", "@saberhq/solana-contrib@^1.12.47", "@saberhq/solana-contrib@^1.12.48", "@saberhq/solana-contrib@^1.12.66":
"@saberhq/solana-contrib@^1.11", "@saberhq/solana-contrib@^1.12.23", "@saberhq/solana-contrib@^1.12.47", "@saberhq/solana-contrib@^1.12.48", "@saberhq/solana-contrib@^1.12.66":
version "1.12.66"
resolved "https://registry.yarnpkg.com/@saberhq/solana-contrib/-/solana-contrib-1.12.66.tgz#19677f54fe56f4d02ad1bf75749d6e14e673f309"
integrity sha512-rFivOXpx5TaFv7JrPA/uhwA9TmPfMym4SY/WP3OZROXO7eh0+JLlecFvy3kkh0mnbM7LPcmQUUPPJ16Ox9+vKA==
Expand All @@ -805,19 +779,6 @@
tiny-invariant "^1.2.0"
tslib "^2.4.0"

"@saberhq/solana-contrib@^1.12.44", "@saberhq/solana-contrib@^1.13.15":
version "1.13.15"
resolved "https://registry.yarnpkg.com/@saberhq/solana-contrib/-/solana-contrib-1.13.15.tgz#e5d9a86b6b2b9fdce3eca05eae00f39e0295307a"
integrity sha512-4IldAgysqQCuiq38DZzld3x1qVv7Jp4WJJ8vv/xPHh3DXeOiWxAtvgqd+aHAFOzyoCRLa9TG2wx21YOrQ/YIxw==
dependencies:
"@solana/buffer-layout" "^4.0.0"
"@types/promise-retry" "^1.1.3"
"@types/retry" "^0.12.2"
promise-retry "^2.0.1"
retry "^0.13.1"
tiny-invariant "^1.2.0"
tslib "^2.4.0"

"@saberhq/token-utils@^1.12.48":
version "1.12.66"
resolved "https://registry.yarnpkg.com/@saberhq/token-utils/-/token-utils-1.12.66.tgz#35bedfe728c2722c006716c77e4faf512c9915a7"
Expand Down Expand Up @@ -1119,28 +1080,6 @@
superstruct "^0.14.2"
tweetnacl "^1.0.0"

"@solana/web3.js@^1.36.0":
version "1.43.1"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.43.1.tgz#f0cfffe7feb798563440f9ca0b0e9ba099e13967"
integrity sha512-s6TRcWz3rYvxM8gg1eQmUAUJQeoXIFMG9MbSWb/uRrLU0q7Xd9Ic1PNbACp1n1O0wyCogTAyFWXXPK476aIVSg==
dependencies:
"@babel/runtime" "^7.12.5"
"@ethersproject/sha2" "^5.5.0"
"@solana/buffer-layout" "^4.0.0"
bigint-buffer "^1.1.5"
bn.js "^5.0.0"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.1"
cross-fetch "^3.1.4"
fast-stable-stringify "^1.0.0"
jayson "^3.4.4"
js-sha3 "^0.8.0"
rpc-websockets "^7.4.2"
secp256k1 "^4.0.2"
superstruct "^0.14.2"
tweetnacl "^1.0.0"

"@szmarczak/http-timer@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
Expand Down Expand Up @@ -1340,11 +1279,6 @@
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.1.tgz#d8f1c0d0dc23afad6dc16a9e993a0865774b4065"
integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==

"@types/retry@^0.12.2":
version "0.12.2"
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.2.tgz#ed279a64fa438bb69f2480eda44937912bb7480a"
integrity sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==

"@types/ws@^7.4.4":
version "7.4.7"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702"
Expand Down Expand Up @@ -1736,13 +1670,6 @@ big.js@^6.1.1:
resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.1.1.tgz#63b35b19dc9775c94991ee5db7694880655d5537"
integrity sha512-1vObw81a8ylZO5ePrtMay0n018TcftpTA5HFKDaSuiUDBo8biRBtjIobw60OpwuvrGk+FsxKamqN4cnmj/eXdg==

bigint-buffer@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442"
integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==
dependencies:
bindings "^1.3.0"

bignumber.js@^9.0.2:
version "9.0.2"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673"
Expand All @@ -1761,7 +1688,7 @@ binary@~0.3.0:
buffers "~0.1.1"
chainsaw "~0.1.0"

bindings@^1.3.0, bindings@^1.3.1:
bindings@^1.3.1:
version "1.5.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
Expand Down Expand Up @@ -3231,11 +3158,6 @@ fast-levenshtein@~2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=

fast-stable-stringify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313"
integrity sha1-XFVDRisiru79NtBbNOUceMuG0xM=

fastest-levenshtein@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2"
Expand Down Expand Up @@ -6678,11 +6600,6 @@ superstruct@^0.14.2:
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b"
integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==

superstruct@^0.15.4:
version "0.15.4"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.4.tgz#e3381dd84ca07e704e19f69eda74eee1a5efb1f9"
integrity sha512-eOoMeSbP9ZJChNOm/9RYjE+F36rYR966AAqeG3xhQB02j2sfAUXDp4EQ/7bAOqnlJnuFDB8yvOu50SocvKpUEw==

[email protected], supports-color@^8.1.1:
version "8.1.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
Expand Down
41 changes: 41 additions & 0 deletions workflows/deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deps

on:
workflow_dispatch: {}

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: 1.9.13
ANCHOR_GIT: https://github.com/project-serum/anchor
RUST_TOOLCHAIN: nightly
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

jobs:
test:
runs-on: ubuntu-latest
name: Build deps and cache
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-linux-build-deps
- name: Install Rust nightly
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: ./.github/actions/install-solana
with:
solana_version: ${{ env.SOLANA_VERSION }}
- uses: ./.github/actions/install-anchor
with:
anchor_git: ${{ env.ANCHOR_GIT }}

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./rust/target
key: ${{ env.cache_id }}-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.RUSTC_HASH }}
Loading

0 comments on commit c95133e

Please sign in to comment.