Skip to content

Commit

Permalink
Get publisher id by default
Browse files Browse the repository at this point in the history
  • Loading branch information
zengxinhai committed Jun 15, 2023
1 parent a730e0d commit 11b5cb9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@mysten/sui.js": "^0.35.1"
},
"devDependencies": {
"@scallop-io/sui-kit": "^0.35.2",
"@scallop-io/sui-kit": "^0.35.3",
"@types/node": "^20.1.5",
"@types/tmp": "^0.2.3",
"dotenv": "^16.0.3",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/lib/sui-response-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ export const parsePublishTxn = (suiResponse: SuiTransactionBlockResponse) => {
const parseRes = {
packageId: '',
upgradeCapId: '',
publisherId: undefined as string | undefined,
created: [] as { type: string; objectId: string, owner: string }[],
}
if (objectChanges) {
for (const change of objectChanges) {
if (change.type === 'created' && change.objectType.endsWith('package::UpgradeCap')) {
parseRes.upgradeCapId = change.objectId;
} else if (change.type === 'created' && change.objectType.endsWith('package::Publisher')) {
parseRes.publisherId = change.objectId;
} else if (change.type === 'published') {
parseRes.packageId = change.packageId;
} else if (change.type === 'created') {
Expand Down

0 comments on commit 11b5cb9

Please sign in to comment.