Skip to content

Commit

Permalink
Change GMC to POPCAT (#417)
Browse files Browse the repository at this point in the history
* up

* post-deploy cleanup

* LUT

* luts

* changelog
  • Loading branch information
filipzeta authored Sep 5, 2024
1 parent ca56176 commit ef2034f
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 85 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
Version changes are pinned to SDK releases.

## [1.45.1]

- Change GMC to POPCAT. ([#417](https://github.com/zetamarkets/sdk/pull/417))

## [1.44.0]

- Fix 'Invalid account discriminator' error when closing account. ([#416](https://github.com/zetamarkets/sdk/pull/416))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zetamarkets/sdk",
"repository": "https://github.com/zetamarkets/sdk/",
"version": "1.44.0",
"version": "1.45.1",
"description": "Zeta SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
14 changes: 7 additions & 7 deletions src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function assetToName(asset: Asset): string | null {
if (asset == Asset.WIF) return "WIF";
if (asset == Asset.RNDR) return "RNDR";
if (asset == Asset.TNSR) return "TNSR";
if (asset == Asset.GMC) return "GMC";
if (asset == Asset.POPCAT) return "POPCAT";
if (asset == null) return null; // Some things, like clock callbacks, are for all assets and return asset=null
return "UNDEFINED";
}
Expand All @@ -89,7 +89,7 @@ export function nameToAsset(name: string): Asset {
if (name == "WIF") return Asset.WIF;
if (name == "RNDR") return Asset.RNDR;
if (name == "TNSR") return Asset.TNSR;
if (name == "GMC") return Asset.GMC;
if (name == "POPCAT") return Asset.POPCAT;
return Asset.UNDEFINED;
}

Expand All @@ -115,7 +115,7 @@ export function toProgramAsset(asset: Asset): any {
if (asset == Asset.WIF) return { wif: {} };
if (asset == Asset.RNDR) return { rndr: {} };
if (asset == Asset.TNSR) return { tnsr: {} };
if (asset == Asset.GMC) return { gmc: {} };
if (asset == Asset.POPCAT) return { popcat: {} };
return { undefined: {} };
}

Expand Down Expand Up @@ -171,8 +171,8 @@ export function fromProgramAsset(asset: any): Asset {
if (objectEquals(asset, { tnsr: {} })) {
return Asset.TNSR;
}
if (objectEquals(asset, { GMC: {} })) {
return Asset.GMC;
if (objectEquals(asset, { POPCAT: {} })) {
return Asset.POPCAT;
}
return Asset.UNDEFINED;
}
Expand Down Expand Up @@ -230,7 +230,7 @@ export function assetToIndex(asset: Asset): number {
case Asset.TNSR: {
return 16;
}
case Asset.GMC: {
case Asset.POPCAT: {
return 17;
}
}
Expand Down Expand Up @@ -291,7 +291,7 @@ export function indexToAsset(index: number): Asset {
return Asset.TNSR;
}
case 17: {
return Asset.GMC;
return Asset.POPCAT;
}
}
return Asset.UNDEFINED;
Expand Down
38 changes: 29 additions & 9 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export enum Asset {
WIF = "WIF",
RNDR = "RNDR",
TNSR = "TNSR",
GMC = "GMC",
POPCAT = "POPCAT",
UNDEFINED = "UNDEFINED",
}

Expand Down Expand Up @@ -84,7 +84,9 @@ export const FLEX_MINTS = {
[Asset.WIF]: new PublicKey("BgDrDxc75EqPTXPUTCFMnYVYPeWK3CimPz2LGw4egsYc"),
[Asset.RNDR]: new PublicKey("397Hd8iZXmzRf4jqCSuACtUUWeweYZRZ4DmgvVpMkHJf"),
[Asset.TNSR]: new PublicKey("58MFM7mjjYMc6GoK6QUu7HuUmsih8aL5MTHptPE29p8G"),
[Asset.GMC]: new PublicKey("wWmjLtKGmXqJnDFnyQtKX1ZNHoBs9JD6bVxNa47zJWr"),
[Asset.POPCAT]: new PublicKey(
"wWmjLtKGmXqJnDFnyQtKX1ZNHoBs9JD6bVxNa47zJWr"
),
},
devnet: {
[Asset.APT]: new PublicKey("FbfkphUHaAd7c27RqhzKBRAPX8T5AzFBH259sbGmNuvG"),
Expand All @@ -108,7 +110,9 @@ export const FLEX_MINTS = {
[Asset.WIF]: new PublicKey("7jCmRqJaJq5iojCwGqq5DdwUBYPhrpvJcgNZsFLM4Pd5"),
[Asset.RNDR]: new PublicKey("GSF4GTjWxacrQoVbf8PUcvCvMvZUzwXFEmb2Jso6XU5H"),
[Asset.TNSR]: new PublicKey("3bTWLSNoD95dP2SHq4diRz3ZTeDXmybTsjPUQzRpTCHR"),
[Asset.GMC]: new PublicKey("CoGwjBS8stc4HCwpa6xh55LmGRTPxPkNXDVc1qBjwa5"),
[Asset.POPCAT]: new PublicKey(
"CoGwjBS8stc4HCwpa6xh55LmGRTPxPkNXDVc1qBjwa5"
),
},
};

Expand Down Expand Up @@ -299,8 +303,8 @@ export const PYTHNET_PRICE_FEED_IDS = {
"0xab7347771135fc733f8f38db462ba085ed3309955f42554a14fa13e855ac0e2f",
[Asset.TNSR]:
"0x05ecd4597cd48fe13d6cc3596c62af4f9675aee06e2e0b94c06d8bee2b659e05",
[Asset.GMC]:
"0xb3bd2a89c026fe7873da91b39bf9347fdea24e5b588330b4899788cf48878133",
[Asset.POPCAT]:
"0xb9312a7ee50e189ef045aa3c7842e099b061bd9bdc99ac645956c3b660dc8cce",
};

export const PYTH_PRICE_FEEDS = {
Expand All @@ -324,7 +328,9 @@ export const PYTH_PRICE_FEEDS = {
[Asset.WIF]: new PublicKey("Ae9pWfoS4jS8WFxMTApKHkmMaod171aRcekm1iFbsmoy"),
[Asset.RNDR]: new PublicKey("7DvNVeya3b6WqcxSzUZFW9CWdDayJoRYjnpg2HVbgv2h"),
[Asset.TNSR]: new PublicKey("2NVLHqPc1nhVYxb7nM5mjfXg26krgz8N2UKWtkJ7J77a"),
[Asset.GMC]: new PublicKey("3msDcvnV1csrwSetu98fZzoS3Nj2AXuQjjaGiTjSxPEg"),
[Asset.POPCAT]: new PublicKey(
"3msDcvnV1csrwSetu98fZzoS3Nj2AXuQjjaGiTjSxPEg"
),
},
devnet: {
[Asset.SOL]: new PublicKey("J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix"),
Expand Down Expand Up @@ -357,7 +363,9 @@ export const PYTH_PRICE_FEEDS = {
[Asset.WIF]: new PublicKey("6B23K3tkb51vLZA14jcEQVCA1pfHptzEHFA93V5dYwbT"),
[Asset.RNDR]: new PublicKey("GbgH1oen3Ne1RY4LwDgh8kEeA1KywHvs5x8zsx6uNV5M"),
[Asset.TNSR]: new PublicKey("9TSGDwcPQX4JpAvZbu2Wp5b68wSYkQvHCvfeBjYcCyC"),
[Asset.GMC]: new PublicKey("GfvaqdmMFT6nmWrSjonR9wDx5tncRj8QPDmxRCtLKP89"),
[Asset.POPCAT]: new PublicKey(
"6UxPR2nXJNNM1nESVWGAf8NXMVu3SGgYf3ZfUFoGB9cs"
),
},
};

Expand Down Expand Up @@ -542,8 +550,8 @@ export const STATIC_AND_PERPS_LUT: {
key: new PublicKey("LAZFv47awUnd9jHkv8XGKFvkUjHtbg64WxDiZqZHubz"),
state: {
deactivationSlot: BigInt("18446744073709551615"),
lastExtendedSlot: 286114199,
lastExtendedSlotStartIndex: 227,
lastExtendedSlot: 287890308,
lastExtendedSlotStartIndex: 239,
authority: new PublicKey("EwXPBSBUPqYDNA3dUVZ3nonFuaw3wGGJqEUTJbknDirH"),
addresses: [
new PublicKey("8eExPiLp47xbSDYkbuem4qnLUpbLTfZBeFuEJoh6EUr2"),
Expand Down Expand Up @@ -785,6 +793,18 @@ export const STATIC_AND_PERPS_LUT: {
new PublicKey("CJESiofGZkrKmVYYR2DCtfxAj2h1jdT9oV6EsdfbYZjr"),
new PublicKey("6ZfjZUd2pgmcevfL6aLTGzpTsLoNyi8pxuboDUnrVf23"),
new PublicKey("5xt8uuStpThtSX1PqHeiJuWtXZFpnkrrTtHDK1srXuL8"),
new PublicKey("6UxPR2nXJNNM1nESVWGAf8NXMVu3SGgYf3ZfUFoGB9cs"),
new PublicKey("6o2AifckJtQnwwg8Ee82iFkpocGpJRr3pY9jM7zeNCH1"),
new PublicKey("CWY7nSGmkLAedL36cdc6cQYCdHGy9sUCV16vTNoupuw1"),
new PublicKey("9e1DZ5mKwUvFsGyBBuCh9DCJmwx72fpyDBsYo3gsGCwY"),
new PublicKey("6G5yk3YcJBWPM7SzZbhUsvhZLsEmonqTvc3FqQGdRA81"),
new PublicKey("2hFnuSe5wWvAu1kxwjNGngtLDXpUWiVpc7UvbNTTkZtg"),
new PublicKey("9ySay4rVbFDDffUHQrCfkq6WcK4oWdxyfquFcunxxbcR"),
new PublicKey("GdeTNiTU4sh5a3KAUPMgcVQkU7XQFNQyqQh4EE1KsMAT"),
new PublicKey("6cAKFTvynML7tR8LLQ1u2UwPorc7TibdvdqjouLquSwD"),
new PublicKey("CJESiofGZkrKmVYYR2DCtfxAj2h1jdT9oV6EsdfbYZjr"),
new PublicKey("6ZfjZUd2pgmcevfL6aLTGzpTsLoNyi8pxuboDUnrVf23"),
new PublicKey("5xt8uuStpThtSX1PqHeiJuWtXZFpnkrrTtHDK1srXuL8"),
],
},
}),
Expand Down
2 changes: 1 addition & 1 deletion src/idl/zeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10309,7 +10309,7 @@
"name": "TNSR"
},
{
"name": "GMC"
"name": "POPCAT"
},
{
"name": "UNDEFINED"
Expand Down
Loading

0 comments on commit ef2034f

Please sign in to comment.