Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-tucker committed Dec 11, 2024
1 parent 104f206 commit dcd9428
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
16 changes: 8 additions & 8 deletions packages/plugin-story/src/actions/attachTerms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type Memory,
type State,
} from "@ai16z/eliza";
import { WalletProvider } from "../providers/wallet";
import { storyWalletProvider, WalletProvider } from "../providers/wallet";
import { attachTermsTemplate } from "../templates";
import {
AttachLicenseTermsResponse,
Expand Down Expand Up @@ -93,6 +93,13 @@ export const attachTermsAction = {
state = await runtime.updateRecentMessageState(state);
}

const walletInfo = await storyWalletProvider.get(
runtime,
message,
state
);
state.walletInfo = walletInfo;

const attachTermsContext = composeContext({
state,
template: attachTermsTemplate,
Expand Down Expand Up @@ -133,13 +140,6 @@ export const attachTermsAction = {
},
examples: [
[
{
user: "assistant",
content: {
text: "Ill help you attach commercial, 10% rev share license terms to IP Asset 0x2265F2b8e47F98b3Bdf7a1937EAc27282954A4Db",
action: "ATTACH_TERMS",
},
},
{
user: "user",
content: {
Expand Down
16 changes: 8 additions & 8 deletions packages/plugin-story/src/actions/licenseIP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type Memory,
type State,
} from "@ai16z/eliza";
import { WalletProvider } from "../providers/wallet";
import { storyWalletProvider, WalletProvider } from "../providers/wallet";
import { licenseIPTemplate } from "../templates";
import { LicenseIPParams } from "../types";
import { MintLicenseTokensResponse } from "@story-protocol/core-sdk";
Expand Down Expand Up @@ -64,6 +64,13 @@ export const licenseIPAction = {
state = await runtime.updateRecentMessageState(state);
}

const walletInfo = await storyWalletProvider.get(
runtime,
message,
state
);
state.walletInfo = walletInfo;

const licenseIPContext = composeContext({
state,
template: licenseIPTemplate,
Expand Down Expand Up @@ -96,13 +103,6 @@ export const licenseIPAction = {
},
examples: [
[
{
user: "assistant",
content: {
text: "Ill help you license an IP Asset 0x2265F2b8e47F98b3Bdf7a1937EAc27282954A4Db with license terms 1",
action: "LICENSE_IP",
},
},
{
user: "user",
content: {
Expand Down
18 changes: 9 additions & 9 deletions packages/plugin-story/src/actions/registerIP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type Memory,
type State,
} from "@ai16z/eliza";
import { WalletProvider } from "../providers/wallet";
import { storyWalletProvider, WalletProvider } from "../providers/wallet";
import { registerIPTemplate } from "../templates";
import { RegisterIPParams } from "../types";
import { RegisterIpResponse } from "@story-protocol/core-sdk";
Expand Down Expand Up @@ -54,7 +54,7 @@ export class RegisterIPAction {
// register ip
const response =
await storyClient.ipAsset.mintAndRegisterIpAssetWithPilTerms({
spgNftContract: "0xc89775f80BA9D1c7901a490a62483282813aeE06",
spgNftContract: "0xC81B2cbEFD1aA0227bf513729580d3CF40fd61dF",
terms: [],
ipMetadata: {
ipMetadataURI: `https://ipfs.io/ipfs/${ipIpfsHash}`,
Expand Down Expand Up @@ -88,6 +88,13 @@ export const registerIPAction = {
state = await runtime.updateRecentMessageState(state);
}

const walletInfo = await storyWalletProvider.get(
runtime,
message,
state
);
state.walletInfo = walletInfo;

const registerIPContext = composeContext({
state,
template: registerIPTemplate,
Expand Down Expand Up @@ -121,13 +128,6 @@ export const registerIPAction = {
},
examples: [
[
{
user: "assistant",
content: {
text: "Ill help you register your IP titled 'My IP' with the description 'This is my IP'",
action: "REGISTER_IP",
},
},
{
user: "user",
content: {
Expand Down

0 comments on commit dcd9428

Please sign in to comment.