@kalashshah/restapi
v0.1.2
Published
This package gives access to Push Protocol (Push Nodes) APIs. Visit [Developer Docs](https://docs.push.org/developers) or [Push.org](https://push.org) to learn more.
Downloads
5
Readme
restapi
This package gives access to Push Protocol (Push Nodes) APIs. Visit Developer Docs or Push.org to learn more.
Index
- restapi
- Index
- How to use in your app?
- SDK Features
- PushNotification Class
- Initialize
- Fetch Inbox Or Spam notifications
- Fetch user subscriptions
- Subscribe to a channel
- Unsubscribe to a channel
- Channel information
- Search Channels
- Get Subscribers Of A Channel
- Send a notification
- Create a channel
- Update channel information
- Verify a channel
- Create channel Setting (WIP)
- Get delegators information
- Add delegator to a channel or alias
- Remove delegator from a channel or alias
- Alias Information
- Stream Notifications
- PushChat Class
- Initialize
- Fetch Info
- Fetch Profile Info
- Update Profile Info
- Fetch Latest Chat
- Fetch Chat History
- Send Message
- Accept Chat Request
- Reject Chat Request
- Block Chat User
- Unblock Chat User
- Create Group
- Fetch Group Info
- Fetch Group Permission
- Update Group
- Add To Group
- Remove From Group
- Join Group
- Leave Group
- Reject Group Joining Request
- Fetch Encryption Info
- Update Encryption
- Stream Chat Events
- Stream Chat Ops Events
- For Video
- For Spaces
- To create a space
- To create a token gated space
- To check user access of a token gated space
- To update space details
- To update token gated space details
- To get space details by spaceId
- To start a space
- To stop a space
- To approve a space request
- To add listeners to space
- To remove listeners from space
- To add speakers to space
- To remove speakers from space
- Fetching list of user spaces
- Fetching list of user space requests
- Fetching list of trending spaces
- PushNotification Class
How to use in your app?
Installation
yarn add @pushprotocol/restapi@latest ethers@^5.6
or
npm install @pushprotocol/restapi@latest ethers@^5.6
Import SDK
import * as PushAPI from '@pushprotocol/restapi';
About generating the "signer" object for different platforms
When using in SERVER-SIDE code:
const ethers = require('ethers');
const PK = 'your_channel_address_secret_key';
const Pkey = `0x${PK}`;
const _signer = new ethers.Wallet(Pkey);
When using in FRONT-END code:
// any other web3 ui lib is also acceptable
import { useWeb3React } from "@web3-react/core";
.
.
.
const { account, library, chainId } = useWeb3React();
const _signer = library.getSigner(account);
About blockchain agnostic address format
In any of the below methods (unless explicitly stated otherwise) we accept either -
CAIP format: for any on chain addresses We strongly recommend using this address format. Learn more about the format and examples. (Example :
eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb
)ETH address format: only for backwards compatibility. (Example:
0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb
)
Chat blockchain agnostic address format
Note - For chat related apis, the address is in the format: eip155:<address> instead of eip155:<chainId>:<address>, we call this format Partial CAIP
(Example : eip155:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb
)
About Push contract addresses
Push core contract address
ETH Mainnet - 0x66329Fdd4042928BfCAB60b179e1538D56eeeeeE
Push communicator contract address
ETH Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
ETH Goerli - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Polygon Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Polygon Mumbai - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Binance Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Binance Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Optimism Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Optimism Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Arbitrum Mainnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
Arbitrum One Testnet - 0xb3971BCef2D791bc4027BbfedFb47319A4AAaaAa
SDK Features
For Video
Instance Variables
peerInstance
- Used to store the simple peer instance used for the webRTC connection.
private peerInstance: any = null;
signer
- Used to store the signer of a user.
- Used in the request, acceptRequest and disconnect methods to send notifications.
private signer: SignerType;
chainId
The chain id of the chain on which the call is being conducted.
private chainId: number;
pgpPrivateKey
- Used to store the PGP private key of a user.
- Used in the request, acceptRequest and disconnect methods to send notifications.
private pgpPrivateKey: string;
env
- The environment on which the call is being conducted.
private env: ENV;
data
- Stores data related to the video call.
export type IMediaStream = MediaStream | null;
export enum VideoCallStatus {
UNINITIALIZED,
INITIALIZED,
RECEIVED,
CONNECTED,
DISCONNECTED,
RETRY_INITIALIZED,
RETRY_RECEIVED,
}
export type PeerData = {
stream: IMediaStream; // incoming media stream
audio: boolean | null; // incoming audio status
video: boolean | null; // incoming video status
address: string; // incoming address
status: VideoCallStatus; // status for the connection with incoming peer
retryCount: number; // number of retires done
};
export type VideoCallData = {
meta: {
chatId: string; // unique chatId for the corresponding push w2w chat
initiator: {
address: string; // initiator's address
signal: any; // initiator's signaling data for webRTC connection
};
broadcast?: {
livepeerInfo: any;
hostAddress: string;
coHostAddress: string;
};
};
local: {
stream: IMediaStream; // local media stream
audio: boolean | null; // local audio status
video: boolean | null; // local video status
address: string; // local address
};
incoming: [PeerData];
};
private data: VideoCallData;
setData
- This function can be used to update the video call
data
setData: (fn: (data: VideoCallData) => VideoCallData) => void;
// usage
import { produce } from 'immer';
setData((oldData) => {
return produce(oldData, (draft) => {
// update the draft object, example
draft.incoming.status = VideoCallStatus.INITIALIZED;
});
});
Methods
constructor
constructor({
signer,
chainId,
pgpPrivateKey,
env,
setData,
}: {
signer: SignerType;
chainId: number;
pgpPrivateKey: string;
env?: ENV;
setData: (fn: (data: VideoCallData) => VideoCallData) => void;
}) {}
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| signer_ | SignerType | - | signer object for a user |
| chainId* | number | - | chainId for the video call - Eth Mainnet: 1, Polygon Mainnet: 137 |
| pgpPrivatekey* | string | - | PGP private key of the user, used while sending video call notifications |
| env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
| setData* | (fn: (data: VideoCallData) => VideoCallData) => void
| - | Function to update video call data |
create
- This method is used to create a local stream
- Assigns the local stream obtained from the
navigator.mediaDevices.getUserMedia
todata.local.stream
state.
export type VideoCreateInputOptions = {
video?: boolean;
audio?: boolean;
};
async create(options: VideoCreateInputOptions): Promise<void> {}
Allowed Options (params with * are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | video | boolean | true | video status for the local stream | | audio | boolean | true | audio status for the local stream |
Note - If audio, video aren't enabled in create() then they wont be available during the call respectively.
request
- This method is used to request a push video call.
- Will be triggered on the initiator's end.
export type VideoRequestInputOptions = {
senderAddress: string;
recipientAddress: string;
chatId: string;
onReceiveMessage?: (message: string) => void;
retry?: boolean;
};
async request(options: VideoRequestInputOptions): Promise<void> {}
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| senderAddress_ | string | - | Local peer address |
| recipientAddress* | string | - | Incoming/remote peer address |
| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
| onReceiveMessage | (message: string) => void
| (message: string) => {console.log('received a meesage', message);}
| Function which will be called when the sender receives a message via webRTC data channel |
| retry | boolean | false | If we are retrying the call, only for internal use |
acceptRequest
- This method is used to accept a push video call.
- Will be triggered on the receiver's end.
export type VideoAcceptRequestInputOptions = {
signalData: any;
senderAddress: string;
recipientAddress: string;
chatId: string;
onReceiveMessage?: (message: string) => void;
retry?: boolean;
};
async acceptRequest(options: VideoAcceptRequestInputOptions): Promise<void> {}
Allowed Options (params with _ are mandatory)
| Param | Type | Default | Remarks |
|----------|---------|---------|--------------------------------------------|
| signalData_ | any | - | Signal data received from the initiator peer via psuh notification upon call request |
| senderAddress* | string | - | Local peer address |
| recipientAddress* | string | - | Incoming/remote peer address |
| chatId* | string | - | Unique identifier for every wallet-to-wallet push chat, will be used during verification proof generation |
| onReceiveMessage | (message: string) => void
| (message: string) => {console.log('received a meesage', message);}
| Function which will be called when the sender receives a message via webRTC data channel |
| retry | boolean | false | If we are retrying the call, only for internal use |
connect
- This is the final method which is used to connect a push video call.
- Will be triggered on the initiator's end.
export type VideoConnectInputOptions = {
signalData: any;
peerAddress?: string;
};
connect(options: VideoConnectInputOptions): void {}
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | signalData_ | any | - | Signal data received from the receiver peer via push notification upon call acceptRequest | | peerAddress | string | data.incoming[0].address | Address of the receiver peer, received via push notification upon call acceptRequest |
disconnect
- This method is used to end a push video call.
- Can be triggered on the initiator as well as receivers end.
export type VideoDisconnectOptions = {
peerAddress: string;
} | null;
disconnect(options: VideoDisconnectOptions): void {}
Allowed Options (params with * are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | peerAddress | string | data.incoming[0].address | Address of the peer to be disconnected from |
enableVideo
- This method is used to enable/disable the video (from
data.local.stream
) for a push video call. - Can be triggered on the initiator as well as receivers end.
- Note - If video was not enabled during
create()
then it will always remain off.
export type EnableVideoInputOptions = {
state: boolean;
}
enableVideo(options: EnableVideoInputOptions): void
Allowed Options (params with * are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | state | boolean | - | true for enable and false for disable |
enableAudio
- This method is used to enable/disable the audio (from
data.local.stream
) for a push video call. - Can be triggered on the initiator as well as receivers end.
- Note - If audio was not enabled during
create()
then it will always remain off.
export type EnableAudioInputOptions = {
state: boolean;
}
enableAudio(options: EnableAudioInputOptions): void
Allowed Options (params with * are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | state | boolean | - | true for enable and false for disable |
isInitiator
- This method is used to tell if the current peer is the initator of the push video call or not.
- Can be triggered on the initiator as well as receivers end.
isInitiator(): boolean
For Spaces
To create a space
// pre-requisite API calls that should be made before
// need to get user and through that encryptedPvtKey of the user
const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
// need to decrypt the encryptedPvtKey to pass in the api using helper function
const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
// actual api
const response = await PushAPI.space.create({
spaceName:'wasteful_indigo_warbler',
spaceDescription: 'boring_emerald_gamefowl',
listeners: ['0x9e60c47edF21fa5e5Af33347680B3971F2FfD464','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
spaceImage: <space image link> ,
speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
isPublic: true,
account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
env: 'staging',
pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
scheduleAt: new Date("2024-07-15T14:48:00.000Z"),
scheduleEnd: new Date("2024-07-15T15:48:00.000Z")
});
To create a token gated space
// pre-requisite API calls that should be made before
// need to get user and through that encryptedPvtKey of the user
const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
// need to decrypt the encryptedPvtKey to pass in the api using helper function
const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
// actual api
const response = await PushAPI.space.create({
spaceName:'wasteful_indigo_warbler',
spaceDescription: 'boring_emerald_gamefowl',
listeners: ['0x9e60c47edF21fa5e5Af33347680B3971F2FfD464','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
spaceImage: <space image link> ,
speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
rules: {
'spaceAccess': {
'conditions': [
{
'any': [
{
'type': 'PUSH',
'category': 'ERC20',
'subcategory': 'holder',
'data': {
'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
'amount': 1000,
'decimals': 18
}
},
{
'type': 'GUILD',
'category': 'guildRoles',
'subcategory': 'specificRole',
'data': {
'guildId': '13468',
'guildRoleId': '19924'
}
}
]
}
]
}
},
isPublic: true,
account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
env: 'staging',
pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
scheduleAt: new Date("2024-07-15T14:48:00.000Z"),
scheduleEnd: new Date("2024-07-15T15:48:00.000Z")
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | account_ | string | - | user address | | spaceName* | string | - | group name | | spaceDescription* | string | - | group description | | spaceImage* | string | - | group image link | | listeners* | Array | - | wallet addresses of all listeners except speakers and spaceCreator | | speakers* | Array | - | wallet addresses of all speakers except listeners and spaceCreator | | isPublic* | boolean | - | true for public space, false for private space | | scheduleAt* | Date | - | Date time when the space is scheduled to start | | scheduleEnd | Date | - | Date time when the space is scheduled to end | | contractAddressERC20 (deprecated) | string | null | ERC20 Contract Address | | numberOfERC20 (deprecated) | int | 0 | Minimum number of tokens required to join the group | | contractAddressNFT (deprecated) | string | null | NFT Contract Address | | numberOfNFTTokens (deprecated) | int | 0 | Minimum number of nfts required to join the group | | rules | Rules | - | conditions for space access (see format below) | | pgpPrivateKey | string | null | mandatory for users having pgp keys| | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
Rules format
export enum ConditionType {
PUSH = 'PUSH',
GUILD = 'GUILD',
}
export type Data = {
contract?: string;
amount?: number;
decimals?: number;
guildId?: string;
guildRoleId?: string;
guildRoleAction?: 'all' | 'any';
url?: string;
comparison?: '>' | '<' | '>=' | '<=' | '==' | '!=';
};
export type ConditionBase = {
type?: ConditionType;
category?: string;
subcategory?: string;
data?: Data;
access?: Boolean;
};
export type Condition = ConditionBase & {
any?: ConditionBase[];
all?: ConditionBase[];
};
export interface Rules {
entry?: {
conditions: Array<Condition | ConditionBase>;
};
chat?: {
conditions: Array<Condition | ConditionBase>;
};
}
// PushAPI.space.create | Response - 200 OK
{
members: [{
wallet: 'eip155:0x727C819feB2c7F99c66d71B8411521bca2010023',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
'xsBNBGSrssEBCACg3ZjrZB40Xqr5IKIEtFldaeQyJPNwDACMekY77yApav0B\n' +
'RwiqhFJDFJKcprSHg/vYdqalAIGRQ+J98VMBtHweurIubD/ODB6WknOms7ZY\n' +
'3ummaEzyFRombuq/C75o/0ImCi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ThHPjTY/inW\n' +
'wVHVug4jIWUQ1QQw/q9qvGxAzQARAQABwsB2BBgBCAAqBYJkq7LBCZDwrCS5\n' +
'ulOLwQKbDBYhBFKpO7zcSRed+QmbIfCsJLm6U4vBAADu6wf+NJDX/3NAxQKN\n' +
'Iigj0GkBm/y69iFmQvWJxxtiYCNu8VBhm8MkcghUJ8G2tWP9ueUOM8sMTEa+\n' +
'G+l+wSNwh/1yisF3FutDpy6l+fiy6kPPD4vl08jY3GrqSuWWfMxTJhMZ5D6v\n' +
'OW2EfdyET+oP5eOnCd6p0EXP2ic48rVHDdU2iWeg0RkGvZP3t2LljWFdLbvw\n' +
'h7+wSD1i4LY4slUIdbLdDSLN1gWFN1HXzX10mpX0grV2sBdfkNyHhF0WcIat\n' +
'sD9HpAx2M62yP2D9D9UZVrW7WfmOoyL1NrnXSJsI8CRFDzujvpIrr7875zSi\n' +
'VnxDVyt7twc7cYqRDHsNYuxAuE815A==\n' +
'=2jvb\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
isSpeaker: true,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA4klEQVR4AcXBoW3FMBRA0dsn75E9skAU6BkMSk1CA0xNsoBnMLSyQPbIDgVlLX0OcPX1Vb1zPj6/v35QWg5o61bQok+MHHVHazmgrVtBE4wJxgRjjofzmuj4xCuiT2iRCe2gJxgTjAnGXMuBTi2MRJ8YOerOSMsBTTAmGBOMuXUraNEntKPuaEfdeUX0iU4taIIxwZhgzPGH6BP/STAmGBOMOR6W+UY7r4l3LPONttITjAnGBGMu+kSnFrQlB96xbgUt+oQmGBOMCcYcDy0HRs5rYmSZb7SWA1pkQhOMCcYEY78uSjTZAXCkaQAAAABJRU5ErkJggg=='
}],
pendingMembers: [{
wallet: 'eip155:0x5f4e9e7Fcc17a943178c0b0881b09E8Ef9D34437',
publicKey: null,
isSpeaker: false,
image: null
},
{
wallet: 'eip155:0xFedfA2b276676C5c6ce753ddb4B05d00104E9236',
publicKey: null,
isSpeaker: false,
image: null
}
],
contractAddressERC20: "0x8Afa8FDf9fB545C8412499E8532C958086608b30",
numberOfERC20: 20,
contractAddressNFT: "0x42af3147f17239341477113484752D5D3dda997B",
numberOfNFTTokens: 2,
verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
'wsBzBAEBCAAnBYJkq7LBCZDwrCS5ulOLwRYhBFKpO7zcSRed+QmbIfCsJLm6\n' +
'U4vBAAAAHwf+K4f0gxaP56X4Cv2zlPWB9iUPi/1FOnx8ZF7oEf9xJSv/xA7v\n' +
'9LHBTZ2Y9AQlJpy0WLB7KGF7mVV1MdUKHjn2SFQ+1h+8d+FIHXfmB7Ie4alP\n' +
'nnar6XjtMVKYyqXRzMzCq2F7Fjea1sUOXBxAeyJstAGG6nvsU51imaAtGQlQ\n' +
'u7ih8D9UkiOe719v5GyI1vtiS+hHGlYo0+A7WVImH6SuVyPZ3UyPvLxXpeKs\n' +
'1SeEfuvfmKHbswm1DDGOknyo7fJ/QgKqOfkwsBIrYRNGwPGEKt8pHdwNxsNn\n' +
'hNQtlFqtmtvieaxbhJQKXHbVgNv206xNsUBrK/U2nCakx7EMmxikFg==\n' +
'=tz9T\n' +
'-----END PGP SIGNATURE-----\n',
spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
spaceName: 'wasteful_indigo_warbler',
isPublic: true,
spaceDescription: 'boring_emerald_gamefowl',
spaceCreator: 'eip155:0x727C819feB2c7F99c66d71B8411521bca2010023',
spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: 'PENDING',
rules: {
'spaceAccess': {
'conditions': [
{
'any': [
{
'type': 'PUSH',
'category': 'ERC20',
'subcategory': 'holder',
'data': {
'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
'amount': 1000,
'decimals': 18
}
},
{
'type': 'GUILD',
'category': 'guildRoles',
'subcategory': 'specificRole',
'data': {
'guildId': '13468',
'guildRoleId': '19924'
}
}
]
}
]
}
}
}
To check user access of a token gated space
// actual api
const response = await PushAPI.space.getAccess({
spaceId:'8f7be0068a677df166c2e5b8a9030fe8a4341807150339e588853c0049df3106',
did: '0x9e60c47edF21fa5e5Af33347680B3971F2FfD464'
env: 'staging',
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | spaceId | string | - | space address | | did | string | - | user address | | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI_chat_getSpaceAccess | Response - 200 OK
{
'spaceAccess': true,
'rules': {
'spaceAccess': {
'conditions': [
{
'any': [
{
'type': 'PUSH',
'category': 'ERC20',
'subcategory': 'holder',
'data': {
'contract': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
'amount': 1000,
'decimals': 18
},
'access': false
},
{
'type': 'GUILD',
'category': 'guildRoles',
'subcategory': 'specificRole',
'data': {
'guildId': '13468',
'guildRoleId': '19924'
},
'access': true
},
{
'type': 'PUSH',
'category': 'ERC721',
'subcategory': 'owner',
'data': {
'contract': 'eip155:5:0x42af3147f17239341477113484752D5D3dda997B',
'amount': 1
},
'access': true
}
]
}
]
}
}
To update space details
Note - updateSpace is an idompotent call
// pre-requisite API calls that should be made before
// need to get user and through that encryptedPvtKey of the user
const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
// need to decrypt the encryptedPvtKey to pass in the api using helper function
const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
// actual api
const response = await PushAPI.space.update({
spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
spaceName: 'Push Space 3',
spaceDescription: 'This is the oficial space for Push Protocol',
listeners: ['0x2e60c47edF21fa5e5A333347680B3971F1FfD456','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
spaceImage: <group image link> ,
speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: PushAPI.ChatStatus.PENDING,
account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
env: 'staging',
pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
});
To update token gated space details
Note - updateSpace is an idompotent call
// pre-requisite API calls that should be made before
// need to get user and through that encryptedPvtKey of the user
const user = await PushAPI.user.get(account: 'eip155:0xFe6C8E9e25f7bcF374412c5C81B2578aC473C0F7', env: 'staging');
// need to decrypt the encryptedPvtKey to pass in the api using helper function
const pgpDecryptedPvtKey = await PushAPI.chat.decryptPGPKey(encryptedPGPPrivateKey: user.encryptedPrivateKey, signer: _signer);
// actual api
const response = await PushAPI.space.update({
spaceId: 'spaces:e0553610da88dacac70b406d1222a6881c0bde2c5129e58b526b5ae729d82116',
spaceName: 'Push Space 3',
spaceDescription: 'This is the oficial space for Push Protocol',
listeners: ['0x2e60c47edF21fa5e5A333347680B3971F1FfD456','0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
spaceImage: <group image link> ,
speakers: ['0x3829E53A15856d1846e1b52d3Bdf5839705c29e5'],
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: PushAPI.ChatStatus.PENDING,
rules: {
'entry': {
'conditions': [
{
'any': [
{
'type': 'PUSH',
'category': 'ERC20',
'subcategory': 'token_holder',
'data': {
'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
'amount': 1000,
'decimals': 18
}
},
{
'type': 'GUILD',
'category': 'guildRoles',
'subcategory': 'allRoles',
'data': {
'guildId': '13468'
}
}
]
}
]
},
'chat': {
'conditions': [
{
'all': [
{
'type': 'PUSH',
'category': 'ERC20',
'subcategory': 'token_holder',
'data': {
'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
'amount': 1000,
'decimals': 18
}
},
{
'type': 'GUILD',
'category': 'guildRoles',
'subcategory': 'specificRole',
'data': {
'guildId': '13468',
'guildRoleId': '19924'
}
}
]
}
]
}
},
account: '0xD993eb61B8843439A23741C0A3b5138763aE11a4',
env: 'staging',
pgpPrivateKey: pgpDecryptedPvtKey, //decrypted private key
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | spaceId_ | string | - | Id of the space | | account* | string | - | user address | | spaceName* | string | - | space name | | spaceDescription* | string | - | space description | | spaceImage* | string | - | space image | | status* | string | - | space status - 'ACTIVE', 'PENDING', 'ENDED' | | listeners* | Array | - | wallet addresses of all listeners except speakers and spaceCreator | | speakers* | Array | - | wallet addresses of all speakers except listeners and spaceCreator | | scheduleAt* | Date | - | Date time when the space is scheduled to start | | scheduleEnd | Date | - | Date time when the space is scheduled to end | | contractAddressERC20 (deprecated) | string | null | ERC20 Contract Address | | numberOfERC20 (deprecated) | int | 0 | Minimum number of tokens required to join the space | | contractAddressNFT (deprecated) | string | null | NFT Contract Address | | numberOfNFTTokens (deprecated) | int | 0 | Minimum number of nfts required to join the space | | rules | Rules | - | conditions for space and chat access (see format above) | | pgpPrivateKey | string | null | mandatory for users having pgp keys| | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI.space.update | Response - 200 OK
{
members: [
{
wallet: 'eip155:0x367c6555b2CAD9C2d2656066EC3996Ba12cD058d',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
'xsBNBGSr17UBCADhEXWz/lsg0sDA+QRygzl+4t84/YYa459nzFRNB36jkbU8\n' +
'FxRsE6oZTu0Leanup7aul4trJJ4qyA6xFfDjprDzrm1Gtp/gos46Lxk+br64\n' +
'lzgqTfSKpBs9UWqOcr4Vnoq9WeOiFZax0DhN//7ibIQDWIJ0E6iOc8uiSoGZ\n' +
's4AHTx7GtUvHxIUAk/hQY8UjjDNyhgCSrmdPeWt/SVbmFCHchdH/KhSK8JVq\n' +
'qs8/nKx2Tm/nmAdWFZDqIJxd5tVuXXMxTZYZADZfmBltR2F/8GkF7hfX/aOo\n' +
'gGQ/u2FPbCKRjtedfJi3WsPUKtyFg6QdwBnOQmYn0fGXlPGR7UVSsmIVABEB\n' +
'AAHNAMLAigQQAQgAPgWCZKvXtQQLCQcICZD2NRrvru2XMgMVCAoEFgACAQIZ\n' +
'AQKbAwIeARYhBM1nsbalDm3PtLAK2/Y1Gu+u7ZcyAADzuwgAmTBbnBQZ2w06\n' +
'RbLmcZf8cYTof1X3mpYBa1lprMltib2jZQdu8DxhZBapYIE1O0UzV2Dy8IXj\n' +
'zavtNFZiLR8FTwkrXQ3DGrZylnqjLkQ6m2jZsGIypb2OpTlBIBnjW98Dh99F\n' +
'egI/5wse59IfGhYXVcKluKDAW2ezUJx8BhacZCwf/S8iG9YKrZctS5cVZxQw\n' +
'SymXv88msoQrWhxmu2AT0rNsZ656ANMr/MuUjKMxQsoNCNIkp5kE0UTGfMwc\n' +
'c69Gabs9uOPOqAGeSBGVfw+uJig/RJ4MWDCbj6QIDsV5FFRvTmJmmSNLNH5y\n' +
'83pHxE+923z6NiPWRonbns3pFNvhnc7ATQRkq9e1AQgAxjGMkGhs2OTW8fW/\n' +
'4tloJOID0U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bhVH0uzmQ4j8hwKkPMEDPEWp+LKsOp+lxUGc6ZPhdVhlP1uagMMUPMEGsZzn/KcCpDzBAzxBp3+lxUGU718vzGmVtcqfpcVBlOZYgZYoZY63PxG7ePK4/oc1EZYoaYIfYN05Y0ReqpB6sAAAAASUVORK5CYII='
}
],
pendingMembers: [
{
wallet: 'eip155:0xB026B0A8BB1fea997a73c5a84fe7aF8cAab1AcF2',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA4ElEQVR4AcXBsU0EMRCG0Y+RC3ETzpwheqAFOnBmOZtSNqGC02abOaUAdwLp3AU+IYT+916+Pj6/CXLp/Kc1B5EhZogZYokn1hxEuXR21hxEuXR2DDFDzBBLuXSiNQdRaxeR+2CntYvIfRDl0okMMUPMEEs8cZw37pQbO8fJnUVlxxAzxAyxxINcOtGag7/IpbNjiBlihlh6f30jcq9EuXSiNQc7uXSiNQdRaxeRIWaIGWLJvRK1dhEdJ3dy6fxGaxeReyUyxAwxQyzxwL0SLSpRLp2dNQeRT7YMMUPMEPsB1yM4zt7CMugAAAAASUVORK5CYII='
},
{
wallet: 'eip155:0x9b70FD7164ec0Ed3E1B3E318836522340dd2e125',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0UlEQVR4AcXBMWoDMRRF0ZtnkWYKgddgGKbSVrSILFBbUWUMLrICgwqXQ9L+NDKDIe+cj8+v7x+CPhpRyZV39NGISq5EwkyYCbN0f9z4a2Omj8ZMyZVo2Tei++NGJMyEmTBLz9OVqOTKTMmVIy7nlaiPRiTMhJkwS8u+8Z+WfSMSZsJMmKXLeWWmj0a07Bszz9OVqORKdDmvRMJMmAmzxAslV45ZOUKYCTNhlvpozJRcifpozJRcifpozAgzYSbMEi/00YhKrsz00ThCmAkzYfYLlLsvpsHyBx0AAAAASUVORK5CYII='
},
{
wallet: 'eip155:0x1A050099a08D7faf3b5923669a0FAe42A0872D72',
publicKey: null,
isSpeaker: false,
image: null
}
],
contractAddressERC20: null,
numberOfERC20: 0,
contractAddressNFT: null,
numberOfNFTTokens: 0,
verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
'wsBzBAEBCAAnBYJkq9e1CZD2NRrvru2XMhYhBM1nsbalDm3PtLAK2/Y1Gu+u\n' +
'7ZcyAAA0igf/Tgo/WU4C5g4UtHPCwU/jThQwjElzCa96bZU8bCXsgnoO1NMI\n' +
'fwI7FxIw8FmFrktHIWT10T/9vq2ItyUvpbWRhnD5zt5aRhJ1KA1z06iwkoUt\n' +
'DLiPfveoSDyIhUIjx5PUMN0r/tXmLhj3CrkHx1hiPBxEkhi9brfFcOvX57HS\n' +
'VOKOeeUa4G1cmk6dtzLHWT4p7ekrFhZPHXDtZUMZEU2wbMkB6bRqlZ7UYLbN\n' +
'7+0AvCu7uaCYG0zfbl3oZc6DkIm9jnBknsII6Hqv7Dc9NLAUBWo8tPrW2/KN\n' +
'8Bv/gk5HPb16tOihIUjs8v45wO3oTPAQYbJGdF6ta+HyiKO8JWipbw==\n' +
'=wkHz\n' +
'-----END PGP SIGNATURE-----\n' +
':null',
spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
spaceName: 'mobile_aquamarine_constrictor',
isPublic: true,
spaceDescription: 'conventional_crimson_dove',
spaceCreator: 'eip155:0x367c6555b2CAD9C2d2656066EC3996Ba12cD058d',
spaceId: 'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: 'PENDING',
rules: {
'spaceAccess': {
'conditions': [
{
'any': [
{
'type': 'PUSH',
'category': 'ERC20',
'subcategory': 'token_holder',
'data': {
'address': 'eip155:5:0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33',
'amount': 1000,
'decimals': 18
}
},
{
'type': 'GUILD',
'category': 'guildRoles',
'subcategory': 'specificRole',
'data': {
'guildId': '13468',
'guildRoleId': '19924'
}
},
{
'type': 'PUSH',
'category': 'ERC721',
'subcategory': 'nft_owner',
'data': {
'address': 'eip155:5:0x42af3147f17239341477113484752D5D3dda997B',
'amount': 1
}
}
]
}
]
}
}
}
To get space details by spaceId
const response = await PushAPI.space.get({
spaceId:
'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
env: 'staging',
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | spaceId_ | string | - | space id | | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI_space_get | Response - 200 OK
{
members: [
{
wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
'06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
'3jlBUFhpsr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dSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
'=q/e/\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
isSpeaker: true,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
}
],
pendingMembers: [
{
wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
},
{
wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
},
{
wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
publicKey: null,
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
}
],
contractAddressERC20: null,
numberOfERC20: 0,
contractAddressNFT: null,
numberOfNFTTokens: 0,
verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
'8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
'=EkOP\n' +
'-----END PGP SIGNATURE-----\n' +
':null',
spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
spaceName: 'intellectual_green_bat',
isPublic: true,
spaceDescription: 'sad_purple_pinniped',
spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: 'PENDING'
}
To start a space
const response = await PushAPI.space.start({
spaceId:
'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
env: 'staging',
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | spaceId_ | string | - | space id | | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI_space_start | Response - 200 OK
{
members: [
{
wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
'xsBNBGSr528BCADI8kQcWkaw9PKmSrwCtPBDWj+wzPhmok9jAzxzb2+qAjSV\n' +
'rYdIrnx6PAp1rMU6qoVg4cdDbCYPV+kCj8l3lUzH/a/SfPsDWpspA/ICWMeS\n' +
'dMdGYxHLk2gsu0wRz69qoddXMY1h5eMZEyRnr2fsX/cy15mxO2IEHYnC2/rp\n' +
'06iFpx1T8k5HWgFDpyleWyMSQ7Bnn7GutrlHYEVtIGVfXDSkea8IDLLkzBEV\n' +
'3jlBUFhpsrlcvDwDYcMYOrqSBEtg1a+GMK+2Ye/hF37KUYTAPleKXeN0cYIs\n' +
'Va8oleZK960XYfuy5SYCJav2kaAggNWQBie5G9C4H3h7FuFwWk8LH3DhABEB\n' +
'AAHNAMLAigQQAQgAPgWCZKvnbwQLCQcICZBm9Bz6DvB6DwMVCAoEFgACAQIZ\n' +
'AQKbAwIeARYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAAAkiQgAukm3owebckwr\n' +
'xAR42r/+CBx1uoqM2ZeEAUeYtBF7sdLEsdxFrxl8wHKAbglZwtgWcfG95v2R\n' +
'zLcBco3v9p0IuS6DZduIfhngZ49gpYwqFGyiCOvo+k14tuMbrbOZTTKp0uc6\n'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zDvo3RO1cROQp0zsikladmzGZHQ==\n' +
'=q/e/\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
isSpeaker: true,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
}
],
pendingMembers: [
{
wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
},
{
wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
},
{
wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
publicKey: null,
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
}
],
contractAddressERC20: null,
numberOfERC20: 0,
contractAddressNFT: null,
numberOfNFTTokens: 0,
verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
'8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
'=EkOP\n' +
'-----END PGP SIGNATURE-----\n' +
':null',
spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
spaceName: 'intellectual_green_bat',
isPublic: true,
spaceDescription: 'sad_purple_pinniped',
spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: 'ACTIVE'
}
To stop a space
const response = await PushAPI.space.stop({
spaceId:
'spaces:108f766a5053e2b985d0843e806f741da5ad754d128aff0710e526eebc127afc',
env: 'staging',
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | spaceId_ | string | - | space id | | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI_space_stop | Response - 200 OK
{
members: [
{
wallet: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
publicKey: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ccLlzYOz3b5BXT+fEkmVsbVTjA\n' +
'Kttjosm7FtY4igY2Hu4UlZZW8M1tYL1R/UegFeMYGY7aO7dcKeiP0NsDwm3c\n' +
'0SiU6/JlOXAIi/ZSKDJ4b5BPK6GFj5pNWr92/V7LejlZfoHAVDbb91tiPGdP\n' +
'y3+r9T3IYsgUDLgOpPQn6o82Nctm6CnIZqAN12nJ1DEJP2JyLDedg9b5H+aa\n' +
'FDZFc7yQ3In/QPtjHImydLt9NwARAQABwsB2BBgBCAAqBYJkq+dvCZBm9Bz6\n' +
'DvB6DwKbDBYhBPkdSvwnOBuAJaOWAGb0HPoO8HoPAABRUQf+KoF4UXuseLBO\n' +
'd0PD0+hEcnsYbaPWmPZtJPWusxPl6kt421luymPiThDXwaMVzRrmxkz0dNZ3\n' +
'bUFYtS24t2BhlXZ6cGFNRjXrA9OV0kLg/kNm1vboQ1GL8qRV9CIjPVEpksQp\n' +
'tOiYN+X+/2XdPJkaQpITHIFV067qWQSAKIonvOI8OJYOovGRQTInz0VE71Yn\n' +
'SeiOilKBK+p2RN38jGr0PGWt740KJ6560FzfUwTAQzz9vrkYa+vEhWe+bzOd\n' +
'YBpxj/BRTGR19DrKlGcFPdTYz5ADxCjBuCxXgoRCbBiWwh+iIstk5qkT8uHK\n' +
'NQjzDvo3RO1cROQp0zsikladmzGZHQ==\n' +
'=q/e/\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
isSpeaker: true,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA10lEQVR4AcXBsWnFMBSG0c8/brOD9kgfogHUGQIuAppInSsVAQ2gdbSD64fTXl4hMI/HPWf5fXxf3DDaxkxIlTuEM+FMOFt5MtqG1XvBipGpsp9YMWaskCqWcCacCWfL4+fzwogx8069FyzhTDgTzpavv3oxEVLlFaNtzAhnwplwtvIkpIpV9hMrxsxM7wUrHxVrtA1LOBPOhLM1pIo12oaVj4rV98JMPj6wRtuwQqpYwplwJpyt3BRjZiZQuUM4E86Es7XsJ1aMTIVUeUXZTyzhTDgTzv4BnGY033BWusUAAAAASUVORK5CYII='
}
],
pendingMembers: [
{
wallet: 'eip155:0xaC6C69c657cF6022fa787B14BDdaA22936B56D65',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA2UlEQVR4AcXBQWoEIRBA0Z+ikOwNDHirbARPKDiLvkzOIATaC4iQbGt6ITSzqPc+np8/fxhpVazzcfCOr99vrK4FS3AmOBOcKRddCy9GwQoxszNHw+rKluBMcCY407QqO10L1hyNO9Kq7AjOBGeCMz0fB9YcjZ20KjtdC1bXghVixhKcCc4EZzpH446uhXfM0bAEZ4IzwZmGmLHmaOyEmNmZo7ETYsYSnAnOBGfKRVoVq2vBmqNxR1oV6+SV4ExwJjhTLroWdkLM7MzRsLoWrMCBJTgTnAnO/gGd1jrTKk/8EAAAAABJRU5ErkJggg=='
},
{
wallet: 'eip155:0xEf532414907E8c631307c0d501cDe6D1694bAF5e',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVR4AcXBobHDMBBF0ZsdjftIDeGuIkzIaGsQC1MNQkZirsLcnaQCk3yqBOzMH4N3zu11f38I+GPiinacRAwxQ8wQS/zo1flSGqNenUgujVGvziiXxsgQM8QMscSPXBqjXp1RLo1Ir84ol0bEEDPEDLHkj4lI51uvzn/4YyJiiBlihlhqx0lkZ2U0Pxci+7YyasdJxBAzxAyx1KsT8W3lil6diCFmiBlit9f9/SHQq3NFLo2IIWaIGWKpVyeybyuj+bkQ2beV0VwXIoaYIWaI/QH8GTSs76EUEQAAAABJRU5ErkJggg=='
},
{
wallet: 'eip155:0x2F5f27B523C8888eA79b7FA80a9CbA6b6980784c',
publicKey: null,
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVR4AcXBsW3DQAxA0W9CExjIDhogfboDCw9gICvcHmldcIAMoYLgJJ5CKzgto4KA4ILvXT5+Pl8kwydZqJHt60bl+ryRDZ9koUYmNBOaCc0u31+/L04INSrDJ2cIzYRmQrMl1Dhj+KQSapwhNBOaCc0WDvZ1o+ROZV83KtfnjUxoJjQTmi0c3B/OO+4PpxLKP0IzoZnQbBk+yUKNyvBJJdSoDJ9kQjOhmdBsCTWy4ZNKqFEZPqmEGpnQTGgmNFs4CDWy4ZN3hBoVoZnQTGj2BxvbMvuaMCXUAAAAAElFTkSuQmCC'
}
],
contractAddressERC20: null,
numberOfERC20: 0,
contractAddressNFT: null,
numberOfNFTTokens: 0,
verificationProof: 'pgp:-----BEGIN PGP SIGNATURE-----\n' +
'\n' +
'wsBzBAEBCAAnBYJkq+dvCZBm9Bz6DvB6DxYhBPkdSvwnOBuAJaOWAGb0HPoO\n' +
'8HoPAAD5ywf/cvaGM0DzcB22Q2FMzUZG4/ZmkN4OknvSj0d4hB/sPUIb9176\n' +
'z+niFMjWZNFpIj8s36f16oMEZZ+Eleu9t6sECBxRDvO8pEwyByCXSmz8e/SH\n' +
'Y659cvg5/A3bSe0FqR0VTI1o+Uz2BpnXG/P38C6D46btaIaJcr4cIh88wQ9J\n' +
'lr05hOE7w/7Uo5OwyXala0NfB+8S4LIfpC2OlPOhyHQEJd2+WoFKb/6dO28D\n' +
'TLuvgYJXJfc4R3ElcgFfm1N9ylG0Pt1F3c0C/k9bNokR2PVXgX2XSTQsx1rD\n' +
'MCY/ePr93INyNZuTPcPlK87X6OTa2/gEW161vup2Xn2Did9HtL76Qw==\n' +
'=EkOP\n' +
'-----END PGP SIGNATURE-----\n' +
':null',
spaceImage: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAvklEQVR4AcXBsW2FMBiF0Y8r3GQb6jeBxRauYRpo4yGQkMd4A7kg7Z/GUfSKe8703fKDkTATZsJsrr0RlZSJ9r4RLayMvLmJjnQS1d6IhJkwE2bT13U/DBzp5BN73xgRZsJMmM1HOolqb/yWiWpvjJSUiRZWopIykTATZsJs5g+1N6KSMiO1N/5DmAkzYTa9Lh6MhJkwE2ZzSZlo7xvRwson3txERzqJhJkwE2bT6+JhoKTMJ2pvjAgzYSbMfgDlXixqjH6gRgAAAABJRU5ErkJggg==',
spaceName: 'intellectual_green_bat',
isPublic: true,
spaceDescription: 'sad_purple_pinniped',
spaceCreator: 'eip155:0xd1ab5Af3Be78bB1492099CE568761F0e706352a0',
spaceId: 'spaces:9dab226c7920fe06154d76f78dfe1187bdc4fda712cdd9a8b37cc6a99741a63b',
scheduleAt: '2023-07-15T14:48:00.000Z',
scheduleEnd: '2023-07-15T15:48:00.000Z',
status: 'ENDED'
}
To approve a space request
const response = await PushAPI.space.approve({
status: 'Approved',
account: '0x18C0Ab0809589c423Ac9eb42897258757b6b3d3d',
senderAddress: '0x873a538254f8162377296326BB3eDDbA7d00F8E9', // spaceId
env: 'staging',
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | status | 'Approved' | 'Approved' | flag for approving and rejecting space request, supports only approving for now| | senderAddress_ | string | - | space request sender's address or spaceId of a space | | signer* | - | - | signer object | | pgpPrivateKey | string | null | mandatory for users having pgp keys| | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI_space_approve | Response - 204 OK
To add listeners to space
const response = await PushAPI.space.addListeners({
spaceId,
listeners: [
`eip155:0x65585D8D2475194A26C0B187e6bED494E5D68d5F`,
`eip155:0xE99F29C1b2A658a478E7766D5A2bB28322326C45`,
],
signer: signer,
pgpPrivateKey: pgpDecrpyptedPvtKey,
env: env as ENV,
});
Allowed Options (params with _ are mandatory) | Param | Type | Default | Remarks | |----------|---------|---------|--------------------------------------------| | spaceId_ | string | - | space id | | listeners | Array | - | new listeners that needs to be added to the space. Don't add listeners which are already part of space | | env | string | 'prod' | API env - 'prod', 'staging', 'dev'|
// PushAPI_space_add_listeners | Response - 200 OK
{
members: [{
wallet: 'eip155:0x4Be8cFD08B330853A530DEBB72a2DAf4d4F3D2Ba',
publicKey: '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'\n' +
'xsBNBGSs51IBCAC+y8oXbU2YvfI7Z4xnSRfcPecRR+nO/XVLDbt30mbn1NU8\n' +
'wHSXcuHLJTuU9yJy1t9AMB2SY8n/YWMFbeNICF0OQVINkvFS+8Ec/F42IIlb\n' +
'StUY8rLS9pxTQoI3k1LnQKNL1krGiEuDl2ZT3l304aPGkF1sowu5w6xnzl/o\n' +
'nb6cgc48jVqIgqoVUCnEoxc3GKdSORm35nl0RBDasFdFPJctnpg2n7hLofU1\n' +
'RGOIzf/cITY7AE3nta0cqaFgNsO4rO0fXRwgDBAu66CtBG4Px2X8hT7IYMum\n' +
'XJtCis3KvrmQAOhWrbAwmWjHbkSDSYigd39rmlht21GKf0/kfoILBgRfABEB\n' +
'AAHNAMLAigQQAQgAPgWCZKznUgQLCQcICZDTsTetOyJa2gMVCAoEFgACAQIZ\n' +
'AQKbAwIeARYhBHGBWhlF6JChmgQO7tOxN607IlraAADq/Af/XWeAagX5+JCX\n' +
'ChzadMaUtI6m2F7nT8sJcJep/a0Ldyz6kPmP9k6kmWO+QXJwl4FrP3e7HPer\n' +
'SjTeIWm0FJ2a+pRtF+lWk7xjIWJuZxbx79nOk98arde75fT+bebne1V0raUM\n' +
'gXPQIc60++okAPif6vJVLAaSMNbCkv8+Lsy0mJqsjY3b9iMVKWHKb8XVvTuN\n' +
'pobxVV4dLq53lrdNDIiwAWTlbxyuKLSEF4f+hIPJX3PAhquORinOubclUwTM\n' +
'+kEmE6VI3pW4VL1VRi10cDI6ruEVwqOwQyYcp9gSDKXFR6ZXz7t0hjUUhl+3\n' +
'z6T7yqAjExW1O4tETVSbt3jg6DjaAM7ATQRkrOdSAQgArRRrLZees3xCYyBO\n' +
'9WDzy7XCM2FxmaIJs/ibWwTtD1ZVoc9NKeOx07FYwGiYjigY6FxxJHdr20IQ\n' +
'3xieIyBLZM2XAIXrsxq4M9GLG8R6nhd35BenjcvSGiZH1Rq0aXtFt9Fd7gc6\n' +
'E8XpMcHPH8KEnf66sPz18vrVCdstVU4Qj2ZjH25ilfeGdMj2HHfDxVN8sRhl\n' +
'AXAcwblQ+IVXGjuKw19T4zN874bcAaOmXfzxu3+2PtxVSR5uV03x1ln3ji+b\n' +
'+GF8atJMMHCqE0FC/dEciS+BWSQtv0D93XWjzExJeyhd7Z+I3BG8JPuJT5Yj\n' +
'4PxktEgwUxQc83JFFwED9knzyQARAQABwsB2BBgBCAAqBYJkrOdSCZDTsTet\n' +
'OyJa2gKbDBYhBHGBWhlF6JChmgQO7tOxN607IlraAABLdggAhe1KLjtHTsUI\n' +
'SR0K25EJ+9gXC7wmebve9wNZL22/Ud9hnyS77/VUmMNBgdPyhm/9ITMhVtTt\n' +
'rRNo1AzsVKDn3/dW1kc+nSribOufxzMoBM7Bm918Zt/0/7wCegz0bp3EAoQ8\n' +
'KEa2KPY9lSh2WtEDoA87D8JB1xwIfcR98vg5/AZ7VdtE88foSqXAm+6F85hz\n' +
'nAASNBO9CCDvUofR28b4exT/aWX0qZxLAukgH7fnYC3KPVv+9ug6mdyJPsOZ\n' +
'LFjF327UKLrBuQ6VRlfKF+XULJbtNPxckgwO1V/oxycq/M67acGoXgc2MgP/\n' +
'2qOkbiQC0ZxcA+Ze5TNNhuGWKv6d9g==\n' +
'=S9Ba\n' +
'-----END PGP PUBLIC KEY BLOCK-----\n',
isSpeaker: true,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA1UlEQVR4AcXBQU1FUQxF0f2bZ6gaIOkAC4yxUCRQHyRoqIo6wcJnesLgEgJJ17p9vDzeEe9vd046nZOo4eT59YYylhnLjGW3p8+HOwedzl9EDSfGMmOZsezim05HRQ2q0zmJGlSno6IGZSwzlhnLrk5HRQ2q01FRw0mno6IG1ekoY5mxzFh2RQ2q01FRw29EDarTUVGDMpYZy4xlV6ejogbV6aio4aTTUVGD6nSUscxYZiy7+KbT+U+dzomxzFhmLLv4QdSgnl9vHNWgOp0TY5mxzFj2BfKPPQUA5ipXAAAAAElFTkSuQmCC'
}],
pendingMembers: [{
wallet: 'eip155:0x4d2eFB18383a48aCe19a198ae5228BB4bf854cec',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA9UlEQVR4AcXBoZHDMBCG0S87ZqEmooaiLmJJsNtwIyFuwzhERZgKmoqkhxz9HaCbmwP73u159w8iN0fVVFC5OT01FVRujqqpoIxgRjAj2JCbo6b1QE3LiDrpeywjF+vBRXOUEcwIZgQb+MW5zaiaCl3NUdN60GMEM4IZwYaaChfNUdN6cNGcnmk9UOc2o2oqKCOYEcwINuTmqJoKF835i3ObUTUVVG6OMoIZwYxgt+fdP4jHMqJe+xuVm9NTU0E9lhH12t8oI5gRzAg28OXcZlTeuKip0JObo06+7AVlBDOCGcFuz7t/6MjN+Y+aCj1GMCOYEewHE5pCbf3G8WQAAAAASUVORK5CYII='
},
{
wallet: 'eip155:0x8E50Bfb57f803814c242c5a25890f5F0c13304fF',
publicKey: '',
isSpeaker: false,
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA20lEQVR4AcXBsWkDQRCG0W+Gy53pkgVVsiXYFVx2rsANiCtEmQoxbCHmYBNd6gLW6aBgjDDmf89eXr8GiW6VqIxGplslKqORccQcMUdsWued6Ho/k+lW+Yt13okcMUfMEZt4sM470YUb0XYsZC6nG9HKTsYRc8Qcsel6P5PpVnnGdixEZTQyjpgj5ohNPOhWyZTRyHSrRN0qURmNyBFzxBwx+34rg0QZjahbJVNGI+pWyThijpgjNvGLbpWojEamW+UZjpgj5ojZx/vnINiOhf90Od2IHDFHzBH7AWIQNGL6hyehAAAAAElFTkSuQmCC'
},